Ready to get started?Download WordPress


Amazon Product in a Post Plugin
Warning: Invalid argument supplied for foreach() (8 posts)

  1. Dimitri.mamulashvili
    Posted 11 months ago #

    hello, i am getting this error on random posts.
    Warning: Invalid argument supplied for foreach() in /home/content/31/11682631/html/wp-content/plugins/amazon-product-in-a-post-plugin/inc/amazon-product-in-a-post-shortcodes.php on line 224
    can you help me?


  2. WebEndev
    Posted 11 months ago #

    I am also getting this error.
    Using WP 3.6.1 and version 3.5.2 of the plugin.
    Using the Genesis framework, version 2.0.1, and it's an HTML5 theme.

    Getting the error on both localhost (XAMPP), and KnownHost VPS.

  3. WebEndev
    Posted 11 months ago #

    Follow Up:

    The problem was the AWS key and secret key I was given to use by the client were incorrect. Once I got the correct keys, it works perfectly.

    Very nice plugin. Love the amazon-elements shortcode. It adds a great deal of flexibility on what can be retrieved by the API.

    The only wish list for me is adding a search tool by keyword(s), and another by ASIN. Keyword search could bring up a list of products, and then the product could be viewed on Amazon, or selected to insert into the post/page.
    Just an idea... :)

    Thank you for your work on this plugin!

  4. candied
    Posted 8 months ago #

    I am also having this problem, I guess this is very common, If you try searching on google (excluding ""): "Warning: Invalid argument supplied foreach() in /inc/amazon-product-in-a-post-shortcodes.php on line 224" a lot of sites will show up. I have tried switching to curl and momentarily fixed the problem but it randomly reappears for a time then disappears again. Help anyone? :)

  5. candied
    Posted 8 months ago #

    More detailed info:
    - I am only using the new-price element.
    - This only happens when the price is not showing.
    - Only displays this error on the mainloop since it is included on the excerpt.
    - On the product page no price and no error are displayed.
    - breaks the site's navigation when it happens parse error is displayed.

  6. mikeholmes1
    Posted 5 months ago #

    On mine it looks like this has something to do with request throttling from Amazon's API. If I right click on the error and inspect element it shows this hidden message:

    <!-- APPIP ERROR:nodata[<!-- HIDDEN APIP ERROR: RequestThrottled: Request from A3E915KZASEHUZ is throttled.-->

    I'm not a programmer. Could someone point me in the right direction on resources to maybe call the info once per day and then store the results without using Amazon's API for every request?

  7. Doremdou
    Posted 4 months ago #

    Hello, nice plugin :)
    But I've got the same problem here and same error:

    Warning: Invalid argument supplied for foreach()

    it happens when using the two types of shortcodes in your notice
    thanks for your help

  8. mattmatt88
    Posted 4 months ago #

    Got the same error, bot only with 10-20% of the products.
    All of the product are from the same category (in my case kindle books), but 10-20% doesn't display, they only show this error:

    Warning: Invalid argument supplied for foreach() in /kunden/381825_1100/webseiten/kindofbook/wp-content/plugins/amazon-product-in-a-post-plugin/inc/amazon-product-in-a-post-shortcodes.php on line 224

    Here's an example product that doesn't work for me:

    Hope you can help quick!

    Thank you


You must log in to post.

About this Plugin

About this Topic


No tags yet.