AVH Amazon

As of October 2010 this plugin is no longer working due to changes at Amazon (see article End of the AVH Amazon plugin?). I keep it here for historic reasons.

The AVH Amazon WordPress plugin gives you the ability to add a widget or use a shortcode in your post or page to display a random item from your Amazon wish list, baby registry and/or wedding registry.

Current Release: Version 3.3.1 Released on: May 20, 2010

Download | Donate | Features | Support | Installation | FAQ | Changelog

Features

The following options have been implemented:
General

  • Works with amazon.com, and locales amazon.ca, amazon.de, amazon.co.uk and amazon.fr
  • Universal List Items from the lists will be shown as well. Thumbnails for the items need to be generated seperately by using the option in the Tools section.


Wishlist

  • Add Associated ID.
  • Choice of thumbnail size, Small/Medium/Large.
  • Option to use unlimited widgets.
  • Multiple items from the same Wish List can be displayed in the widget.
  • A configurable footer can be displayed on the bottom of the widget linking to the list on Amazon.
  • Randomize the items retrieved or keep them in the order retrieved.
  • Retrieve the items in order. The following orders are possible, Last Updated, Date Added, Price – Cheapest to most expensive, Priority.


Shortcode

  • Create the shortcode with the help of a metabox.
  • In the metabox you can select an item or select to randomize the items from your wishlist or search for an item by ASIN.
  • The shortcode creates text, picture or text & picture links.
  • If a text link or text & picture link is used, the default text is the item description from Amazon but the text of the link can be changed.
  • The value all for the ASIN option will show all items from your wishlist. In combination with a text & picture link type you can create a wishlist page.
  • Use the option col=”” to set the number of columns to display.
  • Retrieve the items in order. The following orders are possible, Last Updated, Date Added, Price – Cheapest to most expensive, Priority.


Tools

  • Look up your wishlist ID.
  • Clear the complete cache.
  • Get the pictures for Universal List items in the cache.

It’s compatible with WordPress 2.8 and higher.

Download

Version 3.3.1 Released on: May 20, 2010

Donate

If you enjoy this plug-in please consider a donation. There are several ways you can show your appreciation:

  • Amazon Wish List
    You can send me something from my Amazon Wish List which is shown in the sidebar.
  • Through Paypal.
    Click on the Donate button and you will be directed to Paypal where you can make your donation and you don’t have to have a Paypal account.




Installation

  1. Download the archive and extract all in the wp-content/plugins directory.
  2. Make sure the directory cache in the plug-in folder is writeable.
  3. Go to your WordPress administration page, click on Plugins and activate it.
  4. Go to the Options->AVH Amazon page and fill out your Wish List id.
  5. Go to the Presentation->Widget and drag the widget into the sidebar.
  6. Optionally you can change the Associated ID and or Wish List for this widget. This is for future implementation so you can have multiple widgets with different wish lists.

Support

If you have comments/problems/suggestions, see something in the code which is not compliant to the WordPress Plugin Codex, or just want to say “Cool! It works!”, feel free to create a post at the AVH Support Forum

FAQ

Q: What is my Wish List ID?
A: You can determine your Wish List ID by going to your Wish List page on Amazon. Click on the wish list you want to use in the plug in, even if you only have one wish list. The URL will show you something like this : http://www.amazon.com/gp/registry/wishlist/2CC2KKW02870/ref=cm_wl_rlist_go. This, 2CC2KKW02870 is your Wish List ID.

Q: What happens if I clear the Associated ID ?
A: The plugin will use my Associated ID and you will be supporting further development of the plugin.

Changelog

Version 3.2.1

  • Bugfix: Locale France didn’t work.
  • WordPress 3.0 compatibility
  • Bugfix: Randomize option didn’t stick

Version 3.2.0.1

  • Bugfix: Division by zero in admin section.

Version 3.2

  • RFC: Widget: Ability to disable the randomization of items in a wishlist.
  • RFC: Widget: Ability to select the sort order of the wishlist. Options are Last Updated, Date Added, Price (only cheapest to most expensive is allowed by Amazon) and Priority.
  • RFC: Removed line break tags in the wishlist widget after the image and caption.
  • RFC: Added Amazon.fr
  • Added caching. Wishlists and Items are cached for 23 hours to speed up the lookup process.

Version 3.1.4

  • Bugfix: Invalid argument when there are no widgets on the blog.
  • Bugfix: The shortcode metabox in the post page didn’t work.

Version 3.1.3

  • Bugfix: Uninstall didn’t work.
  • Bugfix: The tabs in the settings page didn’t always work.
  • Updated the Amazon API.
  • Ready for WordPress 2.9

Version 3.1.2

  • Bugfix: Widget didn’t hold value for Associated ID and Associated ID.

Version 3.1.1

  • Bugfix: CSS for the widget was not loaded.

Version 3.1

  • Bugfix: In WordPress 2.8 and PHP5, the secret key calculation didn’t use native PHP5 function.
  • RFC: Ability to set number of columns when displaying all items from a wishlist.
  • The personal secret key is mandatory now. If it’s not present, the plugin will not work.

Version 3.0.8

  • Bugfix: Regression of Bugfix: When using the secret key, the call to Amazon would fail.

Version 3.0.7

  • Bugfix: In the tools section, when looking up your WishList ID and you only have one WishList an undefined function was called.

Version 3.0.6

  • New Amazon API version. Added the ability to see Universal Items on Wishlists.
  • Bugfix: Problem when showing shortcode and widget at the same page.

Version 3.0.5

  • Bugfix: When using the secret key, the call to Amazon would fail.

Version 3.0.4

  • Bugfix: When multiple pages of a list were retrieved and no AWS Key was supplied an error would occur.
  • Bugfix: Certain options weren’t saved in the widget.
  • Bugfix: Shortcodes didn’t work. Call to wrong class.

Version 3.0.3

  • If the plugin was installed prior to upgrading to WordPress 2.8, the widgets would disappear from the sidebars.

Version 3.0.2

  • Reported in conjunction with my AVH Extended Categories widget. The self class does not exists in getInstance.

Version 3.0.1

  • Conflict with declaration of sha256

Version 3.0

  • It uses the new Widget class introduced in WordPress 2.8.
  • Optimizations for WordPress 2.8.
  • Amazon policy change. Calls to Amazon need to be signed per August 15 of 2009. In order to sign calls you will need an Amazon Web Services account. See the FAQ for more details.
  • Picture is shown in metabox for ASIN search.
  • Use of WordPress defined variables, fixes problems when wp-content directory is moved.

Version 2.4

  • Speed improvements.
  • Increased security.
  • Reduced memory footprint.
  • RFC: Ability to select picture size in the short code.
  • Bugfix: Shortcode URL’s for items not in a awishlist were wrong.
  • Several other small bugs are fixed.

Version 2.3.4

  • Bugfix: Footer option in widget didn’t show.

Version 2.3.3

  • Bugfix: In the shortcode the default associate ID wasn’t set to the right one when using a a non US locale.

Version 2.3.2

  • Bugfix: The shortcode didn’t retrieve the assiocated ID set in the admin page.

Version 2.3.1

  • Bugfix: Certain character were not displayed correctly (Characters with Umlauts for example)

Version 2.3

  • RFC: When calling the widget directly the array parameter can hold the widget options.
  • Updated WDSL
  • With WordPress 2.7, when deleting the plugin it will clean up the database, removing the entries related the plugin.
  • Source code improvements.

Version 2.2.4

  • Bugfix: The footer in the widget wasn’t linking correctly.

Version 2.2.3

  • Bugfix: Metabox wasn’t displayed properly in WordPress 2.7

Version 2.2.2

  • Bugfix: Support for non-widget code was broken.
  • Bugfix: When running PHP 5 some warnings “Call-time pass-by-reference has been deprecated”

Version 2.2.1

  • Bugfix: Widget didn’t get the default values.

Version 2.2

  • Display a “no image available” picture when no picture is available.
  • Ability to set default settings for the shortcode.
  • Improve storage of the options.
  • Clear the cache folder at each upgrade.
  • Show searching indicator when searching for WishList or Asin in the Shortcode Metabox.
  • Bugfix: Fixed memory problem. Problem was not using avhamazon class in the shortcode.
  • Bugfix: Metabox was displayed incorrectly on the Page page.
  • RFC: Added option pic+text for the linktype parameter in the shortcode.
  • RFC: Added option all for the asin parameter in the shortcode. This will show all items from a wishlist.

Version 2.1

  • Changed the amount of widgets you can use from 9 to unlimited.

Version 2.0.1

  • Bugfix: Problem with widget header.

Version 2.0

  • Compatibility changed to WordPress 2.5 and higher.
  • RFC: Added shortcode implementation.
  • Number of items to be displayed in the widget can now be changed per widget.

Version 1.5

  • Bugfix: Old WSDL was used to look up the Wish List
  • RFC: Added Amazon.co.uk compatibility.

Version 1.4

  • Bugfix: Only 10 Items from a Wish List were loaded to setup the widget. All items are loaded now.
  • Bugfix: When the list contains one item the widget wouldn’t process it correctly (No image and wrong link).
  • RFC: Added Amazon.de compatibility.
  • RFC: Multiple items from the same Wish List can be displayed in the widget.
  • RFC: A configurable footer can be displayed on the bottom of the widget linking to the list on Amazon.
  • Updated WSDL Location.
  • Code improvements.

Version 1.3

  • RFC: Added Amazon.ca compatibility.

Version 1.2

  • Bug Fix: Creation of the link for the Wish List.

Version 1.1

  • Link from widget makes Amazon recognize it as a link from a Wish List. And the shipping address from the Wish List can be used.
  • Several bug fixes of files not found for WordPress 2.3.
  • Code clean up.

Version 1.0.1

  • Bug Fix: Don’t display purchased items from the lists.
  • Bug Fix: HTML problem when using WordPress 2.3

Version 1.0

  • Added compatibility with WordPress 2.5
  • Added option to use multiple widgets.

Version 0.4.1

  • Bug Fix: Didn’t display picture anymore

Version 0.4

  • Added an “tools” option under Admin -> Manage. You can look up your Wishlist ID by entering the email you use at Amazon. There is no check if the email is valid, if it isn’t you won’t see your wishlist(s)
  • Peter

    Re: Josh~
    Yes at this time it only support Amazon US.

  • Josh~

    Does it support only amazon US?

  • Make it work with Amazon Canada, and you’ll have a fan!

  • Peter

    Khristopher,

    I’m working on it.

  • Gareth

    any chance of making next release work with Amazon UK?

  • Peter

    For Gareth.
    Yep, already in progress. Maybe I’ll do a quick release with just this RFC instead of what I have planned for the next release.

  • I get this error since the last two updates:


    Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of avh_get_list_results(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in / W E B P A T H /wp-content/plugins/avh-amazon/2.5/inc/avh-amazon.widgets.php on line 91

  • Really like teh plugin but have a weird error:

    http://www.germworks.net

    Warning: fopen(/home/germwork/public_html/blog/wp-content/plugins/avh-amazon/cache//wsdlcache-8d089f838d34c5d105c3f4b72f5e1e2a.lock) [function.fopen]: failed to open stream: Permission denied in /home/germwork/public_html/blog/wp-content/plugins/avh-amazon/inc/nusoap/class.wsdlcache.php on line 129

    Warning: flock(): supplied argument is not a valid stream resource in /home/germwork/public_html/blog/wp-content/plugins/avh-amazon/inc/nusoap/class.wsdlcache.php on line 131

  • Jamison Fitzgerald

    Works great for one widget, i even customized the css to remove the box surrounding the images and configured it to leave out the titles and put the items on one row to conserve space, however when i add a second widget and save everything it just copies the contents of the first widget, even if i go back and change it back as soon as i save it will fill the contents of all the options to be the same.

  • I may have to give this a try on our WP site. thanks!

  • great post. Thank for plugin

  • I can’t seem to get the footer text to show up in the widget. Whenever I tick “show footer” and hit save, it seems the “Show footer” get automatically unchecked. Any ideas?

    Thanks! Appreciate the work.

  • Looking good Peter! Updates installed and everything runs great.

  • hey, i’ve been looking for this kind of plugin … but why only U.S Amazon ?

    • Not just US.
      From the Features List:
      Works with Amazon.com and locales Amazon.ca, Amazon.de, Amazon.co.uk.

  • Thanks for the quick update. It works swell!

  • I have removed the widget from my template because it makes my website very slow

    • I’m working on version 2.4 right now that should increase the speed.

      This version is running on the site right now and the best evidence I have of the improvement is on this page
      http://blog.avirtualhome.com/2009/02/09/amazon-launches-the-kindle-2/

      Before it took almost 12 seconds to load this page because it called Amazon 4 times (1 in the sidebar, 3 times in the article itself). Currently the load time is about 4 – 5 seconds.

      If you want I can send the Release Candidate of version 2.4 to you to give it try.

  • bali wedding

    i will try it also on my new wedding blog

  • Hi – I have a funny problem… the widget won’t “stick” when I try to add it to the sidebar. I add it, click “save changes”, and when the page reloads… poof! It’s back on the left side again. I’m puzzled… I’ve never had a widget refuse to live in my sidebar before!

    • You seem to have a problem connecting to Amazon.
      Technical info: I try to retrieve information with the function fsockopen and on your site it doesn’t seems to work.

      This should be resolved with version 2.4 of my plugin. I don’t know when this version will be released.

  • Does this plugin works with the latest wordpress ? Nonetheless a great plugin.

    • Yes it does. Up to 2.7.1 as this is the latest stable as I write this.

  • The new update 2.3.4 still does not perform properly.

    On http://motionpicturecentral.com/blog/2009/02/21/sony-hvr-z7u-professional-1080p-hdv-camcorder/, AVH Amazon provides this link: http://www.amazon.com/Sony-HVR-Z7U-Professional-Video-Camcorder/dp/B00138TS4C/ref=wl_it_dp?ie=UTF8&colid=2YW78VPWH5750&tag=motionpicturecentral-20 – which DOES work.

    On http://motionpicturecentral.com/blog/2009/02/21/sony-hvr-z5u-professional-hdv-high-definition-handheld-camcorder/, AVH Amazon provides this link: http://www.amazon.com/Sony-HVR-Z5U-Definition-Handheld-Camcorder/dp/B001P9HT3Q&tag=motionpicturecentral-20 – which does NOT work.

    It seems the failure is related to the link Amazon provides the AVH Amazon plugin. We have discovered that short links fail. The short links are the sinple direct Amazon links with http://www.amazon.com and ending with the ASIN. The more complex links do not. These are the amazon links with extra tracking information between the ASIN and the Associate ID &tag.

    We have been able to figure out that letting the short link fail at Amazon’s site and then manually inserting a ? or a / after the ASIN and just before &tag=[Associate ID] will cause the link to continue properly to the the related product; however, we do not know if Amazon is properly tracking this. Plus, we don’t know where to manually change AVH’s code to fix the problem.

  • The new update 2.3.4 still does not perform properly. It seems the failure is related to what link Amazon provides the AVH Amazon plugin.

    We have discovered that the short links fail (the links beginning with http://www.amazon.com and ending with the ASIN). On http://motionpicturecentral.com/blog/2009/02/21/sony-hvr-z5u-professional-hdv-high-definition-handheld-camcorder/, AVH Amazon provides this link: http://www.amazon.com/Sony-HVR-Z5U-Definition-Handheld-Camcorder/dp/B001P9HT3Q&tag=motionpicturecentral-20 – which does NOT work.

    The more complex links do work (those with extra tracking information between the ASIN and the Associate ID tag. On http://motionpicturecentral.com/blog/2009/02/21/sony-hvr-z7u-professional-1080p-hdv-camcorder/, AVH Amazon provides this link: http://www.amazon.com/Sony-HVR-Z7U-Professional-Video-Camcorder/dp/B00138TS4C/ref=wl_it_dp?ie=UTF8&colid=2YW78VPWH5750&tag=motionpicturecentral-20 – which DOES work.

    Letting the short link fail at Amazon’s site and then manually inserting a ? or a / after the ASIN and just before &tag=[Associate ID] will cause the link to continue properly the the related product; however, we do not know if Amazon is properly tracking the manual fixes, plus we don’t know where to manually change AVH’s code to fix the problem.

  • Thanks for this wedding gift plugin. We are an event florist in Napa Valley and we are seeing many of our client use websites to help organize and remember their weddings. We will definitely pass this link on to our wedding flower customers.

  • Does this work with multiple authors? (it looks great)

    • Yes it will work with multiple authors but, and I think your real question is if each author can have their own associate ID. There can only be one associate id for the entire blog.

      If you want an associate ID per author let me know and I’ll see what I can do.

      • mariella

        Hello Peter, thank you very much for this great plugin. I would also be very interested to know if there is a possibility for each author to have his/her own associate ID. Are there more info available about that yet?
        Thanks a lot

  • Anonymous

    Could You please tell me if it’s working with Amazon.de? Thanks in advance.

  • Plugin doesn’t want to work anymore.

    Fatal error: Cannot redeclare sha256() in /home/edwink/public_html/blog/wp-content/plugins/avh-amazon/2.8/inc/avh-amazon.sha256.inc.php on line 304

    • Thanks for reporting.
      I just released version 3.0.1 which should have this fixed.

      • Seems to be working. Thanks ๐Ÿ™‚

        • You’re welcome (Graag gedaan ๐Ÿ˜‰ )

  • Inputting an AWS Secret Access Code in the plugin settings causes “unknown failure with Rest Call”. Removing the AWS SEcret Code seems to solve the problem.

    • Besides the secret code, you also need to put in your AWS Key.

      • Exactly! It should work that way.

        However… Entering Both the AWS Key and the AWS SEcret Key in version 3.0.4 caused the “unknown failure with REST CAll” error.

        Removing the AWS SEcret Key cleared the error and allowed the AVH Amazon plugin to continue operating normally.

        • We had the same error and applied the same solution.

          Removing the AWS SEcret Key and leaving the AWS Key in place allowed 3.0.4 to work properly.

        • I opened a topic on my Support Forum, if the suggestion below doesn’t work, let’s continue the discussion there.
          On the page where you got your secret key, you can regenerate your secret key. Use this key for the plugin.

        • We have several different sites. Each have their own AWS Keys; therefore, resetting the keys at Amazon did not work.

          3.0.3 worked fine with the AWS keys. 3.0.4 did not. Something in the new code is causing the error. Peter, perhaps you can try using Query Calls instead of REST Calls to get the XML data. This may hep you find the error.

          • Thanks for this info. I will see what I can do.
            I think I will create a version with some debug functionality, to get this solved..

    • Please upgrade to v3.0.5.
      The bug should be fixed in this version.

  • thankkkkk

  • Hi.

    Thanks so much for your plugin. It’s really useful. I have a question. How can I do to center the thmbnails and the text in the sidebar?

    Thanks ๐Ÿ™‚

    • I apologize for the delay, I was about to answer “Just change the CSS file etc etc” but I discovered the CSS file was not loaded. I just fixed it and will be releasing the bugfix.

      When you have the new version edit the css file avh-amazon.widget.css in the plugin directory and change the following:

      #avhamazon-widget .wishlistimage {
      border-style:solid;
      border-width:1px;
      display:block;
      margin-left:auto;
      margin-right:auto;
      }

      #avhamazon-widget .wishlistcaption {
      font-size:100%;
      text-align:center;
      }

  • Awesome! Thanks so much. It looks so good! ๐Ÿ™‚

  • Mitch

    Hi there, great plugin, I have one problem, the shortcode does not open links in a new window. I have set that option in the admin options of AVH and I tried hacking some of your code pages but cannot get it to open links in _blank ???

  • Stephane

    Excellent add-on! The only feature I would like to see included is an easy way to center the books in the widgets.

    • Edit the css file avh-amazon.widget.css in the plugin directory and change the following:

      #avhamazon-widget .wishlistimage {
      border-style:solid;
      border-width:1px;
      display:block;
      margin-left:auto;
      margin-right:auto;
      }

      #avhamazon-widget .wishlistcaption {
      font-size:100%;
      text-align:center;
      }

  • Thank for plugin

  • BVZ

    Hi there – great plugin! Anyway of customising the output of the images? I wanted to remove the text and show the images in 3 columns to save space. Thanks!

    • Do you mean on a page using the shortcode or as a widget?

      • BVZ

        Sorry – meant the Widget. Also I’ve figured out how to remove the text now, just need to work on displaying as 3 items in a row to save space or 3 columns… whatever works

        • What’s your site so I can take a look. There is no option for columns in the widget, but maybe some creative CSS can do the trick.

  • Hello !
    Is there any way to make it work with the french amazon ?
    I tried adding it to the list but I got a “First argument has to be an array”.

    Thanks a lot !

    • I’ll have to add it. Next week a new version will be released and French Amazon will be included.

  • I got the following error with latest version 3.2

    Warning: Division by zero in /blog/wp-content/plugins/avh-amazon/2.8/inc/avh-amazon.admin.php on line 354

    Locale amazon is also empty.

    • Argh, I hate these stupid mistakes. Last minute changes are never a good idea.
      Anyway v3.2.0.1 fixes the problem.

      • yeah ^^

        Can’t get it work with french amazon.fr: avhamazon error:http_request_failed – Couldn’t resolve host ”

        Also “amazon.fr” doesn’t appear in the second listbox.

  • atrebla

    Hm, the randomize thing doesn’t work for me. Whenever I check it in the widget, it doesn’t “stick”
    Thoughts?

    Awesome plugin otherwise!

    Thanks ๐Ÿ™‚

    • I found the bug, I’ll be releasing an updated version this week.

  • Does this include items from the “Universal Wish List”? Or does it only display items that can be bought from Amazon?

    • Currently it doesn’t, it needs a bit a programming to make it work. Hopefully I’ll be able to add it to the release of this week.

  • Awesome plugin Peter, but no matter how i select to display the items in the sidebar widget, it still sorts them by most recently added. Is this a bug or does it take xx amount of hours to refresh the sort method?

    thanks so much!

    • Try cleaning the cache in the Tools -> AVH Amazon section

      • ah, that got it! thanks man! love the plugin.

  • Thanks for this great plugin…
    I’ve been searching for amazon plugin, but others paid

  • Any luck with being able to include items from the โ€œUniversal Wish Listโ€?

    • Starting with version 3.3 Universal Wish List items are supported. The latest version 3.3.1 solved a small bug, so get the latest version.

  • Hi Peter, do you have any amazon plugin that could display real-time amazon price based on ASIN code?

    • No I don’t have it at hand.
      Shoot me an email through my contacts page and we can discuss this further.