Support » Plugin: If Menu - Visibility control for Menu Items » Getting PHP error in debug.log

  • Resolved michaelroed


    I am getting this error in the log:

    PHP Warning: Invalid argument supplied for foreach() in /home/wp-content/plugins/if-menu/src/conditions-multiple-options.php on line 392

    I am running PHP ver 7.1.

    Could you please advise.

    Thank you,

Viewing 6 replies - 1 through 6 (of 6 total)
  • #metoo. Getting a LOT of these on every page view. It seems to have started only after adding If-Menu “More Visibility Rules”(see my other potentially related issue here:

    Again, I had no errors in the logs from just If-Menu, but now have a lot after enabling “More Visibility Rules.”

    • This reply was modified 2 years, 2 months ago by puravida1976.
    Plugin Author Andrei



    Thanks for letting me know about the problem.

    Can you give a bit more details about WordPress & server please? Would be helpful to test the plugin on same versions of PHP and WordPress, and see why this error appears.

    The plugin is due an update in a few days, and hope we can find what causes this and patch for the next plugin version.


    Absolutely… happy to help!

    WP: 5.3.2
    PHP: 7.3.15
    Server: Nginx w/ PHP-FPM + FastCGI

    I have not yet had a chance to run through the typical “plugin/theme conflict resolution” steps yet, but here’s a sample of the error for my case:

    2020/03/05 10:40:37 [error] 24331#0: *19426 FastCGI sent in stderr: “PHP message: PHP Warning: Invalid argument supplied for foreach() in /home/*****/wp-content/plugins/if-menu/src/conditions-multiple-options.php on line 326

    Slightly different from the OG but very close. 😉

    Plugin Author Andrei



    We released a new version for the plugin that fixes this.

    It took some time to find the cause of this, and test that it works on different version of WordPress and WooCommerce, and should work fine on all of them now.


    Awesome news, @andreiigna!

    I’ll test it over the weekend and report back. Thanks for your diligent work on this!

    Sorry for the delay in testing this, but it seems to be working for me now. No more of these errors in the logs! Nice!

    THANK YOU!! 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Getting PHP error in debug.log’ is closed to new replies.