Async JavaScript - Version 1.16.10.24

Version Description

  • AD: Crazy One Week Sale
Download this release

Release Info

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

Code changes from version 1.16.09.30 to 1.16.10.24

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.16.09.30
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.16.09.30' );
27
  wp_register_style(
28
  'aj_admin_styles',
29
  plugins_url( '/css/admin.css', __FILE__ )
@@ -47,6 +47,23 @@ function aj_admin_init() {
47
  $autoptimize_enabled = get_option( 'autoptimize_enabled' );
48
  $aj_autoptimize_enabled = get_option( 'aj_autoptimize_enabled' );
49
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  /**
51
  * async_javascript_menu()
52
  *
@@ -178,7 +195,19 @@ function async_javascript_admin() {
178
  <?php submit_button(); ?>
179
  </td>
180
  <td style="width:25%;vertical-align: top;">
181
- <a href="https://cloughit.com.au/product/async-javascript-pro/" target="_blank"><img src="https://www.cloughit.com.au/wp-content/uploads/async-javascript-pro.jpg" style="max-width:100%;"></a>
 
 
 
 
 
 
 
 
 
 
 
 
182
  <h2>Need Some Help?</h2>
183
  <p>Lodge a support request at <a href="https://cloughit.com.au/support/?wpsc_category=8" target="_blank">https://cloughit.com.au/support/</a></p>
184
  </td>
@@ -260,4 +289,9 @@ function my_autoptimize_defer( $defer ) {
260
  }
261
  }
262
  }
 
 
 
 
 
263
  ?>
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.16.10.24
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.16.10.24' );
27
  wp_register_style(
28
  'aj_admin_styles',
29
  plugins_url( '/css/admin.css', __FILE__ )
47
  $autoptimize_enabled = get_option( 'autoptimize_enabled' );
48
  $aj_autoptimize_enabled = get_option( 'aj_autoptimize_enabled' );
49
  }
50
+ /**
51
+ * async_javascript_menu()
52
+ *
53
+ * register admin menu
54
+ *
55
+ * @param n/a
56
+ * @return n/a
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
+ $time = current_time( 'timestamp', 1 );
62
+ $exp = strtotime( '2016-11-01 00:00:01' );
63
+ if ( $aj_upgrade_notice != AJ_VERSION && $time < $exp ) {
64
+ echo '<div class="notice notice-info is-dismissible aj-upgrade-notice"><p><em><strong>Crazy One Week Sale!</strong></em> Get Async Javascript Pro for AUD $10.00 (normally AUD $35.00). <strong>Save AUD $25.00!!!</strong> Offer ends 31st Oct 2016. <a href="http://cloughit.com.au/product/async-javascript-pro/" target="_blank">Read more...</a></p></div>';
65
+ }
66
+ }
67
  /**
68
  * async_javascript_menu()
69
  *
195
  <?php submit_button(); ?>
196
  </td>
197
  <td style="width:25%;vertical-align: top;">
198
+ <?php
199
+ $time = current_time( 'timestamp', 1 );
200
+ $exp = strtotime( '2016-11-01 00:00:01' );
201
+ if ( $time < $exp ) {
202
+ ?>
203
+ <a href="https://cloughit.com.au/product/async-javascript-pro/" target="_blank"><img src="https://www.cloughit.com.au/wp-content/uploads/crazy-one-week-sale.jpg" style="max-width:100%;"></a>
204
+ <?
205
+ } else {
206
+ ?>
207
+ <a href="https://cloughit.com.au/product/async-javascript-pro/" target="_blank"><img src="https://www.cloughit.com.au/wp-content/uploads/async-javascript-pro.jpg" style="max-width:100%;"></a>
208
+ <?php
209
+ }
210
+ ?>
211
  <h2>Need Some Help?</h2>
212
  <p>Lodge a support request at <a href="https://cloughit.com.au/support/?wpsc_category=8" target="_blank">https://cloughit.com.au/support/</a></p>
213
  </td>
289
  }
290
  }
291
  }
292
+ add_action( 'wp_ajax_async_javascript_dismiss_upgrade', 'async_javascript_dismiss_upgrade' );
293
+ function async_javascript_dismiss_upgrade() {
294
+ update_option( 'aj_upgrade_notice', AJ_VERSION );
295
+ die();
296
+ }
297
  ?>
images/crazy-one-week-sale.jpg ADDED
Binary file
js/admin.js CHANGED
@@ -36,7 +36,7 @@ jQuery(document).ready(function() {
36
  isChecked();
37
  });
38
 
39
- jQuery(document).on('click','.aj-upgrade-notice',function() {
40
  jQuery.ajax({
41
  url: aj.ajaxurl,
42
  data: {
36
  isChecked();
37
  });
38
 
39
+ jQuery(document).on('click','.aj-upgrade-notice .notice-dismiss',function() {
40
  jQuery.ajax({
41
  url: aj.ajaxurl,
42
  data: {
readme.txt CHANGED
@@ -70,6 +70,10 @@ Please lodge a support request at <a href="https://cloughit.com.au/support/?wpsc
70
 
71
  == Changelog ==
72
 
 
 
 
 
73
  = 1.16.09.30 =
74
 
75
  * MOD: Better detection of jQuery core file
70
 
71
  == Changelog ==
72
 
73
+ = 1.16.10.24 =
74
+
75
+ * AD: Crazy One Week Sale
76
+
77
  = 1.16.09.30 =
78
 
79
  * MOD: Better detection of jQuery core file