Amazon Associates Link Builder - Version 1.9.1

Version Description

  • Fixed issues in v1.9.0 that was not compatible with PHP version 5.5
Download this release

Release Info

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

Code changes from version 1.9.0 to 1.9.1

admin/plugin_admin.php CHANGED
@@ -325,14 +325,30 @@ class Plugin_Admin {
325
  * Registers GutenBerg editor block of Amazon Associates Link Builder if supported.
326
  */
327
  public function register_gb_block_if_supported()
 
 
 
 
 
 
 
 
 
 
328
  {
329
  if ($this->gb_block_manager->is_gb_block_supported()) {
330
  $this->aalb_enqueue_styles();
331
  $this->aalb_enqueue_scripts();
332
- $this->gb_block_manager->register_gb_block();
333
  }
334
  }
335
 
 
 
 
 
 
 
 
336
 
337
  }
338
 
325
  * Registers GutenBerg editor block of Amazon Associates Link Builder if supported.
326
  */
327
  public function register_gb_block_if_supported()
328
+ {
329
+ if ($this->gb_block_manager->is_gb_block_supported()) {
330
+ $this->gb_block_manager->register_gb_block();
331
+ }
332
+ }
333
+
334
+ /**
335
+ * Enqueues block editor assets in Gutenberg editor if supported.
336
+ */
337
+ public function enqueue_block_editor_assets_if_supported()
338
  {
339
  if ($this->gb_block_manager->is_gb_block_supported()) {
340
  $this->aalb_enqueue_styles();
341
  $this->aalb_enqueue_scripts();
 
342
  }
343
  }
344
 
345
+ /**
346
+ * Enqueues block assets.
347
+ */
348
+ public function enqueue_block_assets()
349
+ {
350
+ wp_enqueue_script( 'jquery' );
351
+ }
352
 
353
  }
354
 
amazon-associates-link-builder.php CHANGED
@@ -8,7 +8,7 @@
8
  /*
9
  Plugin Name: Amazon Associates Link Builder
10
  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.
11
- Version: 1.9.0
12
  Author: Amazon Associates Program
13
  Author URI: https://affiliate-program.amazon.com/
14
  License: GPLv2
8
  /*
9
  Plugin Name: Amazon Associates Link Builder
10
  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.
11
+ Version: 1.9.1
12
  Author: Amazon Associates Program
13
  Author URI: https://affiliate-program.amazon.com/
14
  License: GPLv2
constants/cron_constants.php CHANGED
@@ -30,9 +30,15 @@ class Cron_Constants {
30
  const DELETE_FROM_TABLE_HOOK = 'aalb_delete_from_table_hook';
31
  const UPDATE_TABLE_CRON = 'aalb_update_table_cron';
32
  const UPDATE_TABLE_CRON_SCHEDULE_NAME = 'fifteen_minutes';
33
- const UPDATE_TABLE_CRON_SCHEDULE_DEFAULT_VALUE = 15 * MINUTE_IN_SECONDS;
 
 
 
34
  const DELETE_FROM_TABLE_CRON_SCHEDULE_NAME = 'six_hours';
35
- const DELETE_FROM_TABLE_CRON_SCHEDULE_VALUE = 6 * HOUR_IN_SECONDS;
 
 
 
36
  const CACHE_REFRESH_AGE = '25 MINUTE';
37
  const CACHE_EVICT_AGE = '24 HOUR';
38
  const DELAY_EXPONENT_ON_PAAPI_THROTTLE = 'aalb_delay_exponent_on_paapi_throttle';
30
  const DELETE_FROM_TABLE_HOOK = 'aalb_delete_from_table_hook';
31
  const UPDATE_TABLE_CRON = 'aalb_update_table_cron';
32
  const UPDATE_TABLE_CRON_SCHEDULE_NAME = 'fifteen_minutes';
33
+ /**
34
+ * 15 minutes in seconds = 900.
35
+ */
36
+ const UPDATE_TABLE_CRON_SCHEDULE_DEFAULT_VALUE = 900;
37
  const DELETE_FROM_TABLE_CRON_SCHEDULE_NAME = 'six_hours';
38
+ /**
39
+ * 6 hours in seconds = 21600.
40
+ */
41
+ const DELETE_FROM_TABLE_CRON_SCHEDULE_VALUE = 21600;
42
  const CACHE_REFRESH_AGE = '25 MINUTE';
43
  const CACHE_EVICT_AGE = '24 HOUR';
44
  const DELAY_EXPONENT_ON_PAAPI_THROTTLE = 'aalb_delay_exponent_on_paapi_throttle';
constants/plugin_constants.php CHANGED
@@ -23,7 +23,7 @@ namespace AmazonAssociatesLinkBuilder\constants;
23
  */
24
 
25
  class Plugin_Constants {
26
- const PLUGIN_CURRENT_VERSION = '1.9.0';
27
  //Version no. with multi locale settings page
28
  const MULTI_LOCALE_SETTINGS_PLUGIN_VERSION = '1.4.12';
29
  const WORDPRESS_REQUEST_TIMEOUT_IN_MS = 40000;
23
  */
24
 
25
  class Plugin_Constants {
26
+ const PLUGIN_CURRENT_VERSION = '1.9.1';
27
  //Version no. with multi locale settings page
28
  const MULTI_LOCALE_SETTINGS_PLUGIN_VERSION = '1.4.12';
29
  const WORDPRESS_REQUEST_TIMEOUT_IN_MS = 40000;
includes/gb_block_manager.php CHANGED
@@ -96,7 +96,7 @@ class GB_Block_Manager
96
  */
97
  private function is_valid_shortcode($shortcode)
98
  {
99
- return (gettype($shortcode) == $this::TYPE_ARRAY) && ($shortcode[$this::ASIN] != null || $shortcode[$this::ASINS] != null);
100
  }
101
 
102
  private function get_render_output($shortcode_val)
@@ -110,7 +110,7 @@ class GB_Block_Manager
110
  */
111
  private function get_shortcode_value_from_attributes($attributes)
112
  {
113
- return shortcode_parse_atts(trim(trim($attributes[GB_Block_Constants::SHORTCODE_ATTR], $this::OPENING_SQUARE_BRACKET), $this::CLOSING_SQUARE_BRACKET));
114
  }
115
  }
116
 
96
  */
97
  private function is_valid_shortcode($shortcode)
98
  {
99
+ return (gettype($shortcode) == $this::TYPE_ARRAY) && (isset($shortcode[$this::ASIN]) || isset($shortcode[$this::ASINS]));
100
  }
101
 
102
  private function get_render_output($shortcode_val)
110
  */
111
  private function get_shortcode_value_from_attributes($attributes)
112
  {
113
+ return isset($attributes[GB_Block_Constants::SHORTCODE_ATTR]) ? shortcode_parse_atts(trim(trim($attributes[GB_Block_Constants::SHORTCODE_ATTR], $this::OPENING_SQUARE_BRACKET), $this::CLOSING_SQUARE_BRACKET)) : $attributes;
114
  }
115
  }
116
 
includes/plugin_manager.php CHANGED
@@ -77,6 +77,8 @@ class Plugin_Manager {
77
  $this->hook_loader->add_action( 'wp_ajax_get_custom_template_content', $plugin_admin, 'get_custom_template_content' );
78
  $this->hook_loader->add_action( 'media_buttons', $plugin_admin, 'admin_display_callback' );
79
  $this->hook_loader->add_action( 'init', $plugin_admin, 'register_gb_block_if_supported');
 
 
80
  $this->hook_loader->add_action( 'admin_footer', $plugin_admin, 'admin_footer_callback' );
81
  $this->hook_loader->add_action( 'plugins_loaded', $plugin_admin, 'check_update' );
82
 
77
  $this->hook_loader->add_action( 'wp_ajax_get_custom_template_content', $plugin_admin, 'get_custom_template_content' );
78
  $this->hook_loader->add_action( 'media_buttons', $plugin_admin, 'admin_display_callback' );
79
  $this->hook_loader->add_action( 'init', $plugin_admin, 'register_gb_block_if_supported');
80
+ $this->hook_loader->add_action( 'enqueue_block_editor_assets', $plugin_admin, 'enqueue_block_editor_assets_if_supported');
81
+ $this->hook_loader->add_action( 'enqueue_block_assets', $plugin_admin, 'enqueue_block_assets');
82
  $this->hook_loader->add_action( 'admin_footer', $plugin_admin, 'admin_footer_callback' );
83
  $this->hook_loader->add_action( 'plugins_loaded', $plugin_admin, 'check_update' );
84
 
js/aalb_gb_block.js CHANGED
@@ -46,9 +46,7 @@
46
  };
47
 
48
  function getSearchButtonClassName() {
49
- return isSearchDisabled ?
50
- 'button aalb-admin-button-create-amazon-shortcode aalb-admin-button-create-amazon-shortcode-disabled'
51
- : 'button aalb-admin-button-create-amazon-shortcode' ;
52
  }
53
 
54
  function getSpanClassName() {
@@ -112,9 +110,10 @@
112
  el('a',
113
  {
114
  className: getSearchButtonClassName(),
 
115
  onClick: onSearchClick
116
  },
117
- 'Search'
118
  ),
119
 
120
  /**
46
  };
47
 
48
  function getSearchButtonClassName() {
49
+ return 'button aalb-admin-button-create-amazon-shortcode' + (isSearchDisabled ? ' aalb-admin-button-create-amazon-shortcode-disabled':'');
 
 
50
  }
51
 
52
  function getSpanClassName() {
110
  el('a',
111
  {
112
  className: getSearchButtonClassName(),
113
+ title: aalb_strings.add_aalb_shortcode,
114
  onClick: onSearchClick
115
  },
116
+ aalb_strings.search_button_label
117
  ),
118
 
119
  /**
readme.txt CHANGED
@@ -2,8 +2,8 @@
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.7
6
- Stable tag: 1.8.0
7
  Requires PHP: 5.4.0
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -72,6 +72,14 @@ If you get stuck, or have any questions, you can ask for help in the [Amazon Ass
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
73
  8. Price Link Template: Dynamic hyperlink containing the current price offered for buying the item on Amazon
74
  9. Create custom ad templates native to your site' styling
 
 
 
 
 
 
 
 
75
 
76
  == Frequently Asked Questions ==
77
 
@@ -116,6 +124,13 @@ You can see your earnings and other reports from the respective country Associat
116
 
117
  == Changelog ==
118
 
 
 
 
 
 
 
 
119
  = 1.8.0 - July 25, 2018 =
120
  * Added support for Australia (AU) marketplace.
121
  * Fix: SearchBox not disabled in case no tracking-ids have been entered.
@@ -245,6 +260,12 @@ You can see your earnings and other reports from the respective country Associat
245
 
246
  == Upgrade Notice ==
247
 
 
 
 
 
 
 
248
  = 1.8.0 =
249
  * Added Support for Australia (AU) marketplace and minor bug-fixes.
250
 
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: 5.0.3
6
+ Stable tag: 1.9.1
7
  Requires PHP: 5.4.0
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
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
73
  8. Price Link Template: Dynamic hyperlink containing the current price offered for buying the item on Amazon
74
  9. Create custom ad templates native to your site' styling
75
+ 10. Gutenberg editor interface
76
+ 11. Amazon Associates Link Builder block under Widgets category
77
+ 12. Amazon Associates Link Builder search block
78
+ 13. Search for products in Amazon catalog from the Gutenberg block while creating a new post or a page
79
+ 14. Select the products you would like to advertise
80
+ 15. (Optional) Mouse over on change block type
81
+ 16. (Optional) Transform to Shortcode
82
+ 17. (Optional) Transformed to Shortcode
83
 
84
  == Frequently Asked Questions ==
85
 
124
 
125
  == Changelog ==
126
 
127
+ = 1.9.1 - February 06, 2019 =
128
+ * Fix : v1.9.0 not running for few associates.
129
+
130
+ = 1.9.0 - January 29, 2019 =
131
+ * Added Product Advertising API (PA-API) response caching feature. This feature will prevent PA-API throttle by caching PA-API response and updating the cache asynchronously.
132
+ * Added support for Gutenberg editor.
133
+
134
  = 1.8.0 - July 25, 2018 =
135
  * Added support for Australia (AU) marketplace.
136
  * Fix: SearchBox not disabled in case no tracking-ids have been entered.
260
 
261
  == Upgrade Notice ==
262
 
263
+ = 1.9.1 =
264
+ * Fixed issues in v1.9.0 that was not compatible with PHP version 5.5
265
+
266
+ = 1.9.0 =
267
+ * Added Product Advertising API (PA-API) response caching feature. This feature will prevent PA-API throttle by caching PA-API response and updating the cache asynchronously. Added support for Gutenberg editor.
268
+
269
  = 1.8.0 =
270
  * Added Support for Australia (AU) marketplace and minor bug-fixes.
271
 
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit0109db78cca461b11b08bed8bbbfaabf::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit4953f8685b3e2868b7a2d8d46bda633a::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit0109db78cca461b11b08bed8bbbfaabf
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit0109db78cca461b11b08bed8bbbfaabf
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit0109db78cca461b11b08bed8bbbfaabf', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit0109db78cca461b11b08bed8bbbfaabf', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInit0109db78cca461b11b08bed8bbbfaabf::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit4953f8685b3e2868b7a2d8d46bda633a
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit4953f8685b3e2868b7a2d8d46bda633a', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit4953f8685b3e2868b7a2d8d46bda633a', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit4953f8685b3e2868b7a2d8d46bda633a::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit0109db78cca461b11b08bed8bbbfaabf
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'M' =>
@@ -64,10 +64,10 @@ class ComposerStaticInit0109db78cca461b11b08bed8bbbfaabf
64
  public static function getInitializer(ClassLoader $loader)
65
  {
66
  return \Closure::bind(function () use ($loader) {
67
- $loader->prefixLengthsPsr4 = ComposerStaticInit0109db78cca461b11b08bed8bbbfaabf::$prefixLengthsPsr4;
68
- $loader->prefixDirsPsr4 = ComposerStaticInit0109db78cca461b11b08bed8bbbfaabf::$prefixDirsPsr4;
69
- $loader->prefixesPsr0 = ComposerStaticInit0109db78cca461b11b08bed8bbbfaabf::$prefixesPsr0;
70
- $loader->classMap = ComposerStaticInit0109db78cca461b11b08bed8bbbfaabf::$classMap;
71
 
72
  }, null, ClassLoader::class);
73
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit4953f8685b3e2868b7a2d8d46bda633a
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'M' =>
64
  public static function getInitializer(ClassLoader $loader)
65
  {
66
  return \Closure::bind(function () use ($loader) {
67
+ $loader->prefixLengthsPsr4 = ComposerStaticInit4953f8685b3e2868b7a2d8d46bda633a::$prefixLengthsPsr4;
68
+ $loader->prefixDirsPsr4 = ComposerStaticInit4953f8685b3e2868b7a2d8d46bda633a::$prefixDirsPsr4;
69
+ $loader->prefixesPsr0 = ComposerStaticInit4953f8685b3e2868b7a2d8d46bda633a::$prefixesPsr0;
70
+ $loader->classMap = ComposerStaticInit4953f8685b3e2868b7a2d8d46bda633a::$classMap;
71
 
72
  }, null, ClassLoader::class);
73
  }