• Resolved Paddy Landau

    (@paddy-landau)


    This error was reported previously, and was marked resolved and fixed.

    However, it still happens occasionally.

    The problem

    My website occasionally gets a PHP error as follows.

    [17-Dec-2021 02:37:16 UTC] PHP Warning: Invalid argument supplied for foreach() in /home/[redacted]/public_html/wp-content/plugins/sg-security/core/Activity_Log/Activity_Log_Themes.php on line 95

    As far as I can tell, it doesn’t appear to affect the website in any way, but it might help you to identify a potential problem.

    If you need help with diagnosing, I’ll be happy to help — let me know what to do.

    Thank you

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Ignat Georgiev

    (@ignatggeorgiev)

    Hey @paddy-landau,

    Would it be possible to provide an URL to the affected site, please?

    Kind Regards,
    Ignat

    Thread Starter Paddy Landau

    (@paddy-landau)

    @ignatggeorgiev — It’s this one.

    Let me know if I can do something to help.

    Plugin Author Ignat Georgiev

    (@ignatggeorgiev)

    Hey @paddy-landau,

    The issue should be taken care of now. Please let us know if it’s reproduced again

    Kind Regards,
    Ignat

    Thread Starter Paddy Landau

    (@paddy-landau)

    @ignatggeorgiev — Thank you! Must I update SiteGround Security, or did you a different fix?

    Plugin Author Hristo Pandjarov

    (@hristo-sg)

    SiteGround Representative

    It seems you’ve updated the plugin very fast and a secondary deploy wasn’t applied so you were missing a check in the code. That shouldn’t happen again.

    Thread Starter Paddy Landau

    (@paddy-landau)

    @hristo-sg — Thank you, Hristo!

    Thread Starter Paddy Landau

    (@paddy-landau)

    @hristo-sg — Hristo, unfortunately it’s happened again!

    It’s the test site this time. The site is always fully up-to-date (I have auto-update set on everything). Current version is 1.1.3.

    
    [21-Jan-2022 01:37:10 UTC] PHP Warning:  Invalid argument supplied for foreach() in /home/customer/www/[redacted]/public_html/wp-content/plugins/sg-security/core/Activity_Log/Activity_Log_Themes.php on line 95
    

    As always, let me know how I can help with diagnosis or testing.

    Thank you

    Plugin Support Georgi Ganchev

    (@georgiganchev)

    Hello @paddy-landau

    Thank you for the report. Our checks indicate that this error is recoded only under your wpcronmanual.log and not present on the server.

    This warning is related to manual theme updates under your application.

    Could you please provide us with an insight into the latest actions taken on your end in regards to theme updates performed prior to encountering that error?

    Kind regards,
    Georgi

    Thread Starter Paddy Landau

    (@paddy-landau)

    @georgiganchev — Thanks for your reply, Georgi.

    This is really interesting.

    Looking at the files in /wp-content/themes/Divi, I see that there was an automatic update 1:37:09 a.m.

    The error was reported at 1:37:10 a.m.

    So, the security plugin must have run at the same time as, or immediately after, the updates, indirectly leading to this error.

    I hope that this answers your question.

    By the way, the error is reported in php_errorlog in the account’s root folder.

    • This reply was modified 2 years, 10 months ago by Paddy Landau.
    Plugin Support Plamen M

    (@plamenm)

    Hello Paddy,

    First, let me start by mentioning that this is not an Error, but a PHP Warning, instead. The difference is that the warning are not preventative for the execution of the php code, they are rather a notification of an incompatibility or a notice how some part of the code could be improved. This does not mean that the code is incorrect though or that it needs fixing. In many cases, such a code is implemented on purpose – to make it more widely compatible even with sites that run on older PHP Versions.

    I tried to reproduce the reported waring both by updating a theme on a test site and also by deactivating and re-activating the Divi theme on your oldstyle site and then triggering checks in both plugins – SiteGround Optimizer and Security. None of these actions generated the Warning – it seems to occur at some very corner case scenario and you should safely disregard it.

    Regards,
    Plamen

    Thread Starter Paddy Landau

    (@paddy-landau)

    @plamenm — Thank you. I do understand that this is a warning, but if the program is receiving an invalid argument, it could mean invalid execution.

    I shall disregard this, but it’s the only the thing on any of my entire sites (WordPress, using various themes) that ever create php_errorlog. So, it’s a bit weird.

    Plugin Support Georgi Ganchev

    (@georgiganchev)

    @paddy-landau — We appreciate your feedback and report.

    The notice is indeed recorded after auto-update of your premium theme. This is caused by a specific function of the theme that we cannot replicate with any other Divi version we tested. We would try and look further into this and we thank you for your report.

    Thread Starter Paddy Landau

    (@paddy-landau)

    @georgiganchev — Thank you, Georgi

    I appreciate all the time and effort that you and your team put into the plugin.

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