Amazon Associates Link Builder - Version 1.3.2

Version Description

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.

Download this release

Release Info

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

Code changes from version 1.3 to 1.3.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.3');
17
 
18
  //paths
19
  define('AALB_PLUGIN_DIR', plugin_dir_path( __FILE__ ));
@@ -65,6 +65,10 @@ define('AALB_CACHE_LOADER', AALB_PLUGIN_DIR . 'includes/aalb_cache_loader.php');
65
  define('AALB_REMOTE_LOADER', AALB_PLUGIN_DIR . 'includes/aalb_remote_loader.php');
66
  define('AALB_AUTOLOADER', AALB_PLUGIN_DIR . 'includes/aalb_autoloader.php');
67
 
 
 
 
 
68
  //Partials
69
  define('AALB_META_BOX_PARTIAL', AALB_PLUGIN_DIR . 'admin/partials/aalb_meta_box.php');
70
 
@@ -86,7 +90,6 @@ define('WP_POST_NEW', 'post-new.php');
86
 
87
  //Local Styles
88
  define('AALB_ADMIN_CSS', AALB_PLUGIN_URL . 'admin/css/aalb_admin.css');
89
- define('AALB_TEMPLATE_URL',AALB_PLUGIN_URL . 'template/');
90
  define('AALB_BASICS_CSS', AALB_PLUGIN_URL . 'css/aalb_basics.css');
91
 
92
  //Local Scripts
13
  */
14
 
15
  //version
16
+ define('AALB_PLUGIN_CURRENT_VERSION','1.3.2');
17
 
18
  //paths
19
  define('AALB_PLUGIN_DIR', plugin_dir_path( __FILE__ ));
65
  define('AALB_REMOTE_LOADER', AALB_PLUGIN_DIR . 'includes/aalb_remote_loader.php');
66
  define('AALB_AUTOLOADER', AALB_PLUGIN_DIR . 'includes/aalb_autoloader.php');
67
 
68
+ //Templates Directory
69
+ define('AALB_TEMPLATE_URL', AALB_PLUGIN_URL . 'template/');
70
+ define('AALB_TEMPLATE_UPLOADS_FOLDER', 'amazon-associates-link-builder/template/');
71
+
72
  //Partials
73
  define('AALB_META_BOX_PARTIAL', AALB_PLUGIN_DIR . 'admin/partials/aalb_meta_box.php');
74
 
90
 
91
  //Local Styles
92
  define('AALB_ADMIN_CSS', AALB_PLUGIN_URL . 'admin/css/aalb_admin.css');
 
93
  define('AALB_BASICS_CSS', AALB_PLUGIN_URL . 'css/aalb_basics.css');
94
 
95
  //Local Scripts
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.3
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.3.2
11
  Author: Amazon Associates Program
12
  Author URI: https://affiliate-program.amazon.com/
13
  License: GPLv2
includes/aalb_helper.php CHANGED
@@ -196,7 +196,18 @@ class Aalb_Helper{
196
  public function get_template_upload_directory_name() {
197
  global $wp_filesystem;
198
  $upload_dir = wp_upload_dir();
199
- return $wp_filesystem->find_folder( $upload_dir['basedir'] ) . 'amazon-associates-link-builder/template/';
 
 
 
 
 
 
 
 
 
 
 
200
  }
201
 
202
  /**
196
  public function get_template_upload_directory_name() {
197
  global $wp_filesystem;
198
  $upload_dir = wp_upload_dir();
199
+ return $wp_filesystem->find_folder( $upload_dir['basedir'] ) . AALB_TEMPLATE_UPLOADS_FOLDER;
200
+ }
201
+
202
+ /**
203
+ * Gets the template uploads dir URL.
204
+ *
205
+ * @since 1.3.2
206
+ * @return full URL of the template uploads directory
207
+ */
208
+ public function get_template_upload_directory_url() {
209
+ $upload_dir = wp_upload_dir();
210
+ return $upload_dir['baseurl'] . '/' . AALB_TEMPLATE_UPLOADS_FOLDER;
211
  }
212
 
213
  /**
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.7.0
6
- Stable tag: 1.3
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -88,6 +88,10 @@ You can search products using keywords in any supported country, but you have to
88
 
89
  == Changelog ==
90
 
 
 
 
 
91
  = 1.3 - December 27, 2016 =
92
  * If you have created custom templates, be sure to take a backup of your templates before updating the plugin by following [these instructions](https://s3.amazonaws.com/aalb-public-resources/documents/AssociatesLinkBuilder-Guide-HowToBackupCustomTemplates.pdf). If you have not created any custom template, you can simply update the plugin using the update now link.
93
  * Fix: Preserve custom templates with plugin updates. You will no longer need to back up your custom templates when updating the plugin in future.
@@ -110,6 +114,9 @@ You can search products using keywords in any supported country, but you have to
110
 
111
  == Upgrade Notice ==
112
 
 
 
 
113
  = 1.3 =
114
  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.
115
 
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.0
6
+ Stable tag: 1.3.2
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
88
 
89
  == Changelog ==
90
 
91
+ = 1.3.2 - December 29, 2016 =
92
+ * If you are coming from any version other than v1.3 and are using custom templates, be sure to backup your custom templates before updating the plugin by following [these instructions](https://s3.amazonaws.com/aalb-public-resources/documents/AssociatesLinkBuilder-Guide-HowToBackupCustomTemplates.pdf). If you have not created any custom template or if you are coming from v1.3, you can simply update the plugin using the update now link.
93
+ * Fix: Problems with rendering ads when using custom templates.
94
+
95
  = 1.3 - December 27, 2016 =
96
  * If you have created custom templates, be sure to take a backup of your templates before updating the plugin by following [these instructions](https://s3.amazonaws.com/aalb-public-resources/documents/AssociatesLinkBuilder-Guide-HowToBackupCustomTemplates.pdf). If you have not created any custom template, you can simply update the plugin using the update now link.
97
  * Fix: Preserve custom templates with plugin updates. You will no longer need to back up your custom templates when updating the plugin in future.
114
 
115
  == Upgrade Notice ==
116
 
117
+ = 1.3.2 =
118
+ 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.
119
+
120
  = 1.3 =
121
  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.
122
 
shortcode/aalb_shortcode.php CHANGED
@@ -59,8 +59,8 @@ class Aalb_Shortcode {
59
  if(in_array($template_name, $aalb_default_templates)) {
60
  wp_enqueue_style('aalb_template' . $template_name . '_css', AALB_TEMPLATE_URL . $template_name . '.css' );
61
  } else {
62
- $aalb_template_upload_dir = $this->helper->get_template_upload_directory();
63
- wp_enqueue_style('aalb_template' . $template_name . '_css', '/wp-content/uploads/amazon-associates-link-builder/template/' . $template_name . '.css' );
64
  }
65
  }
66
 
59
  if(in_array($template_name, $aalb_default_templates)) {
60
  wp_enqueue_style('aalb_template' . $template_name . '_css', AALB_TEMPLATE_URL . $template_name . '.css' );
61
  } else {
62
+ $aalb_template_upload_url = $this->helper->get_template_upload_directory_url();
63
+ wp_enqueue_style('aalb_template' . $template_name . '_css', $aalb_template_upload_url . $template_name . '.css' );
64
  }
65
  }
66