Support » Plugin: Jetpack by WordPress.com » PHP Warning: Invalid argument supplied for foreach()

  • Resolved bjf2000

    (@bjf2000)


    I’ve noticed with the last couple Jetpack updates (maybe more) that these occur in wp-admin/error_log:

    PHP Notice: Trying to get property ‘option_name’ of non-object in /home/site/public_html/wp-content/plugins/jetpack/modules/widget-visibility/widget-conditions.php on line 807

    PHP Warning: Invalid argument supplied for foreach() in /home/site/public_html/wp-content/plugins/jetpack/modules/widget-visibility/widget-conditions.php on line 810

    PHP Notice: Trying to get property ‘option_name’ of non-object in /home/site/public_html/wp-content/plugins/jetpack/modules/widget-visibility/widget-conditions.php on line 846

    I think it needs this for the Warning. Not sure about the Notice.
    https://thisinterestsme.com/invalid-argument-supplied-for-foreach

    Our PHP is 7.2 and WP is the current 5.x version.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support fresatomica

    (@fresatomica)

    Hi there!

    From the notices you’re seeing, it seems that there might be some underlying issue with your site’s widgets right now. Have you added recently a new widget or edited existing ones? Have you installed/updated a plugin that controls or makes changes to widgets on your site?

    It may be worth trying to delete all your widgets and add them again to see if the issue persists.

    The issue you’re having doesn’t seem related to the Jetpack updates. Also, that same issue has already been reported in our GitHub repo and you can add a comment in there for our developers to have a look:

    https://github.com/Automattic/jetpack/issues/13667

    I can check into that, but are you sure at least the “foreach” one doesn’t directly relate to what’s described in the article? Based on what I found, that would seem to be a common problem that is corrected by making the code changes noted.

    Plugin Contributor James Huff

    (@macmanx)

    Volunteer Moderator

    foreach() is kind of a generic error, and that particular article referrers to a different cause.

    If you can’t find a particular widget causing it, please let us know in a comment over at https://github.com/Automattic/jetpack/issues/13667 so our developers can take a look.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘PHP Warning: Invalid argument supplied for foreach()’ is closed to new replies.