Async JavaScript - Version 2.19.07.14

Version Description

  • add asyncjs_filter_noptimize filter
  • changed textdomain to match slug as suggested by Eneko Garrido
  • confirmed working with WordPress 5.2
Download this release

Release Info

Developer futtta
Plugin Icon 128x128 Async JavaScript
Version 2.19.07.14
Comparing to
See all releases

Code changes from version 2.18.12.10 to 2.19.07.14

async-javascript.php CHANGED
@@ -3,10 +3,10 @@
3
  * Plugin Name: Async JavaScript
4
  * Plugin URI: https://autoptimize.com/
5
  * Description: Async JavaScript gives you full control of which scripts to add a 'async' or 'defer' attribute to or to exclude to help increase the performance of your WordPress website
6
- * Version: 2.18.12.10
7
  * Author: Frank Goossens (futtta)
8
  * Author URI: https://autoptimize.com/
9
- * Text Domain: asyncjs
10
  * License: GNU General Public License v2 or later
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  */
3
  * Plugin Name: Async JavaScript
4
  * Plugin URI: https://autoptimize.com/
5
  * Description: Async JavaScript gives you full control of which scripts to add a 'async' or 'defer' attribute to or to exclude to help increase the performance of your WordPress website
6
+ * Version: 2.19.07.14
7
  * Author: Frank Goossens (futtta)
8
  * Author URI: https://autoptimize.com/
9
+ * Text Domain: async-javascript
10
  * License: GNU General Public License v2 or later
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  */
asyncjsBackendClass.php CHANGED
@@ -209,7 +209,7 @@ class AsyncJavaScriptBackend {
209
  public function aj_admin_notice() {
210
  if ( is_plugin_active( 'async-javascript-pro/async-javascript-pro.php' ) ) {
211
  $class = 'update-nag';
212
- $message = __('We have detected that Async JavaScript Pro is still active. Please disable from the plugin menu before using ','asyncjs') . AJ_TITLE;
213
  echo "<div class=\"$class\">$message</div>";
214
  }
215
  }
@@ -283,14 +283,14 @@ class AsyncJavaScriptBackend {
283
  */
284
  private function about_aj() {
285
  $return = '';
286
- $return .= '<p>'.__('When a JavaScript file is loaded via the <strong><a href="https://codex.wordpress.org/Plugin_API/Action_Reference/wp_enqueue_scripts" target="_blank">wp_enqueue_script</a></strong> function, ' . AJ_TITLE . ' will add an <strong>async</strong> or <strong>defer</strong> attribute.','asyncjs').'</p>';
287
- $return .= '<p>'.__('There are several ways an external JavaScript file can be executed:','asyncjs').'</p>';
288
  $return .= '<ul>';
289
- $return .= '<li>'.__('If <strong>async</strong> is present: The script is executed asynchronously with the rest of the page (the script will be executed while the page continues the parsing)</li>','asyncjs');
290
- $return .= '<li>'.__('If <strong>defer</strong> is present and <strong>async</strong> is not present: The script is executed when the page has finished parsing</li>','asyncjs');
291
- $return .= '<li>'.__('If neither <strong>async</strong> or <strong>defer</strong> is present: The script is fetched and executed immediately, before the browser continues parsing the page</li>','asyncjs');
292
  $return .= '</ul>';
293
- $return .= '<p>'.__('Using <strong>async</strong> or <strong>defer</strong> helps to eliminate render-blocking JavaScript in above-the-fold content. This can also help to increase your pagespeed which in turn can assist in improving your page ranking.</p>','asyncjs');
294
  return $return;
295
  }
296
 
@@ -302,35 +302,35 @@ class AsyncJavaScriptBackend {
302
  */
303
  private function hints_tips() {
304
  $return = '';
305
- $return .= '<h3>'.__('Further Hints &amp; Tips','asyncjs').'</h3>';
306
  if ( is_plugin_active( 'autoptimize/autoptimize.php' ) ) {
307
- $return .= '<p>' . AJ_TITLE . __(' has detected that you have Autoptimize installed and active. ','asyncjs') . AJ_TITLE . __(' can further enhance Autoptimize results by applying Async or Defer to the cache files used by Autoptimize.</p>','asyncjs');
308
  } else {
309
- $return .= '<p>' . AJ_TITLE . __(' has detected that you do not have Autoptimize installed and active. Autoptimize can provide further optimization of JavaScript which can benefit the results of ' . AJ_TITLE . ' (and ' . AJ_TITLE . ' can also enhance Autoptimize results!)</p>','asyncjs');
310
- $return .= '<p>'. __('You can install Autoptimize from the plugin repository, or download it from here: ','asyncjs') .'<a href="https://wordpress.org/plugins/autoptimize/" target="_blank">https://wordpress.org/plugins/autoptimize/</a></p>';
311
  }
312
- $return .= '<p>'. __('Through our testing the following common Autoptimize settings work well to achieve the best results. Of course each website is different so you may need to fine tune these settings to suit.</p>','asyncjs');
313
  $return .= '<ol>';
314
- $return .= '<li>'. __('Navigate to <strong>Settings &gt; Autoptimize</strong></li>','asyncjs');
315
- $return .= '<li>'. __('Click on the <strong>Show advanced settings</strong> button</li>','asyncjs');
316
- $return .= '<li>'. __('Under <strong>JavaScript Options</strong> set the following:</li>','asyncjs');
317
  $return .= '<ul>';
318
- $return .= '<li><strong>'. __('Optimize JavaScript Code?</strong>: Checked</li>','asyncjs');
319
- $return .= '<li><strong>'. __('Force JavaScript in &lt;head&gt;?</strong>: Unchecked</li>','asyncjs');
320
- $return .= '<li><strong>'. __('Also aggregate inline JS?</strong>: Checked<br />(did you need to exclude jQuery in ' . AJ_TITLE . '? Enabling this option <strong><em>MAY</em></strong> help resolve jQuery errors caused by inline JavaScript / jQuery code)</li>','asyncjs');
321
- $return .= '<li><strong>'. __('Exclude scripts from Autoptimize:</strong>: Leave as default (or add any other scripts that you may need to exclude)</li>','asyncjs');
322
- $return .= '<li><strong>'. __('Add try-catch wrapping?</strong>: Unchecked</li>','asyncjs');
323
  $return .= '</ul>';
324
- $return .= '<li>'. __('Click on the <strong>Save Changes and Empty Cache</strong> button</li>','asyncjs');
325
- $return .= '<li>'. __('Navigate to <strong>Settings &gt; ' . AJ_TITLE . '</strong></li>','asyncjs');
326
- $return .= '<li>'. __('Click on the <strong>Settings</strong> tab</li>','asyncjs');
327
- $return .= '<li>'. __('Scroll down to <strong>' . AJ_TITLE . ' For Plugins</strong></li>','asyncjs');
328
- $return .= '<li>'. __('Under <strong>Autoptimize</strong> set the following:</li>','asyncjs');
329
  $return .= '<ul>';
330
- $return .= '<li><strong>'. __('Enable Autoptimize Support</strong>: Checked</li>','asyncjs');
331
- $return .= '<li>'. __('<strong>Method</strong>: Select either <strong>Async</strong> or <strong>Defer</strong> (testing has found that <strong>Defer</strong> usually works best here!)</li>','asyncjs');
332
  $return .= '</ul>';
333
- $return .= '<li>'. __('Click on <strong>Save Changes</strong></li>','asyncjs');
334
  $return .= '</ol>';
335
  return $return;
336
  }
209
  public function aj_admin_notice() {
210
  if ( is_plugin_active( 'async-javascript-pro/async-javascript-pro.php' ) ) {
211
  $class = 'update-nag';
212
+ $message = __('We have detected that Async JavaScript Pro is still active. Please disable from the plugin menu before using ','async-javascript') . AJ_TITLE;
213
  echo "<div class=\"$class\">$message</div>";
214
  }
215
  }
283
  */
284
  private function about_aj() {
285
  $return = '';
286
+ $return .= '<p>'.__('When a JavaScript file is loaded via the <strong><a href="https://codex.wordpress.org/Plugin_API/Action_Reference/wp_enqueue_scripts" target="_blank">wp_enqueue_script</a></strong> function, ' . AJ_TITLE . ' will add an <strong>async</strong> or <strong>defer</strong> attribute.','async-javascript').'</p>';
287
+ $return .= '<p>'.__('There are several ways an external JavaScript file can be executed:','async-javasscript').'</p>';
288
  $return .= '<ul>';
289
+ $return .= '<li>'.__('If <strong>async</strong> is present: The script is executed asynchronously with the rest of the page (the script will be executed while the page continues the parsing)</li>','async-javascript');
290
+ $return .= '<li>'.__('If <strong>defer</strong> is present and <strong>async</strong> is not present: The script is executed when the page has finished parsing</li>','async-javascript');
291
+ $return .= '<li>'.__('If neither <strong>async</strong> or <strong>defer</strong> is present: The script is fetched and executed immediately, before the browser continues parsing the page</li>','async-javascript');
292
  $return .= '</ul>';
293
+ $return .= '<p>'.__('Using <strong>async</strong> or <strong>defer</strong> helps to eliminate render-blocking JavaScript in above-the-fold content. This can also help to increase your pagespeed which in turn can assist in improving your page ranking.</p>','async-javascript');
294
  return $return;
295
  }
296
 
302
  */
303
  private function hints_tips() {
304
  $return = '';
305
+ $return .= '<h3>'.__('Further Hints &amp; Tips','async-javascript').'</h3>';
306
  if ( is_plugin_active( 'autoptimize/autoptimize.php' ) ) {
307
+ $return .= '<p>' . AJ_TITLE . __(' has detected that you have Autoptimize installed and active. ','async-javascript') . AJ_TITLE . __(' can further enhance Autoptimize results by applying Async or Defer to the cache files used by Autoptimize.</p>','async-javascript');
308
  } else {
309
+ $return .= '<p>' . AJ_TITLE . __(' has detected that you do not have Autoptimize installed and active. Autoptimize can provide further optimization of JavaScript which can benefit the results of ' . AJ_TITLE . ' (and ' . AJ_TITLE . ' can also enhance Autoptimize results!)</p>','async-javascript');
310
+ $return .= '<p>'. __('You can install Autoptimize from the plugin repository, or download it from here: ','async-javascript') .'<a href="https://wordpress.org/plugins/autoptimize/" target="_blank">https://wordpress.org/plugins/autoptimize/</a></p>';
311
  }
312
+ $return .= '<p>'. __('Through our testing the following common Autoptimize settings work well to achieve the best results. Of course each website is different so you may need to fine tune these settings to suit.</p>','async-javascript');
313
  $return .= '<ol>';
314
+ $return .= '<li>'. __('Navigate to <strong>Settings &gt; Autoptimize</strong></li>','async-javascript');
315
+ $return .= '<li>'. __('Click on the <strong>Show advanced settings</strong> button</li>','async-javascript');
316
+ $return .= '<li>'. __('Under <strong>JavaScript Options</strong> set the following:</li>','async-javascript');
317
  $return .= '<ul>';
318
+ $return .= '<li><strong>'. __('Optimize JavaScript Code?</strong>: Checked</li>','async-javascript');
319
+ $return .= '<li><strong>'. __('Force JavaScript in &lt;head&gt;?</strong>: Unchecked</li>','async-javascript');
320
+ $return .= '<li><strong>'. __('Also aggregate inline JS?</strong>: Checked<br />(did you need to exclude jQuery in ' . AJ_TITLE . '? Enabling this option <strong><em>MAY</em></strong> help resolve jQuery errors caused by inline JavaScript / jQuery code)</li>','async-javascript');
321
+ $return .= '<li><strong>'. __('Exclude scripts from Autoptimize:</strong>: Leave as default (or add any other scripts that you may need to exclude)</li>','async-javascript');
322
+ $return .= '<li><strong>'. __('Add try-catch wrapping?</strong>: Unchecked</li>','async-javascript');
323
  $return .= '</ul>';
324
+ $return .= '<li>'. __('Click on the <strong>Save Changes and Empty Cache</strong> button</li>','async-javascript');
325
+ $return .= '<li>'. __('Navigate to <strong>Settings &gt; ' . AJ_TITLE . '</strong></li>','async-javascript');
326
+ $return .= '<li>'. __('Click on the <strong>Settings</strong> tab</li>','async-javascript');
327
+ $return .= '<li>'. __('Scroll down to <strong>' . AJ_TITLE . ' For Plugins</strong></li>','async-javascript');
328
+ $return .= '<li>'. __('Under <strong>Autoptimize</strong> set the following:</li>','async-javascript');
329
  $return .= '<ul>';
330
+ $return .= '<li><strong>'. __('Enable Autoptimize Support</strong>: Checked</li>','async-javascript');
331
+ $return .= '<li>'. __('<strong>Method</strong>: Select either <strong>Async</strong> or <strong>Defer</strong> (testing has found that <strong>Defer</strong> usually works best here!)</li>','async-javascript');
332
  $return .= '</ul>';
333
+ $return .= '<li>'. __('Click on <strong>Save Changes</strong></li>','async-javascript');
334
  $return .= '</ol>';
335
  return $return;
336
  }
asyncjsDashboardScreens.php CHANGED
@@ -19,37 +19,37 @@ $aj_autoptimize_enabled = ( get_option( 'aj_autoptimize_enabled', 0 ) == 1 ) ? '
19
  $aj_autoptimize_method = ( get_option( 'aj_autoptimize_method', 'async' ) == 'async' ) ? 'Async' : 'Defer';
20
  ?>
21
  <div class="wrap aj">
22
- <h3><?php echo AJ_TITLE.__(' Status','asyncjs'); ?></h3>
23
  <ul>
24
- <li><strong><?php _e(' Status','asyncjs'); ?></strong> <?php echo $aj_enabled; ?></li>
25
  <?php
26
  if ( $aj_enabled == 'Enabled' ) {
27
  ?>
28
- <li><strong><?php _e('Method:','asyncjs'); ?></strong> <?php echo $aj_method; ?></li>
29
  <li><strong>jQuery:</strong> <?php echo $aj_jquery; ?></li>
30
- <li><strong><?php _e('Exclusions:','asyncjs'); ?></strong> <?php echo $aj_exclusions; ?></li>
31
- <li><strong><?php _e('Plugin Exclusions:','asyncjs'); ?></strong> <?php echo ( is_array( $aj_plugin_exclusions ) ) ? implode( ',', $aj_plugin_exclusions) : $aj_plugin_exclusions; ?></li>
32
- <li><strong><?php _e('Theme Exclusions:','asyncjs'); ?></strong> <?php echo ( is_array( $aj_theme_exclusions ) ) ? implode( ',', $aj_theme_exclusions) : $aj_theme_exclusions; ?></li>
33
  <?php
34
  if ( is_plugin_active( 'autoptimize/autoptimize.php' ) ) {
35
  ?>
36
- <li><strong><?php _e('Autoptimize Status:','asyncjs'); ?></strong> <?php echo $aj_autoptimize_enabled; ?></li>
37
  <?php
38
  if ( $aj_autoptimize_enabled == 'Enabled' ) {
39
  ?>
40
- <li><strong><?php _e('Autoptimize Method:','asyncjs'); ?></strong> <?php echo $aj_autoptimize_method; ?></li>
41
  <?php
42
  }
43
  } else {
44
  ?>
45
- <li><?php _e('Autoptimize not installed or activated.','asyncjs'); ?></li>
46
  <?php
47
  }
48
  }
49
  ?>
50
  </ul>
51
  <hr />
52
- <h3><?php _e('Latest GTmetrix Results','asyncjs'); ?></h3>
53
  <?php
54
  $aj_gtmetrix_results = get_option( 'aj_gtmetrix_results', array() );
55
  if ( isset( $aj_gtmetrix_results['latest'] ) ) {
@@ -74,34 +74,34 @@ $aj_autoptimize_method = ( get_option( 'aj_autoptimize_method', 'async' ) == 'as
74
  <tr>
75
  <td scope="row" align="center"><img src="data:image/jpeg;base64,<?php echo $screenshot; ?>" class="aj_latest_screenshot aj_gtmetrix_screenshot_dashboard">
76
  <td scope="row" align="center">
77
- <h3><?php _e('PageSpeed Score','asyncjs'); ?></h3>
78
  <span class="aj_latest_pagespeed aj_gtmetrix_result"<?php echo $pagespeed_style; ?>><?php echo $pagespeed; ?>%</span>
79
  </td>
80
  <td scope="row" align="center">
81
- <h3><?php _e('YSlow Score','asyncjs'); ?></h3>
82
  <span class="aj_latest_yslow aj_gtmetrix_result"<?php echo $yslow_style; ?>><?php echo $yslow; ?>%</span>
83
  </td>
84
  </tr>
85
  <tr>
86
  <td scope="row" align="center">
87
- <h3><?php _e('Fully Loaded Time','asyncjs'); ?></h3>
88
  <span class="aj_latest_flt aj_gtmetrix_result"><?php echo $flt; ?>s</span>
89
  </td>
90
  <td scope="row" align="center">
91
- <h3><?php _e('Total Page Size','asyncjs'); ?></h3>
92
  <span class="aj_latest_tps aj_gtmetrix_result"><?php echo $tps; ?></span>
93
  </td>
94
  <td scope="row" align="center">
95
- <h3><?php _e('Requests','asyncjs'); ?></h3>
96
  <span class="aj_latest_requests aj_gtmetrix_result"><?php echo $requests; ?></span>
97
  </td>
98
  </tr>
99
- <tr><td scope="row" align="left" colspan="6"><?php _e('See full report: ','asyncjs'); ?> <span class="aj_latest_report"><?php echo $report_url; ?></span></td></tr>
100
  </table>
101
  <?php
102
  }
103
  ?>
104
- <p><?php _e('Please click on the Settings button below to generate a new GTmetrix Report.','asyncjs'); ?></p>
105
- <p><button data-id="aj_goto_settings" class="aj_steps_button button"><?php _e('Settings','asyncjs'); ?></button></p>
106
  </div>
107
  <?php
19
  $aj_autoptimize_method = ( get_option( 'aj_autoptimize_method', 'async' ) == 'async' ) ? 'Async' : 'Defer';
20
  ?>
21
  <div class="wrap aj">
22
+ <h3><?php echo AJ_TITLE.__(' Status','async-javascript'); ?></h3>
23
  <ul>
24
+ <li><strong><?php _e(' Status','async-javascript'); ?></strong> <?php echo $aj_enabled; ?></li>
25
  <?php
26
  if ( $aj_enabled == 'Enabled' ) {
27
  ?>
28
+ <li><strong><?php _e('Method:','async-javascript'); ?></strong> <?php echo $aj_method; ?></li>
29
  <li><strong>jQuery:</strong> <?php echo $aj_jquery; ?></li>
30
+ <li><strong><?php _e('Exclusions:','async-javascript'); ?></strong> <?php echo $aj_exclusions; ?></li>
31
+ <li><strong><?php _e('Plugin Exclusions:','async-javascript'); ?></strong> <?php echo ( is_array( $aj_plugin_exclusions ) ) ? implode( ',', $aj_plugin_exclusions) : $aj_plugin_exclusions; ?></li>
32
+ <li><strong><?php _e('Theme Exclusions:','async-javascript'); ?></strong> <?php echo ( is_array( $aj_theme_exclusions ) ) ? implode( ',', $aj_theme_exclusions) : $aj_theme_exclusions; ?></li>
33
  <?php
34
  if ( is_plugin_active( 'autoptimize/autoptimize.php' ) ) {
35
  ?>
36
+ <li><strong><?php _e('Autoptimize Status:','async-javascript'); ?></strong> <?php echo $aj_autoptimize_enabled; ?></li>
37
  <?php
38
  if ( $aj_autoptimize_enabled == 'Enabled' ) {
39
  ?>
40
+ <li><strong><?php _e('Autoptimize Method:','async-javascript'); ?></strong> <?php echo $aj_autoptimize_method; ?></li>
41
  <?php
42
  }
43
  } else {
44
  ?>
45
+ <li><?php _e('Autoptimize not installed or activated.','async-javascript'); ?></li>
46
  <?php
47
  }
48
  }
49
  ?>
50
  </ul>
51
  <hr />
52
+ <h3><?php _e('Latest GTmetrix Results','async-javascript'); ?></h3>
53
  <?php
54
  $aj_gtmetrix_results = get_option( 'aj_gtmetrix_results', array() );
55
  if ( isset( $aj_gtmetrix_results['latest'] ) ) {
74
  <tr>
75
  <td scope="row" align="center"><img src="data:image/jpeg;base64,<?php echo $screenshot; ?>" class="aj_latest_screenshot aj_gtmetrix_screenshot_dashboard">
76
  <td scope="row" align="center">
77
+ <h3><?php _e('PageSpeed Score','async-javascript'); ?></h3>
78
  <span class="aj_latest_pagespeed aj_gtmetrix_result"<?php echo $pagespeed_style; ?>><?php echo $pagespeed; ?>%</span>
79
  </td>
80
  <td scope="row" align="center">
81
+ <h3><?php _e('YSlow Score','async-javascript'); ?></h3>
82
  <span class="aj_latest_yslow aj_gtmetrix_result"<?php echo $yslow_style; ?>><?php echo $yslow; ?>%</span>
83
  </td>
84
  </tr>
85
  <tr>
86
  <td scope="row" align="center">
87
+ <h3><?php _e('Fully Loaded Time','async-javascript'); ?></h3>
88
  <span class="aj_latest_flt aj_gtmetrix_result"><?php echo $flt; ?>s</span>
89
  </td>
90
  <td scope="row" align="center">
91
+ <h3><?php _e('Total Page Size','async-javascript'); ?></h3>
92
  <span class="aj_latest_tps aj_gtmetrix_result"><?php echo $tps; ?></span>
93
  </td>
94
  <td scope="row" align="center">
95
+ <h3><?php _e('Requests','async-javascript'); ?></h3>
96
  <span class="aj_latest_requests aj_gtmetrix_result"><?php echo $requests; ?></span>
97
  </td>
98
  </tr>
99
+ <tr><td scope="row" align="left" colspan="6"><?php _e('See full report: ','async-javascript'); ?> <span class="aj_latest_report"><?php echo $report_url; ?></span></td></tr>
100
  </table>
101
  <?php
102
  }
103
  ?>
104
+ <p><?php _e('Please click on the Settings button below to generate a new GTmetrix Report.','async-javascript'); ?></p>
105
+ <p><button data-id="aj_goto_settings" class="aj_steps_button button"><?php _e('Settings','async-javascript'); ?></button></p>
106
  </div>
107
  <?php
asyncjsFrontendClass.php CHANGED
@@ -173,10 +173,12 @@ class AsyncJavaScriptFrontend {
173
  {
174
  $key = 'aj_noptimize';
175
  if ( array_key_exists( $key, $_GET ) && '1' === $_GET[ $key ] ) {
176
- return true;
177
  } else {
178
- return false;
179
  }
 
 
180
  }
181
 
182
  /**
173
  {
174
  $key = 'aj_noptimize';
175
  if ( array_key_exists( $key, $_GET ) && '1' === $_GET[ $key ] ) {
176
+ $aj_noptimize = true;
177
  } else {
178
+ $aj_noptimize = false;
179
  }
180
+ $aj_noptimize = (bool) apply_filters( 'asyncjs_filter_noptimize', $aj_noptimize );
181
+ return $aj_noptimize;
182
  }
183
 
184
  /**
asyncjsHelpScreens.php CHANGED
@@ -9,39 +9,39 @@ if (! defined('ABSPATH')) {
9
  <?php echo $this->about_aj(); ?>
10
  </div>
11
  <div class="asItemDetail">
12
- <h3><?php _e('Help &amp; Support', 'asyncjs'); ?></h3>
13
- <p><strong><?php _e('Installed Version: ', 'asyncjs'); ?></strong><?php echo AJ_VERSION; ?></p>
14
- <p><?php _e('Below are some answers to some frequently asked questions about ', 'asyncjs'); ?> <?php echo AJ_TITLE; ?></p>
15
  </div>
16
  <div class="asItemDetail">
17
- <h3><?php _e("Which browsers support the 'async' and 'defer' attributes?", 'asyncjs'); ?></h3>
18
- <p><?php _e("The 'async' attribute is new in HTML5. It is supported by the following browsers:", 'asyncjs'); ?></p>
19
  <ul>
20
  <li>Chrome</li>
21
- <li>IE 10 <?php _e('and higher', 'asyncjs'); ?></li>
22
- <li>Firefox 3.6 <?php _e('and higher', 'asyncjs'); ?></li>
23
  <li>Safari</li>
24
  <li>Opera</li>
25
  </ul>
26
  </div>
27
  <div class="asItemDetail">
28
- <h3><?php _e('Where can I get help?', 'asyncjs'); ?></h3>
29
- <p><?php echo AJ_TITLE; ?> <?php _e('is supported exclusively via the wordpress.org support forum', 'asyncjs'); ?> <a href="https://wordpress.org/support/plugin/async-javascript" target="_blank">https://wordpress.org/support/plugin/async-javascript</a></p>
30
  </div>
31
  <div class="asItemDetail">
32
- <h3><?php _e('Do you provide premium support (configuration) or performance optimization services?', 'asyncjs'); ?></h3>
33
- <p><?php _e('We offer premium services for Async JavaScript and also perform full web performance optimization services. More info at ', 'asyncjs'); ?><a href="https://autoptimize.com/?utm=asyncjs" target="_blank">https://autoptimize.com/</a></p>
34
  </div>
35
  <div class="asItemDetail">
36
- <h3><?php _e('What about CSS?', 'asyncjs'); ?></h3>
37
- <p><?php _e('As the name implies, Async JavaScript is built to enhance JavaScript loading only. Async JavaScript does not have any impact on CSS.', 'asyncjs'); ?></p>
38
- <p><?php _e('We recommend using the awesome <a href="https://wordpress.org/plugins/autoptimize/" target="_blank">Autoptimize</a> plugin alongside Async JavaScript for CSS optimization.', 'asyncjs'); ?></p>
39
  </div>
40
  <div class="asItemDetail">
41
- <h3><?php _e('I want out, how should I remove Async JavaScript?', 'asyncjs'); ?></h3>
42
  <ul>
43
- <li><?php _e('Disable the plugin', 'asyncjs'); ?></li>
44
- <li><?php _e('Delete the plugin', 'asyncjs'); ?></li>
45
  </ul>
46
  </div>
47
  <div class="asItemDetail">
9
  <?php echo $this->about_aj(); ?>
10
  </div>
11
  <div class="asItemDetail">
12
+ <h3><?php _e('Help &amp; Support', 'async-javascript'); ?></h3>
13
+ <p><strong><?php _e('Installed Version: ', 'async-javascript'); ?></strong><?php echo AJ_VERSION; ?></p>
14
+ <p><?php _e('Below are some answers to some frequently asked questions about ', 'async-javascript'); ?> <?php echo AJ_TITLE; ?></p>
15
  </div>
16
  <div class="asItemDetail">
17
+ <h3><?php _e("Which browsers support the 'async' and 'defer' attributes?", 'async-javascript'); ?></h3>
18
+ <p><?php _e("The 'async' attribute is new in HTML5. It is supported by the following browsers:", 'async-javascript'); ?></p>
19
  <ul>
20
  <li>Chrome</li>
21
+ <li>IE 10 <?php _e('and higher', 'async-javascript'); ?></li>
22
+ <li>Firefox 3.6 <?php _e('and higher', 'async-javascript'); ?></li>
23
  <li>Safari</li>
24
  <li>Opera</li>
25
  </ul>
26
  </div>
27
  <div class="asItemDetail">
28
+ <h3><?php _e('Where can I get help?', 'async-javascript'); ?></h3>
29
+ <p><?php echo AJ_TITLE; ?> <?php _e('is supported exclusively via the wordpress.org support forum', 'async-javascript'); ?> <a href="https://wordpress.org/support/plugin/async-javascript" target="_blank">https://wordpress.org/support/plugin/async-javascript</a></p>
30
  </div>
31
  <div class="asItemDetail">
32
+ <h3><?php _e('Do you provide premium support (configuration) or performance optimization services?', 'async-javascript'); ?></h3>
33
+ <p><?php _e('We offer premium services for Async JavaScript and also perform full web performance optimization services. More info at ', 'async-javascript'); ?><a href="https://autoptimize.com/?utm=asyncjs" target="_blank">https://autoptimize.com/</a></p>
34
  </div>
35
  <div class="asItemDetail">
36
+ <h3><?php _e('What about CSS?', 'async-javascript'); ?></h3>
37
+ <p><?php _e('As the name implies, Async JavaScript is built to enhance JavaScript loading only. Async JavaScript does not have any impact on CSS.', 'async-javascript'); ?></p>
38
+ <p><?php _e('We recommend using the awesome <a href="https://wordpress.org/plugins/autoptimize/" target="_blank">Autoptimize</a> plugin alongside Async JavaScript for CSS optimization.', 'async-javascript'); ?></p>
39
  </div>
40
  <div class="asItemDetail">
41
+ <h3><?php _e('I want out, how should I remove Async JavaScript?', 'async-javascript'); ?></h3>
42
  <ul>
43
+ <li><?php _e('Disable the plugin', 'async-javascript'); ?></li>
44
+ <li><?php _e('Delete the plugin', 'async-javascript'); ?></li>
45
  </ul>
46
  </div>
47
  <div class="asItemDetail">
asyncjsPartnersScreens.php CHANGED
@@ -55,7 +55,7 @@ if ( ! defined( 'ABSPATH' ) ) {
55
  }
56
  </style>
57
  <?php
58
- echo '<h2>'. __("These related services can improve your site's performance even more!",'asyncjs') . '</h2>';
59
  ?>
60
  <div>
61
  <?php getasyncJSPartnerFeed(); ?>
@@ -63,7 +63,7 @@ if ( ! defined( 'ABSPATH' ) ) {
63
 
64
  <?php
65
  function getasyncJSPartnerFeed() {
66
- $noFeedText=__( 'Have a look at <a href="http://optimizingmatters.com/">optimizingmatters.com</a> for tools that can help you speed up your site even more!', 'asyncjs' );
67
 
68
  if (apply_filters('asyncJS_settingsscreen_remotehttp',true)) {
69
  $rss = fetch_feed( "http://feeds.feedburner.com/OptimizingMattersDownloads" );
55
  }
56
  </style>
57
  <?php
58
+ echo '<h2>'. __("These related services can improve your site's performance even more!",'async-javascript') . '</h2>';
59
  ?>
60
  <div>
61
  <?php getasyncJSPartnerFeed(); ?>
63
 
64
  <?php
65
  function getasyncJSPartnerFeed() {
66
+ $noFeedText=__( 'Have a look at <a href="http://optimizingmatters.com/">optimizingmatters.com</a> for tools that can help you speed up your site even more!', 'async-javascript');
67
 
68
  if (apply_filters('asyncJS_settingsscreen_remotehttp',true)) {
69
  $rss = fetch_feed( "http://feeds.feedburner.com/OptimizingMattersDownloads" );
asyncjsSettingsScreens.php CHANGED
@@ -34,76 +34,76 @@ $aj_autoptimize_defer = ($aj_autoptimize_method == 'defer') ? ' checked="checked
34
  ?>
35
 
36
  <div class="asItemDetail">
37
- <h3><?php _e('Enable ', 'asyncjs'); ?><?php echo AJ_TITLE; ?></h3>
38
  <p>
39
- <label><?php _e('Enable ', 'asyncjs'); ?><?php echo AJ_TITLE; ?>? </label>
40
  <input type="checkbox" name="aj_enabled" id="aj_enabled" value="1" <?php echo $aj_enabled_checked; ?> />
41
  </p>
42
  <p class='aj_enabled_sub <?php if ( ! $aj_enabled_checked ) { echo " hidden"; } ?>'>
43
- <label><?php _e('Also enable ', 'asyncjs'); ?><?php echo AJ_TITLE; ?> <?php _e('for logged in users','asyncjs'); ?>? </label>
44
  <input type="checkbox" name="aj_enabled_logged" id="aj_enabled_logged" value="1" <?php echo $aj_enabled_logged_checked; ?> />
45
  </p>
46
  <p class='aj_enabled_sub <?php if ( ! $aj_enabled_checked ) { echo " hidden"; } ?>'>
47
- <label><?php _e('Also enable ', 'asyncjs'); ?><?php echo AJ_TITLE; ?> <?php _e('on cart/ checkout pages','asyncjs'); ?>? </label>
48
  <input type="checkbox" name="aj_enabled_shop" id="aj_enabled_shop" value="1" <?php echo $aj_enabled_shop_checked; ?> />
49
  </p>
50
  </div>
51
 
52
  <div class="asItemDetail">
53
- <h3><?php _e('Quick Settings', 'asyncjs'); ?></h3>
54
- <p><?php _e('Use the buttons below to apply common settings.', 'asyncjs'); ?></p>
55
- <p><?php _e('<strong>Note: </strong>Using the buttons below will erase any current settings within ', 'asyncjs'); ?><?php echo AJ_TITLE; ?>.</p>
56
  <p>
57
- <button data-id="aj_step2b_apply" class="aj_steps_button button"><?php _e('Apply Async', 'asyncjs'); ?></button>
58
- <button data-id="aj_step2c_apply" class="aj_steps_button button"><?php _e('Apply Defer', 'asyncjs'); ?></button>
59
- <button data-id="aj_step2d_apply" class="aj_steps_button button"><?php _e('Apply Async', 'asyncjs'); _e(' (jQuery excluded)', 'asyncjs'); ?></button>
60
- <button data-id="aj_step2e_apply" class="aj_steps_button button"><?php _e('Apply Defer', 'asyncjs'); _e(' (jQuery excluded)', 'asyncjs'); ?></button>
61
  </p>
62
  </div>
63
 
64
  <div class="asItemDetail">
65
  <h3><?php echo AJ_TITLE; ?> Method</h3>
66
- <p><?php _e('Please select the method (<strong>async</strong> or <strong>defer</strong>) that you wish to enable:', 'asyncjs'); ?></p>
67
- <p><label><?php _e('Method: ', 'asyncjs'); ?></label><input type="radio" name="aj_method" value="async" <?php echo $aj_method_async; ?> /> Async <input type="radio" name="aj_method" value="defer" <?php echo $aj_method_defer; ?> /> Defer</p>
68
  </div>
69
  <div class="asItemDetail">
70
- <h3><?php _e('jQuery', 'asyncjs'); ?></h3>
71
- <p><?php _e('Often if jQuery is loaded with <strong>async</strong> or <strong>defer</strong> it can break some jQuery functions, specifically inline scripts which require jQuery to be loaded before the scripts are run. <strong><em>Sometimes</em></strong> choosing a different method (<strong>async</strong> or <strong>defer</strong>) will work, otherwise it may be necessary to exclude jQuery from having <strong>async</strong> or <strong>defer</strong> applied.', 'asyncjs'); ?></p>
72
  <p>
73
- <label><?php _e('jQuery Method: ', 'asyncjs'); ?></label>
74
- <input type="radio" id="aj_jquery" name="aj_jquery" value="async" <?php echo $aj_jquery_async; ?> /> Async <input type="radio" name="aj_jquery" value="defer" <?php echo $aj_jquery_defer; ?> /> Defer <input type="radio" name="aj_jquery" value="exclude" <?php echo $aj_jquery_exclude; ?> /> <?php _e('Exclude', 'asyncjs'); ?>
75
  </p>
76
  </div>
77
  <div class="asItemDetail">
78
- <h3><?php _e('Scripts to Async', 'asyncjs'); ?></h3>
79
- <p><?php _e("Please list any scripts which you would like to apply the 'async' attribute to. (comma seperated list eg: jquery.js,jquery-ui.js)", 'asyncjs'); ?></p>
80
  <p>
81
- <label><?php _e('Scripts to Async:', 'asyncjs'); ?> </label>
82
  <textarea id="aj_async" style="width:95%;"><?php echo $aj_async; ?></textarea>
83
  </p>
84
  </div>
85
  <div class="asItemDetail">
86
- <h3><?php _e('Scripts to Defer', 'asyncjs'); ?></h3>
87
- <p><?php _e("Please list any scripts which you would like to apply the 'defer' attribute to. (comma seperated list eg: jquery.js,jquery-ui.js)", 'asyncjs'); ?></p>
88
  <p>
89
- <label><?php _e('Scripts to Defer:', 'asyncjs'); ?> </label>
90
  <textarea id="aj_defer" style="width:95%;"><?php echo $aj_defer; ?></textarea>
91
  </p>
92
  </div>
93
  <div class="asItemDetail">
94
- <h3><?php _e('Script Exclusion', 'asyncjs'); ?></h3>
95
- <p><?php _e('Please list any scripts which you would like excluded from having <strong>async</strong> or <strong>defer</strong> applied during page load. (comma seperated list eg: jquery.js,jquery-ui.js)', 'asyncjs'); ?></p>
96
  <p>
97
- <label><?php _e('Scripts to Exclude:', 'asyncjs'); ?> </label>
98
  <textarea id="aj_exclusions" style="width:95%;"><?php echo $aj_exclusions; ?></textarea>
99
  </p>
100
  </div>
101
  <div class="asItemDetail">
102
- <h3><?php _e('Plugin Exclusions', 'asyncjs'); ?></h3>
103
- <p><?php _e('Please select one or more plugins. Scripts contained within the plugin will not have async / defer applied.', 'asyncjs'); ?></p>
104
- <p><?php _e('<strong><em>Please Note:</em></strong> This will exclude any JavaScript files which are contained within the files of the selected Plugin(s). External JavaScripts loaded by the selected Plugin(s) are not affected.', 'asyncjs'); ?></p>
105
- <p><?php _e('For Example: If a plugin is installed in path <strong>/wp-content/plugins/some-plugin/</strong> then and JavaScripts contained within this path will be excluded. If the plugin loads a JavaScript which is countained elsewhere then the Global Method will be used (ie async or defer)', 'asyncjs'); ?></p>
106
- <p><label><?php _e('Exclusions: ', 'asyncjs'); ?></label>
107
  <?php
108
  $plugins = get_plugins();
109
  $output = '';
@@ -120,19 +120,19 @@ if (!empty($plugins)) {
120
  }
121
  $output .= '</select>';
122
  } else {
123
- $output .= '<p>'.__('No plugins found.', 'asyncjs').'</p>';
124
  }
125
  echo $output;
126
  ?>
127
  </p>
128
  </div>
129
  <div class="asItemDetail">
130
- <h3><?php _e('Theme Exclusions', 'asyncjs'); ?></h3>
131
- <p><?php _e('Please select one or more themes. Scripts contained within the theme will not have async / defer applied.', 'asyncjs'); ?></p>
132
- <p><?php _e('<strong><em>Please Note:</em></strong> This will exclude any JavaScript files which are contained within the files of the selected Theme(s). External JavaScripts loaded by the selected Theme(s) are not affected.', 'asyncjs'); ?></p>
133
- <p><?php _e('For Example: If a theme is installed in path <strong>/wp-content/themes/some-theme/</strong> then and JavaScripts contained within this path will be excluded. If the theme loads a JavaScript which is countained elsewhere then the Global Method will be used (ie async or defer)', 'asyncjs'); ?></p>
134
  <p>
135
- <label><?php _e('Exclusions:', 'asyncjs'); ?> </label>
136
  <?php
137
  $themes = wp_get_themes();
138
  $output = '';
@@ -145,30 +145,30 @@ echo $output;
145
  }
146
  $output .= '</select>';
147
  } else {
148
- $output .= '<p>'. __('No themes found.', 'asyncjs').'</p>';
149
  }
150
  echo $output;
151
  ?>
152
  </p>
153
  </div>
154
  <div class="asItemDetail">
155
- <h3><?php echo AJ_TITLE; ?> <?php _e('For Plugins', 'asyncjs'); ?></h3>
156
- <p><?php _e('Although not recommended, some themes / plugins can load JavaScript files without using the <strong><a href="https://codex.wordpress.org/Plugin_API/Action_Reference/wp_enqueue_scripts" target="_blank">wp_enqueue_script</a></strong> function. In some cases this is necessary for the functionality of the theme / plugin.', 'asyncjs'); ?></p>
157
- <p><?php _e('If these themes / plugins provide a hook that can be used to manipulate how the JavaScript file is loaded then Async Javascript may be able to provide support for these themes / plugins.', 'asyncjs'); ?></p>
158
- <p><?php _e('If you have any active themes / plugins that Async Javascript supports then these will be listed below.', 'asyncjs'); ?></p>
159
- <p><?php _e('If you think you have found a plugin that Async Javascript may be able to provide support for please lodge a ticket at <a href="https://wordpress.org/support/plugin/async-javascript" target="_blank">https://wordpress.org/support/plugin/async-javascript</a>', 'asyncjs'); ?></p>
160
  <?php
161
  if (is_plugin_active('autoptimize/autoptimize.php') || is_plugin_active('autoptimize-beta/autoptimize.php')) {
162
  ?>
163
  <div class="aj_plugin">
164
- <h4><?php _e('Plugin: Autoptimize', 'asyncjs'); ?></h4>
165
  <p><a href="https://wordpress.org/plugins/autoptimize/" target="_blank">https://wordpress.org/plugins/autoptimize/</a></p>
166
  <p>
167
- <label><?php _e('Enable Autoptimize Support:', 'asyncjs'); ?> </label>
168
  <input type="checkbox" id="aj_autoptimize_enabled" value="1" <?php echo $aj_autoptimize_enabled_checked; ?> />
169
  </p>
170
  <p>
171
- <label><?php _e('jQuery Method:', 'asyncjs'); ?> </label>
172
  <input type="radio" name="aj_autoptimize_method" value="async" <?php echo $aj_autoptimize_async; ?> /> Async <input type="radio" name="aj_autoptimize_method" value="defer" <?php echo $aj_autoptimize_defer; ?> /> Defer
173
  </p>
174
  </div>
@@ -177,5 +177,5 @@ echo $output;
177
  ?>
178
  </div>
179
  <p>
180
- <button data-id="aj_save_settings" class="aj_steps_button button"><?php _e('Save Settings', 'asyncjs'); ?></button>
181
  </p>
34
  ?>
35
 
36
  <div class="asItemDetail">
37
+ <h3><?php _e('Enable ', 'async-javascript'); ?><?php echo AJ_TITLE; ?></h3>
38
  <p>
39
+ <label><?php _e('Enable ', 'async-javascript'); ?><?php echo AJ_TITLE; ?>? </label>
40
  <input type="checkbox" name="aj_enabled" id="aj_enabled" value="1" <?php echo $aj_enabled_checked; ?> />
41
  </p>
42
  <p class='aj_enabled_sub <?php if ( ! $aj_enabled_checked ) { echo " hidden"; } ?>'>
43
+ <label><?php _e('Also enable ', 'async-javascript'); ?><?php echo AJ_TITLE; ?> <?php _e('for logged in users','async-javascript'); ?>? </label>
44
  <input type="checkbox" name="aj_enabled_logged" id="aj_enabled_logged" value="1" <?php echo $aj_enabled_logged_checked; ?> />
45
  </p>
46
  <p class='aj_enabled_sub <?php if ( ! $aj_enabled_checked ) { echo " hidden"; } ?>'>
47
+ <label><?php _e('Also enable ', 'async-javascript'); ?><?php echo AJ_TITLE; ?> <?php _e('on cart/ checkout pages','async-javascript'); ?>? </label>
48
  <input type="checkbox" name="aj_enabled_shop" id="aj_enabled_shop" value="1" <?php echo $aj_enabled_shop_checked; ?> />
49
  </p>
50
  </div>
51
 
52
  <div class="asItemDetail">
53
+ <h3><?php _e('Quick Settings', 'async-javascript'); ?></h3>
54
+ <p><?php _e('Use the buttons below to apply common settings.', 'async-javascript'); ?></p>
55
+ <p><?php _e('<strong>Note: </strong>Using the buttons below will erase any current settings within ', 'async-javascript'); ?><?php echo AJ_TITLE; ?>.</p>
56
  <p>
57
+ <button data-id="aj_step2b_apply" class="aj_steps_button button"><?php _e('Apply Async', 'async-javascript'); ?></button>
58
+ <button data-id="aj_step2c_apply" class="aj_steps_button button"><?php _e('Apply Defer', 'async-javascript'); ?></button>
59
+ <button data-id="aj_step2d_apply" class="aj_steps_button button"><?php _e('Apply Async', 'async-javascript'); _e(' (jQuery excluded)', 'async-javascript'); ?></button>
60
+ <button data-id="aj_step2e_apply" class="aj_steps_button button"><?php _e('Apply Defer', 'async-javascript'); _e(' (jQuery excluded)', 'async-javascript'); ?></button>
61
  </p>
62
  </div>
63
 
64
  <div class="asItemDetail">
65
  <h3><?php echo AJ_TITLE; ?> Method</h3>
66
+ <p><?php _e('Please select the method (<strong>async</strong> or <strong>defer</strong>) that you wish to enable:', 'async-javascript'); ?></p>
67
+ <p><label><?php _e('Method: ', 'async-javascript'); ?></label><input type="radio" name="aj_method" value="async" <?php echo $aj_method_async; ?> /> Async <input type="radio" name="aj_method" value="defer" <?php echo $aj_method_defer; ?> /> Defer</p>
68
  </div>
69
  <div class="asItemDetail">
70
+ <h3><?php _e('jQuery', 'async-javascript'); ?></h3>
71
+ <p><?php _e('Often if jQuery is loaded with <strong>async</strong> or <strong>defer</strong> it can break some jQuery functions, specifically inline scripts which require jQuery to be loaded before the scripts are run. <strong><em>Sometimes</em></strong> choosing a different method (<strong>async</strong> or <strong>defer</strong>) will work, otherwise it may be necessary to exclude jQuery from having <strong>async</strong> or <strong>defer</strong> applied.', 'async-javascript'); ?></p>
72
  <p>
73
+ <label><?php _e('jQuery Method: ', 'async-javascript'); ?></label>
74
+ <input type="radio" id="aj_jquery" name="aj_jquery" value="async" <?php echo $aj_jquery_async; ?> /> Async <input type="radio" name="aj_jquery" value="defer" <?php echo $aj_jquery_defer; ?> /> Defer <input type="radio" name="aj_jquery" value="exclude" <?php echo $aj_jquery_exclude; ?> /> <?php _e('Exclude', 'async-javascript'); ?>
75
  </p>
76
  </div>
77
  <div class="asItemDetail">
78
+ <h3><?php _e('Scripts to Async', 'async-javascript'); ?></h3>
79
+ <p><?php _e("Please list any scripts which you would like to apply the 'async' attribute to. (comma seperated list eg: jquery.js,jquery-ui.js)", 'async-javascript'); ?></p>
80
  <p>
81
+ <label><?php _e('Scripts to Async:', 'async-javascript'); ?> </label>
82
  <textarea id="aj_async" style="width:95%;"><?php echo $aj_async; ?></textarea>
83
  </p>
84
  </div>
85
  <div class="asItemDetail">
86
+ <h3><?php _e('Scripts to Defer', 'async-javascript'); ?></h3>
87
+ <p><?php _e("Please list any scripts which you would like to apply the 'defer' attribute to. (comma seperated list eg: jquery.js,jquery-ui.js)", 'async-javascript'); ?></p>
88
  <p>
89
+ <label><?php _e('Scripts to Defer:', 'async-javascript'); ?> </label>
90
  <textarea id="aj_defer" style="width:95%;"><?php echo $aj_defer; ?></textarea>
91
  </p>
92
  </div>
93
  <div class="asItemDetail">
94
+ <h3><?php _e('Script Exclusion', 'async-javascript'); ?></h3>
95
+ <p><?php _e('Please list any scripts which you would like excluded from having <strong>async</strong> or <strong>defer</strong> applied during page load. (comma seperated list eg: jquery.js,jquery-ui.js)', 'async-javascript'); ?></p>
96
  <p>
97
+ <label><?php _e('Scripts to Exclude:', 'async-javascript'); ?> </label>
98
  <textarea id="aj_exclusions" style="width:95%;"><?php echo $aj_exclusions; ?></textarea>
99
  </p>
100
  </div>
101
  <div class="asItemDetail">
102
+ <h3><?php _e('Plugin Exclusions', 'async-javascript'); ?></h3>
103
+ <p><?php _e('Please select one or more plugins. Scripts contained within the plugin will not have async / defer applied.', 'async-javascript'); ?></p>
104
+ <p><?php _e('<strong><em>Please Note:</em></strong> This will exclude any JavaScript files which are contained within the files of the selected Plugin(s). External JavaScripts loaded by the selected Plugin(s) are not affected.', 'async-javascript'); ?></p>
105
+ <p><?php _e('For Example: If a plugin is installed in path <strong>/wp-content/plugins/some-plugin/</strong> then and JavaScripts contained within this path will be excluded. If the plugin loads a JavaScript which is countained elsewhere then the Global Method will be used (ie async or defer)', 'async-javascript'); ?></p>
106
+ <p><label><?php _e('Exclusions: ', 'async-javascript'); ?></label>
107
  <?php
108
  $plugins = get_plugins();
109
  $output = '';
120
  }
121
  $output .= '</select>';
122
  } else {
123
+ $output .= '<p>'.__('No plugins found.', 'async-javascript').'</p>';
124
  }
125
  echo $output;
126
  ?>
127
  </p>
128
  </div>
129
  <div class="asItemDetail">
130
+ <h3><?php _e('Theme Exclusions', 'async-javascript'); ?></h3>
131
+ <p><?php _e('Please select one or more themes. Scripts contained within the theme will not have async / defer applied.', 'async-javascript'); ?></p>
132
+ <p><?php _e('<strong><em>Please Note:</em></strong> This will exclude any JavaScript files which are contained within the files of the selected Theme(s). External JavaScripts loaded by the selected Theme(s) are not affected.', 'async-javascript'); ?></p>
133
+ <p><?php _e('For Example: If a theme is installed in path <strong>/wp-content/themes/some-theme/</strong> then and JavaScripts contained within this path will be excluded. If the theme loads a JavaScript which is countained elsewhere then the Global Method will be used (ie async or defer)', 'async-javascript'); ?></p>
134
  <p>
135
+ <label><?php _e('Exclusions:', 'async-javascript'); ?> </label>
136
  <?php
137
  $themes = wp_get_themes();
138
  $output = '';
145
  }
146
  $output .= '</select>';
147
  } else {
148
+ $output .= '<p>'. __('No themes found.', 'async-javascript').'</p>';
149
  }
150
  echo $output;
151
  ?>
152
  </p>
153
  </div>
154
  <div class="asItemDetail">
155
+ <h3><?php echo AJ_TITLE; ?> <?php _e('For Plugins', 'async-javascript'); ?></h3>
156
+ <p><?php _e('Although not recommended, some themes / plugins can load JavaScript files without using the <strong><a href="https://codex.wordpress.org/Plugin_API/Action_Reference/wp_enqueue_scripts" target="_blank">wp_enqueue_script</a></strong> function. In some cases this is necessary for the functionality of the theme / plugin.', 'async-javascript'); ?></p>
157
+ <p><?php _e('If these themes / plugins provide a hook that can be used to manipulate how the JavaScript file is loaded then Async Javascript may be able to provide support for these themes / plugins.', 'async-javascript'); ?></p>
158
+ <p><?php _e('If you have any active themes / plugins that Async Javascript supports then these will be listed below.', 'async-javascript'); ?></p>
159
+ <p><?php _e('If you think you have found a plugin that Async Javascript may be able to provide support for please lodge a ticket at <a href="https://wordpress.org/support/plugin/async-javascript" target="_blank">https://wordpress.org/support/plugin/async-javascript</a>', 'async-javascript'); ?></p>
160
  <?php
161
  if (is_plugin_active('autoptimize/autoptimize.php') || is_plugin_active('autoptimize-beta/autoptimize.php')) {
162
  ?>
163
  <div class="aj_plugin">
164
+ <h4><?php _e('Plugin: Autoptimize', 'async-javascript'); ?></h4>
165
  <p><a href="https://wordpress.org/plugins/autoptimize/" target="_blank">https://wordpress.org/plugins/autoptimize/</a></p>
166
  <p>
167
+ <label><?php _e('Enable Autoptimize Support:', 'async-javascript'); ?> </label>
168
  <input type="checkbox" id="aj_autoptimize_enabled" value="1" <?php echo $aj_autoptimize_enabled_checked; ?> />
169
  </p>
170
  <p>
171
+ <label><?php _e('jQuery Method:', 'async-javascript'); ?> </label>
172
  <input type="radio" name="aj_autoptimize_method" value="async" <?php echo $aj_autoptimize_async; ?> /> Async <input type="radio" name="aj_autoptimize_method" value="defer" <?php echo $aj_autoptimize_defer; ?> /> Defer
173
  </p>
174
  </div>
177
  ?>
178
  </div>
179
  <p>
180
+ <button data-id="aj_save_settings" class="aj_steps_button button"><?php _e('Save Settings', 'async-javascript'); ?></button>
181
  </p>
asyncjsStatusScreens.php CHANGED
@@ -35,34 +35,34 @@ $aj_autoptimize_method = (get_option('aj_autoptimize_method', 'async') == 'async
35
  <div class="asItemDetail">
36
  <h3><?php echo AJ_TITLE; ?></h3>
37
  <ul>
38
- <li><strong><?php _e('Status', 'asyncjs'); ?>:</strong> <?php echo $aj_enabled; ?></li>
39
  <?php
40
  if ($aj_enabled == 'Enabled') {
41
  ?>
42
- <li><strong><?php _e('Method', 'asyncjs'); ?>:</strong> <?php echo $aj_method; ?></li>
43
- <li><strong><?php _e('jQuery', 'asyncjs'); ?>:</strong> <?php echo $aj_jquery; ?></li>
44
- <li><strong><?php _e('Async Scripts', 'asyncjs'); ?>:</strong> <?php echo $aj_async; ?></li>
45
- <li><strong><?php _e('Defer Scripts', 'asyncjs'); ?>:</strong> <?php echo $aj_defer; ?></li>
46
- <li><strong><?php _e('Exclusions', 'asyncjs'); ?>:</strong>
47
  <ul>
48
- <li><strong><?php _e('Scripts', 'asyncjs'); ?>:</strong> <?php echo $aj_exclusions; ?></li>
49
- <li><strong><?php _e('Plugins', 'asyncjs'); ?>:</strong> <?php echo implode(',', $aj_plugin_exclusions); ?></li>
50
- <li><strong><?php _e('Themes', 'asyncjs'); ?>:</strong> <?php echo implode(',', $aj_theme_exclusions); ?></li>
51
  </ul>
52
  </li>
53
  <?php
54
  if (is_plugin_active('autoptimize/autoptimize.php')) {
55
  ?>
56
- <li><strong><?php _e('Autoptimize Status', 'asyncjs'); ?>:</strong> <?php echo $aj_autoptimize_enabled; ?></li>
57
  <?php
58
  if ($aj_autoptimize_enabled == 'Enabled') {
59
  ?>
60
- <li><strong><?php _e('Autoptimize Method', 'asyncjs'); ?>:</strong> <?php echo $aj_autoptimize_method; ?></li>
61
  <?php
62
  }
63
  } else {
64
  ?>
65
- <li><?php _e('Autoptimize not installed or activated.', 'asyncjs'); ?></li>
66
  <?php
67
  }
68
  }
@@ -70,7 +70,7 @@ $aj_autoptimize_method = (get_option('aj_autoptimize_method', 'async') == 'async
70
  </ul>
71
  </div>
72
  <div class="asItemDetail">
73
- <h3><?php _e('Latest GTmetrix Results', 'asyncjs'); ?></h3>
74
  <?php
75
  $aj_gtmetrix_results = get_option('aj_gtmetrix_results', array());
76
  if (isset($aj_gtmetrix_results['latest'])) {
@@ -90,32 +90,32 @@ if (isset($aj_gtmetrix_results['latest'])) {
90
  $requests = $latest['results']['page_elements'];
91
  $report = $latest['results']['report_url'];
92
  $report_url = '<a href="' . $report . '" target="_blank">' . $report . '</a>'; ?>
93
- <div id="aj_latest_please_wait"><div class="aj_loader"><h3 class="aj_loader_loading_text"><?php _e('Please Wait', 'asyncjs'); ?></h3></div></div>
94
  <table id="aj_latest_gtmetrix_results" class="form-table aj-steps-table" width="100%" cellpadding="10">
95
  <tr>
96
  <td scope="row" align="center"><img src="data:image/jpeg;base64,<?php echo $screenshot; ?>" class="aj_latest_screenshot aj_gtmetrix_screenshot">
97
  <td scope="row" align="center">
98
- <h3><?php _e('PageSpeed Score', 'asyncjs'); ?></h3>
99
  <span class="aj_latest_pagespeed aj_gtmetrix_result"<?php echo $pagespeed_style; ?>><?php echo $pagespeed; ?>%</span>
100
  </td>
101
  <td scope="row" align="center">
102
- <h3><?php _e('YSlow Score', 'asyncjs'); ?></h3>
103
  <span class="aj_latest_yslow aj_gtmetrix_result"<?php echo $yslow_style; ?>><?php echo $yslow; ?>%</span>
104
  </td>
105
  <td scope="row" align="center">
106
- <h3><?php _e('Fully Loaded Time', 'asyncjs'); ?></h3>
107
  <span class="aj_latest_flt aj_gtmetrix_result"><?php echo $flt; ?>s</span>
108
  </td>
109
  <td scope="row" align="center">
110
- <h3><?php _e('Total Page Size', 'asyncjs'); ?></h3>
111
  <span class="aj_latest_tps aj_gtmetrix_result"><?php echo $tps; ?></span>
112
  </td>
113
  <td scope="row" align="center">
114
- <h3><?php _e('Requests', 'asyncjs'); ?></h3>
115
  <span class="aj_latest_requests aj_gtmetrix_result"><?php echo $requests; ?></span>
116
  </td>
117
  </tr>
118
- <tr><td scope="row" align="left" colspan="6"><?php _e('See full report:', 'asyncjs'); ?> <span class="aj_latest_report"><?php echo $report_url; ?></span></td></tr>
119
  </table>
120
  </div>
121
  <?php
@@ -125,48 +125,48 @@ if (isset($aj_gtmetrix_results['latest'])) {
125
  <tr>
126
  <td scope="row" align="center"><img src="" class="aj_latest_screenshot aj_gtmetrix_screenshot">
127
  <td scope="row" align="center">
128
- <h3><?php _e('PageSpeed Score', 'asyncjs'); ?></h3>
129
  <span class="aj_latest_pagespeed aj_gtmetrix_result"></span>
130
  </td>
131
  <td scope="row" align="center">
132
- <h3><?php _e('YSlow Score', 'asyncjs'); ?></h3>
133
  <span class="aj_latest_yslow aj_gtmetrix_result"></span>
134
  </td>
135
  <td scope="row" align="center">
136
- <h3><?php _e('Fully Loaded Time', 'asyncjs'); ?></h3>
137
  <span class="aj_latest_flt aj_gtmetrix_result"></span>
138
  </td>
139
  <td scope="row" align="center">
140
- <h3><?php _e('Total Page Size', 'asyncjs'); ?></h3>
141
  <span class="aj_latest_tps aj_gtmetrix_result"></span>
142
  </td>
143
  <td scope="row" align="center">
144
- <h3><?php _e('Requests', 'asyncjs'); ?></h3>
145
  <span class="aj_latest_requests aj_gtmetrix_result"></span>
146
  </td>
147
  </tr>
148
- <tr><td scope="row" align="center" colspan="6"><?php _e('See full report:', 'asyncjs'); ?> <span class="aj_latest_report"></span></td></tr>
149
  </table>
150
  </div>
151
  <?php
152
  }
153
  ?>
154
  <div class="asItemDetail">
155
- <h3><?php _e('Generate New Report', 'asyncjs'); ?></h3>
156
- <p><?php _e('Please click on the button below to generate a new GTmetrix Report.', 'asyncjs'); ?></p>
157
- <p><?php _e('<strong>Please Note:</strong> By clicking the button below you acknowledge that you understand that one (1) GTmetrix API credit will be used.', 'asyncjs'); ?></p>
158
- <p><button data-id="aj_gtmetrix_test" class="aj_steps_button button"><?php _e('Run GTmetrix Test', 'asyncjs'); ?></button></p>
159
  </div>
160
  <div class="asItemDetail">
161
- <h3><?php _e('GTmetrix API Key', 'asyncjs'); ?></h3>
162
- <p><?php _e("If you haven't already done so, grab an API Key from GTmetrix so that Async JavaScript can obtain your PageSpeed / YSlow results. Here's how:", 'asyncjs'); ?></p>
163
  <ol>
164
- <li><?php _e('Navigate to <a href="https://gtmetrix.com/api/" target="_blank">https://gtmetrix.com/api/</a> (link opens in a new tab)', 'asyncjs'); ?></li>
165
- <li><?php _e("If you do not already have an account with GTmetrix, go ahead and sign up (it's FREE!).", 'asyncjs'); ?></li>
166
- <li><?php _e('Log in to your GTmetrix account.', 'asyncjs'); ?></li>
167
- <li><?php _e("If you haven't yet generated your API Key, click on <strong>Generate API Key</strong>", 'asyncjs'); ?></li>
168
- <li><?php _e('Copy your Username and API Key into the fields below:', 'asyncjs'); ?><br /><input type="text" id="aj_gtmetrix_username" value="<?php echo $aj_gtmetrix_username; ?>" placeholder="GTmetrix Username"><input type="text" id="aj_gtmetrix_api_key" value="<?php echo $aj_gtmetrix_api_key; ?>" placeholder="GTmetrix API Key"></li>
169
- <li><?php _e('Select the desired server.', 'asyncjs'); ?><br />
170
  <select id="aj_gtmetrix_server">
171
  <?php
172
  $gtmetrix_locations = array(
@@ -183,7 +183,7 @@ if (isset($aj_gtmetrix_results['latest'])) {
183
  ?>
184
  </select>
185
  </li>
186
- <li><?php _e('GTmetrix Credits Available:', 'asyncjs'); ?> <span class="aj_gtmetrix_credits"><?php echo $credits; ?></span></li>
187
  </ol>
188
  </div>
189
  <?php
35
  <div class="asItemDetail">
36
  <h3><?php echo AJ_TITLE; ?></h3>
37
  <ul>
38
+ <li><strong><?php _e('Status', 'async-javascript'); ?>:</strong> <?php echo $aj_enabled; ?></li>
39
  <?php
40
  if ($aj_enabled == 'Enabled') {
41
  ?>
42
+ <li><strong><?php _e('Method', 'async-javascript'); ?>:</strong> <?php echo $aj_method; ?></li>
43
+ <li><strong><?php _e('jQuery', 'async-javascript'); ?>:</strong> <?php echo $aj_jquery; ?></li>
44
+ <li><strong><?php _e('Async Scripts', 'async-javascript'); ?>:</strong> <?php echo $aj_async; ?></li>
45
+ <li><strong><?php _e('Defer Scripts', 'async-javascript'); ?>:</strong> <?php echo $aj_defer; ?></li>
46
+ <li><strong><?php _e('Exclusions', 'async-javascript'); ?>:</strong>
47
  <ul>
48
+ <li><strong><?php _e('Scripts', 'async-javascript'); ?>:</strong> <?php echo $aj_exclusions; ?></li>
49
+ <li><strong><?php _e('Plugins', 'async-javascript'); ?>:</strong> <?php echo implode(',', $aj_plugin_exclusions); ?></li>
50
+ <li><strong><?php _e('Themes', 'async-javascript'); ?>:</strong> <?php echo implode(',', $aj_theme_exclusions); ?></li>
51
  </ul>
52
  </li>
53
  <?php
54
  if (is_plugin_active('autoptimize/autoptimize.php')) {
55
  ?>
56
+ <li><strong><?php _e('Autoptimize Status', 'async-javascript'); ?>:</strong> <?php echo $aj_autoptimize_enabled; ?></li>
57
  <?php
58
  if ($aj_autoptimize_enabled == 'Enabled') {
59
  ?>
60
+ <li><strong><?php _e('Autoptimize Method', 'async-javascript'); ?>:</strong> <?php echo $aj_autoptimize_method; ?></li>
61
  <?php
62
  }
63
  } else {
64
  ?>
65
+ <li><?php _e('Autoptimize not installed or activated.', 'async-javascript'); ?></li>
66
  <?php
67
  }
68
  }
70
  </ul>
71
  </div>
72
  <div class="asItemDetail">
73
+ <h3><?php _e('Latest GTmetrix Results', 'async-javascript'); ?></h3>
74
  <?php
75
  $aj_gtmetrix_results = get_option('aj_gtmetrix_results', array());
76
  if (isset($aj_gtmetrix_results['latest'])) {
90
  $requests = $latest['results']['page_elements'];
91
  $report = $latest['results']['report_url'];
92
  $report_url = '<a href="' . $report . '" target="_blank">' . $report . '</a>'; ?>
93
+ <div id="aj_latest_please_wait"><div class="aj_loader"><h3 class="aj_loader_loading_text"><?php _e('Please Wait', 'async-javascript'); ?></h3></div></div>
94
  <table id="aj_latest_gtmetrix_results" class="form-table aj-steps-table" width="100%" cellpadding="10">
95
  <tr>
96
  <td scope="row" align="center"><img src="data:image/jpeg;base64,<?php echo $screenshot; ?>" class="aj_latest_screenshot aj_gtmetrix_screenshot">
97
  <td scope="row" align="center">
98
+ <h3><?php _e('PageSpeed Score', 'async-javascript'); ?></h3>
99
  <span class="aj_latest_pagespeed aj_gtmetrix_result"<?php echo $pagespeed_style; ?>><?php echo $pagespeed; ?>%</span>
100
  </td>
101
  <td scope="row" align="center">
102
+ <h3><?php _e('YSlow Score', 'async-javascript'); ?></h3>
103
  <span class="aj_latest_yslow aj_gtmetrix_result"<?php echo $yslow_style; ?>><?php echo $yslow; ?>%</span>
104
  </td>
105
  <td scope="row" align="center">
106
+ <h3><?php _e('Fully Loaded Time', 'async-javascript'); ?></h3>
107
  <span class="aj_latest_flt aj_gtmetrix_result"><?php echo $flt; ?>s</span>
108
  </td>
109
  <td scope="row" align="center">
110
+ <h3><?php _e('Total Page Size', 'async-javascript'); ?></h3>
111
  <span class="aj_latest_tps aj_gtmetrix_result"><?php echo $tps; ?></span>
112
  </td>
113
  <td scope="row" align="center">
114
+ <h3><?php _e('Requests', 'async-javascript'); ?></h3>
115
  <span class="aj_latest_requests aj_gtmetrix_result"><?php echo $requests; ?></span>
116
  </td>
117
  </tr>
118
+ <tr><td scope="row" align="left" colspan="6"><?php _e('See full report:', 'async-javascript'); ?> <span class="aj_latest_report"><?php echo $report_url; ?></span></td></tr>
119
  </table>
120
  </div>
121
  <?php
125
  <tr>
126
  <td scope="row" align="center"><img src="" class="aj_latest_screenshot aj_gtmetrix_screenshot">
127
  <td scope="row" align="center">
128
+ <h3><?php _e('PageSpeed Score', 'async-javascript'); ?></h3>
129
  <span class="aj_latest_pagespeed aj_gtmetrix_result"></span>
130
  </td>
131
  <td scope="row" align="center">
132
+ <h3><?php _e('YSlow Score', 'async-javascript'); ?></h3>
133
  <span class="aj_latest_yslow aj_gtmetrix_result"></span>
134
  </td>
135
  <td scope="row" align="center">
136
+ <h3><?php _e('Fully Loaded Time', 'async-javascript'); ?></h3>
137
  <span class="aj_latest_flt aj_gtmetrix_result"></span>
138
  </td>
139
  <td scope="row" align="center">
140
+ <h3><?php _e('Total Page Size', 'async-javascript'); ?></h3>
141
  <span class="aj_latest_tps aj_gtmetrix_result"></span>
142
  </td>
143
  <td scope="row" align="center">
144
+ <h3><?php _e('Requests', 'async-javascript'); ?></h3>
145
  <span class="aj_latest_requests aj_gtmetrix_result"></span>
146
  </td>
147
  </tr>
148
+ <tr><td scope="row" align="center" colspan="6"><?php _e('See full report:', 'async-javascript'); ?> <span class="aj_latest_report"></span></td></tr>
149
  </table>
150
  </div>
151
  <?php
152
  }
153
  ?>
154
  <div class="asItemDetail">
155
+ <h3><?php _e('Generate New Report', 'async-javascript'); ?></h3>
156
+ <p><?php _e('Please click on the button below to generate a new GTmetrix Report.', 'async-javascript'); ?></p>
157
+ <p><?php _e('<strong>Please Note:</strong> By clicking the button below you acknowledge that you understand that one (1) GTmetrix API credit will be used.', 'async-javascript'); ?></p>
158
+ <p><button data-id="aj_gtmetrix_test" class="aj_steps_button button"><?php _e('Run GTmetrix Test', 'async-javascript'); ?></button></p>
159
  </div>
160
  <div class="asItemDetail">
161
+ <h3><?php _e('GTmetrix API Key', 'async-javascript'); ?></h3>
162
+ <p><?php _e("If you haven't already done so, grab an API Key from GTmetrix so that Async JavaScript can obtain your PageSpeed / YSlow results. Here's how:", 'async-javascript'); ?></p>
163
  <ol>
164
+ <li><?php _e('Navigate to <a href="https://gtmetrix.com/api/" target="_blank">https://gtmetrix.com/api/</a> (link opens in a new tab)', 'async-javascript'); ?></li>
165
+ <li><?php _e("If you do not already have an account with GTmetrix, go ahead and sign up (it's FREE!).", 'async-javascript'); ?></li>
166
+ <li><?php _e('Log in to your GTmetrix account.', 'async-javascript'); ?></li>
167
+ <li><?php _e("If you haven't yet generated your API Key, click on <strong>Generate API Key</strong>", 'async-javascript'); ?></li>
168
+ <li><?php _e('Copy your Username and API Key into the fields below:', 'async-javascript'); ?><br /><input type="text" id="aj_gtmetrix_username" value="<?php echo $aj_gtmetrix_username; ?>" placeholder="GTmetrix Username"><input type="text" id="aj_gtmetrix_api_key" value="<?php echo $aj_gtmetrix_api_key; ?>" placeholder="GTmetrix API Key"></li>
169
+ <li><?php _e('Select the desired server.', 'async-javascript'); ?><br />
170
  <select id="aj_gtmetrix_server">
171
  <?php
172
  $gtmetrix_locations = array(
183
  ?>
184
  </select>
185
  </li>
186
+ <li><?php _e('GTmetrix Credits Available:', 'async-javascript'); ?> <span class="aj_gtmetrix_credits"><?php echo $credits; ?></span></li>
187
  </ol>
188
  </div>
189
  <?php
asyncjsWizardScreens.php CHANGED
@@ -25,17 +25,17 @@ if ($aj_gtmetrix_username != '' && $aj_gtmetrix_api_key != '') {
25
  ?>
26
 
27
  <div class="asItemDetail" id="aj_step1">
28
- <h3><?php _e('Step 1: GTmetrix API Key', 'asyncjs'); ?></h3>
29
- <p><?php _e('<strong><em>Please Note:</em></strong> You do not have to use this Wizard. All settings can be changed under the', 'asyncjs'); ?> <a href="<?php echo menu_page_url(AJ_ADMIN_MENU_SLUG, false) . '&tab=settings'; ?>"><?php _e('Settings', 'asyncjs'); ?></a> <?php _e('tab.', 'asyncjs'); ?></p>
30
  <hr />
31
- <p><?php _e("If you haven't already done so, grab an API Key from GTmetrix so that Async JavaScript can obtain your PageSpeed / YSlow results. Here's how:", 'asyncjs'); ?></p>
32
  <ol>
33
- <li><?php _e('Navigate to ', 'asyncjs'); ?><a href="https://gtmetrix.com/api/" target="_blank">https://gtmetrix.com/api/</a> <?php _e('(link opens in a new tab)', 'asyncjs'); ?></li>
34
- <li><?php _e("If you do not already have an account with GTmetrix, go ahead and sign up (it's FREE!).", 'asyncjs'); ?></li>
35
- <li><?php _e('Log in to your GTmetrix account.', 'asyncjs'); ?></li>
36
- <li><?php _e("If you haven't yet generated your API Key, click on <strong>Generate API Key</strong>", 'asyncjs'); ?></li>
37
- <li><?php _e('Copy your Username and API Key into the fields below:', 'asyncjs'); ?><br /><input type="text" id="aj_gtmetrix_username" value="<?php echo $aj_gtmetrix_username; ?>" placeholder="GTmetrix Username"><input type="text" id="aj_gtmetrix_api_key" value="<?php echo $aj_gtmetrix_api_key; ?>" placeholder="GTmetrix API Key"></li>
38
- <li><?php _e('Select the desired server.', 'asyncjs'); ?><br />
39
  <select id="aj_gtmetrix_server">
40
  <?php
41
  $gtmetrix_locations = array(
@@ -52,272 +52,270 @@ if ($aj_gtmetrix_username != '' && $aj_gtmetrix_api_key != '') {
52
  ?>
53
  </select>
54
  </li>
55
- <li><?php _e('GTmetrix Credits Available: ', 'asyncjs'); ?><span class="aj_gtmetrix_credits"><?php echo $credits; ?></span></li>
56
  </ol>
57
- <p><?php _e('<strong>Please Note:</strong> By clicking the button below you acknowledge that you understand that five (5) GTmetrix API credits will be used.', 'asyncjs'); ?></p>
58
- <p><button data-id="aj_step2" class="aj_steps_button button"><?php _e('Proceed to Step 2', 'asyncjs'); ?></button></p>
59
  </div>
60
 
61
  <div class="asItemDetail aj_steps_hidden" id="aj_step2" >
62
- <h3><?php _e('Step 2: Initial Test Results', 'asyncjs'); ?></h3>
63
- <p><?php echo AJ_TITLE; ?> <?php _e('will now query GTmetrix and retrieve your sites PageSpeed and YSlow scores.', 'asyncjs'); ?></p>
64
  <div id="aj_step2_please_wait">
65
- <div class="aj_loader"><h3 class="aj_loader_loading_text"><?php _e('Please Wait', 'asyncjs'); ?></h3></div>
66
  </div>
67
  <table id="aj_step2_gtmetrix_results" class="form-table aj-steps-table" style="width:100%;padding:10px;">
68
  <tr>
69
  <td><img src="" alt="GT Metrix Screenshot" class="aj_step2_screenshot aj_gtmetrix_screenshot">
70
  <td>
71
- <h3><?php _e('PageSpeed Score', 'asyncjs'); ?></h3>
72
  <span class="aj_step2_pagespeed aj_gtmetrix_result"></span>
73
  </td>
74
  <td>
75
- <h3><?php _e('YSlow Score', 'asyncjs'); ?></h3>
76
  <span class="aj_step2_yslow aj_gtmetrix_result"></span>
77
  </td>
78
  <td>
79
- <h3><?php _e('Fully Loaded Time', 'asyncjs'); ?></h3>
80
  <span class="aj_step2_flt aj_gtmetrix_result"></span>
81
  </td>
82
  <td>
83
- <h3><?php _e('Total Page Size', 'asyncjs'); ?></h3>
84
  <span class="aj_step2_tps aj_gtmetrix_result"></span>
85
  </td>
86
  <td>
87
- <h3><?php _e('Requests', 'asyncjs'); ?></h3>
88
  <span class="aj_step2_requests aj_gtmetrix_result"></span>
89
  </td>
90
  </tr>
91
 
92
  <tr>
93
- <td colspan="6"><?php _e('See full report:', 'asyncjs'); ?> <span class="aj_step2_report"></span></td>
94
  </tr>
95
  <tr>
96
- <td colspan="6"><?php _e('Simulate', 'asyncjs'); ?> <span class="aj_step2_gtmetrix"></span>: <a href="" class="aj_step2_url" target="_blank"></a>
97
  </tr>
98
 
99
  </table>
100
  </div>
101
 
102
  <div class="asItemDetail aj_steps_hidden" id="aj_step2b">
103
- <h3><?php _e('Testing: Async', 'asyncjs');?></h3>
104
- <p><?php echo AJ_TITLE; ?> <?php _e("will now query GTmetrix and retrieve your sites PageSpeed and YSlow scores whilst simulating the JavaScript 'async' method.", 'asyncjs'); ?></p>
105
  <div id="aj_step2b_please_wait"><div class="aj_loader">
106
- <h3 class="aj_loader_loading_text"><?php _e('Please Wait', 'asyncjs'); ?></h3></div>
107
  </div>
108
  <table id="aj_step2b_gtmetrix_results" class="form-table aj-steps-table" style="width:100%;padding:10px;">
109
  <tr>
110
  <td><img src="" alt="GT Metrix Screenshot" class="aj_step2b_screenshot aj_gtmetrix_screenshot">
111
  <td>
112
- <h3><?php _e('PageSpeed Score', 'asyncjs');?></h3>
113
  <span class="aj_step2b_pagespeed aj_gtmetrix_result"></span>
114
  </td>
115
  <td>
116
- <h3><?php _e('YSlow Score', 'asyncjs');?></h3>
117
  <span class="aj_step2b_yslow aj_gtmetrix_result"></span>
118
  </td>
119
  <td>
120
- <h3><?php _e('Fully Loaded Time', 'asyncjs');?></h3>
121
  <span class="aj_step2b_flt aj_gtmetrix_result"></span>
122
  </td>
123
  <td>
124
- <h3><?php _e('Total Page Size', 'asyncjs');?></h3>
125
  <span class="aj_step2b_tps aj_gtmetrix_result"></span>
126
  </td>
127
  <td>
128
 
129
- <h3><?php _e('Requests', 'asyncjs');?></h3>
130
  <span class="aj_step2b_requests aj_gtmetrix_result"></span>
131
  </td>
132
  </tr>
133
  <tr>
134
- <td colspan="6"><?php _e('See full report:', 'asyncjs');?> <span class="aj_step2b_report"></span></td>
135
  </tr>
136
  <tr>
137
- <td colspan="6"><?php _e('Simulate', 'asyncjs');?> <span class="aj_step2b_gtmetrix"></span>: <a href="" class="aj_step2b_url" target="_blank"></a>
138
  </tr>
139
 
140
  </table>
141
  </div>
142
 
143
  <div class="asItemDetail aj_steps_hidden" id="aj_step2c">
144
- <h3><?php _e('Testing: Defer', 'asyncjs');?></h3>
145
- <p><?php echo AJ_TITLE; ?> <?php _e("will now query GTmetrix and retrieve your sites PageSpeed and YSlow scores whilst simulating the JavaScript 'defer' method.", 'asyncjs');?></p>
146
  <div id="aj_step2c_please_wait">
147
- <div class="aj_loader"><h3 class="aj_loader_loading_text"><?php _e('Please Wait', 'asyncjs'); ?></h3></div>
148
  </div>
149
  <table id="aj_step2c_gtmetrix_results" class="form-table aj-steps-table" style="width:100%;padding:10px;">
150
  <tr>
151
  <td><img src="" alt="GT Metrix Screenshot" class="aj_step2c_screenshot aj_gtmetrix_screenshot">
152
  <td>
153
- <h3><?php _e('PageSpeed Score', 'asyncjs');?></h3>
154
  <span class="aj_step2c_pagespeed aj_gtmetrix_result"></span>
155
  </td>
156
  <td>
157
- <h3><?php _e('YSlow Score', 'asyncjs');?></h3>
158
  <span class="aj_step2c_yslow aj_gtmetrix_result"></span>
159
  </td>
160
  <td>
161
- <h3><?php _e('Fully Loaded Time', 'asyncjs');?></h3>
162
  <span class="aj_step2c_flt aj_gtmetrix_result"></span>
163
  </td>
164
  <td>
165
- <h3><?php _e('Total Page Size', 'asyncjs');?></h3>
166
  <span class="aj_step2c_tps aj_gtmetrix_result"></span>
167
  </td>
168
  <td>
169
- <h3><?php _e('Requests', 'asyncjs');?></h3>
170
  <span class="aj_step2c_requests aj_gtmetrix_result"></span>
171
  </td>
172
  </tr>
173
  <tr>
174
- <td colspan="6"><?php _e('See full report:', 'asyncjs');?> <span class="aj_step2c_report"></span></td>
175
  </tr>
176
  <tr>
177
- <td colspan="6"><?php _e('Simulate', 'asyncjs');?> <span class="aj_step2c_gtmetrix"></span>: <a href="" class="aj_step2c_url" target="_blank"></a>
178
  </tr>
179
 
180
  </table>
181
  </div>
182
 
183
  <div class="asItemDetail aj_steps_hidden" id="aj_step2d">
184
- <h3><?php _e('Testing: Async (jQuery excluded)', 'asyncjs');?></h3>
185
- <p><?php echo AJ_TITLE; ?> <?php _e("will now query GTmetrix and retrieve your sites PageSpeed and YSlow scores whilst simulating the JavaScript 'async' method but excluding jQuery.", 'asyncjs');?></p>
186
  <div id="aj_step2d_please_wait">
187
- <div class="aj_loader"><h3 class="aj_loader_loading_text"><?php _e('Please Wait', 'asyncjs'); ?></h3></div>
188
  </div>
189
  <table id="aj_step2d_gtmetrix_results" class="form-table aj-steps-table" style="width:100%;padding:10px;">
190
  <tr>
191
  <td><img src="" alt="GT Metrix Screenshot" class="aj_step2d_screenshot aj_gtmetrix_screenshot">
192
  <td>
193
- <h3><?php _e('PageSpeed Score', 'asyncjs');?></h3>
194
  <span class="aj_step2d_pagespeed aj_gtmetrix_result"></span>
195
  </td>
196
  <td>
197
- <h3><?php _e('YSlow Score', 'asyncjs');?></h3>
198
  <span class="aj_step2d_yslow aj_gtmetrix_result"></span>
199
  </td>
200
  <td>
201
- <h3><?php _e('Fully Loaded Time', 'asyncjs');?></h3>
202
  <span class="aj_step2d_flt aj_gtmetrix_result"></span>
203
 
204
  </td>
205
  <td>
206
- <h3><?php _e('Total Page Size', 'asyncjs');?></h3>
207
  <span class="aj_step2d_tps aj_gtmetrix_result"></span>
208
  </td>
209
  <td>
210
- <h3><?php _e('Requests', 'asyncjs');?></h3>
211
  <span class="aj_step2d_requests aj_gtmetrix_result"></span>
212
  </td>
213
  </tr>
214
  <tr>
215
- <td colspan="6"><?php _e('See full report:', 'asyncjs');?> <span class="aj_step2d_report"></span></td>
216
  </tr>
217
  <tr>
218
- <td colspan="6"><?php _e('Simulate', 'asyncjs');?> <span class="aj_step2d_gtmetrix"></span>: <a href="" class="aj_step2d_url" target="_blank"></a>
219
  </tr>
220
 
221
  </table>
222
  </div>
223
 
224
  <div class="asItemDetail aj_steps_hidden" id="aj_step2e">
225
- <h3><?php _e('Testing: Defer (jQuery excluded)', 'asyncjs');?></h3>
226
- <p><?php echo AJ_TITLE; ?> <?php _e("will now query GTmetrix and retrieve your sites PageSpeed and YSlow scores whilst simulating the JavaScript 'defer' method but excluding jQuery.", 'asyncjs');?></p>
227
  <div id="aj_step2e_please_wait">
228
- <div class="aj_loader"><h3 class="aj_loader_loading_text"><?php _e('Please Wait', 'asyncjs'); ?></h3></div>
229
  </div>
230
  <table id="aj_step2e_gtmetrix_results" class="form-table aj-steps-table" style="width:100%;padding:10px;">
231
  <tr>
232
  <td><img src="" alt="GT Metrix Screenshot" class="aj_step2e_screenshot aj_gtmetrix_screenshot">
233
  <td>
234
- <h3><?php _e('PageSpeed Score', 'asyncjs');?></h3>
235
  <span class="aj_step2e_pagespeed aj_gtmetrix_result"></span>
236
  </td>
237
  <td>
238
- <h3><?php _e('YSlow Score', 'asyncjs');?></h3>
239
  <span class="aj_step2e_yslow aj_gtmetrix_result"></span>
240
  </td>
241
  <td>
242
- <h3><?php _e('Fully Loaded Time', 'asyncjs');?></h3>
243
  <span class="aj_step2e_flt aj_gtmetrix_result"></span>
244
  </td>
245
  <td>
246
- <h3><?php _e('Total Page Size', 'asyncjs');?></h3>
247
  <span class="aj_step2e_tps aj_gtmetrix_result"></span>
248
  </td>
249
  <td>
250
- <h3><?php _e('Requests', 'asyncjs');?></h3>
251
  <span class="aj_step2e_requests aj_gtmetrix_result"></span>
252
  </td>
253
  </tr>
254
  <tr>
255
- <td colspan="6"><?php _e('See full report:', 'asyncjs');?> <span class="aj_step2e_report"></span></td>
256
  </tr>
257
  <tr>
258
- <td colspan="6"><?php _e('Simulate', 'asyncjs');?> <span class="aj_step2e_gtmetrix"></span>: <a href="" class="aj_step2e_url" target="_blank"></a>
259
  </tr>
260
- <tr><td scope="row" align="left" colspan="6"><?php _e('See full report:', 'asyncjs');?> <span class="aj_step2e_report"></span></td></tr>
261
- <tr><td scope="row" align="left" colspan="6"><?php _e('Simulate', 'asyncjs');?> <span class="aj_step2e_gtmetrix"></span>: <a href="" class="aj_step2e_url" target="_blank"></a></tr>
262
  </table>
263
  </div>
264
 
265
  <div class="asItemDetail aj_steps_hidden" id="aj_step_results">
266
- <h3><?php _e('Step 3: Results &amp; Recommendations', 'asyncjs');?></h3>
267
- <p><?php echo AJ_TITLE; ?> <?php _e('has finished testing your site with the most common configuration options.', 'asyncjs');?></p>
268
- <p><?php _e('Based on the tests Async JavaScript has determined that <span class="aj_gtmetrix_config"></span> has resulted in <span id="aj_gtmetrix_inde_pagespeed"></span> in PageSpeed from <span id="aj_gtmetrix_baseline_pagespeed"></span> to <span id="aj_gtmetrix_best_pagespeed"></span> and <span id="aj_gtmetrix_inde_yslow"></span> in YSlow from <span id="aj_gtmetrix_baseline_yslow"></span> to <span id="aj_gtmetrix_best_yslow"></span>, with a Fully Loaded time of', 'asyncjs');?> <span id="aj_gtmetrix_best_fullyloaded"></span>.</p>
269
- <p><?php _e('Before applying these settings it is important to check your site is still functioning correctly. Click the link below to open your site in a new tab / window to simulate the <?php echo AJ_TITLE; ?> settings and check that everything is working, and also be sure to check the console for any JavaScript errors (see <a href="https://codex.wordpress.org/Using_Your_Browser_to_Diagnose_JavaScript_Errors" target="_blank">Using Your Browser to Diagnose JavaScript Errors</a>)', 'asyncjs');?></p>
270
  <ul>
271
- <li><?php _e('Simulate', 'asyncjs');?> <span class="aj_gtmetrix_config"></span>: <a href="" id="aj_gtmetrix_best_url" target="_blank"></a></li>
272
  </ul>
273
- <p><?php _e('Once you have simulated', 'asyncjs');?> <span class="aj_gtmetrix_config"></span> <?php _e('click on the button below to continue.', 'asyncjs');?></p>
274
- <p><button data-id="aj_step4" class="aj_steps_button button"><?php _e('Proceed to Step 4', 'asyncjs');?></button></p>
275
  </div>
276
 
277
  <div class="asItemDetail aj_steps_hidden" id="aj_step4">
278
- <h3><?php _e('Step 4: Apply Settings', 'asyncjs');?></h3>
279
- <p><?php _e('Is your site still functioning properly and are there no JavaScript errors in the console?', 'asyncjs');?></p>
280
- <p><input type="radio" name="aj_step4_check" value="y"> <?php _e('Yes', 'asyncjs');?> <input type="radio" name="aj_step4_check" value="n"> <?php _e('No', 'asyncjs');?></p>
281
  <div id="aj_step4_y">
282
- <p><?php _e('Great to hear! To apply these settings click the button below.', 'asyncjs');?></p>
283
- <p><button data-id="aj_apply_settings" class="aj_steps_button button"><?php _e('Apply Settings', 'asyncjs');?></button></p>
284
  </div>
285
  <div id="aj_step4_n">
286
- <p><?php _e('Ok, so you have run the simulation on <span class="aj_gtmetrix_config"></span> and although there has been an improvement in reported performance, the simulation shows that something is not right with your site.', 'asyncjs');?></p>
287
  <div id="aj_step4_jquery_excluded">
288
- <p><?php _e('In most cases the issue being experienced relates to jQuery (usually due to inline JavaScript which relies on jQuery) and the solution is to exclude jQuery. However, in this simulation jQuery has already been exculded. As a result a different configuration may work better with a marginal sacrifice in site speed improvement.', 'asyncjs');?></p>
289
- <p><?php _e('Below are links that can be used to run simulations on each of the basic configurations. Click on each of the links and check the functionality of your site as well as the console for errors.', 'asyncjs');?></p>
290
  <ul>
291
- <li><?php _e('Simulate', 'asyncjs');?> <span class="aj_step2b_gtmetrix"></span>: <a href="" class="aj_step2b_url" target="_blank"></a></li>
292
- <li><?php _e('Simulate', 'asyncjs');?> <span class="aj_step2c_gtmetrix"></span>: <a href="" class="aj_step2c_url" target="_blank"></a></li>
293
- <li><?php _e('Simulate', 'asyncjs');?> <span class="aj_step2d_gtmetrix"></span>: <a href="" class="aj_step2d_url" target="_blank"></a></li>
294
- <li><?php _e('Simulate', 'asyncjs');?> <span class="aj_step2e_gtmetrix"></span>: <a href="" class="aj_step2e_url" target="_blank"></a></li>
295
  </ul>
296
- <p><?php _e('Click one of the buttons below to apply these settings or click the Settings button to go to the settings page for manual configuration.', 'asyncjs');?></p>
297
  <p>
298
- <button data-id="aj_step2b_apply" class="aj_steps_button button"><?php _e('Apply', 'asyncjs');?> <span class="aj_step2b_gtmetrix"></span></button>
299
- <button data-id="aj_step2c_apply" class="aj_steps_button button"><?php _e('Apply', 'asyncjs');?> <span class="aj_step2c_gtmetrix"></span></button>
300
- <button data-id="aj_step2d_apply" class="aj_steps_button button"><?php _e('Apply', 'asyncjs');?> <span class="aj_step2d_gtmetrix"></span></button>
301
- <button data-id="aj_step2e_apply" class="aj_steps_button button"><?php _e('Apply', 'asyncjs');?> <span class="aj_step2e_gtmetrix"></span></button>
302
  </p>
303
  <p>
304
- <button data-id="aj_goto_settings" class="aj_steps_button button"><?php _e('Settings', 'asyncjs');?></button>
305
  </p>
306
  </div>
307
  <div id="aj_step4_jquery_not_excluded">
308
- <p><?php _e('In most cases the issue being experienced relates to jQuery (usually due to inline JavaScript which relies on jQuery) and the solution is to exclude jQuery.', 'asyncjs');?></p>
309
- <p><?php _e('Below are links that can be used to run simulations on each of the configurations with jQuery excluded. Click on each of the links and check the functionality of your site as well as the console for errors.', 'asyncjs');?></p>
310
  <ul>
311
- <li><?php _e('Simulate', 'asyncjs');?> <span class="aj_step2d_gtmetrix"></span>: <a href="" class="aj_step2d_url" target="_blank"></a></li>
312
- <li><?php _e('Simulate', 'asyncjs');?> <span class="aj_step2e_gtmetrix"></span>: <a href="" class="aj_step2e_url" target="_blank"></a></li>
313
  </ul>
314
- <p><?php _e('Click one of the buttons below to apply these settings or click the Settings button to go to the settings page for manual configuration.', 'asyncjs');?></p>
315
  <p>
316
- <button data-id="aj_step2d_apply" class="aj_steps_button button"><?php _e('Apply', 'asyncjs');?> <span class="aj_step2d_gtmetrix"></span></button>
317
- <button data-id="aj_step2e_apply" class="aj_steps_button button"><?php _e('Apply', 'asyncjs');?> <span class="aj_step2e_gtmetrix"></span></button>
318
  </p>
319
  <p>
320
- <button data-id="aj_goto_settings" class="aj_steps_button button"><?php _e('Settings', 'asyncjs');?></button>
321
  </p>
322
  </div>
323
  </div>
25
  ?>
26
 
27
  <div class="asItemDetail" id="aj_step1">
28
+ <h3><?php _e('Step 1: GTmetrix API Key', 'async-javascript'); ?></h3>
29
+ <p><?php _e('<strong><em>Please Note:</em></strong> You do not have to use this Wizard. All settings can be changed under the', 'async-javascript'); ?> <a href="<?php echo menu_page_url(AJ_ADMIN_MENU_SLUG, false) . '&tab=settings'; ?>"><?php _e('Settings', 'async-javascript'); ?></a> <?php _e('tab.', 'async-javascript'); ?></p>
30
  <hr />
31
+ <p><?php _e("If you haven't already done so, grab an API Key from GTmetrix so that Async JavaScript can obtain your PageSpeed / YSlow results. Here's how:", 'async-javascript'); ?></p>
32
  <ol>
33
+ <li><?php _e('Navigate to ', 'async-javascript'); ?><a href="https://gtmetrix.com/api/" target="_blank">https://gtmetrix.com/api/</a> <?php _e('(link opens in a new tab)', 'async-javascript'); ?></li>
34
+ <li><?php _e("If you do not already have an account with GTmetrix, go ahead and sign up (it's FREE!).", 'async-javascript'); ?></li>
35
+ <li><?php _e('Log in to your GTmetrix account.', 'async-javascript'); ?></li>
36
+ <li><?php _e("If you haven't yet generated your API Key, click on <strong>Generate API Key</strong>", 'async-javascript'); ?></li>
37
+ <li><?php _e('Copy your Username and API Key into the fields below:', 'async-javascript'); ?><br /><input type="text" id="aj_gtmetrix_username" value="<?php echo $aj_gtmetrix_username; ?>" placeholder="GTmetrix Username"><input type="text" id="aj_gtmetrix_api_key" value="<?php echo $aj_gtmetrix_api_key; ?>" placeholder="GTmetrix API Key"></li>
38
+ <li><?php _e('Select the desired server.', 'async-javascript'); ?><br />
39
  <select id="aj_gtmetrix_server">
40
  <?php
41
  $gtmetrix_locations = array(
52
  ?>
53
  </select>
54
  </li>
55
+ <li><?php _e('GTmetrix Credits Available: ', 'async-javascript'); ?><span class="aj_gtmetrix_credits"><?php echo $credits; ?></span></li>
56
  </ol>
57
+ <p><?php _e('<strong>Please Note:</strong> By clicking the button below you acknowledge that you understand that five (5) GTmetrix API credits will be used.', 'async-javascript'); ?></p>
58
+ <p><button data-id="aj_step2" class="aj_steps_button button"><?php _e('Proceed to Step 2', 'async-javascript'); ?></button></p>
59
  </div>
60
 
61
  <div class="asItemDetail aj_steps_hidden" id="aj_step2" >
62
+ <h3><?php _e('Step 2: Initial Test Results', 'async-javascript'); ?></h3>
63
+ <p><?php echo AJ_TITLE; ?> <?php _e('will now query GTmetrix and retrieve your sites PageSpeed and YSlow scores.', 'async-javascript'); ?></p>
64
  <div id="aj_step2_please_wait">
65
+ <div class="aj_loader"><h3 class="aj_loader_loading_text"><?php _e('Please Wait', 'async-javascript'); ?></h3></div>
66
  </div>
67
  <table id="aj_step2_gtmetrix_results" class="form-table aj-steps-table" style="width:100%;padding:10px;">
68
  <tr>
69
  <td><img src="" alt="GT Metrix Screenshot" class="aj_step2_screenshot aj_gtmetrix_screenshot">
70
  <td>
71
+ <h3><?php _e('PageSpeed Score', 'async-javascript'); ?></h3>
72
  <span class="aj_step2_pagespeed aj_gtmetrix_result"></span>
73
  </td>
74
  <td>
75
+ <h3><?php _e('YSlow Score', 'async-javascript'); ?></h3>
76
  <span class="aj_step2_yslow aj_gtmetrix_result"></span>
77
  </td>
78
  <td>
79
+ <h3><?php _e('Fully Loaded Time', 'async-javascript'); ?></h3>
80
  <span class="aj_step2_flt aj_gtmetrix_result"></span>
81
  </td>
82
  <td>
83
+ <h3><?php _e('Total Page Size', 'async-javascript'); ?></h3>
84
  <span class="aj_step2_tps aj_gtmetrix_result"></span>
85
  </td>
86
  <td>
87
+ <h3><?php _e('Requests', 'async-javascript'); ?></h3>
88
  <span class="aj_step2_requests aj_gtmetrix_result"></span>
89
  </td>
90
  </tr>
91
 
92
  <tr>
93
+ <td colspan="6"><?php _e('See full report:', 'async-javascript'); ?> <span class="aj_step2_report"></span></td>
94
  </tr>
95
  <tr>
96
+ <td colspan="6"><?php _e('Simulate', 'async-javascript'); ?> <span class="aj_step2_gtmetrix"></span>: <a href="" class="aj_step2_url" target="_blank"></a>
97
  </tr>
98
 
99
  </table>
100
  </div>
101
 
102
  <div class="asItemDetail aj_steps_hidden" id="aj_step2b">
103
+ <h3><?php _e('Testing: Async', 'async-javascript');?></h3>
104
+ <p><?php echo AJ_TITLE; ?> <?php _e("will now query GTmetrix and retrieve your sites PageSpeed and YSlow scores whilst simulating the JavaScript 'async' method.", 'async-javascript'); ?></p>
105
  <div id="aj_step2b_please_wait"><div class="aj_loader">
106
+ <h3 class="aj_loader_loading_text"><?php _e('Please Wait', 'async-javascript'); ?></h3></div>
107
  </div>
108
  <table id="aj_step2b_gtmetrix_results" class="form-table aj-steps-table" style="width:100%;padding:10px;">
109
  <tr>
110
  <td><img src="" alt="GT Metrix Screenshot" class="aj_step2b_screenshot aj_gtmetrix_screenshot">
111
  <td>
112
+ <h3><?php _e('PageSpeed Score', 'async-javascript');?></h3>
113
  <span class="aj_step2b_pagespeed aj_gtmetrix_result"></span>
114
  </td>
115
  <td>
116
+ <h3><?php _e('YSlow Score', 'async-javascript');?></h3>
117
  <span class="aj_step2b_yslow aj_gtmetrix_result"></span>
118
  </td>
119
  <td>
120
+ <h3><?php _e('Fully Loaded Time', 'async-javascript');?></h3>
121
  <span class="aj_step2b_flt aj_gtmetrix_result"></span>
122
  </td>
123
  <td>
124
+ <h3><?php _e('Total Page Size', 'async-javascript');?></h3>
125
  <span class="aj_step2b_tps aj_gtmetrix_result"></span>
126
  </td>
127
  <td>
128
 
129
+ <h3><?php _e('Requests', 'async-javascript');?></h3>
130
  <span class="aj_step2b_requests aj_gtmetrix_result"></span>
131
  </td>
132
  </tr>
133
  <tr>
134
+ <td colspan="6"><?php _e('See full report:', 'async-javascript');?> <span class="aj_step2b_report"></span></td>
135
  </tr>
136
  <tr>
137
+ <td colspan="6"><?php _e('Simulate', 'async-javascript');?> <span class="aj_step2b_gtmetrix"></span>: <a href="" class="aj_step2b_url" target="_blank"></a>
138
  </tr>
139
 
140
  </table>
141
  </div>
142
 
143
  <div class="asItemDetail aj_steps_hidden" id="aj_step2c">
144
+ <h3><?php _e('Testing: Defer', 'async-javascript');?></h3>
145
+ <p><?php echo AJ_TITLE; ?> <?php _e("will now query GTmetrix and retrieve your sites PageSpeed and YSlow scores whilst simulating the JavaScript 'defer' method.", 'async-javascript');?></p>
146
  <div id="aj_step2c_please_wait">
147
+ <div class="aj_loader"><h3 class="aj_loader_loading_text"><?php _e('Please Wait', 'async-javascript'); ?></h3></div>
148
  </div>
149
  <table id="aj_step2c_gtmetrix_results" class="form-table aj-steps-table" style="width:100%;padding:10px;">
150
  <tr>
151
  <td><img src="" alt="GT Metrix Screenshot" class="aj_step2c_screenshot aj_gtmetrix_screenshot">
152
  <td>
153
+ <h3><?php _e('PageSpeed Score', 'async-javascript');?></h3>
154
  <span class="aj_step2c_pagespeed aj_gtmetrix_result"></span>
155
  </td>
156
  <td>
157
+ <h3><?php _e('YSlow Score', 'async-javascript');?></h3>
158
  <span class="aj_step2c_yslow aj_gtmetrix_result"></span>
159
  </td>
160
  <td>
161
+ <h3><?php _e('Fully Loaded Time', 'async-javascript');?></h3>
162
  <span class="aj_step2c_flt aj_gtmetrix_result"></span>
163
  </td>
164
  <td>
165
+ <h3><?php _e('Total Page Size', 'async-javascript');?></h3>
166
  <span class="aj_step2c_tps aj_gtmetrix_result"></span>
167
  </td>
168
  <td>
169
+ <h3><?php _e('Requests', 'async-javascript');?></h3>
170
  <span class="aj_step2c_requests aj_gtmetrix_result"></span>
171
  </td>
172
  </tr>
173
  <tr>
174
+ <td colspan="6"><?php _e('See full report:', 'async-javascript');?> <span class="aj_step2c_report"></span></td>
175
  </tr>
176
  <tr>
177
+ <td colspan="6"><?php _e('Simulate', 'async-javascript');?> <span class="aj_step2c_gtmetrix"></span>: <a href="" class="aj_step2c_url" target="_blank"></a>
178
  </tr>
179
 
180
  </table>
181
  </div>
182
 
183
  <div class="asItemDetail aj_steps_hidden" id="aj_step2d">
184
+ <h3><?php _e('Testing: Async (jQuery excluded)', 'async-javascript');?></h3>
185
+ <p><?php echo AJ_TITLE; ?> <?php _e("will now query GTmetrix and retrieve your sites PageSpeed and YSlow scores whilst simulating the JavaScript 'async' method but excluding jQuery.", 'async-javascript');?></p>
186
  <div id="aj_step2d_please_wait">
187
+ <div class="aj_loader"><h3 class="aj_loader_loading_text"><?php _e('Please Wait', 'async-javascript'); ?></h3></div>
188
  </div>
189
  <table id="aj_step2d_gtmetrix_results" class="form-table aj-steps-table" style="width:100%;padding:10px;">
190
  <tr>
191
  <td><img src="" alt="GT Metrix Screenshot" class="aj_step2d_screenshot aj_gtmetrix_screenshot">
192
  <td>
193
+ <h3><?php _e('PageSpeed Score', 'async-javascript');?></h3>
194
  <span class="aj_step2d_pagespeed aj_gtmetrix_result"></span>
195
  </td>
196
  <td>
197
+ <h3><?php _e('YSlow Score', 'async-javascript');?></h3>
198
  <span class="aj_step2d_yslow aj_gtmetrix_result"></span>
199
  </td>
200
  <td>
201
+ <h3><?php _e('Fully Loaded Time', 'async-javascript');?></h3>
202
  <span class="aj_step2d_flt aj_gtmetrix_result"></span>
203
 
204
  </td>
205
  <td>
206
+ <h3><?php _e('Total Page Size', 'async-javascript');?></h3>
207
  <span class="aj_step2d_tps aj_gtmetrix_result"></span>
208
  </td>
209
  <td>
210
+ <h3><?php _e('Requests', 'async-javascript');?></h3>
211
  <span class="aj_step2d_requests aj_gtmetrix_result"></span>
212
  </td>
213
  </tr>
214
  <tr>
215
+ <td colspan="6"><?php _e('See full report:', 'async-javascript');?> <span class="aj_step2d_report"></span></td>
216
  </tr>
217
  <tr>
218
+ <td colspan="6"><?php _e('Simulate', 'async-javascript');?> <span class="aj_step2d_gtmetrix"></span>: <a href="" class="aj_step2d_url" target="_blank"></a>
219
  </tr>
220
 
221
  </table>
222
  </div>
223
 
224
  <div class="asItemDetail aj_steps_hidden" id="aj_step2e">
225
+ <h3><?php _e('Testing: Defer (jQuery excluded)', 'async-javascript');?></h3>
226
+ <p><?php echo AJ_TITLE; ?> <?php _e("will now query GTmetrix and retrieve your sites PageSpeed and YSlow scores whilst simulating the JavaScript 'defer' method but excluding jQuery.", 'async-javascript');?></p>
227
  <div id="aj_step2e_please_wait">
228
+ <div class="aj_loader"><h3 class="aj_loader_loading_text"><?php _e('Please Wait', 'async-javascript'); ?></h3></div>
229
  </div>
230
  <table id="aj_step2e_gtmetrix_results" class="form-table aj-steps-table" style="width:100%;padding:10px;">
231
  <tr>
232
  <td><img src="" alt="GT Metrix Screenshot" class="aj_step2e_screenshot aj_gtmetrix_screenshot">
233
  <td>
234
+ <h3><?php _e('PageSpeed Score', 'async-javascript');?></h3>
235
  <span class="aj_step2e_pagespeed aj_gtmetrix_result"></span>
236
  </td>
237
  <td>
238
+ <h3><?php _e('YSlow Score', 'async-javascript');?></h3>
239
  <span class="aj_step2e_yslow aj_gtmetrix_result"></span>
240
  </td>
241
  <td>
242
+ <h3><?php _e('Fully Loaded Time', 'async-javascript');?></h3>
243
  <span class="aj_step2e_flt aj_gtmetrix_result"></span>
244
  </td>
245
  <td>
246
+ <h3><?php _e('Total Page Size', 'async-javascript');?></h3>
247
  <span class="aj_step2e_tps aj_gtmetrix_result"></span>
248
  </td>
249
  <td>
250
+ <h3><?php _e('Requests', 'async-javascript');?></h3>
251
  <span class="aj_step2e_requests aj_gtmetrix_result"></span>
252
  </td>
253
  </tr>
254
  <tr>
255
+ <td colspan="6"><?php _e('See full report:', 'async-javascript');?> <span class="aj_step2e_report"></span></td>
256
  </tr>
257
  <tr>
258
+ <td colspan="6"><?php _e('Simulate', 'async-javascript');?> <span class="aj_step2e_gtmetrix"></span>: <a href="" class="aj_step2e_url" target="_blank"></a>
259
  </tr>
 
 
260
  </table>
261
  </div>
262
 
263
  <div class="asItemDetail aj_steps_hidden" id="aj_step_results">
264
+ <h3><?php _e('Step 3: Results &amp; Recommendations', 'async-javascript');?></h3>
265
+ <p><?php echo AJ_TITLE; ?> <?php _e('has finished testing your site with the most common configuration options.', 'async-javascript');?></p>
266
+ <p><?php _e('Based on the tests Async JavaScript has determined that <span class="aj_gtmetrix_config"></span> has resulted in <span id="aj_gtmetrix_inde_pagespeed"></span> in PageSpeed from <span id="aj_gtmetrix_baseline_pagespeed"></span> to <span id="aj_gtmetrix_best_pagespeed"></span> and <span id="aj_gtmetrix_inde_yslow"></span> in YSlow from <span id="aj_gtmetrix_baseline_yslow"></span> to <span id="aj_gtmetrix_best_yslow"></span>, with a Fully Loaded time of', 'async-javascript');?> <span id="aj_gtmetrix_best_fullyloaded"></span>.</p>
267
+ <p><?php _e('Before applying these settings it is important to check your site is still functioning correctly. Click the link below to open your site in a new tab / window to simulate the <?php echo AJ_TITLE; ?> settings and check that everything is working, and also be sure to check the console for any JavaScript errors (see <a href="https://codex.wordpress.org/Using_Your_Browser_to_Diagnose_JavaScript_Errors" target="_blank">Using Your Browser to Diagnose JavaScript Errors</a>)', 'async-javascript');?></p>
268
  <ul>
269
+ <li><?php _e('Simulate', 'async-javascript');?> <span class="aj_gtmetrix_config"></span>: <a href="" id="aj_gtmetrix_best_url" target="_blank"></a></li>
270
  </ul>
271
+ <p><?php _e('Once you have simulated', 'async-javascript');?> <span class="aj_gtmetrix_config"></span> <?php _e('click on the button below to continue.', 'async-javascript');?></p>
272
+ <p><button data-id="aj_step4" class="aj_steps_button button"><?php _e('Proceed to Step 4', 'async-javascript');?></button></p>
273
  </div>
274
 
275
  <div class="asItemDetail aj_steps_hidden" id="aj_step4">
276
+ <h3><?php _e('Step 4: Apply Settings', 'async-javascript');?></h3>
277
+ <p><?php _e('Is your site still functioning properly and are there no JavaScript errors in the console?', 'async-javascript');?></p>
278
+ <p><input type="radio" name="aj_step4_check" value="y"> <?php _e('Yes', 'async-javascript');?> <input type="radio" name="aj_step4_check" value="n"> <?php _e('No', 'async-javascript');?></p>
279
  <div id="aj_step4_y">
280
+ <p><?php _e('Great to hear! To apply these settings click the button below.', 'async-javascript');?></p>
281
+ <p><button data-id="aj_apply_settings" class="aj_steps_button button"><?php _e('Apply Settings', 'async-javascript');?></button></p>
282
  </div>
283
  <div id="aj_step4_n">
284
+ <p><?php _e('Ok, so you have run the simulation on <span class="aj_gtmetrix_config"></span> and although there has been an improvement in reported performance, the simulation shows that something is not right with your site.', 'async-javascript');?></p>
285
  <div id="aj_step4_jquery_excluded">
286
+ <p><?php _e('In most cases the issue being experienced relates to jQuery (usually due to inline JavaScript which relies on jQuery) and the solution is to exclude jQuery. However, in this simulation jQuery has already been exculded. As a result a different configuration may work better with a marginal sacrifice in site speed improvement.', 'async-javascript');?></p>
287
+ <p><?php _e('Below are links that can be used to run simulations on each of the basic configurations. Click on each of the links and check the functionality of your site as well as the console for errors.', 'async-javascript');?></p>
288
  <ul>
289
+ <li><?php _e('Simulate', 'async-javascript');?> <span class="aj_step2b_gtmetrix"></span>: <a href="" class="aj_step2b_url" target="_blank"></a></li>
290
+ <li><?php _e('Simulate', 'async-javascript');?> <span class="aj_step2c_gtmetrix"></span>: <a href="" class="aj_step2c_url" target="_blank"></a></li>
291
+ <li><?php _e('Simulate', 'async-javascript');?> <span class="aj_step2d_gtmetrix"></span>: <a href="" class="aj_step2d_url" target="_blank"></a></li>
292
+ <li><?php _e('Simulate', 'async-javascript');?> <span class="aj_step2e_gtmetrix"></span>: <a href="" class="aj_step2e_url" target="_blank"></a></li>
293
  </ul>
294
+ <p><?php _e('Click one of the buttons below to apply these settings or click the Settings button to go to the settings page for manual configuration.', 'async-javascript');?></p>
295
  <p>
296
+ <button data-id="aj_step2b_apply" class="aj_steps_button button"><?php _e('Apply', 'async-javascript');?> <span class="aj_step2b_gtmetrix"></span></button>
297
+ <button data-id="aj_step2c_apply" class="aj_steps_button button"><?php _e('Apply', 'async-javascript');?> <span class="aj_step2c_gtmetrix"></span></button>
298
+ <button data-id="aj_step2d_apply" class="aj_steps_button button"><?php _e('Apply', 'async-javascript');?> <span class="aj_step2d_gtmetrix"></span></button>
299
+ <button data-id="aj_step2e_apply" class="aj_steps_button button"><?php _e('Apply', 'async-javascript');?> <span class="aj_step2e_gtmetrix"></span></button>
300
  </p>
301
  <p>
302
+ <button data-id="aj_goto_settings" class="aj_steps_button button"><?php _e('Settings', 'async-javascript');?></button>
303
  </p>
304
  </div>
305
  <div id="aj_step4_jquery_not_excluded">
306
+ <p><?php _e('In most cases the issue being experienced relates to jQuery (usually due to inline JavaScript which relies on jQuery) and the solution is to exclude jQuery.', 'async-javascript');?></p>
307
+ <p><?php _e('Below are links that can be used to run simulations on each of the configurations with jQuery excluded. Click on each of the links and check the functionality of your site as well as the console for errors.', 'async-javascript');?></p>
308
  <ul>
309
+ <li><?php _e('Simulate', 'async-javascript');?> <span class="aj_step2d_gtmetrix"></span>: <a href="" class="aj_step2d_url" target="_blank"></a></li>
310
+ <li><?php _e('Simulate', 'async-javascript');?> <span class="aj_step2e_gtmetrix"></span>: <a href="" class="aj_step2e_url" target="_blank"></a></li>
311
  </ul>
312
+ <p><?php _e('Click one of the buttons below to apply these settings or click the Settings button to go to the settings page for manual configuration.', 'async-javascript');?></p>
313
  <p>
314
+ <button data-id="aj_step2d_apply" class="aj_steps_button button"><?php _e('Apply', 'async-javascript');?> <span class="aj_step2d_gtmetrix"></span></button>
315
+ <button data-id="aj_step2e_apply" class="aj_steps_button button"><?php _e('Apply', 'async-javascript');?> <span class="aj_step2e_gtmetrix"></span></button>
316
  </p>
317
  <p>
318
+ <button data-id="aj_goto_settings" class="aj_steps_button button"><?php _e('Settings', 'async-javascript');?></button>
319
  </p>
320
  </div>
321
  </div>
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: (cloughit), optimizingmatters, futtta, wormeyman
3
  Donate link: http://blog.futtta.be/2013/10/21/do-not-donate-to-me/
4
  Tags: async, javascript, pagespeed, performance, render blocking
5
  Requires at least: 4.6
6
- Tested up to: 5.0
7
- Stable tag: 2.18.12.10
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -57,6 +57,12 @@ We recommend using the awesome <a href="https://wordpress.org/plugins/autoptimiz
57
 
58
  == Changelog ==
59
 
 
 
 
 
 
 
60
  = 2.18.12.10 =
61
 
62
  * the "happy birthday to me" edition ;-)
3
  Donate link: http://blog.futtta.be/2013/10/21/do-not-donate-to-me/
4
  Tags: async, javascript, pagespeed, performance, render blocking
5
  Requires at least: 4.6
6
+ Tested up to: 5.2
7
+ Stable tag: 2.19.07.14
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
57
 
58
  == Changelog ==
59
 
60
+ = 2.19.07.14 =
61
+
62
+ * add `asyncjs_filter_noptimize` filter
63
+ * changed textdomain to match slug as suggested by Eneko Garrido
64
+ * confirmed working with WordPress 5.2
65
+
66
  = 2.18.12.10 =
67
 
68
  * the "happy birthday to me" edition ;-)