Async JavaScript - Version 2.17.06.13

Version Description

  • MOD: Dashboard Widget and Notices only available to Administrators
Download this release

Release Info

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

Code changes from version 2.17.05.07 to 2.17.06.13

async-javascript.php CHANGED
@@ -4,7 +4,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
  Plugin Name: Async JavaScript
5
  Plugin URI: https://cloughit.com.au/product/async-javascript/
6
  Description: Async JavaScript adds a 'async' or 'defer' attribute to scripts loaded via wp_enqueue_script
7
- Version: 2.17.05.07
8
  Author: Clough I.T. Solutions
9
  Author URI: http://www.cloughit.com.au/
10
  Text Domain: async-javascript
@@ -26,7 +26,7 @@ function aj_admin_init() {
26
  define( 'AJ_ADMIN_URL', trailingslashit( admin_url() ) );
27
  define( 'AJ_PLUGIN_URL', trailingslashit( plugin_dir_url( __FILE__ ) ) );
28
  define( 'AJ_PLUGIN_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
29
- define( 'AJ_VERSION', '2.17.05.07' );
30
  require_once( AJ_PLUGIN_DIR . 'lib/gtmetrix/class.Services_WTF_Test.php' );
31
  }
32
  /**
@@ -64,17 +64,19 @@ function aj_enqueue_scripts() {
64
  */
65
  add_action( 'wp_dashboard_setup', 'register_aj_dashboard_widget' );
66
  function register_aj_dashboard_widget() {
67
- global $wp_meta_boxes;
68
- wp_add_dashboard_widget(
69
- 'aj_dashboard_widget',
70
- AJ_TITLE,
71
- 'aj_dashboard_widget'
72
- );
73
- $dashboard = $wp_meta_boxes['dashboard']['normal']['core'];
74
- $my_widget = array( 'aj_dashboard_widget' => $dashboard['aj_dashboard_widget'] );
75
- unset( $dashboard['aj_dashboard_widget'] );
76
- $sorted_dashboard = array_merge( $my_widget, $dashboard );
77
- $wp_meta_boxes['dashboard']['normal']['core'] = $sorted_dashboard;
 
 
78
  }
79
  /**
80
  * aj_dashboard_widget()
@@ -190,7 +192,7 @@ function aj_dashboard_widget() {
190
  */
191
  add_action( 'admin_notices', 'async_javascript_upgrade_notice' );
192
  function async_javascript_upgrade_notice() {
193
- if ( is_admin() ) {
194
  $options = array(
195
  'timeout' => 10, //seconds
196
  'headers' => array(
4
  Plugin Name: Async JavaScript
5
  Plugin URI: https://cloughit.com.au/product/async-javascript/
6
  Description: Async JavaScript adds a 'async' or 'defer' attribute to scripts loaded via wp_enqueue_script
7
+ Version: 2.17.06.13
8
  Author: Clough I.T. Solutions
9
  Author URI: http://www.cloughit.com.au/
10
  Text Domain: async-javascript
26
  define( 'AJ_ADMIN_URL', trailingslashit( admin_url() ) );
27
  define( 'AJ_PLUGIN_URL', trailingslashit( plugin_dir_url( __FILE__ ) ) );
28
  define( 'AJ_PLUGIN_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
29
+ define( 'AJ_VERSION', '2.17.06.13' );
30
  require_once( AJ_PLUGIN_DIR . 'lib/gtmetrix/class.Services_WTF_Test.php' );
31
  }
32
  /**
64
  */
65
  add_action( 'wp_dashboard_setup', 'register_aj_dashboard_widget' );
66
  function register_aj_dashboard_widget() {
67
+ if ( current_user_can( 'manage_options' ) ) {
68
+ global $wp_meta_boxes;
69
+ wp_add_dashboard_widget(
70
+ 'aj_dashboard_widget',
71
+ AJ_TITLE,
72
+ 'aj_dashboard_widget'
73
+ );
74
+ $dashboard = $wp_meta_boxes['dashboard']['normal']['core'];
75
+ $my_widget = array( 'aj_dashboard_widget' => $dashboard['aj_dashboard_widget'] );
76
+ unset( $dashboard['aj_dashboard_widget'] );
77
+ $sorted_dashboard = array_merge( $my_widget, $dashboard );
78
+ $wp_meta_boxes['dashboard']['normal']['core'] = $sorted_dashboard;
79
+ }
80
  }
81
  /**
82
  * aj_dashboard_widget()
192
  */
193
  add_action( 'admin_notices', 'async_javascript_upgrade_notice' );
194
  function async_javascript_upgrade_notice() {
195
+ if ( is_admin() && current_user_can( 'manage_options' ) ) {
196
  $options = array(
197
  'timeout' => 10, //seconds
198
  'headers' => array(
images/clock_fast_times_text_10762.gif ADDED
Binary file
readme.txt CHANGED
@@ -3,8 +3,8 @@ 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.4
7
- Stable tag: 2.17.05.07
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -101,6 +101,10 @@ Coming soon!
101
 
102
  == Changelog ==
103
 
 
 
 
 
104
  = 2.17.05.07 =
105
 
106
  * MOD: Remove front facing JS and CSS as not needed
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.8
7
+ Stable tag: 2.17.06.13
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
101
 
102
  == Changelog ==
103
 
104
+ = 2017.06.13 =
105
+
106
+ * MOD: Dashboard Widget and Notices only available to Administrators
107
+
108
  = 2.17.05.07 =
109
 
110
  * MOD: Remove front facing JS and CSS as not needed