Version Description
- MOD: Update readme.txt information
Download this release
Release Info
Developer | cloughit |
Plugin | Async JavaScript |
Version | 1.17.01.14 |
Comparing to | |
See all releases |
Code changes from version 1.16.12.12 to 1.17.01.14
- async-javascript.php +24 -8
- readme.txt +11 -7
async-javascript.php
CHANGED
@@ -4,7 +4,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|
4 |
Plugin Name: Async JavaScript
|
5 |
Plugin URI: https://cloughit.com.au/product/async-javascript/
|
6 |
Description: Async JavaScript adds a 'async' or 'defer' attribute to scripts loaded via wp_enqueue_script
|
7 |
-
Version: 1.
|
8 |
Author: Clough I.T. Solutions
|
9 |
Author URI: http://www.cloughit.com.au/
|
10 |
Text Domain: async-javascript
|
@@ -23,7 +23,7 @@ add_action( 'admin_init', 'aj_admin_init' );
|
|
23 |
function aj_admin_init() {
|
24 |
define( 'AJ_PLUGIN_URL', trailingslashit( plugin_dir_url( __FILE__ ) ) );
|
25 |
define( 'AJ_PLUGIN_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
|
26 |
-
define( 'AJ_VERSION', '1.
|
27 |
wp_register_style(
|
28 |
'aj_admin_styles',
|
29 |
plugins_url( '/css/admin.css', __FILE__ )
|
@@ -57,12 +57,28 @@ function aj_admin_init() {
|
|
57 |
*/
|
58 |
add_action( 'admin_notices', 'async_javascript_upgrade_notice' );
|
59 |
function async_javascript_upgrade_notice() {
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
}
|
67 |
/**
|
68 |
* async_javascript_menu()
|
4 |
Plugin Name: Async JavaScript
|
5 |
Plugin URI: https://cloughit.com.au/product/async-javascript/
|
6 |
Description: Async JavaScript adds a 'async' or 'defer' attribute to scripts loaded via wp_enqueue_script
|
7 |
+
Version: 1.17.01.14
|
8 |
Author: Clough I.T. Solutions
|
9 |
Author URI: http://www.cloughit.com.au/
|
10 |
Text Domain: async-javascript
|
23 |
function aj_admin_init() {
|
24 |
define( 'AJ_PLUGIN_URL', trailingslashit( plugin_dir_url( __FILE__ ) ) );
|
25 |
define( 'AJ_PLUGIN_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
|
26 |
+
define( 'AJ_VERSION', '1.17.01.14' );
|
27 |
wp_register_style(
|
28 |
'aj_admin_styles',
|
29 |
plugins_url( '/css/admin.css', __FILE__ )
|
57 |
*/
|
58 |
add_action( 'admin_notices', 'async_javascript_upgrade_notice' );
|
59 |
function async_javascript_upgrade_notice() {
|
60 |
+
$aj_upgrade_notice = get_option( 'aj_upgrade_notice' );
|
61 |
+
if ( $aj_upgrade_notice != AJ_VERSION ) {
|
62 |
+
$options = array(
|
63 |
+
'timeout' => 10, //seconds
|
64 |
+
'headers' => array(
|
65 |
+
'Accept' => 'application/json',
|
66 |
+
)
|
67 |
+
);
|
68 |
+
$aj_notice_url = 'https://cloughit.com.au/wordpress-plugins/async-javascript/aj-upgrade-notice.json';
|
69 |
+
$aj_notice_json = wp_remote_get( $aj_notice_url, $options );
|
70 |
+
if ( is_array( $aj_notice_json ) && ! is_wp_error( $aj_notice_json ) ) {
|
71 |
+
$body = wp_remote_retrieve_body( $aj_notice_json );
|
72 |
+
$aj_notice = json_decode( $body );
|
73 |
+
$exp = strtotime( $aj_notice->expire );
|
74 |
+
$title = $aj_notice->title != '' ? '<string><em>' . stripslashes( $aj_notice->title ) . '</em></strong>' : '';
|
75 |
+
$message = stripslashes( $aj_notice->message );
|
76 |
+
$time = current_time( 'timestamp', 1 );
|
77 |
+
if ( $time < $exp ) {
|
78 |
+
echo '<div class="notice notice-info is-dismissible aj-upgrade-notice">' . $title . $message . '</div>';
|
79 |
+
}
|
80 |
+
}
|
81 |
+
}
|
82 |
}
|
83 |
/**
|
84 |
* async_javascript_menu()
|
readme.txt
CHANGED
@@ -3,12 +3,12 @@ Contributors: (cloughit)
|
|
3 |
Donate link: http://www.cloughit.com.au/donate/ (coming soon)
|
4 |
Tags: async,javascript,google,pagespeed,js,speed,performance,boost,render,blocking,above-the-fold
|
5 |
Requires at least: 2.8
|
6 |
-
Tested up to: 4.7
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
-
Async JavaScript adds a 'async' attribute to
|
12 |
|
13 |
== Description ==
|
14 |
|
@@ -16,7 +16,7 @@ Help to eliminate Render-blocking JavaScript in above-the-fold content with Asyn
|
|
16 |
|
17 |
Render-blocking JavaScript prevents above-the-fold content on your page from being rendered until the JavaScript has finished loading. This can impact on your page speed and ultimately your ranking within search engines. It can also impact your users experience.
|
18 |
|
19 |
-
Async JavaScript adds a 'async' or 'defer' attribute to all JavaScripts loaded by the WordPress wp_enqueue_script function. This 'async' or 'defer' attribute forces the
|
20 |
|
21 |
<em>Want more control? </em><strong>Async JavaScript Pro</strong> allows you to:
|
22 |
|
@@ -37,7 +37,7 @@ Just install from your WordPress "Plugins | Add New" screen and all will be well
|
|
37 |
|
38 |
== Frequently Asked Questions ==
|
39 |
|
40 |
-
= Which browsers support the 'async'
|
41 |
|
42 |
The 'async' attribute is new in HTML5. It is supported by the following browsers:
|
43 |
|
@@ -53,7 +53,7 @@ Please lodge a support request at <a href="https://cloughit.com.au/support/?wpsc
|
|
53 |
|
54 |
= What information should I include when requesting support =
|
55 |
|
56 |
-
* A description of the problem, including screenshots and information from your browser's
|
57 |
* URL of your blog (you can turn Async JavaScript off, but should be willing to turn it briefly on to have the error visible)
|
58 |
* your Async JavaScript settings (including a description of changes you made to the configuration to try to troubleshoot yourself)
|
59 |
* the Theme used (including the Theme's download link)
|
@@ -66,10 +66,14 @@ Please lodge a support request at <a href="https://cloughit.com.au/support/?wpsc
|
|
66 |
|
67 |
== Screenshots ==
|
68 |
|
69 |
-
|
70 |
|
71 |
== Changelog ==
|
72 |
|
|
|
|
|
|
|
|
|
73 |
= 1.16.12.12 =
|
74 |
|
75 |
* MOD: WordPress 4.7 Support
|
3 |
Donate link: http://www.cloughit.com.au/donate/ (coming soon)
|
4 |
Tags: async,javascript,google,pagespeed,js,speed,performance,boost,render,blocking,above-the-fold
|
5 |
Requires at least: 2.8
|
6 |
+
Tested up to: 4.7.1
|
7 |
+
Stable tag: 1.17.01.14
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
+
Async JavaScript adds a 'async' or 'defer' attribute to JavaScripts loaded via wp_enqueue_script
|
12 |
|
13 |
== Description ==
|
14 |
|
16 |
|
17 |
Render-blocking JavaScript prevents above-the-fold content on your page from being rendered until the JavaScript has finished loading. This can impact on your page speed and ultimately your ranking within search engines. It can also impact your users experience.
|
18 |
|
19 |
+
Async JavaScript adds a 'async' or 'defer' attribute to all JavaScripts loaded by the WordPress wp_enqueue_script function. This 'async' or 'defer' attribute forces the JavaScript to be loaded asynchronously or deferred, therefore speeding up page delivery.
|
20 |
|
21 |
<em>Want more control? </em><strong>Async JavaScript Pro</strong> allows you to:
|
22 |
|
37 |
|
38 |
== Frequently Asked Questions ==
|
39 |
|
40 |
+
= Which browsers support the 'async' and 'defer' attributes =
|
41 |
|
42 |
The 'async' attribute is new in HTML5. It is supported by the following browsers:
|
43 |
|
53 |
|
54 |
= What information should I include when requesting support =
|
55 |
|
56 |
+
* A description of the problem, including screenshots and information from your browser's debug console
|
57 |
* URL of your blog (you can turn Async JavaScript off, but should be willing to turn it briefly on to have the error visible)
|
58 |
* your Async JavaScript settings (including a description of changes you made to the configuration to try to troubleshoot yourself)
|
59 |
* the Theme used (including the Theme's download link)
|
66 |
|
67 |
== Screenshots ==
|
68 |
|
69 |
+
Coming soon!
|
70 |
|
71 |
== Changelog ==
|
72 |
|
73 |
+
= 1.17.01.14 =
|
74 |
+
|
75 |
+
* MOD: Update readme.txt information
|
76 |
+
|
77 |
= 1.16.12.12 =
|
78 |
|
79 |
* MOD: WordPress 4.7 Support
|