Amazon Associates Link Builder - Version 1.5.2

Version Description

Fixed issues in v1.5.1 that were not handled and returned PHP fatal error.

Download this release

Release Info

Developer amazonlinkbuilder
Plugin Icon 128x128 Amazon Associates Link Builder
Version 1.5.2
Comparing to
See all releases

Code changes from version 1.5.1 to 1.5.2

aalb_config.php CHANGED
@@ -13,7 +13,7 @@ and limitations under the License.
13
  */
14
 
15
  //version
16
- define( 'AALB_PLUGIN_CURRENT_VERSION', '1.5.1' );
17
 
18
  //Version no. with multi locale settings page
19
  define( 'AALB_MULTI_LOCALE_SETTINGS_PLUGIN_VERSION', '1.4.12' );
13
  */
14
 
15
  //version
16
+ define( 'AALB_PLUGIN_CURRENT_VERSION', '1.5.2' );
17
 
18
  //Version no. with multi locale settings page
19
  define( 'AALB_MULTI_LOCALE_SETTINGS_PLUGIN_VERSION', '1.4.12' );
amazon-associates-link-builder.php CHANGED
@@ -7,7 +7,7 @@
7
  /*
8
  Plugin Name: Amazon Associates Link Builder
9
  Description: Amazon Associates Link Builder is the official free Amazon Associates Program plugin for WordPress. The plugin enables you to search for products in the Amazon catalog, access real-time price and availability information, and easily create links in your posts to products on Amazon.com. You will be able to generate text links, create custom ad units, or take advantage of out-of-the-box widgets that we’ve designed and included with the plugin.
10
- Version: 1.5.1
11
  Author: Amazon Associates Program
12
  Author URI: https://affiliate-program.amazon.com/
13
  License: GPLv2
7
  /*
8
  Plugin Name: Amazon Associates Link Builder
9
  Description: Amazon Associates Link Builder is the official free Amazon Associates Program plugin for WordPress. The plugin enables you to search for products in the Amazon catalog, access real-time price and availability information, and easily create links in your posts to products on Amazon.com. You will be able to generate text links, create custom ad units, or take advantage of out-of-the-box widgets that we’ve designed and included with the plugin.
10
+ Version: 1.5.2
11
  Author: Amazon Associates Program
12
  Author URI: https://affiliate-program.amazon.com/
13
  License: GPLv2
ip2country/aalb_maxmind_db_manager.php CHANGED
@@ -103,7 +103,7 @@ class Aalb_Maxmind_Db_Manager {
103
  }
104
 
105
  /*
106
- * It downlaods the db file
107
  *
108
  * @since 1.5.0
109
  *
@@ -111,20 +111,42 @@ class Aalb_Maxmind_Db_Manager {
111
  *
112
  */
113
  private function get_db() {
114
- $response = null;
115
  try {
116
- $response = $this->customized_download_url( AALB_GEOLITE_COUNTRY_DB_DOWNLOAD_URL );
117
- if ( is_wp_error( $response ) ) {
118
- error_log( "Maxmind_db_manager:get_db:::" . $response->get_error_message() );
119
- }
120
- }
121
- catch ( Exception $e ) {
122
  error_log( "Error in maxmind_db_manager:get_db:::" . $e->getMessage() );
123
  }
124
 
125
  return $response;
126
  }
127
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
  /*
129
  * It reset the db keys if required
130
  *
103
  }
104
 
105
  /*
106
+ * It downloads the db file
107
  *
108
  * @since 1.5.0
109
  *
111
  *
112
  */
113
  private function get_db() {
 
114
  try {
115
+ $response = $this->verify_response( $this->customized_download_url( AALB_GEOLITE_COUNTRY_DB_DOWNLOAD_URL ) );
116
+ } catch ( Exception $e ) {
117
+ $response = null;
 
 
 
118
  error_log( "Error in maxmind_db_manager:get_db:::" . $e->getMessage() );
119
  }
120
 
121
  return $response;
122
  }
123
 
124
+ /*
125
+ * It verifies the HTTP response.
126
+ *
127
+ * @argument HTTP_RESPONSE $response
128
+ *
129
+ * @since 1.5.2
130
+ *
131
+ * @return HTTP_RESPONSE $response
132
+ */
133
+ private function verify_response( $response ) {
134
+ if ( is_wp_error( $response ) ) {
135
+ throw new Exception( "WP_ERROR: " . $response->get_error_message() );
136
+ } else if ( ! is_array( $response ) || ! array_key_exists( "response", $response ) || ! array_key_exists( "tmpfname", $response ) ) {
137
+ throw new Exception( "Either the output is not an array or the one of the keys, response or tmpfname doesn't exist" );
138
+ } else {
139
+ $http_response = $response['response'];
140
+ //Below sis reponse code returned by HTTP response
141
+ $code = $http_response['response']['code'];
142
+ if ( $code != HTTP_SUCCESS ) {
143
+ throw new Exception( $code );
144
+ }
145
+ }
146
+
147
+ return $response;
148
+ }
149
+
150
  /*
151
  * It reset the db keys if required
152
  *
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: amazonlinkbuilder
3
  Tags: Amazon, Affiliate, Associates, Amazon Associates, Amazon Associate, Product Advertising API, Amazon API, Amazon Link, Amazon Ad, Amazon Affiliate, eCommerce
4
  Requires at least: 3.0.1
5
- Tested up to: 4.9
6
- Stable tag: 1.4.13
7
- Requires PHP: 5.3.0
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -24,7 +24,7 @@ Link Builder is the official free Amazon Associates Program plugin for WordPress
24
  == Installation ==
25
 
26
  = Pre-requisites =
27
- __Requires PHP Version:__ 5.3 or higher
28
  <br />
29
 
30
  __Requires WordPress Version:__ 3.0.1 or higher
@@ -66,7 +66,7 @@ If you get stuck, or have any questions, you can ask for help in the [Amazon Ass
66
  1. Amazon Associates Link Builder settings console
67
  2. Search for products in Amazon catalog directly from the WordPress toolbar while creating a new post or a page
68
  3. Select the products you would like to advertise
69
- 4. Associate a template and Associates Id to your links
70
  5. Product Carousel Template: Stylishly designed and responsive ad unit that automatically adapts for different device types and screen resolutions that can be placed within or at the end of your content
71
  6. Product Ad Template: A variation of the product carousel template for advertising one product at a time
72
  7. Product Grid Template: Another variation of the product carousel template that can be used to display a grid of products alongside your content
@@ -91,7 +91,7 @@ Information we learn from Amazon Associates Link Builder users helps us to evalu
91
  You can review the **About** section under the Associates Link Builder menu bar or [Link Builder User Guide](https://s3.amazonaws.com/aalb-public-resources/documents/AssociatesLinkBuilder-UserGuide.pdf) for more information on getting started and key features of the plugin. If you get stuck, or have any questions, you can ask for help in the [Amazon Associates Link Builder Plugin Forum](https://wordpress.org/support/plugin/amazon-associates-link-builder).
92
 
93
  = How can I add links to different Amazon sites in my blog? =
94
- You can search products using keywords in any supported country, but you have to join the Associates Program in those countries separately to be able to do this. For example - If you are a blogger in UK interested in linking to Amazon.com (US) site, then you will first need to join the Amazon Associates Program in US to be able to search for products on Amazon.com site.
95
 
96
  = How can I use this plugin to remove rel="noreferrer" from affiliate links in my site? =
97
  You can remove rel="noreferrer" from links to Amazon sites in all posts by selecting the appropriate checkbox in the settings page. This will not remove rel="noopener", if present. This feature only affects links to Amazon sites. This change is reversible and as soon as you deselect the checkbox on settings page, the pages will be restored to the original content.
@@ -99,8 +99,34 @@ You can remove rel="noreferrer" from links to Amazon sites in all posts by selec
99
  = Are Amazon Product Advertising API credentials required to use the feature to remove rel="noreferrer" for Amazon Affiliate Links from all posts? =
100
  Amazon Product Advertising API credentials are not required to use the feature to remove rel="noreferrer" for Amazon Affiliate Links from all posts.
101
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  == Changelog ==
103
 
 
 
 
 
 
 
 
 
 
 
 
104
  = 1.4.13 - November 10, 2017 =
105
  * Fix: Tracking Ids section is not visible on settings page for few associates.
106
  * Fix: Save Changes button on settings page remains disabled for few associates.
@@ -197,6 +223,15 @@ Amazon Product Advertising API credentials are not required to use the feature t
197
 
198
  == Upgrade Notice ==
199
 
 
 
 
 
 
 
 
 
 
200
  = 1.4.13 =
201
  Fix for non working tracking-ids section and Save Changes button for few associates on settings page.
202
 
2
  Contributors: amazonlinkbuilder
3
  Tags: Amazon, Affiliate, Associates, Amazon Associates, Amazon Associate, Product Advertising API, Amazon API, Amazon Link, Amazon Ad, Amazon Affiliate, eCommerce
4
  Requires at least: 3.0.1
5
+ Tested up to: 4.9.1
6
+ Stable tag: 1.5.2
7
+ Requires PHP: 5.4.0
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
24
  == Installation ==
25
 
26
  = Pre-requisites =
27
+ __Requires PHP Version:__ 5.4.0 or higher
28
  <br />
29
 
30
  __Requires WordPress Version:__ 3.0.1 or higher
66
  1. Amazon Associates Link Builder settings console
67
  2. Search for products in Amazon catalog directly from the WordPress toolbar while creating a new post or a page
68
  3. Select the products you would like to advertise
69
+ 4. Add products from multiple marketplaces for geo targeting feature
70
  5. Product Carousel Template: Stylishly designed and responsive ad unit that automatically adapts for different device types and screen resolutions that can be placed within or at the end of your content
71
  6. Product Ad Template: A variation of the product carousel template for advertising one product at a time
72
  7. Product Grid Template: Another variation of the product carousel template that can be used to display a grid of products alongside your content
91
  You can review the **About** section under the Associates Link Builder menu bar or [Link Builder User Guide](https://s3.amazonaws.com/aalb-public-resources/documents/AssociatesLinkBuilder-UserGuide.pdf) for more information on getting started and key features of the plugin. If you get stuck, or have any questions, you can ask for help in the [Amazon Associates Link Builder Plugin Forum](https://wordpress.org/support/plugin/amazon-associates-link-builder).
92
 
93
  = How can I add links to different Amazon sites in my blog? =
94
+ You can search products using keywords in any supported country, but you have to join the Associates Program in those countries separately to be able to do this. For example - If you are a blogger in UK interested in generating links to Amazon.com (US) site, then you will first need to join the Amazon Associates Program in the US to be able to search for products on Amazon.com site. Now, you can add links for products from both US and UK in a single shortcode that will render ad depending upon visitor's country under geo-targeted links feature.
95
 
96
  = How can I use this plugin to remove rel="noreferrer" from affiliate links in my site? =
97
  You can remove rel="noreferrer" from links to Amazon sites in all posts by selecting the appropriate checkbox in the settings page. This will not remove rel="noopener", if present. This feature only affects links to Amazon sites. This change is reversible and as soon as you deselect the checkbox on settings page, the pages will be restored to the original content.
99
  = Are Amazon Product Advertising API credentials required to use the feature to remove rel="noreferrer" for Amazon Affiliate Links from all posts? =
100
  Amazon Product Advertising API credentials are not required to use the feature to remove rel="noreferrer" for Amazon Affiliate Links from all posts.
101
 
102
+ = What is geo-targeted links feature? =
103
+ This feature enables Amazon Associates to create content customized for and better monetize their international traffic.
104
+
105
+ = How will the geo-targeting feature benefit me? =
106
+ The geo-targeting feature lets you monetize any traffic from other countries that was harder to monetize earlier. In accordance with our Operating Agreement, attribution to amazon links placed on your site does not hold if the end user has to switch to a different country specific website to complete his/her purchase. Similarly, if you send users to the correct country website, but with an incorrect country’s tracking id (not valid in that locale), then you will not get paid the affiliate fees for that sale. Many associates use complex home-grown systems, or unreliable 3rd party systems to overcome these limitations. These systems might have trust, reliability and pricing implications on your business. The geo-targeting feature in the WordPress plugin aims to reduce this complexity and give you more control on your monetization of global traffic.
107
+
108
+ = How do I use the geo-targeting feature in the plugin? =
109
+ As a part of the global settings in the plugin, you can configure which countries you want to work with, and the respective tracking id(s). You will also need to provide a set of PA-API credentials, which are connected to each of your respective country associate accounts. You will only need to do this once. As you create content, you will see a tabbed pane which lets you select product sets for each country that you have configured in the plugin. You should pick your default country as the first product set configured. The corresponding short code that is generated will have all the information required to render ads appropriately. When a user visits your site, we use the user’s location to determine which of the product sets to display to the user, and the corresponding ads are rendered. If the user is from a location that you haven’t configured, then your default product set is displayed to the user.
110
+
111
+ = What will happen if the customer is coming from a country for which I have not configured the shortcode in geo-targeting feature? =
112
+ The customer will be shown ads from the first country added in shortcode.
113
+
114
+ = How can I see my reporting for geo-targeting feature? =
115
+ You can see your earnings and other reports from the respective country Associates Portal under "Amazon Associates Link Builder" section.
116
+
117
  == Changelog ==
118
 
119
+ = 1.5.2 - December 2, 2017 =
120
+ * Fix: v1.5.1 not running for few associates.
121
+
122
+ = 1.5.1 - December 1, 2017 =
123
+ * Fix: v1.5.0 not running for few associates.
124
+ * Minumum supported PHP version changed to 5.4.0 from 5.3.0.
125
+
126
+ = 1.5.0 - November 29, 2017 =
127
+ * Geo-targeted links that enables Amazon Associates to create content customized for and better monetize their international traffic. More details [here](https://amazon-affiliate.eu/en/about-the-programme/amazon-associates-link-builder/).
128
+ * Fix: amazon_link shortcode will also work with ProductLink template if text attribute is added separately.
129
+
130
  = 1.4.13 - November 10, 2017 =
131
  * Fix: Tracking Ids section is not visible on settings page for few associates.
132
  * Fix: Save Changes button on settings page remains disabled for few associates.
223
 
224
  == Upgrade Notice ==
225
 
226
+ = 1.5.2 =
227
+ Fixed issues in v1.5.1 that were not handled and returned PHP fatal error.
228
+
229
+ = 1.5.1 =
230
+ Fixed issues in v1.5.0 that was incompatible with few environments and changed minimum supported PHP version to 5.4.0.
231
+
232
+ = 1.5.0 =
233
+ Geo-targeted links that enables Amazon Associates to create content customized for and better monetize their international traffic & fix to allow using Product Links with amazon_link shortcode.
234
+
235
  = 1.4.13 =
236
  Fix for non working tracking-ids section and Save Changes button for few associates on settings page.
237