Support » Plugin: Wordfence Security - Firewall & Malware Scan » wfAdminNoticeQueue Invalid argument supplied for foreach()

  • Resolved Cyrille37

    (@cyrille37)


    Hello

    With wordfence version 7.4.14.

    There are warnings in admin area :

    Warning: Invalid argument supplied for foreach()
    in .../wordpress/wp-content/plugins/wordfence/lib/wfAdminNoticeQueue.php
    on line 79
    
    Warning: Invalid argument supplied for foreach()
    in .../wordpress/wp-content/plugins/wordfence/lib/wfAdminNoticeQueue.php
    on line 131

    Regards.

    • This topic was modified 7 months, 4 weeks ago by Cyrille37.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Cyrille37

    (@cyrille37)

    The var_dump($notices); give bool(false)

    $notices = self::_notices();
    var_dump($notices);
    foreach ($notices as $nid => $n) {
    Plugin Support wfpeter

    (@wfpeter)

    Hi @cyrille37, thanks for your detailed message with the var dump.

    Before I speak with the development team, do you have any PHP error logs from the timestamp when these show up in the admin area that may provide more information than the just the line number? I appreciate it may show the bool(false) that you have already found but it may show more.

    Does this still occur when disabling all plugins aside from Wordfence? I’d like to rule out a conflict with another plugin changing this $notices variable that may get loaded on all pages of your site.

    Thanks,

    Peter.

    Thread Starter Cyrille37

    (@cyrille37)

    Hello Peter.

    Thanks a lot for you answer.

    I think it’s enough for the development team, they just have to make sure that the function wfAdminNoticeQueue::::_notices() returns the expected value type. Checks are to be done inside has needed.

    Regards & Cheers

    Plugin Support wfpeter

    (@wfpeter)

    Hi @cyrille37,

    Could I please check whether these warnings still present when the latest version of Wordfence is the only plugin enabled? You may also need to return to a default theme such as Twenty Twenty during this time to rule out an issue in templates too. Naturally, we have a large quantity of customers not reporting this same issue and I suspect $notices is being cleared by other included files.

    Please install a maintenance mode plugin if visitors are likely to be affected by this brief period of testing.

    Thanks again for your assistance,

    Peter.

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