EWWW Image Optimizer - Version 4.6.2

Version Description

  • changed: API key may be defined as EWWW_IMAGE_OPTIMIZER_CLOUD_KEY
  • fixed: if img tag is missing dimensions, ExactDN sometimes loads original rather than existing thumbnail
  • fixed: TinyPNG/TinyJPG images skipped when Force Re-optimize is checked
Download this release

Release Info

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

Code changes from version 4.6.1 to 4.6.2

bulk.php CHANGED
@@ -681,6 +681,7 @@ function ewww_image_optimizer_media_scan( $hook = '' ) {
681
  }
682
  global $optimized_list;
683
  /* $queued_ids = array(); */
 
684
  $image_count = 0;
685
  $attachments_processed = 0;
686
  $attachment_query = '';
@@ -817,8 +818,11 @@ function ewww_image_optimizer_media_scan( $hook = '' ) {
817
  ewww_image_optimizer_delete_queued_image( $selected_id );
818
  continue;
819
  }
820
- if ( ! empty( $attachment_meta[ $selected_id ]['tinypng'] ) ) {
821
  ewwwio_debug_message( "TinyPNG already compressed $selected_id" );
 
 
 
822
  ewww_image_optimizer_delete_queued_image( $selected_id );
823
  continue;
824
  }
@@ -1262,6 +1266,7 @@ function ewww_image_optimizer_media_scan( $hook = '' ) {
1262
  'remaining' => sprintf( esc_html__( 'Stage 1, %d images left to scan.', 'ewww-image-optimizer' ), $remaining ) . "&nbsp;<img src='$loading_image' />",
1263
  'notice' => $notice,
1264
  'bad_attachment' => $bad_attachment,
 
1265
  )
1266
  )
1267
  );
@@ -1273,6 +1278,7 @@ function ewww_image_optimizer_media_scan( $hook = '' ) {
1273
  'remaining' => esc_html__( 'Stage 2, please wait.', 'ewww-image-optimizer' ) . "&nbsp;<img src='$loading_image' />",
1274
  'notice' => $notice,
1275
  'bad_attachment' => $bad_attachment,
 
1276
  )
1277
  )
1278
  );
681
  }
682
  global $optimized_list;
683
  /* $queued_ids = array(); */
684
+ $tiny_notice = '';
685
  $image_count = 0;
686
  $attachments_processed = 0;
687
  $attachment_query = '';
818
  ewww_image_optimizer_delete_queued_image( $selected_id );
819
  continue;
820
  }
821
+ if ( ! empty( $attachment_meta[ $selected_id ]['tinypng'] ) && empty( $_REQUEST['ewww_force'] ) ) {
822
  ewwwio_debug_message( "TinyPNG already compressed $selected_id" );
823
+ if ( ! $tiny_notice ) {
824
+ $tiny_notice = esc_html__( 'Images compressed by TinyJPG and TinyPNG have been skipped, refresh and use the Force Re-optimize option to override.', 'ewww-image-optimizer' );
825
+ }
826
  ewww_image_optimizer_delete_queued_image( $selected_id );
827
  continue;
828
  }
1266
  'remaining' => sprintf( esc_html__( 'Stage 1, %d images left to scan.', 'ewww-image-optimizer' ), $remaining ) . "&nbsp;<img src='$loading_image' />",
1267
  'notice' => $notice,
1268
  'bad_attachment' => $bad_attachment,
1269
+ 'tiny_skip' => $tiny_notice,
1270
  )
1271
  )
1272
  );
1278
  'remaining' => esc_html__( 'Stage 2, please wait.', 'ewww-image-optimizer' ) . "&nbsp;<img src='$loading_image' />",
1279
  'notice' => $notice,
1280
  'bad_attachment' => $bad_attachment,
1281
+ 'tiny_skip' => $tiny_notice,
1282
  )
1283
  )
1284
  );
changelog.txt CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  = 4.6.1 =
2
  * added: automatic configuration for ExactDN + WP Offload Media
3
  * fixed: bulk action from media library skipping last attachment in selection
1
+ = 4.6.2 =
2
+ * changed: API key may be defined as EWWW_IMAGE_OPTIMIZER_CLOUD_KEY
3
+ * fixed: if img tag is missing dimensions, ExactDN sometimes loads original rather than existing thumbnail
4
+ * fixed: TinyPNG/TinyJPG images skipped when Force Re-optimize is checked
5
+
6
  = 4.6.1 =
7
  * added: automatic configuration for ExactDN + WP Offload Media
8
  * fixed: bulk action from media library skipping last attachment in selection
classes/class-exactdn.php CHANGED
@@ -834,6 +834,10 @@ class ExactDN extends EWWWIO_Page_Parser {
834
  }
835
 
836
  list( $filename_width, $filename_height ) = $this->get_dimensions_from_filename( $src );
 
 
 
 
837
  // WP Attachment ID, if uploaded to this site.
838
  preg_match( '#class=["|\']?[^"\']*wp-image-([\d]+)[^"\']*["|\']?#i', $images['img_tag'][ $index ], $attachment_id );
839
  if ( ! ewww_image_optimizer_get_option( 'exactdn_prevent_db_queries' ) && empty( $attachment_id ) ) {
@@ -881,6 +885,7 @@ class ExactDN extends EWWWIO_Page_Parser {
881
  if ( ( false !== $width && $width > $src_per_wp[1] ) || ( false !== $height && $height > $src_per_wp[2] ) ) {
882
  $width = false === $width ? false : min( $width, $src_per_wp[1] );
883
  $height = false === $height ? false : min( $height, $src_per_wp[2] );
 
884
  }
885
 
886
  // If no width and height are found, max out at source image's natural dimensions.
@@ -889,8 +894,10 @@ class ExactDN extends EWWWIO_Page_Parser {
889
  $width = $src_per_wp[1];
890
  $height = $src_per_wp[2];
891
  $transform = 'fit';
 
892
  } elseif ( isset( $size ) && array_key_exists( $size, $image_sizes ) && isset( $image_sizes[ $size ]['crop'] ) ) {
893
  $transform = (bool) $image_sizes[ $size ]['crop'] ? 'resize' : 'fit';
 
894
  }
895
  }
896
  } else {
@@ -2150,6 +2157,9 @@ class ExactDN extends EWWWIO_Page_Parser {
2150
  if ( strpos( $image_url, 'lazy-load/images/' ) ) {
2151
  return array();
2152
  }
 
 
 
2153
  return $args;
2154
  }
2155
 
834
  }
835
 
836
  list( $filename_width, $filename_height ) = $this->get_dimensions_from_filename( $src );
837
+ if ( false === $width && false === $height ) {
838
+ $width = $filename_width;
839
+ $height = $filename_height;
840
+ }
841
  // WP Attachment ID, if uploaded to this site.
842
  preg_match( '#class=["|\']?[^"\']*wp-image-([\d]+)[^"\']*["|\']?#i', $images['img_tag'][ $index ], $attachment_id );
843
  if ( ! ewww_image_optimizer_get_option( 'exactdn_prevent_db_queries' ) && empty( $attachment_id ) ) {
885
  if ( ( false !== $width && $width > $src_per_wp[1] ) || ( false !== $height && $height > $src_per_wp[2] ) ) {
886
  $width = false === $width ? false : min( $width, $src_per_wp[1] );
887
  $height = false === $height ? false : min( $height, $src_per_wp[2] );
888
+ ewwwio_debug_message( "constrained to attachment dims, w=$width and h=$height" );
889
  }
890
 
891
  // If no width and height are found, max out at source image's natural dimensions.
894
  $width = $src_per_wp[1];
895
  $height = $src_per_wp[2];
896
  $transform = 'fit';
897
+ ewwwio_debug_message( "no dims, using attachment dims, w=$width and h=$height" );
898
  } elseif ( isset( $size ) && array_key_exists( $size, $image_sizes ) && isset( $image_sizes[ $size ]['crop'] ) ) {
899
  $transform = (bool) $image_sizes[ $size ]['crop'] ? 'resize' : 'fit';
900
+ ewwwio_debug_message( 'attachment size set to crop' );
901
  }
902
  }
903
  } else {
2157
  if ( strpos( $image_url, 'lazy-load/images/' ) ) {
2158
  return array();
2159
  }
2160
+ if ( strpos( $image_url, 'public/images/spacer.' ) ) {
2161
+ return array();
2162
+ }
2163
  return $args;
2164
  }
2165
 
common.php CHANGED
@@ -23,7 +23,7 @@ if ( ! defined( 'ABSPATH' ) ) {
23
  exit;
24
  }
25
 
26
- define( 'EWWW_IMAGE_OPTIMIZER_VERSION', '461.0' );
27
 
28
  // Initialize a couple globals.
29
  $ewww_debug = '';
@@ -749,6 +749,10 @@ function ewww_image_optimizer_admin_init() {
749
  ewww_image_optimizer_cron_setup( 'ewww_image_optimizer_auto' );
750
  // Queue the function that contains custom styling for our progressbars.
751
  add_action( 'admin_enqueue_scripts', 'ewww_image_optimizer_progressbar_style' );
 
 
 
 
752
  // Alert user if multiple re-optimizations detected.
753
  add_action( 'network_admin_notices', 'ewww_image_optimizer_notice_reoptimization' );
754
  add_action( 'admin_notices', 'ewww_image_optimizer_notice_reoptimization' );
@@ -2938,7 +2942,7 @@ function ewww_image_optimizer_cloud_key_sanitize( $key ) {
2938
  ewwwio_debug_message( '<b>' . __FUNCTION__ . '()</b>' );
2939
  $key = trim( $key );
2940
  if ( ewww_image_optimizer_function_exists( 'print_r' ) ) {
2941
- ewwwio_debug_message( print_r( $_REQUEST, true ) );
2942
  }
2943
  if ( empty( $key ) ) {
2944
  return '';
@@ -3077,7 +3081,9 @@ function ewww_image_optimizer_cloud_verify( $cache = true, $api_key = '' ) {
3077
  ewww_image_optimizer_set_option( 'ewww_image_optimizer_cloud_key', '' );
3078
  }
3079
  ewwwio_debug_message( "verification success via: $url" );
 
3080
  } else {
 
3081
  if ( ! $sanitize && ! empty( $result['body'] ) && false !== strpos( $result['body'], 'invalid' ) ) {
3082
  ewww_image_optimizer_set_option( 'ewww_image_optimizer_cloud_key', '' );
3083
  }
@@ -3121,6 +3127,13 @@ function ewww_image_optimizer_cloud_post_key( $url, $key ) {
3121
  return $result;
3122
  }
3123
 
 
 
 
 
 
 
 
3124
  /**
3125
  * Checks the configured API key for quota information.
3126
  *
@@ -6922,6 +6935,12 @@ function ewww_image_optimizer_get_option( $option_name ) {
6922
  if ( defined( $constant_name ) && ( is_int( constant( $constant_name ) ) || is_bool( constant( $constant_name ) ) ) ) {
6923
  return constant( $constant_name );
6924
  }
 
 
 
 
 
 
6925
  if ( ! function_exists( 'is_plugin_active_for_network' ) && is_multisite() ) {
6926
  // Need to include the plugin library for the is_plugin_active function.
6927
  require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
@@ -7457,6 +7476,7 @@ function ewww_image_optimizer_options( $network = 'singlesite' ) {
7457
  $status_notices .= "</p>\n";
7458
  $disable_level = '';
7459
  } else {
 
7460
  if ( ! class_exists( 'ExactDN' ) && ! ewww_image_optimizer_get_option( 'ewww_image_optimizer_exactdn' ) ) {
7461
  $compress_recommendations[] = esc_html__( 'Enable premium compression with an API key or ExactDN.', 'ewww-image-optimizer' );
7462
  }
@@ -7751,6 +7771,11 @@ function ewww_image_optimizer_options( $network = 'singlesite' ) {
7751
  if ( is_multisite() && is_plugin_active_for_network( EWWW_IMAGE_OPTIMIZER_PLUGIN_FILE_REL ) && ! get_site_option( 'ewww_image_optimizer_allow_multisite_override' ) ) {
7752
  $output[] = '<i class="network-singlesite"><strong>' . esc_html__( 'Configure network-wide settings in the Network Admin.', 'ewww-image-optimizer' ) . "</strong></i>\n";
7753
  }
 
 
 
 
 
7754
  $output[] = "<div id='ewww-general-settings'>\n";
7755
  $output[] = "<table class='form-table'>\n";
7756
  if ( is_multisite() ) {
@@ -8059,19 +8084,19 @@ function ewww_image_optimizer_options( $network = 'singlesite' ) {
8059
  ewwwio_help_link( 'https://docs.ewww.io/article/16-ewww-io-and-webp-images', '5854745ac697912ffd6c1c89' ) .
8060
  "</th><td><span><input type='checkbox' id='ewww_image_optimizer_webp_force' name='ewww_image_optimizer_webp_force' value='true' " .
8061
  ( ewww_image_optimizer_get_option( 'ewww_image_optimizer_webp_force' ) == true ? "checked='true'" : '' ) . ' /> ' .
8062
- esc_html__( 'WebP images will be generated and saved for all JPG/PNG images regardless of their size. The Alternative WebP Rewriting will not check if a file exists, only that the domain matches the home url.', 'ewww-image-optimizer' ) . "</span></td></tr>\n";
8063
  ewwwio_debug_message( 'forced webp: ' . ( ewww_image_optimizer_get_option( 'ewww_image_optimizer_webp_force' ) == true ? 'on' : 'off' ) );
8064
  }
8065
  if ( ! ewww_image_optimizer_ce_webp_enabled() ) {
8066
  if ( ! ewww_image_optimizer_get_option( 'ewww_image_optimizer_exactdn' ) ) {
8067
  $webp_paths = ewww_image_optimizer_get_option( 'ewww_image_optimizer_webp_paths' ) ? esc_html( implode( "\n", ewww_image_optimizer_get_option( 'ewww_image_optimizer_webp_paths' ) ) ) : '';
8068
- $output[] = "<tr class='$network_class'><th scope='row'><label for='ewww_image_optimizer_webp_paths'>" . esc_html__( 'WebP URLs', 'ewww-image-optimizer' ) . '</label>' . ewwwio_help_link( 'https://docs.ewww.io/article/16-ewww-io-and-webp-images', '5854745ac697912ffd6c1c89' ) . '</th><td>' . esc_html__( 'If Force WebP is enabled, enter URL patterns that should be permitted for Alternative WebP Rewriting. One pattern per line, may be partial URLs, but must include the domain name.', 'ewww-image-optimizer' ) . '<br>' .
8069
  "<textarea id='ewww_image_optimizer_webp_paths' name='ewww_image_optimizer_webp_paths' rows='3' cols='60'>$webp_paths</textarea></td></tr>\n";
8070
  ewwwio_debug_message( 'webp paths:' );
8071
  ewwwio_debug_message( $webp_paths );
8072
  }
8073
  $output[] = "<tr class='$network_class'><th scope='row'><label for='ewww_image_optimizer_webp_for_cdn'>" .
8074
- esc_html__( 'Alternative WebP Rewriting', 'ewww-image-optimizer' ) .
8075
  '</label>' . ewwwio_help_link( 'https://docs.ewww.io/article/16-ewww-io-and-webp-images', '5854745ac697912ffd6c1c89,59443d162c7d3a0747cdf9f0' ) . "</th><td><span><input type='checkbox' id='ewww_image_optimizer_webp_for_cdn' name='ewww_image_optimizer_webp_for_cdn' value='true' " .
8076
  ( ewww_image_optimizer_get_option( 'ewww_image_optimizer_webp_for_cdn' ) == true ? "checked='true'" : '' ) . ' /> ' .
8077
  esc_html__( 'Use this if the Apache rewrite rules do not work, or if your images are served from a CDN.', 'ewww-image-optimizer' ) . ' ' .
@@ -8756,10 +8781,14 @@ function ewwwio_dump_var( $var, $var2 = false, $var3 = false ) {
8756
  }
8757
  ewwwio_debug_message( 'dumping var' );
8758
  ewwwio_debug_message( print_r( $var, true ) );
8759
- ewwwio_debug_message( 'dumping var2' );
8760
- ewwwio_debug_message( print_r( $var2, true ) );
8761
- ewwwio_debug_message( 'dumping var3' );
8762
- ewwwio_debug_message( print_r( $var3, true ) );
 
 
 
 
8763
  return $var;
8764
  }
8765
 
23
  exit;
24
  }
25
 
26
+ define( 'EWWW_IMAGE_OPTIMIZER_VERSION', '462.0' );
27
 
28
  // Initialize a couple globals.
29
  $ewww_debug = '';
749
  ewww_image_optimizer_cron_setup( 'ewww_image_optimizer_auto' );
750
  // Queue the function that contains custom styling for our progressbars.
751
  add_action( 'admin_enqueue_scripts', 'ewww_image_optimizer_progressbar_style' );
752
+ if ( defined( 'EWWW_IMAGE_OPTIMIZER_CLOUD_KEY' ) && get_option( 'ewww_image_optimizer_cloud_key_invalid' ) ) {
753
+ add_action( 'network_admin_notices', 'ewww_image_optimizer_notice_invalid_key' );
754
+ add_action( 'admin_notices', 'ewww_image_optimizer_notice_invalid_key' );
755
+ }
756
  // Alert user if multiple re-optimizations detected.
757
  add_action( 'network_admin_notices', 'ewww_image_optimizer_notice_reoptimization' );
758
  add_action( 'admin_notices', 'ewww_image_optimizer_notice_reoptimization' );
2942
  ewwwio_debug_message( '<b>' . __FUNCTION__ . '()</b>' );
2943
  $key = trim( $key );
2944
  if ( ewww_image_optimizer_function_exists( 'print_r' ) ) {
2945
+ /* ewwwio_debug_message( print_r( $_REQUEST, true ) ); */
2946
  }
2947
  if ( empty( $key ) ) {
2948
  return '';
3081
  ewww_image_optimizer_set_option( 'ewww_image_optimizer_cloud_key', '' );
3082
  }
3083
  ewwwio_debug_message( "verification success via: $url" );
3084
+ delete_option( 'ewww_image_optimizer_cloud_key_invalid' );
3085
  } else {
3086
+ update_option( 'ewww_image_optimizer_cloud_key_invalid', true, false );
3087
  if ( ! $sanitize && ! empty( $result['body'] ) && false !== strpos( $result['body'], 'invalid' ) ) {
3088
  ewww_image_optimizer_set_option( 'ewww_image_optimizer_cloud_key', '' );
3089
  }
3127
  return $result;
3128
  }
3129
 
3130
+ /**
3131
+ * Let the user know their key is invalid.
3132
+ */
3133
+ function ewww_image_optimizer_notice_invalid_key() {
3134
+ echo "<div id='ewww-image-optimizer-invalid-key' class='notice error'><p><strong>" . esc_html__( 'Could not validate EWWW Image Optimizer API key, please check your key to ensure it is correct.', 'ewww-image-optimizer' ) . '</strong></p></div>';
3135
+ }
3136
+
3137
  /**
3138
  * Checks the configured API key for quota information.
3139
  *
6935
  if ( defined( $constant_name ) && ( is_int( constant( $constant_name ) ) || is_bool( constant( $constant_name ) ) ) ) {
6936
  return constant( $constant_name );
6937
  }
6938
+ if ( 'ewww_image_optimizer_cloud_key' === $option_name && defined( $constant_name ) ) {
6939
+ $option_value = constant( $constant_name );
6940
+ if ( is_string( $option_value ) && ! empty( $option_value ) ) {
6941
+ return trim( $option_value );
6942
+ }
6943
+ }
6944
  if ( ! function_exists( 'is_plugin_active_for_network' ) && is_multisite() ) {
6945
  // Need to include the plugin library for the is_plugin_active function.
6946
  require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
7476
  $status_notices .= "</p>\n";
7477
  $disable_level = '';
7478
  } else {
7479
+ delete_option( 'ewww_image_optimizer_cloud_key_invalid' );
7480
  if ( ! class_exists( 'ExactDN' ) && ! ewww_image_optimizer_get_option( 'ewww_image_optimizer_exactdn' ) ) {
7481
  $compress_recommendations[] = esc_html__( 'Enable premium compression with an API key or ExactDN.', 'ewww-image-optimizer' );
7482
  }
7771
  if ( is_multisite() && is_plugin_active_for_network( EWWW_IMAGE_OPTIMIZER_PLUGIN_FILE_REL ) && ! get_site_option( 'ewww_image_optimizer_allow_multisite_override' ) ) {
7772
  $output[] = '<i class="network-singlesite"><strong>' . esc_html__( 'Configure network-wide settings in the Network Admin.', 'ewww-image-optimizer' ) . "</strong></i>\n";
7773
  }
7774
+ if ( ewww_image_optimizer_get_option( 'ewww_image_optimizer_noauto' ) ) {
7775
+ ewwwio_debug_message( 'automatic compression disabled' );
7776
+ } else {
7777
+ ewwwio_debug_message( 'automatic compression enabled' );
7778
+ }
7779
  $output[] = "<div id='ewww-general-settings'>\n";
7780
  $output[] = "<table class='form-table'>\n";
7781
  if ( is_multisite() ) {
8084
  ewwwio_help_link( 'https://docs.ewww.io/article/16-ewww-io-and-webp-images', '5854745ac697912ffd6c1c89' ) .
8085
  "</th><td><span><input type='checkbox' id='ewww_image_optimizer_webp_force' name='ewww_image_optimizer_webp_force' value='true' " .
8086
  ( ewww_image_optimizer_get_option( 'ewww_image_optimizer_webp_force' ) == true ? "checked='true'" : '' ) . ' /> ' .
8087
+ esc_html__( 'WebP images will be generated and saved for all JPG/PNG images regardless of their size. The JS WebP Rewriting will not check if a file exists, only that the domain matches the home url.', 'ewww-image-optimizer' ) . "</span></td></tr>\n";
8088
  ewwwio_debug_message( 'forced webp: ' . ( ewww_image_optimizer_get_option( 'ewww_image_optimizer_webp_force' ) == true ? 'on' : 'off' ) );
8089
  }
8090
  if ( ! ewww_image_optimizer_ce_webp_enabled() ) {
8091
  if ( ! ewww_image_optimizer_get_option( 'ewww_image_optimizer_exactdn' ) ) {
8092
  $webp_paths = ewww_image_optimizer_get_option( 'ewww_image_optimizer_webp_paths' ) ? esc_html( implode( "\n", ewww_image_optimizer_get_option( 'ewww_image_optimizer_webp_paths' ) ) ) : '';
8093
+ $output[] = "<tr class='$network_class'><th scope='row'><label for='ewww_image_optimizer_webp_paths'>" . esc_html__( 'WebP URLs', 'ewww-image-optimizer' ) . '</label>' . ewwwio_help_link( 'https://docs.ewww.io/article/16-ewww-io-and-webp-images', '5854745ac697912ffd6c1c89' ) . '</th><td>' . esc_html__( 'If Force WebP is enabled, enter URL patterns that should be permitted for JS WebP Rewriting. One pattern per line, may be partial URLs, but must include the domain name.', 'ewww-image-optimizer' ) . '<br>' .
8094
  "<textarea id='ewww_image_optimizer_webp_paths' name='ewww_image_optimizer_webp_paths' rows='3' cols='60'>$webp_paths</textarea></td></tr>\n";
8095
  ewwwio_debug_message( 'webp paths:' );
8096
  ewwwio_debug_message( $webp_paths );
8097
  }
8098
  $output[] = "<tr class='$network_class'><th scope='row'><label for='ewww_image_optimizer_webp_for_cdn'>" .
8099
+ esc_html__( 'JS WebP Rewriting', 'ewww-image-optimizer' ) .
8100
  '</label>' . ewwwio_help_link( 'https://docs.ewww.io/article/16-ewww-io-and-webp-images', '5854745ac697912ffd6c1c89,59443d162c7d3a0747cdf9f0' ) . "</th><td><span><input type='checkbox' id='ewww_image_optimizer_webp_for_cdn' name='ewww_image_optimizer_webp_for_cdn' value='true' " .
8101
  ( ewww_image_optimizer_get_option( 'ewww_image_optimizer_webp_for_cdn' ) == true ? "checked='true'" : '' ) . ' /> ' .
8102
  esc_html__( 'Use this if the Apache rewrite rules do not work, or if your images are served from a CDN.', 'ewww-image-optimizer' ) . ' ' .
8781
  }
8782
  ewwwio_debug_message( 'dumping var' );
8783
  ewwwio_debug_message( print_r( $var, true ) );
8784
+ if ( $var2 ) {
8785
+ ewwwio_debug_message( 'dumping var2' );
8786
+ ewwwio_debug_message( print_r( $var2, true ) );
8787
+ }
8788
+ if ( $var3 ) {
8789
+ ewwwio_debug_message( 'dumping var3' );
8790
+ ewwwio_debug_message( print_r( $var3, true ) );
8791
+ }
8792
  return $var;
8793
  }
8794
 
ewww-image-optimizer.php CHANGED
@@ -14,7 +14,7 @@ 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
  Text Domain: ewww-image-optimizer
17
- Version: 4.6.1
18
  Author URI: https://ewww.io/
19
  License: GPLv3
20
  */
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
  Text Domain: ewww-image-optimizer
17
+ Version: 4.6.2
18
  Author URI: https://ewww.io/
19
  License: GPLv3
20
  */
includes/eio.js CHANGED
@@ -232,6 +232,7 @@ jQuery(document).ready(function($) {
232
  var ewww_minutes_remaining = 0;
233
  var ewww_seconds_remaining = 0;
234
  var ewww_countdown = false;
 
235
  // initialize the ajax actions for the appropriate bulk page
236
  var ewww_quota_update_data = {
237
  action: 'bulk_quota_update',
@@ -317,6 +318,11 @@ jQuery(document).ready(function($) {
317
  if ( ewww_response.notice ) {
318
  $('#ewww-scanning').append( '<br>' + ewww_response.notice );
319
  }
 
 
 
 
 
320
  if ( ewww_response.bad_attachment ) {
321
  $('#ewww-scanning').append( '<br>' + ewww_vars.bad_attachment + ' ' + ewww_response.bad_attachment );
322
  }
@@ -328,11 +334,19 @@ jQuery(document).ready(function($) {
328
  // $('#ewww-bulk-loading').hide();
329
  $('#ewww-scanning').hide();
330
  $('#ewww-nothing').show();
 
 
 
 
331
  //$('#ewww-aux-start').show();
332
  //$('#ewww-aux-again').show();
333
  //$('#ewww-aux-first').hide();
334
  } else {
335
  $('#ewww-scanning').html(ewww_response.message);
 
 
 
 
336
  $('#ewww-bulk-start').show();
337
  // ewwwStartOpt();
338
  }
232
  var ewww_minutes_remaining = 0;
233
  var ewww_seconds_remaining = 0;
234
  var ewww_countdown = false;
235
+ var ewww_tiny_skip = '';
236
  // initialize the ajax actions for the appropriate bulk page
237
  var ewww_quota_update_data = {
238
  action: 'bulk_quota_update',
318
  if ( ewww_response.notice ) {
319
  $('#ewww-scanning').append( '<br>' + ewww_response.notice );
320
  }
321
+ if ( ewww_response.tiny_skip ) {
322
+ $('#ewww-scanning').append( '<br>' + ewww_response.tiny_skip );
323
+ ewww_tiny_skip = ewww_response.tiny_skip;
324
+ console.log( 'skipped some tiny images' );
325
+ }
326
  if ( ewww_response.bad_attachment ) {
327
  $('#ewww-scanning').append( '<br>' + ewww_vars.bad_attachment + ' ' + ewww_response.bad_attachment );
328
  }
334
  // $('#ewww-bulk-loading').hide();
335
  $('#ewww-scanning').hide();
336
  $('#ewww-nothing').show();
337
+ if ( ewww_tiny_skip ) {
338
+ $('#ewww-nothing').append( '<br><i>' + ewww_tiny_skip + '</i>' );
339
+ console.log( 'done, skipped some tiny images' );
340
+ }
341
  //$('#ewww-aux-start').show();
342
  //$('#ewww-aux-again').show();
343
  //$('#ewww-aux-first').hide();
344
  } else {
345
  $('#ewww-scanning').html(ewww_response.message);
346
+ if ( ewww_tiny_skip ) {
347
+ $('#ewww-scanning').append( '<br><i>' + ewww_tiny_skip + '</i>' );
348
+ console.log( 'done, skipped some tiny images' );
349
+ }
350
  $('#ewww-bulk-start').show();
351
  // ewwwStartOpt();
352
  }
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: image, compress, resize, optimize, optimization, lossless, lossy, seo, web
5
  Requires at least: 4.9
6
  Tested up to: 5.1
7
  Requires PHP: 5.6
8
- Stable tag: 4.6.1
9
  License: GPLv3
10
 
11
  Speed up your website and improve your visitors' experience by automatically compressing and resizing images and PDFs. Boost SEO and improve sales.
@@ -59,7 +59,7 @@ All images created by the built-in WP_Image_Editor class will be automatically o
59
 
60
  = WebP Images =
61
 
62
- One-click WebP with ExactDN and Alternative WebP Rewriting. Otherwise, can generate WebP versions of your images, and enables you to serve even smaller images to supported browsers. Several methods are available for serving WebP images, including Apache-compatible rewrite rules and our Alternative WebP Rewriting option compatible with caches and CDNs. Also works with the WebP option in the Cache Enabler plugin from KeyCDN.
63
 
64
  = WP-CLI =
65
 
@@ -174,6 +174,11 @@ http://developer.yahoo.com/performance/rules.html#opt_images
174
  * Feature requests can be viewed and submitted at https://github.com/nosilver4u/ewww-image-optimizer/labels/enhancement
175
  * If you would like to help translate this plugin in your language, get started here: https://translate.wordpress.org/projects/wp-plugins/ewww-image-optimizer/
176
 
 
 
 
 
 
177
  = 4.6.1 =
178
  * added: automatic configuration for ExactDN + WP Offload Media
179
  * fixed: bulk action from media library skipping last attachment in selection
@@ -191,39 +196,6 @@ http://developer.yahoo.com/performance/rules.html#opt_images
191
  * fixed: PHP notice when EXACTDN_EXCLUDE is defined
192
  * fixed: race condition in Alt WebP prevents Webp derivatives from replacing the originals
193
 
194
- = 4.5.3 =
195
- * fixed: ExactDN duplicates srcset instead of replacing it
196
- * security: remote code execution, low exposure
197
-
198
- = 4.5.2 =
199
- * added: automatic migration to move image paths from absolute to relative
200
- * changed: default quality for PNG to JPG did not match WordPress default
201
- * fixed: legacy absolute paths not matched during bulk scanner when relative matching is enabled
202
- * fixed: PNG to JPG auto-convert produces larger JPG images in some cases
203
-
204
- = 4.5.1 =
205
- * changed: optimization results are tracked by relative urls instead of absolute ones for better portability, migration tool coming soon
206
- * changed: ExactDN defaults to crop when explicit dimensions are given to image_downsize(), revert to scaling with EXACTDN_IMAGE_DOWNSIZE_SCALE
207
- * fixed: WooCommerce thumbnail regeneration triggers excessive admin-ajax requests within EWWW IO
208
- * fixed: ExactDN filtering REST API media endpoint for Gutenberg editor requests
209
- * fixed: ExactDN adding unneeded resize parameters to full-size image urls
210
- * fixed: Alt WebP skipping images with query strings
211
- * fixed: Alt WebP not working with Jetpack Lazy Load for images missing srcset
212
- * fixed: Show Optimized Images table does not display images saved to ewwwio_images table with relative path matching
213
- * fixed: Show Optimized Images table has broken thumbs when WP_CONTENT_DIR is outside of ABSPATH
214
-
215
- = 4.5.0 =
216
- * added: Alt WebP supports BJ Lazy Load, a3 Lazy Load, WP Rocket Lazy Load, Jetpack Lazy Load, and WP Retina Lazy Load
217
- * added: ExactDN rewrites relative image urls that start with a single slash
218
- * changed: ExactDN srcset markup for smaller images improved
219
- * fixed: errors during upload/download with WP Offload Media
220
- * fixed: Alt WebP refuses to process page when FB tracking pixel is present
221
- * fixed: SVG files within <use> tags throw errors with ExactDN
222
- * fixed: thumbnail generation fails with S3 Uploads plugin
223
- * fixed: unable to modify WebP conversion option when ExactDN is enabled
224
- * fixed: ExactDN inserts full-size image without arguments
225
- * removed: PHP 5.5 no longer supported
226
-
227
  = Earlier versions =
228
  Please refer to the separate changelog.txt file.
229
 
5
  Requires at least: 4.9
6
  Tested up to: 5.1
7
  Requires PHP: 5.6
8
+ Stable tag: 4.6.2
9
  License: GPLv3
10
 
11
  Speed up your website and improve your visitors' experience by automatically compressing and resizing images and PDFs. Boost SEO and improve sales.
59
 
60
  = WebP Images =
61
 
62
+ One-click WebP with ExactDN and JS WebP Rewriting. Otherwise, can generate WebP versions of your images, and enables you to serve even smaller images to supported browsers. Several methods are available for serving WebP images, including Apache-compatible rewrite rules and our JS WebP Rewriting option compatible with caches and CDNs. Also works with the WebP option in the Cache Enabler plugin from KeyCDN.
63
 
64
  = WP-CLI =
65
 
174
  * Feature requests can be viewed and submitted at https://github.com/nosilver4u/ewww-image-optimizer/labels/enhancement
175
  * If you would like to help translate this plugin in your language, get started here: https://translate.wordpress.org/projects/wp-plugins/ewww-image-optimizer/
176
 
177
+ = 4.6.2 =
178
+ * changed: API key may be defined as EWWW_IMAGE_OPTIMIZER_CLOUD_KEY
179
+ * fixed: if img tag is missing dimensions, ExactDN sometimes loads original rather than existing thumbnail
180
+ * fixed: TinyPNG/TinyJPG images skipped when Force Re-optimize is checked
181
+
182
  = 4.6.1 =
183
  * added: automatic configuration for ExactDN + WP Offload Media
184
  * fixed: bulk action from media library skipping last attachment in selection
196
  * fixed: PHP notice when EXACTDN_EXCLUDE is defined
197
  * fixed: race condition in Alt WebP prevents Webp derivatives from replacing the originals
198
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  = Earlier versions =
200
  Please refer to the separate changelog.txt file.
201