=== Amazon Link === Contributors: paulstuttard Donate link: http://www.houseindorset.co.uk/plugins Tags: Amazon, links, wishlist, recommendations, shortcode, ip2nation, localise, images, media library, affiliate, product, template Requires at least: 3.3 Tested up to: 5.1 Stable tag: 3.2.10 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html This plugin enables you to put Amazon product links, images and bespoke templates into your site's Pages, Posts, Widgets and Templates. == Description == This plugin is used to quickly add Amazon products links to your WordPress posts and pages. The product links can be simple text links, thumbnail images, full-size images, complex templates or full-blown Amazon flash widgets. The product links that can be for any of the Amazon domains ([UK](http://www.amazon.co.uk), [US](http://www.amazon.com), [Brazil](http://www.amazon.com.br), [Canada](http://www.amazon.ca), [China](http://www.amazon.cn), [Germany](http://www.amazon.de), [Spain](http://www.amazon.es), [France](http://www.amazon.fr), [Italy](http://www.amazon.it), [India](http://www.amazon.in), [Mexico](http://www.amazon.com.mx), [Australia](http://www.amazon.com.au) and [Japan](http://www.amazon.co.jp/)). The content of the product links can be statically entered by the Author (when the link is created), or dynamically refreshed when displayed using data from the Amazon site that is most appropriate for the nationality of the reader. The product links to be displayed can be specified when the link is created, using the built in Amazon search widget, or dynamically generated by searching the content of the site. All product links will contain the Amazon affiliate ID of the site author and will be the relevant one for that locale. This allows you to collect commission on any products purchased through the links. = Key features = * [Search Tool](./faq#search) to assist authors to create links in posts and pages * Simple `[amazon]` [shortcode](./other_notes#shortcode) used to generate product links * [Localisation](./faq#localise) of all links based on the nationality of the reader * Amazon Product Details Cache to ensure pages load quickly * Optional multinational popup to allow the reader to choose which Amazon site to visit * [Global options](./other_notes) to update the behaviour of all the links on your site * Ability to locally override the global options using the [shortcode](./other_notes#shortcode) content * Affiliate Tracking IDs for each WordPress user or by user specified ['Channels'](./faq#channels). * Flexible [template facility](./faq#templates) to enable the author to quickly create complex content quickly and consistently * Includes [built in templates](./faq#defaults) for the major Amazon widgets (Carousel, My Favourites, etc.). * Facility to extend and modify the functionality of the plugin using WordPress [filters](./technical#filters) = Quick Start = To quickly add a simple text link add the following lines into an entry (page, post or text widget): `[amazon asin=&text=]` Where ASIN Number is the unique amazon number used to identify products e.g. "1405235675". The Link Text is simply what you want to be shown for the link, e.g. "Mr. Good". To utilise one of the templates simply specify the template option with the name of the template to use. For example: `[amazon asin=&title=&thumb=&template=thumbnail]`. To take full advantage of the plugin features it is recommended that you have an Amazon Web Services account, and enter the Access Key ID and Secret Access Key in the Amazon Link Settings page. Once your AWS account settings are entered the plugin can be configured to dynamically fill in the templates with live information from the appropriate Amazon site. Alternatively you can use the Amazon Search tool on the Page/Post edit screen to find Amazon products and let the plugin pre-fill the Amazon Link shortcode with all the details needed to create the appropriate template. To generate a list of products relevant to the content of your site use the 'cat' option, to specify where the plugin should search for Amazon product links. This option can be either 'local' to search the current page content or a list of category ids to search specific sections of your site. For example I use this feature to provide friends and family some ideas for presents. This feature also needs access to the Amazon Web Service API and uses the 'CartSimilarities' feature to generate the list of items. This is created by either putting the line `amazon_recommends(,)` in your template. Or putting the line `[amazon cat=&last=]` within a post or page. Where 'Category' is a list of category ids to search within (e.g. as expected by the 'cat' argument of [query_posts](http://codex.wordpress.org/Class_Reference/WP_Query#Parameters) function. The 'last' parameter is the number of posts to search through. = Latest Version - 3.2.10 = * Bug Fix - The default 'no image' URL use https if site is using https * Bug Fix - Remove any hard coded 'http' URLs (inc Templates) * Bug Fix - Make links use 'AWS' parameters == Installation == = New Install = 1. Install either via WordPress Plugin Installer (Go to: `'Plugins' > 'Add New'` admin page and Search Plugins using the term `'amazon link'`). Or by uploading the files to your server (in `'/wp-content/plugins/'`) after downloading the [amazon-link plugin](http://wordpress.org/extend/plugins/amazon-link/) from the [Plugin Directory](http://wordpress.org/extend/plugins/) 1. Activate the plugin through the 'Plugins' menu in WordPress. 1. Update the settings (at the very least enter the default Affiliate Tags) 1. If you wish to use the advanced functionality: Wishlists, Search, Media Upload facilities or the live data option you must also set up an [Amazon Web Services](http://aws.amazon.com/) account. So that you can update the AWS Public and Private key settings. 1. If you wish to use link localisation then you need to install the ip2nation database using the option in the Amazon Link Settings page. 1. If you would like to take advantage of the Amazon Link Product caching then you will need to enable this on the Amazon Link Settings page. 1. Insert links and wishlists into your content using the [amazon] tag as described above, or using the Amazon Link box on the Page/Post edit pages. = Upgrading = Generally upgrading should happen smoothly, however for major releases (e.g. 3.0 to 3.1) please read the [Upgrade Guide](http://www.houseindorset.co.uk/plugins/amazon-link/upgrading/). To upgrade use the built in WordPress update option on the Plugins Admin page. == Screenshots == 1. Quickly create lists of associated products using the Wishlist feature. 2. Optionally enable the Amazon Link Multinational links to allow users to select their preferred Amazon site. 3. On the WordPress Post/Page edit screen utilise the Amazon Link Search Tool to find products and create links. 4. Use the Amazon Link Templates manager to modify and create your own Link Content. 5. Use the extensive Amazon Link Options page to customise the behaviour of the plugin. 6. On the Amazon Link Associate ID options page enter all your Amazon Associate IDs to earn commission from links. == Changelog == **3.2.10 - 06 March 2019** * Bug Fix - The default 'no image' URL use https if site is using https * Bug Fix - Remove any hard coded 'http' URLs (inc Templates) * Bug Fix - Make links use 'AWS' parameters **3.2.9 - 30 May 2018** * Feature - Add support for Australia. * Bug Fix - Fix localisation & localisation spoofing on Cloudflare. * Bug Fix - Fix changing associate tags on Setup screen. * Bug Fix - Fix Media Upload of Images * Bug Fix - Fix 'Images' extra plugin failing to resize images **3.2.8 - 12 December 2017** * Feature - Add ability to disable some locales. * Bug Fix - Fix failing ip2nation installation. * Bug Fix - Fix some warnings. **3.2.7 - 24 June 2017** * Feature - Add global option to disable template previews. * Feature - Add global option to set the default template. * Feature - Add Amazon Search Widget template. * Bug Fix - Fix 'Convert' plugin to help with removal of shortcodes. **3.2.6 - 15th July 2016** * Bug Fix - Fix Multinational ASIN handling in the shortcode, blanks & '-' parsed correctly. * Bug Fix - Fix key validation for non-UK registered affiliates * Feature - Add support for Mexico **3.2.5 - 25th June 2015** * Bug Fix - Validate AWS Keys in all locales. * Bug Fix - Tidy up ip2nation installer, in support of MaxMind alternate * Update - Update the Default Templates to use the new Amazon Widget URLS * Feature - 'Count' keyword for multi ASIN links * Feature - 'alt' option to return 'AlternateVersions' of an Item * Feature - Allow User names as well as IDs in the 'Author' Channel Filter * Feature - Add support for links to an book's author's Biography %BURL% and %BLINK_OPEN% * Feature - Update Amazon Link Images Extra to use image modifiers (e.g. SL800 [More](http://aaugh.com/imageabuse.html)) not just size (e.g. 800) * Feature - Add filters to change the country map, locales available to allow removal of support for specific locales. * Policy - Plugin Extras linked to Developer Support Option **3.2.4 - 24th June 2014** * Bug Fix - Save Affiliate IDs on Setup Screen. **3.2.3 - 11th May 2014** * New Feature - Add 'home_links' option to show default locale links if product not available locally, and hide price if not relevant for that locale. * Bug Fix - Correct US iframe image - %RCM% keyword. **3.2.2 - 9th April 2014** * New Feature - New Setup page to help new users configure the plugin * New Feature - Add support for Brazil locale * New Feature - Add settings to allow the 'Add Amazon Link' form to have pre-configured defaults * Bug Fix - Correction to iframe localised subdomains * Bug Fix - Tweek the way Amazon data is escaped to show HTML in the Editorial Comments * Bug Fix - Remove depreciated screen_icons * Bug Fix - Ensure 'Link Text' is put into the shortcode when link inserted into a post * Bug Fix - Prevent PHP timeouts when install the ip2nation database * Bug Fix - Ensure multinational links are 'nofollow' * Bug Fix - Escape the '&' in the link URLs **3.2 - 12th March 2014** * New Feature - Experimental 'live search', use a shortcode using s_title, s_index, s_author to create a wishlist of search results. * Bug Fix - Improve separation of backend and frontend functionality * Bug Fix - Fix bug with Template Export encoding function * Bug Fix - Ensure 'Extra' plugins are Deactivated before Uninstalling * Bug Fix - Improve performance of User Channel lookups * Bug Fix - Rework parsing of shortcode arguments and settings * Other - Updates to match WordPress coding standard * Other - Update Amazon Java based Templates to match new subdomains * Compliance - Improve visibility of use of plugins own affiliate IDs **3.1.2 - 16th December 2013** * New Feature - Add keyword for URL, RURL & SURL as per LINK_OPEN but just the URL. * New Feature - Experimental 'Shortcode Cache' to attempt to reduce load on high traffic sites * Bug Fix - Make Media Library Image Search Optional to reduce server overhead * Bug Fix - Ensure Image Upload works when 'images' extra installed. * Bug Fix - Update 'wishlist' styles to allow variable height items. * Bug Fix - Fix Wishlist selection of post categories * Bug Fix - Update ip2nation to use WP functions to get & extract the database * Bug Fix - Fix clash with other plugins and Amazon Link Settings Menus * Bug Fix - Fix clash with 'Category Sticky Posts' * Other - Rework Channel selection to use live product data **3.1.0** This release of the plugin is a major rework of the internals to make it simpler to customise the behaviour of the plugin. Please take the usual precautions when upgrading (backup Database, etc.). Please read the [Upgrade Guide](http://www.houseindorset.co.uk/plugins/amazon-link/upgrading/). * New Feature - Re-organised Settings pages and update Contextual Help * New Plugin (BETA) - Add 'Redirect links' an 'Extras' plugin to create links in the form `www.domain.com/al/0123456789` that auto redirect to the appropriate Amazon site. * New Plugin (BETA) - Add a database of predefined shortcodes accessed using a unique References ID * New Plugin (BETA) - Add a facility to search for and replace shortcodes in post content * New Plugin (BETA) - Add a facility to change the size of the images retrieved from Amazon * New Feature - Ability to Export existing templates to a plugin file * New Feature - Add new keywords PUB_KEY, BUY_BUTTON * New Feature - Add new Amazon Link type 'URL' so can manually specify the link destination * New Feature - Add simple Rules to Channels * New Feature - Option to disable User specific Affiliate IDs * New Template - 'Add To Cart' Template added * Bug Fix - Change the way templates are processed, to improve page performance * Bug Fix - Update settings page to correctly handle 1 or 2 column mode * Bug Fix - Update multinational 'popup' to reposition itself if not in correct screen location. * Bug Fix - Remove various warnings when DEBUG enabled, and some CSS errors * Bug Fix - Conditionally add contextual help based on WordPress version * Other - Rework plugin to allow more customisation of the data retrieved and how it is displayed. **3.0.3** * New Feature - Amazon Link Helper Box added to all custom Post types * New Feature - Add 'Extra' plugin manager to allow installation of user provided features, e.g. The addition of an '%Editorial%' keyword to display Amazon 'Editorial Review' content * New Feature - Add ability to change the ASINs used to generate the template previews * Bug Fix - correct multi-ASIN argument handling **3.0.2** * New Feature - Add basic contextual help to the plugin Settings page. * New Feature - Validate AWS keys when entered on the Setting page. * New Feature - Add support for 'Link to Reviews' rather than the product in templates * New Feature - Add 'rel="nofollow"' to all links. * Bug Fix - Check for Creation Date when checking the ip2nation database, thanks to Ken Paulson for spotting * Bug Fix - Position of 'multinational popup' made more consistent **3.0.1** * New Feature - Simple Template Manager * New Feature - Amazon Product Cache to speed up page loading * New Feature - Add 'Template Type' option to identify templates that require no ASIN, or Multiple ASINS. * New Feature - Search using by 'ASIN' if 'Title' and 'Author' fields blank * New Feature - 'country' modifiers (UK#, DE#, US#, etc.) for Template keywords. * New Feature - 'country' specific shortcode modifiers (, , , etc.) for any Shortcode keyword. * Templates Update - Add 'Amazon Impression Tracking' to templates * Templates Update - Add 'Easy Banner' template example * Templates Update - Add 'Amazon Preview Script' template, add to the bottom of your post/page or include in your theme's footer * Templates Update - Add 'Multinational' template, example of using 'country' modifiers. * Bug Fix - Fix filtering of incomplete tags. * Bug Fix - Move 'aws_signed_request' into the Class to avoid name clash with 'premiumtheme', thanks to *pst61* for spotting. **2.0.9** * New Feature - Amazon search links for non-local links * Bug Fix - Fix so that searches from all Search Indices return valid results. * Bug Fix - Extra checks on ip2nation lookup failures. **2.0.8** * Bug Fix - Extract price information from OfferListing, LowestNew, LowestUsed and then ItemAttributes. Thanks to [Matthew](http://mynextebook.com) for spotting. **2.0.7** * Fix US localisation of image iframe template - addition of RCM template item **2.0.6** * Add support for www.amazon.es * Improve localisation of image iframe template - addition of MPLACE_ID template item **2.0.4** * Add Affiliate ID channels and User Affiliate ID settings * Facility to set Affiliate channel by Author or manually in each shortcode. * Bug fix - Italian AWS API Version Increment * Bug fix - Fix php 'Notice's when WP_DEBUG is enabled **2.0.3** * Add extra support for www.amazon.it and www.amazon.cn * Add 'found' tag to templates to indicate if product is listed on Amazon, and updated default templates to make use of this. * Bug fix - not displaying '$' prices correctly * Bug fix - not linking to default locale correctly **2.0.2** * Make template names case insensitive * Added debug output option to help diagnosis of problems * Add notes to options page to highlight AWS requirements * Disable Search options on page/post edit screens if AWS keys not entered * Bug Fix - Only do 'live' data lookups when activated * Bug Fix - Improve ability of shortcode settings to override global settings when generating template links * Bug Fix - If product not available in locale, use author's locale. Thanks to [Sandie](/) for highlighting. * Bug Fix - Improve handling of failed ASIN lookups. Thanks to [Matt](/) for bring to my attention. * Bug Fix - Correct usage of activation hook, and add upgrade checks **2.0.1** * Tidy up options so that default affiliate ID's are not displayed and removed redundant 'remote_images' option. * Fix bug with plugin activation outputting characters - Thanks to [Viktor Leberecht](http://viktor-leberecht.com) for highlighting. * Fix bug when creating the default templates - Thanks to [Tobias Hartmann](http://www.tobias-hartmann.net) for spotting. **2.0** * Add template facility, with pre-designed templates for most Amazon widgets * Add ability to create multiple links from one shortcode * Add shortcode processing in widgets * Add an option to make the links open in a new window when clicked on by a reader. * Add an option to set the length of the wishlist displayed **1.8.1** Default to using .com for aws requests when user has configured Italian or Chinese as the default domain. Note requires Wordpress version 3.1 for this release. **1.8** Add support for images into the shortcode, as well as the ability to add images to the Wordpress media library. **1.7** Rework ip2nation download function **1.6** Add support for China and Canada Associates sites, fix ip2nation status check bug. **1.5** Change the multinational link to use less in-line javascript. **1.4** Added a simple widget to the post & page new/edit screen to assist in adding shortcodes to posts, providing a facility to search Amazon. **1.3** Add link localisation through IP address lookup, and support for all 6 amazon affiliate sites not just one via a image popup. **1.2** Improve options page processing. **1.1** Move options page into 'Options' section. Corrected stylesheet content, updated styles & provide facility to override the stylesheet. Add internationalisation hooks into plugin. **1.0** First Release == Frequently Asked Questions == **I've tried the plugin and it doesn't do what I want, help?** If you think the plugin doesn't work, please try contacting me and I will endeavour to help. You can [search](https://www.google.com/search?q=site:wordpress.org%2Fsupport%2Ftopic+%22amazon-link%22) the forums or start a new forum topic on the [Wordpress site](http://wordpress.org/support/plugin/amazon-link). **Where do I enter my Amazon Affiliate/Associate IDs?** The site owner can enter their Affiliate IDs on the Amazon Link > Associate IDs page in the 'Amazon Tracking ID Channels' section. Select the 'Default' Channel and enter your IDs for all the locales in which you have registered. Optionally any user of your site (including the owner/administrator) can also add their Affiliate IDs to their User Profile. However it is recommended that the Affiliate IDs in the default channel as set up, as some sections of the site (e.g. shortcodes inserted in sidebar widgets) do not have an 'author'. If some of the IDs are not supplied in a User's profile, or in a particular Channel, then the ones in the default channel will be used instead. Only if no IDs exist for a particular locale then the plugin will use its own default IDs. **How do I insert product links into my posts?** The plugin adds a helper tool to the Post and Page administrative pages of your WordPress site that can be used to generate shortcodes easily and quickly. If you already know the ASIN then simply enter it into the ASIN input and click on 'Send To Editor', this can be used to generate simple text links to products. If you do not know the ASIN then there is a facility to search Amazon, by ASIN, Index, Product Title and or Product Author/Artist. Use this to find the product you wish to link to on your site. Once found select the appropriate template and other settings and press the 'Insert' button. This will insert the shortcode into your post with all the settings required for the selected template pre-filled. **This feature is only available if you have entered your Amazon Web Services access keys in the plugin settings.** If you are using 'live' data then it will only include keywords that must be provided by the author 'text', 'text1', etc. If you are using static data then it will also pre-fill the keywords with the product information retrieved from the Amazon site. There is also a facility to add cover images from the Amazon items into the local media library as attachments to the post (Press the 'Upload' button). The plugin will always use these local images in preference to ones fetched from the Amazon site. These images or the remote ones hosted on Amazon can be used to insert image or thumbnail links into your posts. **How do I align thumbnails, images or iframes horizontally and make the text wrap around?** If you want images to be displayed side by side and the text to wrap around the Amazon items, then you simply need to take advantage of the built in 'align' classes provided by WordPress. On the Amazon-Link / Templates Settings page: * Find the template you wish to use (e.g. thumbnail), * Create a copy of that template and rename it appropriately (e.g. thumbnail left) * In the template content find the first element e.g. inside the `
` or `