Support » Plugin: Powered Cache – Caching and Optimization for WordPress – Easily Improve PageSpeed & Web Vitals Score » Invalid argument supplied for foreach() CDN.php on line 115

  • Resolved PeterB

    (@peter_bepe)


    Hello,

    When a page is loaded via wget it generates an error like this:

    PHP Warning: Invalid argument supplied for foreach() in /var/www/XXXX/YYYY/web/wp-content/plugins/powered-cache/includes/classes/CDN.php on line 115

    I have CDN configured for js and img, but not for css.

    What could be the reason?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Mustafa Uysal

    (@m_uysl)

    Hi @peter_bepe,

    It seems related to srcset URL replacement. Is there a lazy load or image optimization plugin activated? If have any, can you try to deactivate (temporarily) one by one and see if the warning goes off?

    Regards,

    Thread Starter PeterB

    (@peter_bepe)

    Yes it is part of the Jannah theme.
    Once I disabled lazy loading there, the errors stopped, but pagespeed score dropped about 5-8 points.
    How to proceed from here? TIA!

    Plugin Author Mustafa Uysal

    (@m_uysl)

    @peter_bepe Can you use Powered Cache’s built-in lazy-load feature instead of theme’s? Powered Cache -> Media Optimization -> Lazy Load

    It works with srcset.

    Thread Starter PeterB

    (@peter_bepe)

    Thanks, I tried that but the pagespeed score is still 5+ points below what it was.. 🙁

    Plugin Author Mustafa Uysal

    (@m_uysl)

    I see. Well, in this case, you can keep using the theme’s lazy-loading feature and ignore the warning. I’m going to fix it in the next version of the plugin which will be released soon.

    Thread Starter PeterB

    (@peter_bepe)

    Thank you and thank you.

    Plugin Author Mustafa Uysal

    (@m_uysl)

    Hi @peter_bepe

    This is fixed in the new version (2.1). Please update the plugin and let me know how it went.

    Marking as resolved now; feel free to update if the problem persists.

    Thread Starter PeterB

    (@peter_bepe)

    Thank you, the warnings are gone now.
    Have a nice day!

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.