Async JavaScript - Version 2.17.11.15

Version Description

  • MOD: Added User Agent to GTMetrix requests
Download this release

Release Info

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

Code changes from version 2.17.11.03 to 2.17.11.15

Files changed (2) hide show
  1. async-javascript.php +35 -10
  2. readme.txt +5 -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: https://cloughit.com.au/product/async-javascript/
6
  Description: Async JavaScript adds a 'async' or 'defer' attribute to scripts loaded via wp_enqueue_script
7
- Version: 2.17.11.03
8
  Author: Clough I.T. Solutions
9
  Author URI: http://www.cloughit.com.au/
10
  Text Domain: async-javascript
@@ -26,7 +26,8 @@ function aj_admin_init() {
26
  define( 'AJ_ADMIN_URL', trailingslashit( admin_url() ) );
27
  define( 'AJ_PLUGIN_URL', trailingslashit( plugin_dir_url( __FILE__ ) ) );
28
  define( 'AJ_PLUGIN_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
29
- define( 'AJ_VERSION', '2.17.11.03' );
 
30
  if ( !class_exists( 'Services_WTF_Test' ) ) {
31
  require_once( AJ_PLUGIN_DIR . 'lib/gtmetrix/class.Services_WTF_Test.php' );
32
  }
@@ -234,7 +235,10 @@ function async_javascript_admin() {
234
  $aj_gtmetrix_api_key = get_option( 'aj_gtmetrix_api_key', '' );
235
  $aj_gtmetrix_server = get_option( 'aj_gtmetrix_server', '' );
236
  if ( $aj_gtmetrix_username != '' && $aj_gtmetrix_api_key != '' ) {
237
- $test = new Services_WTF_Test( $aj_gtmetrix_username, $aj_gtmetrix_api_key );
 
 
 
238
  $status = $test->status();
239
  $credits = $status['api_credits'];
240
  } else {
@@ -541,7 +545,10 @@ function async_javascript_admin() {
541
  $aj_gtmetrix_api_key = get_option( 'aj_gtmetrix_api_key', '' );
542
  $aj_gtmetrix_server = get_option( 'aj_gtmetrix_server', '' );
543
  if ( $aj_gtmetrix_username != '' && $aj_gtmetrix_api_key != '' ) {
544
- $test = new Services_WTF_Test( $aj_gtmetrix_username, $aj_gtmetrix_api_key );
 
 
 
545
  $status = $test->status();
546
  $credits = $status['api_credits'];
547
  } else {
@@ -983,7 +990,10 @@ function aj_steps() {
983
  update_option( 'aj_gtmetrix_username', $aj_gtmetrix_username );
984
  update_option( 'aj_gtmetrix_api_key', $aj_gtmetrix_api_key );
985
  update_option( 'aj_gtmetrix_server', $aj_gtmetrix_server );
986
- $test = new Services_WTF_Test( $aj_gtmetrix_username, $aj_gtmetrix_api_key );
 
 
 
987
  $args = array(
988
  'url' => $site_url,
989
  'location' => $aj_gtmetrix_server
@@ -1030,7 +1040,10 @@ function aj_steps() {
1030
  update_option( 'aj_gtmetrix_username', $aj_gtmetrix_username );
1031
  update_option( 'aj_gtmetrix_api_key', $aj_gtmetrix_api_key );
1032
  update_option( 'aj_gtmetrix_server', $aj_gtmetrix_server );
1033
- $test = new Services_WTF_Test( $aj_gtmetrix_username, $aj_gtmetrix_api_key );
 
 
 
1034
  $args = array(
1035
  'url' => $site_url . '?aj_simulate=async',
1036
  'location' => $aj_gtmetrix_server
@@ -1077,7 +1090,10 @@ function aj_steps() {
1077
  update_option( 'aj_gtmetrix_username', $aj_gtmetrix_username );
1078
  update_option( 'aj_gtmetrix_api_key', $aj_gtmetrix_api_key );
1079
  update_option( 'aj_gtmetrix_server', $aj_gtmetrix_server );
1080
- $test = new Services_WTF_Test( $aj_gtmetrix_username, $aj_gtmetrix_api_key );
 
 
 
1081
  $args = array(
1082
  'url' => $site_url . '?aj_simulate=defer',
1083
  'location' => $aj_gtmetrix_server
@@ -1124,7 +1140,10 @@ function aj_steps() {
1124
  update_option( 'aj_gtmetrix_username', $aj_gtmetrix_username );
1125
  update_option( 'aj_gtmetrix_api_key', $aj_gtmetrix_api_key );
1126
  update_option( 'aj_gtmetrix_server', $aj_gtmetrix_server );
1127
- $test = new Services_WTF_Test( $aj_gtmetrix_username, $aj_gtmetrix_api_key );
 
 
 
1128
  $args = array(
1129
  'url' => $site_url . '?aj_simulate=async&aj_simulate_jquery=exclude',
1130
  'location' => $aj_gtmetrix_server
@@ -1171,7 +1190,10 @@ function aj_steps() {
1171
  update_option( 'aj_gtmetrix_username', $aj_gtmetrix_username );
1172
  update_option( 'aj_gtmetrix_api_key', $aj_gtmetrix_api_key );
1173
  update_option( 'aj_gtmetrix_server', $aj_gtmetrix_server );
1174
- $test = new Services_WTF_Test( $aj_gtmetrix_username, $aj_gtmetrix_api_key );
 
 
 
1175
  $args = array(
1176
  'url' => $site_url . '?aj_simulate=defer&aj_simulate_jquery=exclude',
1177
  'location' => $aj_gtmetrix_server
@@ -1273,7 +1295,10 @@ function aj_steps() {
1273
  update_option( 'aj_gtmetrix_username', $aj_gtmetrix_username );
1274
  update_option( 'aj_gtmetrix_api_key', $aj_gtmetrix_api_key );
1275
  update_option( 'aj_gtmetrix_server', $aj_gtmetrix_server );
1276
- $test = new Services_WTF_Test( $aj_gtmetrix_username, $aj_gtmetrix_api_key );
 
 
 
1277
  $args = array(
1278
  'url' => $site_url,
1279
  'location' => $aj_gtmetrix_server
4
  Plugin Name: Async JavaScript
5
  Plugin URI: https://cloughit.com.au/product/async-javascript/
6
  Description: Async JavaScript adds a 'async' or 'defer' attribute to scripts loaded via wp_enqueue_script
7
+ Version: 2.17.11.15
8
  Author: Clough I.T. Solutions
9
  Author URI: http://www.cloughit.com.au/
10
  Text Domain: async-javascript
26
  define( 'AJ_ADMIN_URL', trailingslashit( admin_url() ) );
27
  define( 'AJ_PLUGIN_URL', trailingslashit( plugin_dir_url( __FILE__ ) ) );
28
  define( 'AJ_PLUGIN_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
29
+ define( 'AJ_VERSION', '2.17.11.15' );
30
+ define( 'AJ_UA', 'Async JavaScript/' . AJ_VERSION . ' (+https://cloughit.com.au/product/async-javascript/)' );
31
  if ( !class_exists( 'Services_WTF_Test' ) ) {
32
  require_once( AJ_PLUGIN_DIR . 'lib/gtmetrix/class.Services_WTF_Test.php' );
33
  }
235
  $aj_gtmetrix_api_key = get_option( 'aj_gtmetrix_api_key', '' );
236
  $aj_gtmetrix_server = get_option( 'aj_gtmetrix_server', '' );
237
  if ( $aj_gtmetrix_username != '' && $aj_gtmetrix_api_key != '' ) {
238
+ $test = new Services_WTF_Test();
239
+ $test->api_username( $aj_gtmetrix_username );
240
+ $test->api_password( $aj_gtmetrix_api_key );
241
+ $test->user_agent( AJ_UA );
242
  $status = $test->status();
243
  $credits = $status['api_credits'];
244
  } else {
545
  $aj_gtmetrix_api_key = get_option( 'aj_gtmetrix_api_key', '' );
546
  $aj_gtmetrix_server = get_option( 'aj_gtmetrix_server', '' );
547
  if ( $aj_gtmetrix_username != '' && $aj_gtmetrix_api_key != '' ) {
548
+ $test = new Services_WTF_Test();
549
+ $test->api_username( $aj_gtmetrix_username );
550
+ $test->api_password( $aj_gtmetrix_api_key );
551
+ $test->user_agent( AJ_UA );
552
  $status = $test->status();
553
  $credits = $status['api_credits'];
554
  } else {
990
  update_option( 'aj_gtmetrix_username', $aj_gtmetrix_username );
991
  update_option( 'aj_gtmetrix_api_key', $aj_gtmetrix_api_key );
992
  update_option( 'aj_gtmetrix_server', $aj_gtmetrix_server );
993
+ $test = new Services_WTF_Test();
994
+ $test->api_username( $aj_gtmetrix_username );
995
+ $test->api_password( $aj_gtmetrix_api_key );
996
+ $test->user_agent( AJ_UA );
997
  $args = array(
998
  'url' => $site_url,
999
  'location' => $aj_gtmetrix_server
1040
  update_option( 'aj_gtmetrix_username', $aj_gtmetrix_username );
1041
  update_option( 'aj_gtmetrix_api_key', $aj_gtmetrix_api_key );
1042
  update_option( 'aj_gtmetrix_server', $aj_gtmetrix_server );
1043
+ $test = new Services_WTF_Test();
1044
+ $test->api_username( $aj_gtmetrix_username );
1045
+ $test->api_password( $aj_gtmetrix_api_key );
1046
+ $test->user_agent( AJ_UA );
1047
  $args = array(
1048
  'url' => $site_url . '?aj_simulate=async',
1049
  'location' => $aj_gtmetrix_server
1090
  update_option( 'aj_gtmetrix_username', $aj_gtmetrix_username );
1091
  update_option( 'aj_gtmetrix_api_key', $aj_gtmetrix_api_key );
1092
  update_option( 'aj_gtmetrix_server', $aj_gtmetrix_server );
1093
+ $test = new Services_WTF_Test();
1094
+ $test->api_username( $aj_gtmetrix_username );
1095
+ $test->api_password( $aj_gtmetrix_api_key );
1096
+ $test->user_agent( AJ_UA );
1097
  $args = array(
1098
  'url' => $site_url . '?aj_simulate=defer',
1099
  'location' => $aj_gtmetrix_server
1140
  update_option( 'aj_gtmetrix_username', $aj_gtmetrix_username );
1141
  update_option( 'aj_gtmetrix_api_key', $aj_gtmetrix_api_key );
1142
  update_option( 'aj_gtmetrix_server', $aj_gtmetrix_server );
1143
+ $test = new Services_WTF_Test();
1144
+ $test->api_username( $aj_gtmetrix_username );
1145
+ $test->api_password( $aj_gtmetrix_api_key );
1146
+ $test->user_agent( AJ_UA );
1147
  $args = array(
1148
  'url' => $site_url . '?aj_simulate=async&aj_simulate_jquery=exclude',
1149
  'location' => $aj_gtmetrix_server
1190
  update_option( 'aj_gtmetrix_username', $aj_gtmetrix_username );
1191
  update_option( 'aj_gtmetrix_api_key', $aj_gtmetrix_api_key );
1192
  update_option( 'aj_gtmetrix_server', $aj_gtmetrix_server );
1193
+ $test = new Services_WTF_Test();
1194
+ $test->api_username( $aj_gtmetrix_username );
1195
+ $test->api_password( $aj_gtmetrix_api_key );
1196
+ $test->user_agent( AJ_UA );
1197
  $args = array(
1198
  'url' => $site_url . '?aj_simulate=defer&aj_simulate_jquery=exclude',
1199
  'location' => $aj_gtmetrix_server
1295
  update_option( 'aj_gtmetrix_username', $aj_gtmetrix_username );
1296
  update_option( 'aj_gtmetrix_api_key', $aj_gtmetrix_api_key );
1297
  update_option( 'aj_gtmetrix_server', $aj_gtmetrix_server );
1298
+ $test = new Services_WTF_Test();
1299
+ $test->api_username( $aj_gtmetrix_username );
1300
+ $test->api_password( $aj_gtmetrix_api_key );
1301
+ $test->user_agent( AJ_UA );
1302
  $args = array(
1303
  'url' => $site_url,
1304
  'location' => $aj_gtmetrix_server
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.9
7
- Stable tag: 2.17.11.03
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -101,6 +101,10 @@ Coming soon!
101
 
102
  == Changelog ==
103
 
 
 
 
 
104
  = 2.17.11.03 =
105
 
106
  * MOD: Check for GTMetrix class existance prior to including class
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.9
7
+ Stable tag: 2.17.11.15
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
101
 
102
  == Changelog ==
103
 
104
+ = 2.17.11.15 =
105
+
106
+ * MOD: Added User Agent to GTMetrix requests
107
+
108
  = 2.17.11.03 =
109
 
110
  * MOD: Check for GTMetrix class existance prior to including class