Async JavaScript - Version 1.15.02.23.1

Version Description

Download this release

Release Info

Developer cloughit
Plugin Icon 128x128 Async JavaScript
Version 1.15.02.23.1
Comparing to
See all releases

Code changes from version 1.15.02.23 to 1.15.02.23.1

Files changed (2) hide show
  1. async-javascript.php +7 -5
  2. readme.txt +4 -1
async-javascript.php CHANGED
@@ -4,7 +4,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
  Plugin Name: Async Javascript
5
  Plugin URI: http://www.cloughit.com.au/wordpress/plugins/async-javascript-wordpress-plugin/
6
  Description: Async Javascript adds a 'async' or 'defer' attribute to scripts loaded via wp_enqueue_script
7
- Version: 1.15.02.23
8
  Author: David Clough (cloughit)
9
  Author URI: http://www.cloughit.com.au/
10
  Text Domain: async-javascript
@@ -157,14 +157,16 @@ function async_js($url) {
157
  $aj_enabled = (get_option('aj_enabled') == 1) ? true : false;
158
  $aj_method = (get_option('aj_method') != 'async') ? 'defer' : 'async';
159
  $aj_exclusions = get_option('aj_exclusions');
160
- $array_exclusions = explode(',',$aj_exclusions);
161
  if (false !== $aj_enabled && false === is_admin()) {
162
  if (false === strpos($url,'.js')) {
163
  return $url;
164
  }
165
- foreach ($array_exclusions as $exclusion) {
166
- if (false !== strpos(strtolower($url),strtolower($exclusion))) {
167
- return $url;
 
 
168
  }
169
  }
170
  return $url . "' " . $aj_method . "='" . $aj_method;
4
  Plugin Name: Async Javascript
5
  Plugin URI: http://www.cloughit.com.au/wordpress/plugins/async-javascript-wordpress-plugin/
6
  Description: Async Javascript adds a 'async' or 'defer' attribute to scripts loaded via wp_enqueue_script
7
+ Version: 1.15.02.23.1
8
  Author: David Clough (cloughit)
9
  Author URI: http://www.cloughit.com.au/
10
  Text Domain: async-javascript
157
  $aj_enabled = (get_option('aj_enabled') == 1) ? true : false;
158
  $aj_method = (get_option('aj_method') != 'async') ? 'defer' : 'async';
159
  $aj_exclusions = get_option('aj_exclusions');
160
+ $array_exclusions = !empty($aj_exclusions) ? explode(',',$aj_exclusions) : $aj_exclusions;
161
  if (false !== $aj_enabled && false === is_admin()) {
162
  if (false === strpos($url,'.js')) {
163
  return $url;
164
  }
165
+ if (is_array($array_exclusions) && !empty($array_exclusions)) {
166
+ foreach ($array_exclusions as $exclusion) {
167
+ if (false !== strpos(strtolower($url),strtolower($exclusion))) {
168
+ return $url;
169
+ }
170
  }
171
  }
172
  return $url . "' " . $aj_method . "='" . $aj_method;
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.cloughit.com.au/donate/ (coming soon)
4
  Tags: async,javascript,google,pagespeed,js,speed,performance,boost,render,blocking,above-the-fold
5
  Requires at least: 2.8
6
  Tested up to: 4.1.1
7
- Stable tag: 1.15.02.23
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -60,6 +60,9 @@ Contact David Clough @ Clough I.T. Solutions - support@cloughit.com.au
60
 
61
  == Changelog ==
62
 
 
 
 
63
  = 1.15.02.23
64
  * Tested for WordPress v4.1.1
65
  * Added ability to provide a comma seperated list of scripts to be excluded from async/defer (thanks to Nico Ryba for this suggestion)
4
  Tags: async,javascript,google,pagespeed,js,speed,performance,boost,render,blocking,above-the-fold
5
  Requires at least: 2.8
6
  Tested up to: 4.1.1
7
+ Stable tag: 1.15.02.23.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
60
 
61
  == Changelog ==
62
 
63
+ = 1.15.02.23.1
64
+ * Code error fix
65
+
66
  = 1.15.02.23
67
  * Tested for WordPress v4.1.1
68
  * Added ability to provide a comma seperated list of scripts to be excluded from async/defer (thanks to Nico Ryba for this suggestion)