Support » Plugin: AMP for WP - Accelerated Mobile Pages » Warning: Invalid argument supplied for foreach() in

  • Resolved dhoch14

    (@dhoch14)


    After fixing the dreaded issue related to .9.57.3, I’m getting many errors related to Warning: Invalid argument supplied for foreach() on any AMP page.

    Here is the exact error message:

    Warning: Invalid argument supplied for foreach() in longhaultrekkers.com/wp-content/plugins/amp/includes/sanitizers/class-amp-img-sanitizer.php on line 61

    Any suggestions?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Looks like you don’t have the plugin installed.

    Hmm. I’ve uninstalled and reinstalled with the same issue. Why do you think it’s not installed?

    Perhaps when I deactivate and delete from the admin panel it isn’t actually deleting everything?

    I’ve tried renaming folders in FTP and resinstalling as well.

    Plugin Author Ahmed Kaludi

    (@ahmedkaludi)

    Hi @dhoch14

    I’m extremely sorry for the inconvenience. We work very hard to make sure that we are delivering a consistent user experience but this latest update of AMP by Automattic caused some of these issues BUT we are actively working on solving them.

    So, when I go to longhaultrekkers.com/mckenzie-pass-scenic-bikeway/amp/
    I don’t see that error, perhaps you can point me to the right direction?

    Regards,
    Ahmed

    I’ve had to delete the plugins and reinstall the previous versions. Unfortunately, the auto-redirect stopped working so any mobile users were having unreadable pages.

    I’ve have had to deactivate any AMP plugins so mobile works. Any estimates when you’ll have the next stable version out?

    Thanks for the reply.

    Plugin Contributor ampforwp

    (@ampforwp)

    Hi @dhoch14,

    We are trying our best to release it within a day or two.

    Have you tried disabling the WP_Debug? May be you have it enabled that is why it’s showing an error.

    Please check once and let us know.

    Regards
    Marqas

    I seeing the same error after updating to AMP Version 0.5.1

    Hello,
    I have to build up a Webpage with WordPress. I need some help to solve a problem with the ‘mainpage’

    Here is the exact error message:
    “Warning: Invalid argument supplied for foreach() in /homepages/18/d577585979/htdocs/clickandbuilds/Website0/wp-content/themes/glow-pro/inc/widgets/widget-services.php on line 200”

    Any suggestion to help me out with this error. I can’t set up or retipe this page.

    With kind regards
    Marimal

    Plugin Author Ahmed Kaludi

    (@ahmedkaludi)

    Hi

    You are getting that error from the “glow-pro” theme. It has one a pre-built widget called services which is incorrectly calling the loop which is the root cause of this issue

    I recommend you to contact the author of that theme.

    Hello to ALL in this Forum,

    The problem is solved.
    1st step:
    I added this code to main theme’s functions.php:
    error_reporting(0);
    2nd step: because I couldn’t upload the page which I updated.
    I try disabling all the plugins and saw if this fixes the issue? Also I have cleared all the caches after disabling the plugins.
    Then I try re-enabling the plugins one by one until the issue comes back. This procedure will help diagnose which plugin is causing the issue.
    AND BINGO the big problem was a plugin by name: MEGA MENU plugin for Word Press

    THANKS to ALL

    Plugin Author Ahmed Kaludi

    (@ahmedkaludi)

    Hi @marimal
    I am glad to know that your problem was resolved.

    Have you deactivated that one?

    Can you tell me if you want to use that plugin? So I can get a solution for you.

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