EWWW Image Optimizer - Version 6.1.3

Version Description

  • changed: bulk optimizer no longer skips image types set to "no compression" in WebP-only mode
  • fixed: CNAME setting from WP Offload Media triggers "unknown" error in Easy IO
  • fixed: missing EIO_LL_THRESHOLD variable for minified JS
Download this release

Release Info

Developer nosilver4u
Plugin Icon 128x128 EWWW Image Optimizer
Version 6.1.3
Comparing to
See all releases

Code changes from version 6.1.2 to 6.1.3

bulk.php CHANGED
@@ -1128,7 +1128,7 @@ function ewww_image_optimizer_media_scan( $hook = '' ) {
1128
  ewwwio_debug_message( "missing mime for $selected_id" );
1129
  }
1130
 
1131
- if ( ! in_array( $mime, $enabled_types, true ) ) {
1132
  $skipped_ids[] = $selected_id;
1133
  continue;
1134
  }
1128
  ewwwio_debug_message( "missing mime for $selected_id" );
1129
  }
1130
 
1131
+ if ( ! in_array( $mime, $enabled_types, true ) && empty( $ewww_webp_only ) ) {
1132
  $skipped_ids[] = $selected_id;
1133
  continue;
1134
  }
changelog.txt CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  = 6.1.2 =
2
  * fixed: bug from bypass/exclusion code for bulk scanner in 6.1.1
3
  * fixed: running is_file on system binaries may trigger open_basedir warnings, use EWWWIO_OPEN_BASEDIR to override PHP's open_basedir restriction
1
+ = 6.1.3 =
2
+ * changed: bulk optimizer no longer skips image types set to "no compression" in WebP-only mode
3
+ * fixed: CNAME setting from WP Offload Media triggers "unknown" error in Easy IO
4
+ * fixed: missing EIO_LL_THRESHOLD variable for minified JS
5
+
6
  = 6.1.2 =
7
  * fixed: bug from bypass/exclusion code for bulk scanner in 6.1.1
8
  * fixed: running is_file on system binaries may trigger open_basedir warnings, use EWWWIO_OPEN_BASEDIR to override PHP's open_basedir restriction
classes/class-eio-lazy-load.php CHANGED
@@ -949,7 +949,8 @@ if ( ! class_exists( 'EIO_Lazy_Load' ) ) {
949
  */
950
  function no_js_css() {
951
  echo '<noscript><style>.lazyload[data-src]{display:none !important;}</style></noscript>';
952
- echo '<style>.lazyload{background-image:none !important;}</style>';
 
953
  }
954
 
955
  /**
@@ -993,12 +994,14 @@ if ( ! class_exists( 'EIO_Lazy_Load' ) ) {
993
  if ( defined( strtoupper( $this->prefix ) . 'LAZY_PRINT' ) && constant( strtoupper( $this->prefix ) . 'LAZY_PRINT' ) ) {
994
  wp_enqueue_script( 'eio-lazy-load-print', plugins_url( '/includes/ls.print.min.js', $plugin_file ), array(), $this->version );
995
  }
 
996
  wp_localize_script(
997
  'eio-lazy-load',
998
  'eio_lazy_vars',
999
  array(
1000
  'exactdn_domain' => ( $this->parsing_exactdn ? $this->exactdn_domain : '' ),
1001
  'skip_autoscale' => ( defined( 'EIO_LL_AUTOSCALE' ) && ! EIO_LL_AUTOSCALE ? 1 : 0 ),
 
1002
  )
1003
  );
1004
  }
949
  */
950
  function no_js_css() {
951
  echo '<noscript><style>.lazyload[data-src]{display:none !important;}</style></noscript>';
952
+ // And this allows us to lazy load external/internal CSS background images.
953
+ echo '<style>.lazyload{background-image:none !important;}.lazyload:before{background-image:none !important;}</style>';
954
  }
955
 
956
  /**
994
  if ( defined( strtoupper( $this->prefix ) . 'LAZY_PRINT' ) && constant( strtoupper( $this->prefix ) . 'LAZY_PRINT' ) ) {
995
  wp_enqueue_script( 'eio-lazy-load-print', plugins_url( '/includes/ls.print.min.js', $plugin_file ), array(), $this->version );
996
  }
997
+ $threshold = defined( 'EIO_LL_THRESHOLD' ) && EIO_LL_THRESHOLD ? EIO_LL_THRESHOLD : 0;
998
  wp_localize_script(
999
  'eio-lazy-load',
1000
  'eio_lazy_vars',
1001
  array(
1002
  'exactdn_domain' => ( $this->parsing_exactdn ? $this->exactdn_domain : '' ),
1003
  'skip_autoscale' => ( defined( 'EIO_LL_AUTOSCALE' ) && ! EIO_LL_AUTOSCALE ? 1 : 0 ),
1004
+ 'threshold' => (int) $threshold > 50 ? (int) $threshold : 0,
1005
  )
1006
  );
1007
  }
classes/class-exactdn.php CHANGED
@@ -305,6 +305,8 @@ if ( ! class_exists( 'ExactDN' ) ) {
305
  $this->debug_message( '<b>' . __METHOD__ . '()</b>' );
306
 
307
  if ( $this->is_as3cf_cname_active() ) {
 
 
308
  add_action( 'admin_notices', $this->prefix . 'notice_exactdn_as3cf_cname_active' );
309
  return false;
310
  }
305
  $this->debug_message( '<b>' . __METHOD__ . '()</b>' );
306
 
307
  if ( $this->is_as3cf_cname_active() ) {
308
+ global $exactdn_activate_error;
309
+ $exactdn_activate_error = 'as3cf_cname_active';
310
  add_action( 'admin_notices', $this->prefix . 'notice_exactdn_as3cf_cname_active' );
311
  return false;
312
  }
common.php CHANGED
@@ -14,7 +14,7 @@ if ( ! defined( 'ABSPATH' ) ) {
14
  exit;
15
  }
16
 
17
- define( 'EWWW_IMAGE_OPTIMIZER_VERSION', '612' );
18
 
19
  // Initialize a couple globals.
20
  $eio_debug = '';
@@ -4377,15 +4377,19 @@ function ewww_image_optimizer_exactdn_activate_ajax() {
4377
  if ( empty( $exactdn_activate_error ) ) {
4378
  $exactdn_activate_error = 'error unknown';
4379
  }
 
 
 
 
 
 
 
 
 
4380
  die(
4381
  wp_json_encode(
4382
  array(
4383
- 'error' => sprintf(
4384
- /* translators: 1: A link to the documentation 2: the error message/details */
4385
- esc_html__( 'Could not activate Easy IO, please try again in a few minutes. If this error continues, please see %1$s for troubleshooting steps: %2$s', 'ewww-image-optimizer' ),
4386
- 'https://docs.ewww.io/article/66-exactdn-not-verified',
4387
- '<code>' . esc_html( $exactdn_activate_error ) . '</code>'
4388
- ),
4389
  )
4390
  )
4391
  );
@@ -6302,14 +6306,22 @@ function ewww_image_optimizer_remote_fetch( $id, $meta ) {
6302
  ewwwio_debug_message( "unfiltered fullsize path: $filename" );
6303
  $temp_file = download_url( $full_url );
6304
  if ( ! is_wp_error( $temp_file ) ) {
 
6305
  if ( ! is_dir( dirname( $filename ) ) ) {
6306
  wp_mkdir_p( dirname( $filename ) );
6307
  }
6308
- if ( ! ewwwio_is_file( $filename ) ) {
 
6309
  ewwwio_rename( $temp_file, $filename );
 
 
6310
  } else {
 
6311
  unlink( $temp_file );
6312
  }
 
 
 
6313
  }
6314
  $base_dir = trailingslashit( dirname( $filename ) );
6315
  // Original image detected.
@@ -6464,8 +6476,10 @@ function ewww_image_optimizer_remote_fetch( $id, $meta ) {
6464
  } // End if().
6465
  clearstatcache();
6466
  if ( ! empty( $filename ) && ewwwio_is_file( $filename ) ) {
 
6467
  return $filename;
6468
  } else {
 
6469
  return false;
6470
  }
6471
  }
14
  exit;
15
  }
16
 
17
+ define( 'EWWW_IMAGE_OPTIMIZER_VERSION', '613' );
18
 
19
  // Initialize a couple globals.
20
  $eio_debug = '';
4377
  if ( empty( $exactdn_activate_error ) ) {
4378
  $exactdn_activate_error = 'error unknown';
4379
  }
4380
+ $error_message = sprintf(
4381
+ /* translators: 1: A link to the documentation 2: the error message/details */
4382
+ esc_html__( 'Could not activate Easy IO, please try again in a few minutes. If this error continues, please see %1$s for troubleshooting steps: %2$s', 'ewww-image-optimizer' ),
4383
+ 'https://docs.ewww.io/article/66-exactdn-not-verified',
4384
+ '<code>' . esc_html( $exactdn_activate_error ) . '</code>'
4385
+ );
4386
+ if ( 'as3cf_cname_active' === $exactdn_activate_error ) {
4387
+ $error_message = esc_html__( 'Easy IO cannot optimize your images while using a custom domain (CNAME) in WP Offload Media. Please disable the custom domain in the WP Offload Media settings.', 'ewww-image-optimizer' );
4388
+ }
4389
  die(
4390
  wp_json_encode(
4391
  array(
4392
+ 'error' => $error_message,
 
 
 
 
 
4393
  )
4394
  )
4395
  );
6306
  ewwwio_debug_message( "unfiltered fullsize path: $filename" );
6307
  $temp_file = download_url( $full_url );
6308
  if ( ! is_wp_error( $temp_file ) ) {
6309
+ ewwwio_debug_message( "downloaded to $temp_file" );
6310
  if ( ! is_dir( dirname( $filename ) ) ) {
6311
  wp_mkdir_p( dirname( $filename ) );
6312
  }
6313
+ if ( ! ewwwio_is_file( $filename ) && is_writable( dirname( $filename ) ) ) {
6314
+ ewwwio_debug_message( "renaming $temp_file to $filename" );
6315
  ewwwio_rename( $temp_file, $filename );
6316
+ } elseif ( ! is_writable( dirname( $filename ) ) ) {
6317
+ ewwwio_debug_message( 'destination dir not writable' );
6318
  } else {
6319
+ ewwwio_debug_message( 'file already found, nuking temp file' );
6320
  unlink( $temp_file );
6321
  }
6322
+ if ( ! ewwwio_is_file( $filename ) ) {
6323
+ ewwwio_debug_message( 'download failed' );
6324
+ }
6325
  }
6326
  $base_dir = trailingslashit( dirname( $filename ) );
6327
  // Original image detected.
6476
  } // End if().
6477
  clearstatcache();
6478
  if ( ! empty( $filename ) && ewwwio_is_file( $filename ) ) {
6479
+ ewwwio_debug_message( "$filename found, success!" );
6480
  return $filename;
6481
  } else {
6482
+ ewwwio_debug_message( "$filename not found, boo..." );
6483
  return false;
6484
  }
6485
  }
ewww-image-optimizer.php CHANGED
@@ -13,7 +13,7 @@ Plugin Name: EWWW Image Optimizer
13
  Plugin URI: https://wordpress.org/plugins/ewww-image-optimizer/
14
  Description: Reduce file sizes for images within WordPress including NextGEN Gallery and GRAND FlAGallery. Uses jpegtran, optipng/pngout, and gifsicle.
15
  Author: Exactly WWW
16
- Version: 6.1.2
17
  Author URI: https://ewww.io/
18
  License: GPLv3
19
  */
13
  Plugin URI: https://wordpress.org/plugins/ewww-image-optimizer/
14
  Description: Reduce file sizes for images within WordPress including NextGEN Gallery and GRAND FlAGallery. Uses jpegtran, optipng/pngout, and gifsicle.
15
  Author: Exactly WWW
16
+ Version: 6.1.3
17
  Author URI: https://ewww.io/
18
  License: GPLv3
19
  */
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: optimize, image, convert, webp, resize, compress, lazy load, optimization,
5
  Requires at least: 5.4
6
  Tested up to: 5.7
7
  Requires PHP: 7.1
8
- Stable tag: 6.1.2
9
  License: GPLv3
10
 
11
  Smaller Images, Faster Sites, Happier Visitors. Comprehensive image optimization that doesn't require a degree in rocket science.
@@ -132,6 +132,11 @@ That's not a question, but since I made it up, I'll answer it. See this resource
132
  * Feature requests can be viewed and submitted on our [feedback portal](https://feedback.ewww.io)
133
  * If you would like to help translate this plugin in your language, [join the team](https://translate.wordpress.org/projects/wp-plugins/ewww-image-optimizer/)
134
 
 
 
 
 
 
135
  = 6.1.2 =
136
  * fixed: bug from bypass/exclusion code for bulk scanner in 6.1.1
137
  * fixed: running is_file on system binaries may trigger open_basedir warnings, use EWWWIO_OPEN_BASEDIR to override PHP's open_basedir restriction
5
  Requires at least: 5.4
6
  Tested up to: 5.7
7
  Requires PHP: 7.1
8
+ Stable tag: 6.1.3
9
  License: GPLv3
10
 
11
  Smaller Images, Faster Sites, Happier Visitors. Comprehensive image optimization that doesn't require a degree in rocket science.
132
  * Feature requests can be viewed and submitted on our [feedback portal](https://feedback.ewww.io)
133
  * If you would like to help translate this plugin in your language, [join the team](https://translate.wordpress.org/projects/wp-plugins/ewww-image-optimizer/)
134
 
135
+ = 6.1.3 =
136
+ * changed: bulk optimizer no longer skips image types set to "no compression" in WebP-only mode
137
+ * fixed: CNAME setting from WP Offload Media triggers "unknown" error in Easy IO
138
+ * fixed: missing EIO_LL_THRESHOLD variable for minified JS
139
+
140
  = 6.1.2 =
141
  * fixed: bug from bypass/exclusion code for bulk scanner in 6.1.1
142
  * fixed: running is_file on system binaries may trigger open_basedir warnings, use EWWWIO_OPEN_BASEDIR to override PHP's open_basedir restriction