Autoptimize - Version 2.7.1

Version Description

  • A couple of small bugfixes, see the GitHub commit log.
Download this release

Release Info

Developer futtta
Plugin Icon 128x128 Autoptimize
Version 2.7.1
Comparing to
See all releases

Code changes from version 2.7.0 to 2.7.1

autoptimize.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Autoptimize
4
  * Plugin URI: https://autoptimize.com/
5
  * Description: Makes your site faster by optimizing CSS, JS, Images, Google fonts and more.
6
- * Version: 2.7.0
7
  * Author: Frank Goossens (futtta)
8
  * Author URI: https://autoptimize.com/
9
  * Text Domain: autoptimize
@@ -20,7 +20,7 @@ if ( ! defined( 'ABSPATH' ) ) {
20
  exit;
21
  }
22
 
23
- define( 'AUTOPTIMIZE_PLUGIN_VERSION', '2.7.0' );
24
 
25
  // plugin_dir_path() returns the trailing slash!
26
  define( 'AUTOPTIMIZE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
3
  * Plugin Name: Autoptimize
4
  * Plugin URI: https://autoptimize.com/
5
  * Description: Makes your site faster by optimizing CSS, JS, Images, Google fonts and more.
6
+ * Version: 2.7.1
7
  * Author: Frank Goossens (futtta)
8
  * Author URI: https://autoptimize.com/
9
  * Text Domain: autoptimize
20
  exit;
21
  }
22
 
23
+ define( 'AUTOPTIMIZE_PLUGIN_VERSION', '2.7.1' );
24
 
25
  // plugin_dir_path() returns the trailing slash!
26
  define( 'AUTOPTIMIZE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
classes/autoptimizeCriticalCSSBase.php CHANGED
@@ -136,18 +136,20 @@ class autoptimizeCriticalCSSBase {
136
  }
137
 
138
  public function on_upgrade() {
 
 
139
  // Create the cache directory if it doesn't exist already.
140
  if ( ! file_exists( AO_CCSS_DIR ) ) {
141
  mkdir( AO_CCSS_DIR, 0755, true );
142
  }
143
 
144
  // Create a scheduled event for the queue.
145
- if ( ! wp_next_scheduled( 'ao_ccss_queue' ) ) {
146
  wp_schedule_event( time(), apply_filters( 'ao_ccss_queue_schedule', 'ao_ccss' ), 'ao_ccss_queue' );
147
  }
148
 
149
  // Create a scheduled event for log maintenance.
150
- if ( ! wp_next_scheduled( 'ao_ccss_maintenance' ) ) {
151
  wp_schedule_event( time(), 'twicedaily', 'ao_ccss_maintenance' );
152
  }
153
  }
136
  }
137
 
138
  public function on_upgrade() {
139
+ global $ao_ccss_key;
140
+
141
  // Create the cache directory if it doesn't exist already.
142
  if ( ! file_exists( AO_CCSS_DIR ) ) {
143
  mkdir( AO_CCSS_DIR, 0755, true );
144
  }
145
 
146
  // Create a scheduled event for the queue.
147
+ if ( isset( $ao_ccss_key ) && ! empty( $ao_ccss_key ) && ! wp_next_scheduled( 'ao_ccss_queue' ) ) {
148
  wp_schedule_event( time(), apply_filters( 'ao_ccss_queue_schedule', 'ao_ccss' ), 'ao_ccss_queue' );
149
  }
150
 
151
  // Create a scheduled event for log maintenance.
152
+ if ( isset( $ao_ccss_key ) && ! empty( $ao_ccss_key ) && ! wp_next_scheduled( 'ao_ccss_maintenance' ) ) {
153
  wp_schedule_event( time(), 'twicedaily', 'ao_ccss_maintenance' );
154
  }
155
  }
classes/autoptimizeCriticalCSSCron.php CHANGED
@@ -773,7 +773,7 @@ class autoptimizeCriticalCSSCron {
773
  }
774
  }
775
 
776
- public static function ao_ccss_cleaning() {
777
  // Perform plugin maintenance
778
  // Truncate log file >= 1MB .
779
  if ( file_exists( AO_CCSS_LOG ) ) {
773
  }
774
  }
775
 
776
+ public function ao_ccss_cleaning() {
777
  // Perform plugin maintenance
778
  // Truncate log file >= 1MB .
779
  if ( file_exists( AO_CCSS_LOG ) ) {
classes/autoptimizeScripts.php CHANGED
@@ -208,13 +208,13 @@ class autoptimizeScripts extends autoptimizeBase
208
  // only optimize known good JS?
209
  $whitelist_js = apply_filters( 'autoptimize_filter_js_whitelist', '', $this->content );
210
  if ( ! empty( $whitelist_js ) ) {
211
- $this->whitelist = array_filter( array_map( 'trim', explode( ', ', $whitelist_js ) ) );
212
  }
213
 
214
  // is there JS we should simply remove?
215
  $removable_js = apply_filters( 'autoptimize_filter_js_removables', '', $this->content );
216
  if ( ! empty( $removable_js ) ) {
217
- $this->jsremovables = array_filter( array_map( 'trim', explode( ', ', $removable_js ) ) );
218
  }
219
 
220
  // only header?
@@ -267,7 +267,7 @@ class autoptimizeScripts extends autoptimizeBase
267
  }
268
  $excl_js_arr = array_keys( $exclude_js );
269
  } else {
270
- $excl_js_arr = array_filter( array_map( 'trim', explode( ', ', $exclude_js ) ) );
271
  }
272
  $this->dontmove = array_merge( $excl_js_arr, $this->dontmove );
273
  }
208
  // only optimize known good JS?
209
  $whitelist_js = apply_filters( 'autoptimize_filter_js_whitelist', '', $this->content );
210
  if ( ! empty( $whitelist_js ) ) {
211
+ $this->whitelist = array_filter( array_map( 'trim', explode( ',', $whitelist_js ) ) );
212
  }
213
 
214
  // is there JS we should simply remove?
215
  $removable_js = apply_filters( 'autoptimize_filter_js_removables', '', $this->content );
216
  if ( ! empty( $removable_js ) ) {
217
+ $this->jsremovables = array_filter( array_map( 'trim', explode( ',', $removable_js ) ) );
218
  }
219
 
220
  // only header?
267
  }
268
  $excl_js_arr = array_keys( $exclude_js );
269
  } else {
270
+ $excl_js_arr = array_filter( array_map( 'trim', explode( ',', $exclude_js ) ) );
271
  }
272
  $this->dontmove = array_merge( $excl_js_arr, $this->dontmove );
273
  }
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: http://blog.futtta.be/2013/10/21/do-not-donate-to-me/
5
  Requires at least: 4.9
6
  Tested up to: 5.4
7
  Requires PHP: 5.6
8
- Stable tag: 2.7.0
9
 
10
  Autoptimize speeds up your website by optimizing JS, CSS, images (incl. lazy-load), HTML and Google Fonts, asyncing JS, removing emoji cruft and more.
11
 
@@ -295,6 +295,9 @@ Just [fork Autoptimize on Github](https://github.com/futtta/autoptimize) and cod
295
 
296
  == Changelog ==
297
 
 
 
 
298
  = 2.7.0 =
299
  * Integration of critical CSS power-up.
300
  * New option to ensure missing autoptimized files are served with fallback JS/ CSS.
5
  Requires at least: 4.9
6
  Tested up to: 5.4
7
  Requires PHP: 5.6
8
+ Stable tag: 2.7.1
9
 
10
  Autoptimize speeds up your website by optimizing JS, CSS, images (incl. lazy-load), HTML and Google Fonts, asyncing JS, removing emoji cruft and more.
11
 
295
 
296
  == Changelog ==
297
 
298
+ = 2.7.1 =
299
+ * A couple of small bugfixes, see the [GitHub commit log](https://github.com/futtta/autoptimize/commits/beta).
300
+
301
  = 2.7.0 =
302
  * Integration of critical CSS power-up.
303
  * New option to ensure missing autoptimized files are served with fallback JS/ CSS.