Amazon Associates Link Builder - Version 1.4.5

Version Description

Prime branding changes, feature to remove rel="noreferrer" from Amazon Affiliate links.

Download this release

Release Info

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

Code changes from version 1.4.4 to 1.4.5

aalb_config.php CHANGED
@@ -13,7 +13,7 @@ and limitations under the License.
13
  */
14
 
15
  //version
16
- define( 'AALB_PLUGIN_CURRENT_VERSION', '1.4.4' );
17
 
18
  //PHP version compatible for AALB plugin
19
  define('AALB_PLUGIN_MINIMUM_SUPPORTED_PHP_VERSION','5.3.0');
@@ -99,6 +99,7 @@ define( 'WP_POST_NEW', 'post-new.php' );
99
 
100
  //Local Styles
101
  define( 'AALB_ADMIN_CSS', AALB_PLUGIN_URL . 'admin/css/aalb_admin.css' );
 
102
  define( 'AALB_BASICS_CSS', AALB_PLUGIN_URL . 'css/aalb_basics.css' );
103
 
104
  //Local Scripts
@@ -157,6 +158,7 @@ define( 'AALB_CRED_CONFIG_GROUP', 'aalb_cred_config_group' );
157
  define( 'AALB_STORE_ID_NAMES', 'aalb_store_id_names' );
158
  define( 'AALB_SHOW_HTTP_WARNING_ONCE', 'aalb_show_http_warning_once' );
159
  define( 'AALB_PLUGIN_VERSION', 'aalb_plugin_version' );
 
160
 
161
  //Masking constant
162
  define( 'AALB_AWS_SECRET_KEY_MASK', '••••••••••••••••••••••••••••••••••••••••' );
@@ -236,4 +238,21 @@ define( 'JP', 'JP' );
236
  define( 'MX', 'MX' );
237
  define( 'UK', 'UK' );
238
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
  ?>
13
  */
14
 
15
  //version
16
+ define( 'AALB_PLUGIN_CURRENT_VERSION', '1.4.5' );
17
 
18
  //PHP version compatible for AALB plugin
19
  define('AALB_PLUGIN_MINIMUM_SUPPORTED_PHP_VERSION','5.3.0');
99
 
100
  //Local Styles
101
  define( 'AALB_ADMIN_CSS', AALB_PLUGIN_URL . 'admin/css/aalb_admin.css' );
102
+ define( 'AALB_CREDENTIALS_CSS', AALB_PLUGIN_URL . 'admin/css/aalb_credentials.css' );
103
  define( 'AALB_BASICS_CSS', AALB_PLUGIN_URL . 'css/aalb_basics.css' );
104
 
105
  //Local Scripts
158
  define( 'AALB_STORE_ID_NAMES', 'aalb_store_id_names' );
159
  define( 'AALB_SHOW_HTTP_WARNING_ONCE', 'aalb_show_http_warning_once' );
160
  define( 'AALB_PLUGIN_VERSION', 'aalb_plugin_version' );
161
+ define( 'AALB_NO_REFERRER_DISABLED', 'aalb_no_referrer_disabled' );
162
 
163
  //Masking constant
164
  define( 'AALB_AWS_SECRET_KEY_MASK', '••••••••••••••••••••••••••••••••••••••••' );
238
  define( 'MX', 'MX' );
239
  define( 'UK', 'UK' );
240
 
241
+ //Amazon URLs To be used in Aalb_Content_Filter.
242
+ $AALB_AMAZON_DOMAINS = array(
243
+ 'amazon\.com',
244
+ 'amazon\.fr',
245
+ 'amazon\.it',
246
+ 'amazon\.de',
247
+ 'amazon\.es',
248
+ 'amazon\.com\.br',
249
+ 'amazon\.ca',
250
+ 'amazon\.cn',
251
+ 'amazon\.in',
252
+ 'amazon\.co\.jp',
253
+ 'amazon\.com\.mx',
254
+ 'amazon\.co\.uk',
255
+ 'amzn\.to'
256
+ );
257
+
258
  ?>
admin/aalb_admin.php CHANGED
@@ -28,7 +28,6 @@ class Aalb_Admin {
28
  private $remote_loader;
29
  private $tracking_api_helper;
30
  private $helper;
31
- private $admin_notice_manager;
32
  private $compatibility_helper;
33
 
34
  public function __construct() {
@@ -37,22 +36,16 @@ class Aalb_Admin {
37
  $this->remote_loader = new Aalb_Remote_Loader();
38
  $this->tracking_api_helper = new Aalb_Tracking_Api_Helper();
39
  $this->helper = new Aalb_Helper();
40
- $admin_notice_manager = Aalb_Admin_Notice_Manager::getInstance();
41
- $admin_notice_manager->add_notice( $this, 'aalb_plugin_activation' );
42
  }
43
 
44
  /**
45
- * Show warning message if the AWS Credentials are not yet set upon activation
46
  *
47
- * @since 1.0.0
 
48
  */
49
- public function aalb_plugin_activation() {
50
- if ( get_option( AALB_AWS_ACCESS_KEY ) == '' or get_option( AALB_AWS_SECRET_KEY ) == '' ) {
51
- echo "<div class=\"notice notice-error\">
52
- <h3>Amazon Associates Link Builder Important Message!</h3>
53
- <p>Please Note - You need to add your Access Key ID and Secret Access Key in the plugin settings page for adding links to Amazon using Amazon Associates Link Builder plugin.</p>
54
- </div>";
55
- }
56
  }
57
 
58
  /**
@@ -92,7 +85,7 @@ class Aalb_Admin {
92
  wp_enqueue_style( 'thickbox' );
93
  wp_localize_script( 'aalb_admin_js', 'api_pref', $this->get_paapi_pref() );
94
  wp_localize_script( 'aalb_admin_js', 'aalb_strings', $this->get_aalb_strings() );
95
- }
96
 
97
  /**
98
  * Returns data to be localized in the script.
@@ -111,17 +104,18 @@ class Aalb_Admin {
111
  'action' => 'get_item_search_result',
112
  'item_search_nonce' => wp_create_nonce( 'aalb-item-search-nonce' ),
113
  'AALB_SHORTCODE_AMAZON_LINK' => AALB_SHORTCODE_AMAZON_LINK,
114
- 'AALB_SHORTCODE_AMAZON_TEXT' => AALB_SHORTCODE_AMAZON_TEXT
 
115
  );
116
  }
117
 
118
- /**
119
- * Returns constant strings to be used in aalb_admin.js
120
- * Makes the variable values in PHP to be used in Javascript.
121
- *
122
- * @since 1.4.4
123
- * @return array Data to be localized in the script
124
- **/
125
  private function get_aalb_strings() {
126
  return array(
127
  "template_asin_error" => "Only one product can be selected for template",
28
  private $remote_loader;
29
  private $tracking_api_helper;
30
  private $helper;
 
31
  private $compatibility_helper;
32
 
33
  public function __construct() {
36
  $this->remote_loader = new Aalb_Remote_Loader();
37
  $this->tracking_api_helper = new Aalb_Tracking_Api_Helper();
38
  $this->helper = new Aalb_Helper();
 
 
39
  }
40
 
41
  /**
42
+ * Checks whether PA-API Credentials are set
43
  *
44
+ * @since 1.4.5
45
+ * @return boolean true if PA-API credentials are set
46
  */
47
+ public function aalb_is_paapi_credentials_set() {
48
+ return !( get_option( AALB_AWS_ACCESS_KEY ) == '' or get_option( AALB_AWS_SECRET_KEY ) == '' );
 
 
 
 
 
49
  }
50
 
51
  /**
85
  wp_enqueue_style( 'thickbox' );
86
  wp_localize_script( 'aalb_admin_js', 'api_pref', $this->get_paapi_pref() );
87
  wp_localize_script( 'aalb_admin_js', 'aalb_strings', $this->get_aalb_strings() );
88
+ }
89
 
90
  /**
91
  * Returns data to be localized in the script.
104
  'action' => 'get_item_search_result',
105
  'item_search_nonce' => wp_create_nonce( 'aalb-item-search-nonce' ),
106
  'AALB_SHORTCODE_AMAZON_LINK' => AALB_SHORTCODE_AMAZON_LINK,
107
+ 'AALB_SHORTCODE_AMAZON_TEXT' => AALB_SHORTCODE_AMAZON_TEXT,
108
+ 'IS_PAAPI_CREDENTIALS_SET' => $this->aalb_is_paapi_credentials_set()
109
  );
110
  }
111
 
112
+ /**
113
+ * Returns constant strings to be used in aalb_admin.js
114
+ * Makes the variable values in PHP to be used in Javascript.
115
+ *
116
+ * @since 1.4.4
117
+ * @return array Data to be localized in the script
118
+ */
119
  private function get_aalb_strings() {
120
  return array(
121
  "template_asin_error" => "Only one product can be selected for template",
admin/css/aalb_admin.css CHANGED
@@ -14,7 +14,7 @@ and limitations under the License.
14
  display: inline;
15
  }
16
 
17
- img#aalb-admin-searchbox-amzlogo {
18
  width: 30px;
19
  height: 30px;
20
  padding: 0px;
@@ -438,3 +438,42 @@ input.aalb-admin-input-search:focus {
438
  opacity : 0.2;
439
  }
440
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  display: inline;
15
  }
16
 
17
+ .aalb-admin-searchbox-amzlogo {
18
  width: 30px;
19
  height: 30px;
20
  padding: 0px;
438
  opacity : 0.2;
439
  }
440
 
441
+ .aalb-admin-inline.aalb-admin-searchbox:hover .aalb-admin-searchbox-tooltip-text {
442
+ visibility: visible;
443
+ }
444
+
445
+ input.aalb-admin-input-search:disabled {
446
+ opacity: 0.8;
447
+ }
448
+
449
+ .aalb-admin-button-create-amazon-shortcode-disabled {
450
+ pointer-events: none;
451
+ cursor: default;
452
+ opacity: 0.4;
453
+ }
454
+
455
+ .aalb-admin-inline.aalb-admin-searchbox .aalb-admin-searchbox-tooltip-text {
456
+ visibility: hidden;
457
+ background-color: #ffffff;
458
+ color: black;
459
+ text-align: center;
460
+ border-radius: 6px;
461
+ padding: 10px;
462
+ position: absolute;
463
+ z-index: 1;
464
+ bottom: 60%;
465
+ width: 290px;
466
+ box-shadow: 3px 3px 10px 0px rgba(44, 50, 50, 0.76);
467
+ border: 1px black;
468
+ font-size: 12px;
469
+ }
470
+
471
+ .aalb-admin-searchbox-tooltip-disabled {
472
+ display: none;
473
+ }
474
+
475
+ .aalb-admin-searchbox-tooltip-text a {
476
+ text-decoration: underline !important;
477
+ color: #0073aa !important;
478
+ font-weight: bold;
479
+ }
admin/css/aalb_credentials.css ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Copyright 2016-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+
4
+ Licensed under the GNU General Public License as published by the Free Software Foundation,
5
+ Version 2.0 (the "License"). You may not use this file except in compliance with the License.
6
+ A copy of the License is located in the "license" file accompanying this file.
7
+
8
+ This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
9
+ either express or implied. See the License for the specific language governing permissions
10
+ and limitations under the License.
11
+ */
12
+
13
+ td.aalb-settings-input-column {
14
+ vertical-align: middle;
15
+ }
16
+
17
+ td.aalb-settings-no-referrer-column {
18
+ padding-top: 2%;
19
+ }
20
+
21
+ .aalb-settings-identifier {
22
+ width: 15%;
23
+ }
24
+
25
+ .aalb-settings-input-field {
26
+ width:90%;
27
+ }
28
+
29
+ .aalb-settings-no-referrer-text{
30
+ font-size:110%;
31
+ }
32
+
33
+ .aalb-settings-fieldset {
34
+ border: 1px solid !important;
35
+ background: #ffffff;
36
+ }
37
+
38
+ .aalb-settings-table {
39
+ border:none !important;
40
+ }
41
+
42
+ .aalb-settings-legend {
43
+ margin-left: 15px;
44
+ }
45
+
46
+ td.aalb-settings-terms-column {
47
+ vertical-align: middle;
48
+ width:85%;
49
+ }
50
+
51
+ div.aalb-terms-conditions {
52
+ margin-top: 20px;
53
+ margin-bottom: -10px;
54
+ font-size: 110%;
55
+ }
admin/js/aalb_admin.js CHANGED
@@ -16,6 +16,7 @@ var tb_remove;
16
  var link_id = "";
17
  var AALB_SHORTCODE_AMAZON_LINK = api_pref.AALB_SHORTCODE_AMAZON_LINK; //constant value from server side is reused here
18
  var AALB_SHORTCODE_AMAZON_TEXT = api_pref.AALB_SHORTCODE_AMAZON_TEXT;
 
19
  //object used as map to check duplicate asin selected by admin
20
  var asin_map = {};
21
  var SINGLE_ASIN_TEMPLATE = {
@@ -62,13 +63,17 @@ jQuery( document ).ready( function() {
62
  //checking for user selected template and number of products selected by user
63
  if( ( selected_products > 1 ) && SINGLE_ASIN_TEMPLATE[ user_selected_template ] ) {
64
  jQuery( '#aalb-add-template-asin-error' ).text( aalb_strings.template_asin_error + ' ' + user_selected_template );
65
- aalb_add_short_code_button.prop( 'disabled', true );
66
 
67
  } else {
68
  aalb_add_short_code_button.prop( 'disabled', false );
69
  jQuery( '#aalb-add-template-asin-error' ).text( '' );
70
  }
71
  } );
 
 
 
 
72
  } );
73
 
74
  /**
@@ -498,3 +503,13 @@ function aalb_reset_add_short_button_and_error_warnings() {
498
  jQuery( '#aalb-add-template-asin-error' ).text( '' );
499
  }
500
 
 
 
 
 
 
 
 
 
 
 
16
  var link_id = "";
17
  var AALB_SHORTCODE_AMAZON_LINK = api_pref.AALB_SHORTCODE_AMAZON_LINK; //constant value from server side is reused here
18
  var AALB_SHORTCODE_AMAZON_TEXT = api_pref.AALB_SHORTCODE_AMAZON_TEXT;
19
+ var IS_PAAPI_CREDENTIALS_SET = api_pref.IS_PAAPI_CREDENTIALS_SET;
20
  //object used as map to check duplicate asin selected by admin
21
  var asin_map = {};
22
  var SINGLE_ASIN_TEMPLATE = {
63
  //checking for user selected template and number of products selected by user
64
  if( ( selected_products > 1 ) && SINGLE_ASIN_TEMPLATE[ user_selected_template ] ) {
65
  jQuery( '#aalb-add-template-asin-error' ).text( aalb_strings.template_asin_error + ' ' + user_selected_template );
66
+ aalb_add_short_code_button.prop( 'disabled', true );
67
 
68
  } else {
69
  aalb_add_short_code_button.prop( 'disabled', false );
70
  jQuery( '#aalb-add-template-asin-error' ).text( '' );
71
  }
72
  } );
73
+
74
+ if(!IS_PAAPI_CREDENTIALS_SET){
75
+ aalb_disable_editor_search();
76
+ }
77
  } );
78
 
79
  /**
503
  jQuery( '#aalb-add-template-asin-error' ).text( '' );
504
  }
505
 
506
+ /**
507
+ * To disable editor search for AALB plugin
508
+ **/
509
+ function aalb_disable_editor_search() {
510
+ jQuery(".aalb-admin-button-create-amazon-shortcode").addClass('aalb-admin-button-create-amazon-shortcode-disabled');
511
+ jQuery( ".aalb-admin-input-search" ).prop( 'disabled', true );
512
+ var aalb_admin_searchbox_tooltip = jQuery('.aalb-admin-searchbox-tooltip-disabled');
513
+ aalb_admin_searchbox_tooltip.addClass('aalb-admin-searchbox-tooltip-text');
514
+ aalb_admin_searchbox_tooltip.removeClass('aalb-admin-searchbox-tooltip-disabled');
515
+ }
admin/partials/aalb_editor_search_box.php CHANGED
@@ -11,6 +11,10 @@ and limitations under the License.
11
  */
12
  -->
13
 
 
 
 
 
14
  <!--
15
 
16
  UI for Search box shown in WordPress editors. User can type in keyword and trigger add short code box.
@@ -18,8 +22,9 @@ and limitations under the License.
18
  -->
19
 
20
  <div class="aalb-admin-inline aalb-admin-searchbox">
21
- <img src=<?= AALB_ADMIN_ICON ?> class="aalb-admin-searchbox-amzlogo"
22
- style="height: 30px; width: 30px; padding: 0px;">
 
23
  <input type="text" class="aalb-admin-input-search"
24
  name="aalb-admin-input-search"
25
  placeholder="Enter keyword(s)"
11
  */
12
  -->
13
 
14
+ <?php
15
+ $aalb_settings_page_url = admin_url( 'admin.php?page=associates-link-builder-settings' ) ;
16
+ ?>
17
+
18
  <!--
19
 
20
  UI for Search box shown in WordPress editors. User can type in keyword and trigger add short code box.
22
  -->
23
 
24
  <div class="aalb-admin-inline aalb-admin-searchbox">
25
+ <span class="aalb-admin-searchbox-tooltip-disabled">Please configure your PA-API credentials in the <a href= <?php echo $aalb_settings_page_url ?> >Settings Page</a> to use the Link Builder features.
26
+ </span>
27
+ <img src=<?= AALB_ADMIN_ICON ?> class="aalb-admin-searchbox-amzlogo">
28
  <input type="text" class="aalb-admin-input-search"
29
  name="aalb-admin-input-search"
30
  placeholder="Enter keyword(s)"
admin/sidebar/aalb_sidebar.php CHANGED
@@ -48,6 +48,7 @@ class Aalb_Sidebar {
48
  register_setting( AALB_CRED_CONFIG_GROUP, AALB_DEFAULT_MARKETPLACE );
49
  register_setting( AALB_CRED_CONFIG_GROUP, AALB_DEFAULT_TEMPLATE );
50
  register_setting( AALB_CRED_CONFIG_GROUP, AALB_STORE_ID_NAMES );
 
51
  }
52
 
53
  /**
48
  register_setting( AALB_CRED_CONFIG_GROUP, AALB_DEFAULT_MARKETPLACE );
49
  register_setting( AALB_CRED_CONFIG_GROUP, AALB_DEFAULT_TEMPLATE );
50
  register_setting( AALB_CRED_CONFIG_GROUP, AALB_STORE_ID_NAMES );
51
+ register_setting( AALB_CRED_CONFIG_GROUP, AALB_NO_REFERRER_DISABLED );
52
  }
53
 
54
  /**
admin/sidebar/partials/aalb_credentials.php CHANGED
@@ -18,6 +18,7 @@ $aalb_store_id_names = $helper->get_store_ids_array();
18
  wp_enqueue_script( 'jquery' );
19
  wp_enqueue_script( 'aalb_credentials_js', AALB_CREDENTIALS_JS, array( 'jquery' ), AALB_PLUGIN_CURRENT_VERSION );
20
  wp_localize_script( 'aalb_credentials_js', 'wp_opt', array( 'plugin_url' => AALB_PLUGIN_URL ) );
 
21
  ?>
22
 
23
  <div class="wrap">
@@ -26,123 +27,144 @@ wp_localize_script( 'aalb_credentials_js', 'wp_opt', array( 'plugin_url' => AALB
26
  <form method="post" action="options.php">
27
  <?php settings_fields( AALB_CRED_CONFIG_GROUP );
28
  do_settings_sections( AALB_CRED_CONFIG_GROUP ); ?>
29
- <table class="widefat fixed">
30
- <tr>
31
- <th scope="row" style="width:15%;">Access Key ID</th>
32
- <td style="vertical-align:middle;">
33
- <input type="text" name="aalb_aws_access_key" required style="width:90%"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  value="<?php echo esc_attr( openssl_decrypt( base64_decode( get_option( AALB_AWS_ACCESS_KEY ) ), AALB_ENCRYPTION_ALGORITHM, AALB_ENCRYPTION_KEY, 0, AALB_ENCRYPTION_IV ) ); ?>"/>
35
- </td>
36
- <td>Your Access Key ID that you generated after signing up for the Amazon Product Advertising API. If
37
- you have not already signed up for the Amazon Product Advertising API, you can do so by following
38
- instructions listed <a
39
  href="http://docs.aws.amazon.com/AWSECommerceService/latest/DG/CHAP_GettingStarted.html"
40
  target="_blank">here</a>.
41
- </td>
42
- </tr>
43
- <tr>
44
- <th scope="row" style="width:15%;">Secret Access Key</th>
45
- <?php $secret_key = get_option( AALB_AWS_SECRET_KEY );
46
- if ( $secret_key ) {
47
- $secret_key = AALB_AWS_SECRET_KEY_MASK;
48
- }
49
- ?>
50
- <td style="vertical-align:middle;"><input type="password" name="aalb_aws_secret_key" required
51
- style="width:90%" value="<?php echo esc_attr( $secret_key ); ?>"
52
- autocomplete="off"/></td>
53
- <td>A key that is used in conjunction with the Access Key ID to cryptographically sign an API request.
54
- To retrieve your Access Key ID or Secret Access Key, go to <a
 
55
  href="https://affiliate-program.amazon.com/gp/advertising/api/detail/your-account.html"
56
  target="_blank">Manage Your Account</a>. The plugin uses a default encryption key for
57
- encrypting the Secret Key. You can change the key using AALB_ENCRYPTION_KEY parameter defined in
58
- /aalb_config.php.
59
- </td>
60
- </tr>
61
- <tr>
62
- <th scope="row" style="width:15%;">Associate ID</th>
63
- <td style="width:90%;vertical-align:middle;">
64
- <textarea type="text" id="aalb_store_id_names" name="aalb_store_id_names" style="width:90%"
65
- value="<?php echo esc_attr( get_option( AALB_STORE_ID_NAMES ) ); ?>"
66
- onchange="aalb_credentials_store_ids_onchange(this)"><?php echo esc_attr( get_option( AALB_STORE_ID_NAMES ) ); ?>
67
- </textarea>
68
- </td>
69
- <td>Associate ID is used to monitor traffic and sales from your links to Amazon. You can add one store
70
- id or tracking id per row. You are recommended to create a new tracking ID in your Amazon Associates
71
- account for using it as Associate ID in the plugin.
72
- </td>
73
- </tr>
74
- <tr>
75
- <th scope="row" style="width:15%;">Default Associate ID</th>
76
- <td style="vertical-align:middle;">
77
- <?php $default_store_id = get_option( AALB_DEFAULT_STORE_ID, AALB_DEFAULT_STORE_ID_NAME ); ?>
78
- <select id="aalb_default_store_id" name="aalb_default_store_id" style="width:90%">
79
- <?php
80
- foreach ( $aalb_store_id_names as $store_id ) {
81
- echo '<option value="' . $store_id . '"';
82
- selected( $default_store_id, $store_id );
83
- echo '>' . $store_id . '</option>\n';
84
- }
85
- ?>
86
- </select>
87
- </td>
88
- <td>The Associate ID that will be used for tagging the affiliate links generated by the plugin if no tag
89
- is specified in the short code.
90
- </td>
91
- </tr>
92
- <tr>
93
- <th scope="row" style="width:15%;">Default Marketplace</th>
94
- <td style="vertical-align:middle;">
95
- <?php $default_marketplace = get_option( AALB_DEFAULT_MARKETPLACE, AALB_DEFAULT_MARKETPLACE_NAME ); ?>
96
- <select name="aalb_default_marketplace" style="width:90%">
97
- <?php
98
- $config_loader = new Aalb_Config_Loader();
99
- $aalb_marketplace_names = $config_loader->fetch_marketplaces();
100
- foreach ( $aalb_marketplace_names as $marketplace ) {
101
- echo '<option value="' . $marketplace . '"';
102
- selected( $default_marketplace, $marketplace );
103
- echo '>' . $marketplace . '</option>\n';
104
- }
105
- ?>
106
- </select>
107
- </td>
108
- <td>Set the default Amazon marketplace based on the Amazon website that is identified in your Associates
109
- Account (for instance, if you have signed up for Amazon.co.uk site, then your default marketplace
110
- selection should be UK).
111
- </td>
112
- </tr>
113
- <tr>
114
- <th scope="row" style="width:15%;">Default Template</th>
115
- <td style="vertical-align:middle;">
116
- <?php $default_template = get_option( AALB_DEFAULT_TEMPLATE, AALB_DEFAULT_TEMPLATE_NAME ); ?>
117
- <select name="aalb_default_template" style="width:90%">
118
- <?php
119
- $templates = get_option( AALB_TEMPLATE_NAMES, $default_template );
120
- foreach ( $templates as $template ) {
121
- echo '<option value="' . $template . '"';
122
- selected( $default_template, $template );
123
- echo '>' . $template . '</option>\n';
124
- }
125
- ?>
126
- </select>
127
- </td>
128
- <td>The ad template that will be used for rendering the ad if no template is specified in the short
129
- code.
130
- </td>
131
- </tr>
132
- </table>
133
- <br>
134
- <table>
135
- <tr>
136
- <th scope="row" style="width:1%;">
137
- <input id="aalb-terms-checkbox" type="checkbox" name="demo-checkbox" value="1"/>
138
- </th>
139
- <td style="vertical-align:middle;">
140
- Check here to indicate that you have read and agree to the Amazon Associates Link Builder <a
141
- href="https://s3.amazonaws.com/aalb-public-resources/documents/AssociatesLinkBuilder-ConditionsOfUse-2017-01-17.pdf"
142
- target="_blank">Conditions of Use</a>.
143
- </td>
144
- </tr>
145
- </table>
146
  <?php submit_button( 'Save Changes', 'primary', 'submit', true, array( 'disabled' => 'disabled' ) ); ?>
147
  </form>
148
  </div>
18
  wp_enqueue_script( 'jquery' );
19
  wp_enqueue_script( 'aalb_credentials_js', AALB_CREDENTIALS_JS, array( 'jquery' ), AALB_PLUGIN_CURRENT_VERSION );
20
  wp_localize_script( 'aalb_credentials_js', 'wp_opt', array( 'plugin_url' => AALB_PLUGIN_URL ) );
21
+ wp_enqueue_style( 'aalb_credentials_css', AALB_CREDENTIALS_CSS, array(), AALB_PLUGIN_CURRENT_VERSION );
22
  ?>
23
 
24
  <div class="wrap">
27
  <form method="post" action="options.php">
28
  <?php settings_fields( AALB_CRED_CONFIG_GROUP );
29
  do_settings_sections( AALB_CRED_CONFIG_GROUP ); ?>
30
+ <fieldset class="aalb-settings-fieldset">
31
+ <legend class="aalb-settings-legend"> Tracking Id(s) </legend>
32
+ <table class ="widefat fixed aalb-settings-table">
33
+ <tr>
34
+ <th scope="row" class="aalb-settings-identifier">Associate ID</th>
35
+ <td class="aalb-settings-input-column">
36
+ <textarea type="text" id=<?php echo AALB_STORE_ID_NAMES ?> name=<?php echo AALB_STORE_ID_NAMES ?> class="aalb-settings-input-field"
37
+ value="<?php echo esc_attr( get_option( AALB_STORE_ID_NAMES ) ); ?>"
38
+ onchange="aalb_credentials_store_ids_onchange(this)"><?php echo esc_attr( get_option( AALB_STORE_ID_NAMES ) ); ?>
39
+ </textarea>
40
+ </td>
41
+ <td>Associate ID is used to monitor traffic and sales from your links to Amazon. You can add one store
42
+ id or tracking id per row. You are recommended to create a new tracking ID in your Amazon Associates
43
+ account for using it as Associate ID in the plugin.
44
+ </td>
45
+ </tr>
46
+ </table>
47
+ </fieldset>
48
+ <br>
49
+
50
+ <fieldset class="aalb-settings-fieldset">
51
+ <legend class="aalb-settings-legend">Site Wide Settings</legend>
52
+ <table class ="widefat fixed aalb-settings-table">
53
+ <tr>
54
+ <th scope="row" class="aalb-settings-identifier">Default Associate ID</th>
55
+ <td class="aalb-settings-input-column">
56
+ <?php $default_store_id = get_option( AALB_DEFAULT_STORE_ID, AALB_DEFAULT_STORE_ID_NAME ); ?>
57
+ <select id=<?php echo AALB_DEFAULT_STORE_ID ?> name=<?php echo AALB_DEFAULT_STORE_ID ?> class="aalb-settings-input-field">
58
+ <?php
59
+ foreach ( $aalb_store_id_names as $store_id ) {
60
+ echo '<option value="' . $store_id . '"';
61
+ selected( $default_store_id, $store_id );
62
+ echo '>' . $store_id . '</option>\n';
63
+ }
64
+ ?>
65
+ </select>
66
+ </td>
67
+ <td>The Associate ID that will be used for tagging the affiliate links generated by the plugin if no tag
68
+ is specified in the short code.
69
+ </td>
70
+ </tr>
71
+ <tr>
72
+ <th scope="row" class="aalb-settings-identifier">Default Marketplace</th>
73
+ <td class="aalb-settings-input-column">
74
+ <?php $default_marketplace = get_option( AALB_DEFAULT_MARKETPLACE, AALB_DEFAULT_MARKETPLACE_NAME ); ?>
75
+ <select name=<?php echo AALB_DEFAULT_MARKETPLACE ?> class="aalb-settings-input-field">
76
+ <?php
77
+ $config_loader = new Aalb_Config_Loader();
78
+ $aalb_marketplace_names = $config_loader->fetch_marketplaces();
79
+ foreach ( $aalb_marketplace_names as $marketplace ) {
80
+ echo '<option value="' . $marketplace . '"';
81
+ selected( $default_marketplace, $marketplace );
82
+ echo '>' . $marketplace . '</option>\n';
83
+ }
84
+ ?>
85
+ </select>
86
+ </td>
87
+ <td>Set the default Amazon marketplace based on the Amazon website that is identified in your Associates
88
+ Account (for instance, if you have signed up for Amazon.co.uk site, then your default marketplace
89
+ selection should be UK).
90
+ </td>
91
+ </tr>
92
+ <tr>
93
+ <th scope="row" class="aalb-settings-identifier">Default Template</th>
94
+ <td class="aalb-settings-input-column">
95
+ <?php $default_template = get_option( AALB_DEFAULT_TEMPLATE, AALB_DEFAULT_TEMPLATE_NAME ); ?>
96
+ <select name=<?php echo AALB_DEFAULT_TEMPLATE ?> class="aalb-settings-input-field">
97
+ <?php
98
+ $templates = get_option( AALB_TEMPLATE_NAMES, $default_template );
99
+ foreach ( $templates as $template ) {
100
+ echo '<option value="' . $template . '"';
101
+ selected( $default_template, $template );
102
+ echo '>' . $template . '</option>\n';
103
+ }
104
+ ?>
105
+ </select>
106
+ </td>
107
+ <td>The ad template that will be used for rendering the ad if no template is specified in the short
108
+ code.
109
+ </td>
110
+ </tr>
111
+ <tr>
112
+ <td scope="row" colspan="2" class="aalb-settings-no-referrer-column">
113
+ <input id=<?php echo AALB_NO_REFERRER_DISABLED ?> type="checkbox" name=<?php echo AALB_NO_REFERRER_DISABLED ?> value="true"<?php if (get_option( AALB_NO_REFERRER_DISABLED )) echo "checked='checked'"; ?> />
114
+ <label class="aalb-settings-no-referrer-text" for="aalb_no_referrer_disabled">Remove rel="noreferrer" for Amazon Affiliate Links from all posts</label>
115
+ </td>
116
+ <td> Selecting the checkbox will remove rel="noreferrer" from Amazon links on all posts till date. The action is reversible and you can revert by deselecting the checkbox
117
+ </td>
118
+ </tr>
119
+ </table>
120
+ </fieldset>
121
+ <br>
122
+
123
+ <fieldset class="aalb-settings-fieldset">
124
+ <legend class="aalb-settings-legend">PA-API Credentials</legend>
125
+ <table class ="widefat fixed aalb-settings-table">
126
+ <tr>
127
+ <th scope="row" class="aalb-settings-identifier">Access Key ID</th>
128
+ <td class="aalb-settings-input-column">
129
+ <input type="text" name=<?php echo AALB_AWS_ACCESS_KEY ?> class="aalb-settings-input-field"
130
  value="<?php echo esc_attr( openssl_decrypt( base64_decode( get_option( AALB_AWS_ACCESS_KEY ) ), AALB_ENCRYPTION_ALGORITHM, AALB_ENCRYPTION_KEY, 0, AALB_ENCRYPTION_IV ) ); ?>"/>
131
+ </td>
132
+ <td>Your Access Key ID that you generated after signing up for the Amazon Product Advertising API. If
133
+ you have not already signed up for the Amazon Product Advertising API, you can do so by following
134
+ instructions listed <a
135
  href="http://docs.aws.amazon.com/AWSECommerceService/latest/DG/CHAP_GettingStarted.html"
136
  target="_blank">here</a>.
137
+ </td>
138
+ </tr>
139
+ <tr>
140
+ <th scope="row" class="aalb-settings-identifier">Secret Access Key</th>
141
+ <?php $secret_key = get_option( AALB_AWS_SECRET_KEY );
142
+ if ( $secret_key ) {
143
+ $secret_key = AALB_AWS_SECRET_KEY_MASK;
144
+ }
145
+ ?>
146
+ <td class="aalb-settings-input-column"><input type="password" name=<?php echo AALB_AWS_SECRET_KEY ?>
147
+ class="aalb-settings-input-field" value="<?php echo esc_attr( $secret_key ); ?>"
148
+ autocomplete="off"/>
149
+ </td>
150
+ <td>A key that is used in conjunction with the Access Key ID to cryptographically sign an API request.
151
+ To retrieve your Access Key ID or Secret Access Key, go to <a
152
  href="https://affiliate-program.amazon.com/gp/advertising/api/detail/your-account.html"
153
  target="_blank">Manage Your Account</a>. The plugin uses a default encryption key for
154
+ encrypting the Secret Key. You can change the key using AALB_ENCRYPTION_KEY parameter defined in
155
+ /aalb_config.php.
156
+ </td>
157
+ </tr>
158
+ </table>
159
+ </fieldset>
160
+
161
+ <div class="aalb-terms-conditions">
162
+ <input id="aalb-terms-checkbox" type="checkbox" name="demo-checkbox" value="1"/>
163
+ <label for="aalb-terms-checkbox">Check here to indicate that you have read and agree to the Amazon Associates Link Builder</label>
164
+ <a href="https://s3.amazonaws.com/aalb-public-resources/documents/AssociatesLinkBuilder-ConditionsOfUse-2017-01-17.pdf"
165
+ target="_blank">Conditions of Use</a>.
166
+ </div>
167
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
  <?php submit_button( 'Save Changes', 'primary', 'submit', true, array( 'disabled' => 'disabled' ) ); ?>
169
  </form>
170
  </div>
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.4.4
11
  Author: Amazon Associates Program
12
  Author URI: https://affiliate-program.amazon.com/
13
  License: GPLv2
@@ -31,8 +31,8 @@ if ( ! defined( 'WPINC' ) ) {
31
 
32
  require_once( plugin_dir_path( __FILE__ ) . 'aalb_config.php' );
33
 
34
- add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'add_action_links' );
35
- function add_action_links( $links ) {
36
  $mylinks = array(
37
  '<a href="' . admin_url( 'admin.php?page=associates-link-builder-about' ) . '">About</a>',
38
  '<a href="' . admin_url( 'admin.php?page=associates-link-builder-settings' ) . '">Settings</a>',
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.4.5
11
  Author: Amazon Associates Program
12
  Author URI: https://affiliate-program.amazon.com/
13
  License: GPLv2
31
 
32
  require_once( plugin_dir_path( __FILE__ ) . 'aalb_config.php' );
33
 
34
+ add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'aalb_add_action_links' );
35
+ function aalb_add_action_links( $links ) {
36
  $mylinks = array(
37
  '<a href="' . admin_url( 'admin.php?page=associates-link-builder-about' ) . '">About</a>',
38
  '<a href="' . admin_url( 'admin.php?page=associates-link-builder-settings' ) . '">Settings</a>',
includes/aalb_activator.php CHANGED
@@ -57,15 +57,6 @@ class Aalb_Activator {
57
  }
58
  }
59
 
60
- /**
61
- * Init store ids key and add todatabase.
62
- *
63
- * @since 1.0.0
64
- */
65
- private function load_store_ids() {
66
- update_option( AALB_STORE_IDS, '' );
67
- }
68
-
69
  /**
70
  * Halts activation process if the plugin is not compatible with the user environment
71
  *
@@ -84,7 +75,6 @@ class Aalb_Activator {
84
  if($this->aalb_compatibility_helper->is_plugin_compatible()) {
85
  $this->load_templates();
86
  $this->load_db_keys();
87
- $this->load_store_ids();
88
  } else {
89
  $this->halt_activation();
90
  }
57
  }
58
  }
59
 
 
 
 
 
 
 
 
 
 
60
  /**
61
  * Halts activation process if the plugin is not compatible with the user environment
62
  *
75
  if($this->aalb_compatibility_helper->is_plugin_compatible()) {
76
  $this->load_templates();
77
  $this->load_db_keys();
 
78
  } else {
79
  $this->halt_activation();
80
  }
includes/aalb_compatibility_helper.php CHANGED
@@ -71,7 +71,7 @@ class Aalb_Compatibility_Helper {
71
  if(is_plugin_active($plugin) ) {
72
  deactivate_plugins($plugin);
73
  //Remove action_links from admin page present below the plugin
74
- remove_filter( 'plugin_action_links_' . $plugin, 'add_action_links' );
75
  $aalb_admin_notice_manager = Aalb_Admin_Notice_Manager::getInstance();
76
  $aalb_admin_notice_manager->remove_all_notices();
77
  $aalb_admin_notice_manager->add_notice($this, 'incompatible_environment_message');
71
  if(is_plugin_active($plugin) ) {
72
  deactivate_plugins($plugin);
73
  //Remove action_links from admin page present below the plugin
74
+ remove_filter( 'plugin_action_links_' . $plugin, 'aalb_add_action_links' );
75
  $aalb_admin_notice_manager = Aalb_Admin_Notice_Manager::getInstance();
76
  $aalb_admin_notice_manager->remove_all_notices();
77
  $aalb_admin_notice_manager->add_notice($this, 'incompatible_environment_message');
includes/aalb_content_filter.php ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Copyright 2016-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+
5
+ Licensed under the GNU General Public License as published by the Free Software Foundation,
6
+ Version 2.0 (the "License"). You may not use this file except in compliance with the License.
7
+ A copy of the License is located in the "license" file accompanying this file.
8
+
9
+ This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
10
+ either express or implied. See the License for the specific language governing permissions
11
+ and limitations under the License.
12
+ */
13
+
14
+ /**
15
+ * Fired during Content rendering of the post. It Modifies contents of the blog post.
16
+ * It is associated with the_content hook of the link builder plugin.
17
+ *
18
+ * @since 1.4.5
19
+ * @package AmazonAssociatesLinkBuilder
20
+ * @subpackage AmazonAssociatesLinkBuilder/includes
21
+ * @author amipara
22
+ */
23
+ class Aalb_Content_Filter {
24
+
25
+ /**
26
+ * Attaches Aalb_Content_Filter to the "the_content" hook of Wordpress
27
+ * to intercept HTML content while post is being rendered if feature is enabled in settings.
28
+ *
29
+ * @since 1.4.5
30
+ */
31
+ static function attach() {
32
+ if ( get_option( AALB_NO_REFERRER_DISABLED ) ) {
33
+ add_filter( 'the_content', array( new Aalb_Content_Filter(), 'filter' ) );
34
+ }
35
+ }
36
+
37
+ /**
38
+ * Filters blog html content and does following.
39
+ * 1. Removes "noreferrer" attribute from all amazon anchor links.
40
+ *
41
+ * @since 1.4.5
42
+ *
43
+ * @param string $content HTML blog content to be rendered.
44
+ *
45
+ * @return string Filtered HTML blog content
46
+ */
47
+
48
+ function filter( $content ) {
49
+
50
+ $document = new DomDocument();
51
+
52
+ //https://stackoverflow.com/questions/1148928/disable-warnings-when-loading-non-well-formed-html-by-domdocument-php
53
+ //Disable warnings generated while parsing
54
+ $libxml_previous_state = libxml_use_internal_errors( true );
55
+ //Parse the Html Document
56
+ $document->loadHTML( $content );
57
+ //Clear all errors the were generated while parsing
58
+ libxml_clear_errors();
59
+ // Restore previous error queue before HTML parse
60
+ libxml_use_internal_errors( $libxml_previous_state );
61
+
62
+ $dom_xpath = new DOMXPath( $document );
63
+ $anchor_node_list = $dom_xpath->query( "//a[contains(@rel,'noreferrer')]" );
64
+
65
+ $content_updated = false;
66
+
67
+ //Remove noreferrer form amazon anchor links
68
+ foreach ( $anchor_node_list as $anchor_node ) {
69
+ if ( $this->has_amazon_link( $anchor_node ) ) {
70
+ $this->remove_noreferrer( $anchor_node );
71
+ $content_updated = true;
72
+ }
73
+ }
74
+
75
+ return $content_updated ? $document->saveHTML() : $content;
76
+ }
77
+
78
+ /**
79
+ * Checks if anchor node points to amazon url.
80
+ * @link https://stackoverflow.com/questions/3921066/php-regex-to-match-a-list-of-words-against-a-string
81
+ *
82
+ * @since 1.4.5
83
+ *
84
+ * @param DOMElement $node HTML blog content to be rendered.
85
+ *
86
+ * @return boolean true when $node points to amazon url other wise false.
87
+ */
88
+ private function has_amazon_link( $node ) {
89
+ $href_value = $node->getAttribute( 'href' );
90
+ $parsed_url = parse_url( $href_value );
91
+
92
+ return $parsed_url && array_key_exists( 'host', $parsed_url ) && preg_match_all( $this->amazon_url_regex(), $parsed_url['host'], $matches );
93
+ }
94
+
95
+ /**
96
+ * Removes noreferrer attribute from $node.
97
+ *
98
+ * @since 1.4.5
99
+ *
100
+ * @param DOMElement $node Anchor link node for which noreferrer needs to removed.
101
+ *
102
+ */
103
+ private function remove_noreferrer( $node ) {
104
+ $rel_value = $node->getAttribute( 'rel' );
105
+ $rel_value = trim( str_replace( 'noreferrer', '', $rel_value ) );
106
+ if ( $rel_value ) {
107
+ $node->setAttribute( 'rel', $rel_value );
108
+ } else {
109
+ $node->removeAttribute( 'rel' );
110
+ }
111
+ }
112
+
113
+ /**
114
+ * Generates amazon url regex from list of amazon domain names.
115
+ *
116
+ * @since 1.4.5
117
+ *
118
+ * @return string amazon url regex
119
+ */
120
+ private function amazon_url_regex() {
121
+ return '/(' . implode( '$|', $GLOBALS['AALB_AMAZON_DOMAINS'] ) . '$)/i';
122
+ }
123
+
124
+ }
includes/aalb_manager.php CHANGED
@@ -77,6 +77,7 @@ class Aalb_Manager {
77
  public function execute() {
78
  $this->hook_loader->execute();
79
  $this->shortcode_loader->add_shortcode();
 
80
  }
81
 
82
  }
77
  public function execute() {
78
  $this->hook_loader->execute();
79
  $this->shortcode_loader->add_shortcode();
80
+ Aalb_Content_Filter::attach();
81
  }
82
 
83
  }
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.7.5
6
- Stable tag: 1.4.4
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -92,8 +92,20 @@ You can review the **About** section under the Associates Link Builder menu ba
92
  = How can I add links to different Amazon sites in my blog? =
93
  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.
94
 
 
 
 
 
 
 
95
  == Changelog ==
96
 
 
 
 
 
 
 
97
  = 1.4.4 - May 25, 2017 =
98
  * Default Templates provided by the plugin will now render correctly on mobile devices. Your existing posts with default templates will reflect these changes after update. This does not affect custom templates and they will continue to render as before.
99
  * UI Change: Template, Country and Associate ID select boxes are now at the top of the 'Add Shortcode' dialog box to better reflect the order of operations.
@@ -147,6 +159,9 @@ You can search products using keywords in any supported country, but you have to
147
  * Plugin released for beta testing
148
 
149
  == Upgrade Notice ==
 
 
 
150
  = 1.4.4 =
151
  This update improves mobile rendering of default templates and some bug fixes.
152
 
@@ -166,4 +181,4 @@ This update includes general performance improvements, and support for text link
166
  This update fixes the issue with improper rendering of ads using custom templates. If you are coming from v1.3, you don't need to take a backup of your templates before updating to v1.3.2.
167
 
168
  = 1.3 =
169
- This update includes a few minor fixes. In particular, you will no longer need to back up your custom templates when updating the plugin in future.
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.8.0
6
+ Stable tag: 1.4.5
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
92
  = How can I add links to different Amazon sites in my blog? =
93
  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.
94
 
95
+ = How can I use this plugin to remove rel="noreferrer" from affiliate links in my site? =
96
+ 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.
97
+
98
+ = Are Amazon Product Advertising API credentials required to use the feature to remove rel="noreferrer" for Amazon Affiliate Links from all posts? =
99
+ Amazon Product Advertising API credentials are not required to use the feature to remove rel="noreferrer" for Amazon Affiliate Links from all posts.
100
+
101
  == Changelog ==
102
 
103
+ = 1.4.5 - June 13, 2017 =
104
+ * Prime branding changes.
105
+ * UI Change: Settings page revamped.
106
+ * Remove rel="noreferrer" for Amazon Affiliate Links from all posts by clicking the checkbox in settings.
107
+ * Fix: Naming conflict in function name
108
+
109
  = 1.4.4 - May 25, 2017 =
110
  * Default Templates provided by the plugin will now render correctly on mobile devices. Your existing posts with default templates will reflect these changes after update. This does not affect custom templates and they will continue to render as before.
111
  * UI Change: Template, Country and Associate ID select boxes are now at the top of the 'Add Shortcode' dialog box to better reflect the order of operations.
159
  * Plugin released for beta testing
160
 
161
  == Upgrade Notice ==
162
+ = 1.4.5 =
163
+ Prime branding changes, feature to remove rel="noreferrer" from Amazon Affiliate links.
164
+
165
  = 1.4.4 =
166
  This update improves mobile rendering of default templates and some bug fixes.
167
 
181
  This update fixes the issue with improper rendering of ads using custom templates. If you are coming from v1.3, you don't need to take a backup of your templates before updating to v1.3.2.
182
 
183
  = 1.3 =
184
+ This update includes a few minor fixes. In particular, you will no longer need to back up your custom templates when updating the plugin in future.
template/ProductAd.css CHANGED
@@ -165,25 +165,16 @@
165
  }
166
 
167
  .aalb-pa-ad-unit .aalb-pa-product-prime-icon .icon-prime-all {
168
- background: url('https://images-na.ssl-images-amazon.com/images/G/01/AUIClients/AmazonUIBaseCSS-sprite_1x-e1a6545ba46e2ced9fc835dbdec4fff037b5b6bf._V2_.png') no-repeat;
169
  display: inline-block;
170
  margin-top: -1px;
171
  vertical-align: middle;
172
- background-position: -205px -246px;
173
- width: 47px;
 
174
  height: 15px;
175
  }
176
 
177
- .aalb-pa-ad-unit .aalb-pa-product-prime-icon .icon-prime-es {
178
- background: url('https://images-na.ssl-images-amazon.com/images/G/01/AUIClients/AmazonUIBaseCSS-sprite_1x-e1a6545ba46e2ced9fc835dbdec4fff037b5b6bf._V2_.png') no-repeat;
179
- display: inline-block;
180
- margin-top: -1px;
181
- vertical-align: middle;
182
- background-position: -205px -274px;
183
- width: 62px;
184
- height: 16px;
185
- }
186
-
187
  .aalb-pa-ad-unit .aalb-pa-product-offer-price,
188
  .aalb-pa-ad-unit .aalb-pa-product-list-price,
189
  .aalb-pa-ad-unit .aalb-pa-product-prime-icon {
@@ -238,22 +229,13 @@
238
 
239
  @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
240
  .aalb-pa-ad-unit .aalb-pa-product-prime-icon .icon-prime-all {
241
- background: url('https://images-na.ssl-images-amazon.com/images/G/01/AUIClients/AmazonUIBaseCSS-sprite_1x-e1a6545ba46e2ced9fc835dbdec4fff037b5b6bf._V2_.png') no-repeat;
242
  display: inline-block;
243
  margin-top: -1px;
244
  vertical-align: middle;
245
- background-position: -205px -246px;
246
- width: 47px;
 
247
  height: 15px;
248
  }
249
-
250
- .aalb-pa-ad-unit .aalb-pa-product-prime-icon .icon-prime-es {
251
- background: url('https://images-na.ssl-images-amazon.com/images/G/01/AUIClients/AmazonUIBaseCSS-sprite_1x-e1a6545ba46e2ced9fc835dbdec4fff037b5b6bf._V2_.png') no-repeat;
252
- display: inline-block;
253
- margin-top: -1px;
254
- vertical-align: middle;
255
- background-position: -205px -274px;
256
- width: 62px;
257
- height: 16px;
258
- }
259
- }
165
  }
166
 
167
  .aalb-pa-ad-unit .aalb-pa-product-prime-icon .icon-prime-all {
168
+ background: url("https://images-na.ssl-images-amazon.com/images/G/01/AUIClients/AmazonUIBaseCSS-sprite_2x_weblab_AUI_100106_T1-4e9f4ae74b1b576e5f55de370aae7aedaedf390d._V2_.png") no-repeat;
169
  display: inline-block;
170
  margin-top: -1px;
171
  vertical-align: middle;
172
+ background-position: -192px -911px;
173
+ background-size: 560px 938px;
174
+ width: 52px;
175
  height: 15px;
176
  }
177
 
 
 
 
 
 
 
 
 
 
 
178
  .aalb-pa-ad-unit .aalb-pa-product-offer-price,
179
  .aalb-pa-ad-unit .aalb-pa-product-list-price,
180
  .aalb-pa-ad-unit .aalb-pa-product-prime-icon {
229
 
230
  @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
231
  .aalb-pa-ad-unit .aalb-pa-product-prime-icon .icon-prime-all {
232
+ background: url("https://images-na.ssl-images-amazon.com/images/G/01/AUIClients/AmazonUIBaseCSS-sprite_2x_weblab_AUI_100106_T1-4e9f4ae74b1b576e5f55de370aae7aedaedf390d._V2_.png") no-repeat;
233
  display: inline-block;
234
  margin-top: -1px;
235
  vertical-align: middle;
236
+ background-position: -192px -911px;
237
+ background-size: 560px 938px;
238
+ width: 52px;
239
  height: 15px;
240
  }
241
+ }
 
 
 
 
 
 
 
 
 
 
template/ProductAd.mustache CHANGED
@@ -37,12 +37,7 @@
37
  {{/StrikePrice}}
38
  {{#Prime}} <!-- The section tag ensures that prime icon is displayed only if it is available -->
39
  <div class="aalb-pa-product-prime-icon">
40
- {{#MarketplaceES}} <!-- Display Prime Icon for ES if marketplace is ES -->
41
- <i class="icon-prime-es"></i>
42
- {{/MarketplaceES}}
43
- {{^MarketplaceES}} <!-- Display Common Prime Icon for all other marketplaces -->
44
  <i class="icon-prime-all"></i>
45
- {{/MarketplaceES}}
46
  </div>
47
  {{/Prime}}
48
  </div>
37
  {{/StrikePrice}}
38
  {{#Prime}} <!-- The section tag ensures that prime icon is displayed only if it is available -->
39
  <div class="aalb-pa-product-prime-icon">
 
 
 
 
40
  <i class="icon-prime-all"></i>
 
41
  </div>
42
  {{/Prime}}
43
  </div>
template/ProductCarousel.css CHANGED
@@ -167,25 +167,16 @@
167
  }
168
 
169
  .aalb-pc-ad-unit .aalb-pc-product-prime-icon .icon-prime-all {
170
- background: url('https://images-na.ssl-images-amazon.com/images/G/01/AUIClients/AmazonUIBaseCSS-sprite_1x-e1a6545ba46e2ced9fc835dbdec4fff037b5b6bf._V2_.png') no-repeat;
171
  display: inline-block;
172
  margin-top: -1px;
173
  vertical-align: middle;
174
- background-position: -205px -246px;
175
- width: 47px;
 
176
  height: 15px;
177
  }
178
 
179
- .aalb-pc-ad-unit .aalb-pc-product-prime-icon .icon-prime-es {
180
- background: url('https://images-na.ssl-images-amazon.com/images/G/01/AUIClients/AmazonUIBaseCSS-sprite_1x-e1a6545ba46e2ced9fc835dbdec4fff037b5b6bf._V2_.png') no-repeat;
181
- display: inline-block;
182
- margin-top: -1px;
183
- vertical-align: middle;
184
- background-position: -205px -274px;
185
- width: 62px;
186
- height: 16px;
187
- }
188
-
189
  .aalb-pc-ad-unit .aalb-pc-product-offer-price,
190
  .aalb-pc-ad-unit .aalb-pc-product-list-price,
191
  .aalb-pc-ad-unit .aalb-pc-product-prime-icon {
@@ -240,22 +231,13 @@
240
 
241
  @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
242
  .aalb-pc-ad-unit .aalb-pc-product-prime-icon .icon-prime-all {
243
- background: url('https://images-na.ssl-images-amazon.com/images/G/01/AUIClients/AmazonUIBaseCSS-sprite_1x-e1a6545ba46e2ced9fc835dbdec4fff037b5b6bf._V2_.png') no-repeat;
244
  display: inline-block;
245
  margin-top: -1px;
246
  vertical-align: middle;
247
- background-position: -205px -246px;
248
- width: 47px;
 
249
  height: 15px;
250
  }
251
-
252
- .aalb-pc-ad-unit .aalb-pc-product-prime-icon .icon-prime-es {
253
- background: url('https://images-na.ssl-images-amazon.com/images/G/01/AUIClients/AmazonUIBaseCSS-sprite_1x-e1a6545ba46e2ced9fc835dbdec4fff037b5b6bf._V2_.png') no-repeat;
254
- display: inline-block;
255
- margin-top: -1px;
256
- vertical-align: middle;
257
- background-position: -205px -274px;
258
- width: 62px;
259
- height: 16px;
260
- }
261
- }
167
  }
168
 
169
  .aalb-pc-ad-unit .aalb-pc-product-prime-icon .icon-prime-all {
170
+ background: url("https://images-na.ssl-images-amazon.com/images/G/01/AUIClients/AmazonUIBaseCSS-sprite_2x_weblab_AUI_100106_T1-4e9f4ae74b1b576e5f55de370aae7aedaedf390d._V2_.png") no-repeat;
171
  display: inline-block;
172
  margin-top: -1px;
173
  vertical-align: middle;
174
+ background-position: -192px -911px;
175
+ background-size: 560px 938px;
176
+ width: 52px;
177
  height: 15px;
178
  }
179
 
 
 
 
 
 
 
 
 
 
 
180
  .aalb-pc-ad-unit .aalb-pc-product-offer-price,
181
  .aalb-pc-ad-unit .aalb-pc-product-list-price,
182
  .aalb-pc-ad-unit .aalb-pc-product-prime-icon {
231
 
232
  @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
233
  .aalb-pc-ad-unit .aalb-pc-product-prime-icon .icon-prime-all {
234
+ background: url("https://images-na.ssl-images-amazon.com/images/G/01/AUIClients/AmazonUIBaseCSS-sprite_2x_weblab_AUI_100106_T1-4e9f4ae74b1b576e5f55de370aae7aedaedf390d._V2_.png") no-repeat;
235
  display: inline-block;
236
  margin-top: -1px;
237
  vertical-align: middle;
238
+ background-position: -192px -911px;
239
+ background-size: 560px 938px;
240
+ width: 52px;
241
  height: 15px;
242
  }
243
+ }
 
 
 
 
 
 
 
 
 
 
template/ProductCarousel.mustache CHANGED
@@ -38,12 +38,7 @@
38
  {{/StrikePrice}}
39
  {{#Prime}} <!-- The section tag ensures that prime icon is displayed only if it is available -->
40
  <div class="aalb-pc-product-prime-icon">
41
- {{#MarketplaceES}} <!-- Display Prime Icon for ES if marketplace is ES -->
42
- <i class="icon-prime-es"></i>
43
- {{/MarketplaceES}}
44
- {{^MarketplaceES}} <!-- Display Common Prime Icon for all other marketplaces -->
45
  <i class="icon-prime-all"></i>
46
- {{/MarketplaceES}}
47
  </div>
48
  {{/Prime}}
49
  </div>
38
  {{/StrikePrice}}
39
  {{#Prime}} <!-- The section tag ensures that prime icon is displayed only if it is available -->
40
  <div class="aalb-pc-product-prime-icon">
 
 
 
 
41
  <i class="icon-prime-all"></i>
 
42
  </div>
43
  {{/Prime}}
44
  </div>
template/ProductGrid.css CHANGED
@@ -167,22 +167,13 @@
167
  }
168
 
169
  .aalb-pg-ad-unit .aalb-pg-product-prime-icon .icon-prime-all {
170
- background: url('https://images-na.ssl-images-amazon.com/images/G/01/AUIClients/AmazonUIBaseCSS-sprite_1x-e1a6545ba46e2ced9fc835dbdec4fff037b5b6bf._V2_.png') no-repeat;
171
  display: inline-block;
172
  margin-top: -1px;
173
  vertical-align: middle;
174
- background-position: -205px -246px;
175
- width: 47px;
176
- height: 16px;
177
- }
178
-
179
- .aalb-pg-ad-unit .aalb-pg-product-prime-icon .icon-prime-es {
180
- background: url('https://images-na.ssl-images-amazon.com/images/G/01/AUIClients/AmazonUIBaseCSS-sprite_1x-e1a6545ba46e2ced9fc835dbdec4fff037b5b6bf._V2_.png') no-repeat;
181
- display: inline-block;
182
- margin-top: -1px;
183
- vertical-align: middle;
184
- background-position: -205px -274px;
185
- width: 62px;
186
  height: 15px;
187
  }
188
 
@@ -240,22 +231,13 @@
240
 
241
  @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
242
  .aalb-pg-ad-unit .aalb-pg-product-prime-icon .icon-prime-all {
243
- background: url('https://images-na.ssl-images-amazon.com/images/G/01/AUIClients/AmazonUIBaseCSS-sprite_1x-e1a6545ba46e2ced9fc835dbdec4fff037b5b6bf._V2_.png') no-repeat;
244
  display: inline-block;
245
  margin-top: -1px;
246
  vertical-align: middle;
247
- background-position: -205px -246px;
248
- width: 47px;
 
249
  height: 15px;
250
  }
251
-
252
- .aalb-pg-ad-unit .aalb-pg-product-prime-icon .icon-prime-es {
253
- background: url('https://images-na.ssl-images-amazon.com/images/G/01/AUIClients/AmazonUIBaseCSS-sprite_1x-e1a6545ba46e2ced9fc835dbdec4fff037b5b6bf._V2_.png') no-repeat;
254
- display: inline-block;
255
- margin-top: -1px;
256
- vertical-align: middle;
257
- background-position: -205px -274px;
258
- width: 62px;
259
- height: 16px;
260
- }
261
- }
167
  }
168
 
169
  .aalb-pg-ad-unit .aalb-pg-product-prime-icon .icon-prime-all {
170
+ background: url("https://images-na.ssl-images-amazon.com/images/G/01/AUIClients/AmazonUIBaseCSS-sprite_2x_weblab_AUI_100106_T1-4e9f4ae74b1b576e5f55de370aae7aedaedf390d._V2_.png") no-repeat;
171
  display: inline-block;
172
  margin-top: -1px;
173
  vertical-align: middle;
174
+ background-position: -192px -911px;
175
+ background-size: 560px 938px;
176
+ width: 52px;
 
 
 
 
 
 
 
 
 
177
  height: 15px;
178
  }
179
 
231
 
232
  @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
233
  .aalb-pg-ad-unit .aalb-pg-product-prime-icon .icon-prime-all {
234
+ background: url("https://images-na.ssl-images-amazon.com/images/G/01/AUIClients/AmazonUIBaseCSS-sprite_2x_weblab_AUI_100106_T1-4e9f4ae74b1b576e5f55de370aae7aedaedf390d._V2_.png") no-repeat;
235
  display: inline-block;
236
  margin-top: -1px;
237
  vertical-align: middle;
238
+ background-position: -192px -911px;
239
+ background-size: 560px 938px;
240
+ width: 52px;
241
  height: 15px;
242
  }
243
+ }
 
 
 
 
 
 
 
 
 
 
template/ProductGrid.mustache CHANGED
@@ -40,12 +40,7 @@
40
  {{/StrikePrice}}
41
  {{#Prime}} <!-- The section tag ensures that prime icon is displayed only if it is available -->
42
  <div class="aalb-pg-product-prime-icon">
43
- {{#MarketplaceES}} <!-- Display Prime Icon for ES if marketplace is ES -->
44
- <i class="icon-prime-es"></i>
45
- {{/MarketplaceES}}
46
- {{^MarketplaceES}} <!-- Display Common Prime Icon for all other marketplaces -->
47
  <i class="icon-prime-all"></i>
48
- {{/MarketplaceES}}
49
  </div>
50
  {{/Prime}}
51
  </div>
40
  {{/StrikePrice}}
41
  {{#Prime}} <!-- The section tag ensures that prime icon is displayed only if it is available -->
42
  <div class="aalb-pg-product-prime-icon">
 
 
 
 
43
  <i class="icon-prime-all"></i>
 
44
  </div>
45
  {{/Prime}}
46
  </div>