• Resolved net_runner

    (@net_runner)


    Warning: foreach() argument must be of type array|object, null given in /home/xxxxxxx/public_html/wp-content/plugins/wp-seopress/seopress-functions.php on line 401

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Benjamin Denis

    (@rainbowgeek)

    Hi,

    Thanks for reporting this. We’ve been able to identify the cause of the warning:

    foreach() argument must be of type array|object, null given

    In some specific setups (typically when a third-party plugin/theme filters the list of post types or taxonomies and returns null), SEOPress can end up passing a null value to a foreach() loop, which triggers this PHP warning when warnings are displayed on the frontend.

    We’ve prepared a fix that makes this loop defensive (it falls back to an empty array when nothing is returned), which prevents the warning from appearing without changing SEO output.

    In the meantime, if you need an immediate workaround, you can:

    Temporarily disable WP_DEBUG display on the frontend (or set WP_DEBUG_DISPLAY to false), and/or Check for any custom code or plugins hooking into filters like seopress_post_types / seopress_get_taxonomies_list and ensure they always return an array.

    If you can share your active theme + the list of active plugins (or confirm if you have any custom snippets related to SEOPress filters), we can also help pinpoint what returned null on your site.

    Thanks again, and sorry for the inconvenience.

    Thread Starter net_runner

    (@net_runner)

    Thanks! I’ll just wait for the next version.

    It’s a simple mainwp monitoring site – without any content, plugin list is:

    FluentSMTP2.2.95
    Independent Analytics for MainWP1.4
    MainWP Advanced Uptime Monitor Integration5.3.4
    MainWP Client Notes Pro Report Extension1.3.1
    MainWP Dashboard6.0.7
    MainWP Jetpack Protect Extension5.0.4
    MainWP Pro Reports Extension5.1
    MainWP Sucuri Extension5.0.3
    SEOPress9.7.2
    SEOPress for MainWP1.5
    WPvivid Backup MainWP0.9.40
    WPvivid Backup Plugin0.9.125
    WPvivid Plugins Pro2.2.43

    Plugin Author Benjamin Denis

    (@rainbowgeek)

    Sure! The update is coming today.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.