Amazon Associates Link Builder - Version 1.7.0

Version Description

  • April 2, 2018 =
  • Added support for wider character set sent by Product Advertising API(PA-API). More details about change on PA-API can be found here.
Download this release

Release Info

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

Code changes from version 1.6.0 to 1.7.0

aalb_config.php CHANGED
@@ -13,7 +13,7 @@ and limitations under the License.
13
  */
14
 
15
  //version
16
- define( 'AALB_PLUGIN_CURRENT_VERSION', '1.6.0' );
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.7.0' );
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.6.0
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.7.0
11
  Author: Amazon Associates Program
12
  Author URI: https://affiliate-program.amazon.com/
13
  License: GPLv2
includes/aalb_template_engine.php CHANGED
@@ -60,6 +60,7 @@ class Aalb_Template_Engine {
60
  public function render( $display_key, $products_key, $template, $url, $marketplace, $link_code, $store_id, $asin_group ) {
61
  if ( false === ( $display_unit = $this->cache_template_loader->get_display_unit( $display_key ) ) ) {
62
  $products = $this->get_products( $products_key, $url, $link_code );
 
63
  $xml = $this->parse( $products );
64
  $items = $this->get_items( $xml );
65
 
@@ -75,6 +76,25 @@ class Aalb_Template_Engine {
75
  return $display_unit;
76
  }
77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
 
79
  /**
80
  * Adds pixel image HTML element to the display unit
60
  public function render( $display_key, $products_key, $template, $url, $marketplace, $link_code, $store_id, $asin_group ) {
61
  if ( false === ( $display_unit = $this->cache_template_loader->get_display_unit( $display_key ) ) ) {
62
  $products = $this->get_products( $products_key, $url, $link_code );
63
+ $products = $this->unescape_numeric_character_references( $products );
64
  $xml = $this->parse( $products );
65
  $items = $this->get_items( $xml );
66
 
76
  return $display_unit;
77
  }
78
 
79
+ /**
80
+ * Single Escape Numeric Character References(NCR) using regular expression replacement
81
+ *
82
+ * @since 1.7.0
83
+ *
84
+ * @param string $products Deserialized XML string with NCRs double escaped
85
+ *
86
+ * @return string Deserialized XML string with NCRS single escaped
87
+ */
88
+ private function unescape_numeric_character_references( $products ) {
89
+ //Single Escape NCR represented as hex number
90
+ $products = preg_replace( "/&(#x[a-fA-F0-9]{4,6};)/", "&$1", $products );
91
+
92
+ //Single Escape other special characters escaped by Product Advertising API like Σ(Σ),Θ(Θ)
93
+ $products = preg_replace( "/&(#[0-9]{1,7};)/", "&$1", $products );
94
+
95
+ return $products;
96
+ }
97
+
98
 
99
  /**
100
  * Adds pixel image HTML element to the display unit
readme.txt CHANGED
@@ -3,7 +3,7 @@ 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.4
6
- Stable tag: 1.6.0
7
  Requires PHP: 5.4.0
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -116,6 +116,9 @@ You can see your earnings and other reports from the respective country Associat
116
 
117
  == Changelog ==
118
 
 
 
 
119
  = 1.6.0 - March 14, 2018 =
120
  * Added Impressions data in reports shown on respective associates website. This will work only for ads rendered after upgrade to this release.
121
 
@@ -236,6 +239,9 @@ You can see your earnings and other reports from the respective country Associat
236
 
237
  == Upgrade Notice ==
238
 
 
 
 
239
  = 1.6.0 - March 14, 2018 =
240
  * Added Impressions data in reports shown on respective associates website for ads rendered after upgrade to this release.
241
 
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.4
6
+ Stable tag: 1.7.0
7
  Requires PHP: 5.4.0
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
116
 
117
  == Changelog ==
118
 
119
+ = 1.7.0 - April 2, 2018 =
120
+ * Added support for wider character set sent by Product Advertising API(PA-API). More details about change on PA-API can be found [here](https://forums.aws.amazon.com/ann.jspa?annID=5543).
121
+
122
  = 1.6.0 - March 14, 2018 =
123
  * Added Impressions data in reports shown on respective associates website. This will work only for ads rendered after upgrade to this release.
124
 
239
 
240
  == Upgrade Notice ==
241
 
242
+ = 1.7.0 - April 2, 2018 =
243
+ * Added support for wider character set sent by Product Advertising API(PA-API). More details about change on PA-API can be found [here](https://forums.aws.amazon.com/ann.jspa?annID=5543).
244
+
245
  = 1.6.0 - March 14, 2018 =
246
  * Added Impressions data in reports shown on respective associates website for ads rendered after upgrade to this release.
247