Version Description
Download this release
Release Info
Developer | amazonlinkbuilder |
Plugin | Amazon Associates Link Builder |
Version | 1.4.13RC1 |
Comparing to | |
See all releases |
Code changes from version 1.4.12 to 1.4.13RC1
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.
|
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.4.13RC1' );
|
17 |
|
18 |
//Version no. with multi locale settings page
|
19 |
define( 'AALB_MULTI_LOCALE_SETTINGS_PLUGIN_VERSION', '1.4.12' );
|
admin/sidebar/js/aalb_credentials.js
CHANGED
@@ -58,7 +58,7 @@ var aalb_credentials_object = (function( $ ) {
|
|
58 |
$( '#aalb-store-ids-settings' ).on( 'click', '.aalb-remove-marketplace', function() {
|
59 |
marketplace_row_to_remove = $( this ).closest( '.aalb-marketplace-row' );
|
60 |
if( is_marketplace_row_removal_allowed( marketplace_row_to_remove.find( 'select' ).val() ) ) {
|
61 |
-
|
62 |
tb_show( aalb_cred_strings.remove_marketplace_confirmation, '#TB_inline?width=350&height=85&inlineId=aalb-remove-marketplace-confirmation-container', false );
|
63 |
} else {
|
64 |
show_dismissable_error_message( aalb_cred_strings.remove_last_marketplace_error );
|
@@ -95,7 +95,7 @@ var aalb_credentials_object = (function( $ ) {
|
|
95 |
|
96 |
//Bind click event with "Add marketplace" anchor tag
|
97 |
$( '#aalb-add-new-marketplace' ).on( 'click', function() {
|
98 |
-
var locale_row_hbs =
|
99 |
if( locale_row_hbs != null ) {
|
100 |
var locale_row_template = Handlebars.compile( locale_row_hbs );
|
101 |
var locale_row_html = locale_row_template( marketplace_row_context );
|
@@ -140,12 +140,12 @@ var aalb_credentials_object = (function( $ ) {
|
|
140 |
|
141 |
//Sanitize store-id input on change
|
142 |
$( "#aalb-store-ids-settings" ).on( 'change', '.aalb-marketplace-row input', function() {
|
143 |
-
store_ids_list = $( this ).val().trim().split( STORE_ID_SEPARATOR );
|
144 |
//Removes empty store-id values from array
|
145 |
var sanitized_store_ids_list = store_ids_list.map( function( store_id ) {
|
146 |
return store_id.trim();
|
147 |
} ).filter( function( store_id ) {
|
148 |
-
return store_id
|
149 |
} );
|
150 |
$( this ).val( sanitized_store_ids_list.join( STORE_ID_SEPARATOR ) );
|
151 |
} );
|
@@ -201,9 +201,9 @@ var aalb_credentials_object = (function( $ ) {
|
|
201 |
}
|
202 |
return options.inverse( this );
|
203 |
} );
|
204 |
-
var hbs_store_id_settings =
|
205 |
if( hbs_store_id_settings != null ) {
|
206 |
-
store_id_settings_template = Handlebars.compile( hbs_store_id_settings );
|
207 |
var store_id_setings_html = store_id_settings_template( store_ids_settings_context );
|
208 |
$( "#aalb-credentials-form" ).prepend( store_id_setings_html );
|
209 |
}
|
@@ -221,10 +221,12 @@ var aalb_credentials_object = (function( $ ) {
|
|
221 |
var marketplace_store_id_obj = $.parseJSON( aalb_cred_data.new_store_ids );
|
222 |
var marketplace_store_id_array = [];
|
223 |
for( var marketplace in marketplace_store_id_obj ) {
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
|
|
|
|
228 |
}
|
229 |
return marketplace_store_id_array;
|
230 |
}
|
@@ -400,12 +402,13 @@ var aalb_credentials_object = (function( $ ) {
|
|
400 |
function make_a_marketplace_default( new_default_marketplace ) {
|
401 |
$( '.aalb-marketplace-row' ).each( function() {
|
402 |
var marketplace = $( this ).find( 'select' ).val();
|
|
|
403 |
if( marketplace === default_marketplace ) {
|
404 |
-
|
405 |
element.find( 'span' ).remove();
|
406 |
element.append( '<a href="#">' + aalb_cred_strings.set_as_default_marketplace_label + '</a>' );
|
407 |
} else if( marketplace === new_default_marketplace ) {
|
408 |
-
|
409 |
element.find( 'a' ).remove();
|
410 |
element.append( '<span>' + aalb_cred_strings.default_marketplace_label + '</span>' );
|
411 |
}
|
58 |
$( '#aalb-store-ids-settings' ).on( 'click', '.aalb-remove-marketplace', function() {
|
59 |
marketplace_row_to_remove = $( this ).closest( '.aalb-marketplace-row' );
|
60 |
if( is_marketplace_row_removal_allowed( marketplace_row_to_remove.find( 'select' ).val() ) ) {
|
61 |
+
//ToDO: Below modal box size is overriden by the amp.js provided by "Accelerated mobile pages" plugin
|
62 |
tb_show( aalb_cred_strings.remove_marketplace_confirmation, '#TB_inline?width=350&height=85&inlineId=aalb-remove-marketplace-confirmation-container', false );
|
63 |
} else {
|
64 |
show_dismissable_error_message( aalb_cred_strings.remove_last_marketplace_error );
|
95 |
|
96 |
//Bind click event with "Add marketplace" anchor tag
|
97 |
$( '#aalb-add-new-marketplace' ).on( 'click', function() {
|
98 |
+
var locale_row_hbs = $( "#aalb-marketplace-row-hbs" ).html();
|
99 |
if( locale_row_hbs != null ) {
|
100 |
var locale_row_template = Handlebars.compile( locale_row_hbs );
|
101 |
var locale_row_html = locale_row_template( marketplace_row_context );
|
140 |
|
141 |
//Sanitize store-id input on change
|
142 |
$( "#aalb-store-ids-settings" ).on( 'change', '.aalb-marketplace-row input', function() {
|
143 |
+
var store_ids_list = $( this ).val().trim().split( STORE_ID_SEPARATOR );
|
144 |
//Removes empty store-id values from array
|
145 |
var sanitized_store_ids_list = store_ids_list.map( function( store_id ) {
|
146 |
return store_id.trim();
|
147 |
} ).filter( function( store_id ) {
|
148 |
+
return store_id !== "";
|
149 |
} );
|
150 |
$( this ).val( sanitized_store_ids_list.join( STORE_ID_SEPARATOR ) );
|
151 |
} );
|
201 |
}
|
202 |
return options.inverse( this );
|
203 |
} );
|
204 |
+
var hbs_store_id_settings = $( "#aalb-hbs-store-id-settings" ).html();
|
205 |
if( hbs_store_id_settings != null ) {
|
206 |
+
var store_id_settings_template = Handlebars.compile( hbs_store_id_settings );
|
207 |
var store_id_setings_html = store_id_settings_template( store_ids_settings_context );
|
208 |
$( "#aalb-credentials-form" ).prepend( store_id_setings_html );
|
209 |
}
|
221 |
var marketplace_store_id_obj = $.parseJSON( aalb_cred_data.new_store_ids );
|
222 |
var marketplace_store_id_array = [];
|
223 |
for( var marketplace in marketplace_store_id_obj ) {
|
224 |
+
if( marketplace_store_id_obj.hasOwnProperty( marketplace ) ) {
|
225 |
+
marketplace_store_id_array.push( {
|
226 |
+
"marketplace" : marketplace,
|
227 |
+
"tracking_ids": marketplace_store_id_obj[ marketplace ].toString()
|
228 |
+
} );
|
229 |
+
}
|
230 |
}
|
231 |
return marketplace_store_id_array;
|
232 |
}
|
402 |
function make_a_marketplace_default( new_default_marketplace ) {
|
403 |
$( '.aalb-marketplace-row' ).each( function() {
|
404 |
var marketplace = $( this ).find( 'select' ).val();
|
405 |
+
var element = "";
|
406 |
if( marketplace === default_marketplace ) {
|
407 |
+
element = $( this ).find( '.aalb-default-marketplace' );
|
408 |
element.find( 'span' ).remove();
|
409 |
element.append( '<a href="#">' + aalb_cred_strings.set_as_default_marketplace_label + '</a>' );
|
410 |
} else if( marketplace === new_default_marketplace ) {
|
411 |
+
element = $( this ).find( '.aalb-default-marketplace' );
|
412 |
element.find( 'a' ).remove();
|
413 |
element.append( '<span>' + aalb_cred_strings.default_marketplace_label + '</span>' );
|
414 |
}
|
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.
|
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.4.13RC1
|
11 |
Author: Amazon Associates Program
|
12 |
Author URI: https://affiliate-program.amazon.com/
|
13 |
License: GPLv2
|
includes/aalb_settings_page_migration_helper.php
CHANGED
@@ -31,7 +31,7 @@ class Aalb_Settings_Page_Migration_Helper {
|
|
31 |
* @since 1.4.12
|
32 |
*/
|
33 |
public function run_migration_logic() {
|
34 |
-
if ( version_compare( AALB_MULTI_LOCALE_SETTINGS_PLUGIN_VERSION, get_option( AALB_PLUGIN_VERSION ) ) ) {
|
35 |
delete_option( AALB_STORE_IDS );
|
36 |
$this->migrate_storeids();
|
37 |
}
|
31 |
* @since 1.4.12
|
32 |
*/
|
33 |
public function run_migration_logic() {
|
34 |
+
if ( version_compare( AALB_MULTI_LOCALE_SETTINGS_PLUGIN_VERSION, get_option( AALB_PLUGIN_VERSION ), ">" ) ) {
|
35 |
delete_option( AALB_STORE_IDS );
|
36 |
$this->migrate_storeids();
|
37 |
}
|