Version Description
- added: defer jQuery also with EXACTDN_DEFER_JQUERY override
- added: Lazy Load supports VC grid layouts retrieved via AJAX
- fixed: Lazy Load and JS WebP prevent loading of images in oEmbed endpoint
- fixed: jQuery exclusion was preventing deferral of jQuery extensions also
- fixed: Lazy Load parsing Owl Lazy images
- fixed: Easy IO adds srcset/sizes to feeds
- fixed: filename in attachment metadata not updated for duplicate thumbnails after conversion success
- fixed: notices for undefined variables during bulk optimize
Download this release
Release Info
Developer | nosilver4u |
Plugin | EWWW Image Optimizer |
Version | 5.3.2 |
Comparing to | |
See all releases |
Code changes from version 5.3.1 to 5.3.2
- bulk.php +3 -3
- changelog.txt +10 -0
- classes/class-eio-alt-webp.php +4 -0
- classes/class-eio-lazy-load.php +30 -13
- classes/class-ewww-image.php +16 -12
- classes/class-exactdn.php +2 -2
- common.php +3 -2
- ewww-image-optimizer.php +1 -1
- includes/media.js +4 -0
- readme.txt +11 -50
bulk.php
CHANGED
@@ -1997,9 +1997,9 @@ function ewww_image_optimizer_bulk_update_meta() {
|
|
1997 |
}
|
1998 |
$attachment_id = (int) $_REQUEST['attachment_id'];
|
1999 |
ewwwio_debug_message( "saving attachment meta for $attachment_id" );
|
|
|
2000 |
if ( class_exists( 'S3_Uploads' ) ) {
|
2001 |
ewwwio_debug_message( 're-uploading to S3(_Uploads)' );
|
2002 |
-
$meta = wp_get_attachment_metadata( $attachment_id );
|
2003 |
ewww_image_optimizer_remote_push( $meta, $attachment_id );
|
2004 |
}
|
2005 |
if ( class_exists( 'Windows_Azure_Helper' ) && function_exists( 'windows_azure_storage_wp_generate_attachment_metadata' ) ) {
|
@@ -2008,8 +2008,8 @@ function ewww_image_optimizer_bulk_update_meta() {
|
|
2008 |
windows_azure_storage_delete_local_files( $meta, $attachment_id );
|
2009 |
}
|
2010 |
}
|
2011 |
-
wp_update_attachment_metadata( $attachment_id,
|
2012 |
-
do_action( 'ewww_image_optimizer_after_optimize_attachment', $
|
2013 |
die( ewwwio_json_encode( array( 'success' => 1 ) ) );
|
2014 |
}
|
2015 |
|
1997 |
}
|
1998 |
$attachment_id = (int) $_REQUEST['attachment_id'];
|
1999 |
ewwwio_debug_message( "saving attachment meta for $attachment_id" );
|
2000 |
+
$meta = wp_get_attachment_metadata( $attachment_id );
|
2001 |
if ( class_exists( 'S3_Uploads' ) ) {
|
2002 |
ewwwio_debug_message( 're-uploading to S3(_Uploads)' );
|
|
|
2003 |
ewww_image_optimizer_remote_push( $meta, $attachment_id );
|
2004 |
}
|
2005 |
if ( class_exists( 'Windows_Azure_Helper' ) && function_exists( 'windows_azure_storage_wp_generate_attachment_metadata' ) ) {
|
2008 |
windows_azure_storage_delete_local_files( $meta, $attachment_id );
|
2009 |
}
|
2010 |
}
|
2011 |
+
wp_update_attachment_metadata( $attachment_id, $meta );
|
2012 |
+
do_action( 'ewww_image_optimizer_after_optimize_attachment', $attachment_id, $meta );
|
2013 |
die( ewwwio_json_encode( array( 'success' => 1 ) ) );
|
2014 |
}
|
2015 |
|
changelog.txt
CHANGED
@@ -1,3 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
= 5.3.1 =
|
2 |
* added: defer JS with Easy IO via EXACTDN_DEFER_SCRIPTS override
|
3 |
* fixed: warning related to user-defined exclusions in JS and picture WebP
|
1 |
+
= 5.3.2 =
|
2 |
+
* added: defer jQuery also with EXACTDN_DEFER_JQUERY override
|
3 |
+
* added: Lazy Load supports VC grid layouts retrieved via AJAX
|
4 |
+
* fixed: Lazy Load and JS WebP prevent loading of images in oEmbed endpoint
|
5 |
+
* fixed: jQuery exclusion was preventing deferral of jQuery extensions also
|
6 |
+
* fixed: Lazy Load parsing Owl Lazy images
|
7 |
+
* fixed: Easy IO adds srcset/sizes to feeds
|
8 |
+
* fixed: filename in attachment metadata not updated for duplicate thumbnails after conversion success
|
9 |
+
* fixed: notices for undefined variables during bulk optimize
|
10 |
+
|
11 |
= 5.3.1 =
|
12 |
* added: defer JS with Easy IO via EXACTDN_DEFER_SCRIPTS override
|
13 |
* fixed: warning related to user-defined exclusions in JS and picture WebP
|
classes/class-eio-alt-webp.php
CHANGED
@@ -365,6 +365,7 @@ class EIO_Alt_Webp extends EIO_Page_Parser {
|
|
365 |
! empty( $_GET['et_fb'] ) ||
|
366 |
! empty( $_GET['tatsu'] ) ||
|
367 |
( ! empty( $_POST['action'] ) && 'tatsu_get_concepts' === $_POST['action'] ) ||
|
|
|
368 |
is_feed() ||
|
369 |
is_preview() ||
|
370 |
( defined( 'REST_REQUEST' ) && REST_REQUEST ) ||
|
@@ -394,6 +395,9 @@ class EIO_Alt_Webp extends EIO_Page_Parser {
|
|
394 |
if ( ! empty( $_GET['tatsu'] ) || ( ! empty( $_POST['action'] ) && 'tatsu_get_concepts' === $_POST['action'] ) ) {
|
395 |
ewwwio_debug_message( 'tatsu' );
|
396 |
}
|
|
|
|
|
|
|
397 |
if ( is_feed() ) {
|
398 |
ewwwio_debug_message( 'is_feed' );
|
399 |
}
|
365 |
! empty( $_GET['et_fb'] ) ||
|
366 |
! empty( $_GET['tatsu'] ) ||
|
367 |
( ! empty( $_POST['action'] ) && 'tatsu_get_concepts' === $_POST['action'] ) ||
|
368 |
+
is_embed() ||
|
369 |
is_feed() ||
|
370 |
is_preview() ||
|
371 |
( defined( 'REST_REQUEST' ) && REST_REQUEST ) ||
|
395 |
if ( ! empty( $_GET['tatsu'] ) || ( ! empty( $_POST['action'] ) && 'tatsu_get_concepts' === $_POST['action'] ) ) {
|
396 |
ewwwio_debug_message( 'tatsu' );
|
397 |
}
|
398 |
+
if ( is_embed() ) {
|
399 |
+
$this->debug_message( 'is_embed' );
|
400 |
+
}
|
401 |
if ( is_feed() ) {
|
402 |
ewwwio_debug_message( 'is_feed' );
|
403 |
}
|
classes/class-eio-lazy-load.php
CHANGED
@@ -80,6 +80,7 @@ if ( ! class_exists( 'EIO_Lazy_Load' ) ) {
|
|
80 |
add_action( 'wp_head', array( $this, 'no_js_css' ) );
|
81 |
|
82 |
add_filter( $this->prefix . 'filter_page_output', array( $this, 'filter_page_output' ), 15 );
|
|
|
83 |
|
84 |
if ( class_exists( 'ExactDN' ) && $this->get_option( $this->prefix . 'exactdn' ) ) {
|
85 |
global $exactdn;
|
@@ -171,6 +172,7 @@ if ( ! class_exists( 'EIO_Lazy_Load' ) ) {
|
|
171 |
! empty( $_GET['tatsu'] ) ||
|
172 |
( ! empty( $_POST['action'] ) && 'tatsu_get_concepts' === $_POST['action'] ) ||
|
173 |
! apply_filters( 'eio_do_lazyload', true ) ||
|
|
|
174 |
is_feed() ||
|
175 |
is_preview() ||
|
176 |
( defined( 'REST_REQUEST' ) && REST_REQUEST ) ||
|
@@ -206,6 +208,9 @@ if ( ! class_exists( 'EIO_Lazy_Load' ) ) {
|
|
206 |
if ( ! apply_filters( 'eio_do_lazyload', true ) ) {
|
207 |
$this->debug_message( 'do_lazyload short-circuit' );
|
208 |
}
|
|
|
|
|
|
|
209 |
if ( is_feed() ) {
|
210 |
$this->debug_message( 'is_feed' );
|
211 |
}
|
@@ -352,6 +357,30 @@ if ( ! class_exists( 'EIO_Lazy_Load' ) ) {
|
|
352 |
$this->set_attribute( $image, 'data-src', $file, true );
|
353 |
$srcset = $this->get_attribute( $image, 'srcset' );
|
354 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
355 |
$width_attr = $this->get_attribute( $image, 'width' );
|
356 |
$height_attr = $this->get_attribute( $image, 'height' );
|
357 |
$placeholder_src = $this->placeholder_src;
|
@@ -430,20 +459,7 @@ if ( ! class_exists( 'EIO_Lazy_Load' ) ) {
|
|
430 |
} else {
|
431 |
$this->set_attribute( $image, 'src', $placeholder_src, true );
|
432 |
}
|
433 |
-
$disable_native_lazy = false;
|
434 |
-
// Ignore native lazy loading images.
|
435 |
-
$loading_attr = $this->get_attribute( $image, 'loading' );
|
436 |
-
if ( $loading_attr && in_array( trim( $loading_attr ), array( 'auto', 'eager', 'lazy' ), true ) ) {
|
437 |
-
$disable_native_lazy = true;
|
438 |
-
}
|
439 |
|
440 |
-
if (
|
441 |
-
( ! defined( 'EWWWIO_DISABLE_NATIVE_LAZY' ) || ! EWWWIO_DISABLE_NATIVE_LAZY ) &&
|
442 |
-
( ! defined( 'EASYIO_DISABLE_NATIVE_LAZY' ) || ! EASYIO_DISABLE_NATIVE_LAZY ) &&
|
443 |
-
! $disable_native_lazy
|
444 |
-
) {
|
445 |
-
$this->set_attribute( $image, 'loading', 'lazy' );
|
446 |
-
}
|
447 |
$this->set_attribute( $image, 'class', $this->get_attribute( $image, 'class' ) . ' lazyload', true );
|
448 |
return $image;
|
449 |
}
|
@@ -584,6 +600,7 @@ if ( ! class_exists( 'EIO_Lazy_Load' ) ) {
|
|
584 |
'gazette-featured-content-thumbnail',
|
585 |
'lazy-slider-img=',
|
586 |
'mgl-lazy',
|
|
|
587 |
'skip-lazy',
|
588 |
'timthumb.php?',
|
589 |
'wpcf7_captcha/',
|
80 |
add_action( 'wp_head', array( $this, 'no_js_css' ) );
|
81 |
|
82 |
add_filter( $this->prefix . 'filter_page_output', array( $this, 'filter_page_output' ), 15 );
|
83 |
+
add_filter( 'vc_get_vc_grid_data_response', array( $this, 'filter_page_output' ) );
|
84 |
|
85 |
if ( class_exists( 'ExactDN' ) && $this->get_option( $this->prefix . 'exactdn' ) ) {
|
86 |
global $exactdn;
|
172 |
! empty( $_GET['tatsu'] ) ||
|
173 |
( ! empty( $_POST['action'] ) && 'tatsu_get_concepts' === $_POST['action'] ) ||
|
174 |
! apply_filters( 'eio_do_lazyload', true ) ||
|
175 |
+
is_embed() ||
|
176 |
is_feed() ||
|
177 |
is_preview() ||
|
178 |
( defined( 'REST_REQUEST' ) && REST_REQUEST ) ||
|
208 |
if ( ! apply_filters( 'eio_do_lazyload', true ) ) {
|
209 |
$this->debug_message( 'do_lazyload short-circuit' );
|
210 |
}
|
211 |
+
if ( is_embed() ) {
|
212 |
+
$this->debug_message( 'is_embed' );
|
213 |
+
}
|
214 |
if ( is_feed() ) {
|
215 |
$this->debug_message( 'is_feed' );
|
216 |
}
|
357 |
$this->set_attribute( $image, 'data-src', $file, true );
|
358 |
$srcset = $this->get_attribute( $image, 'srcset' );
|
359 |
|
360 |
+
$disable_native_lazy = false;
|
361 |
+
// Ignore native lazy loading images.
|
362 |
+
$loading_attr = $this->get_attribute( $image, 'loading' );
|
363 |
+
if ( $loading_attr && in_array( trim( $loading_attr ), array( 'auto', 'eager', 'lazy' ), true ) ) {
|
364 |
+
$disable_native_lazy = true;
|
365 |
+
}
|
366 |
+
if (
|
367 |
+
( ! defined( 'EWWWIO_DISABLE_NATIVE_LAZY' ) || ! EWWWIO_DISABLE_NATIVE_LAZY ) &&
|
368 |
+
( ! defined( 'EASYIO_DISABLE_NATIVE_LAZY' ) || ! EASYIO_DISABLE_NATIVE_LAZY ) &&
|
369 |
+
! $disable_native_lazy
|
370 |
+
) {
|
371 |
+
$this->set_attribute( $image, 'loading', 'lazy' );
|
372 |
+
}
|
373 |
+
|
374 |
+
if (
|
375 |
+
! empty( $_POST['action'] ) &&
|
376 |
+
! empty( $_POST['vc_action'] ) &&
|
377 |
+
! empty( $_POST['tag'] ) &&
|
378 |
+
'vc_get_vc_grid_data' === $_POST['action'] &&
|
379 |
+
'vc_get_vc_grid_data' === $_POST['vc_action'] &&
|
380 |
+
'vc_media_grid' === $_POST['tag']
|
381 |
+
) {
|
382 |
+
return $image;
|
383 |
+
}
|
384 |
$width_attr = $this->get_attribute( $image, 'width' );
|
385 |
$height_attr = $this->get_attribute( $image, 'height' );
|
386 |
$placeholder_src = $this->placeholder_src;
|
459 |
} else {
|
460 |
$this->set_attribute( $image, 'src', $placeholder_src, true );
|
461 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
462 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
463 |
$this->set_attribute( $image, 'class', $this->get_attribute( $image, 'class' ) . ' lazyload', true );
|
464 |
return $image;
|
465 |
}
|
600 |
'gazette-featured-content-thumbnail',
|
601 |
'lazy-slider-img=',
|
602 |
'mgl-lazy',
|
603 |
+
'owl-lazy',
|
604 |
'skip-lazy',
|
605 |
'timthumb.php?',
|
606 |
'wpcf7_captcha/',
|
classes/class-ewww-image.php
CHANGED
@@ -250,7 +250,7 @@ class EWWW_Image {
|
|
250 |
} else {
|
251 |
$base_dir = trailingslashit( dirname( $this->file ) );
|
252 |
}
|
253 |
-
|
254 |
foreach ( $sizes_queried as $size_queried ) {
|
255 |
$size_queried['path'] = ewww_image_optimizer_absolutize_path( $size_queried['path'] );
|
256 |
|
@@ -265,6 +265,9 @@ class EWWW_Image {
|
|
265 |
ewwwio_debug_message( 'updating regular size' );
|
266 |
$meta['sizes'][ $size_queried['resize'] ]['file'] = basename( $new_name );
|
267 |
$meta['sizes'][ $size_queried['resize'] ]['mime-type'] = ewww_image_optimizer_quick_mimetype( $new_name );
|
|
|
|
|
|
|
268 |
} elseif ( ewww_image_optimizer_iterable( $meta['custom_sizes'] ) ) {
|
269 |
$dimensions = str_replace( 'custom-size-', '', $size_queried['resize'] );
|
270 |
if ( is_array( $meta['custom_sizes'][ $dimensions ] ) ) {
|
@@ -276,7 +279,7 @@ class EWWW_Image {
|
|
276 |
ewwwio_debug_message( "converted {$size_queried['resize']} from db query" );
|
277 |
}
|
278 |
|
279 |
-
|
280 |
if ( isset( $meta['sizes'] ) && ewww_image_optimizer_iterable( $meta['sizes'] ) ) {
|
281 |
$disabled_sizes = ewww_image_optimizer_get_option( 'ewww_image_optimizer_disable_resizes_opt', false, true );
|
282 |
foreach ( $meta['sizes'] as $size => $data ) {
|
@@ -298,11 +301,14 @@ class EWWW_Image {
|
|
298 |
/* ewwwio_debug_message( 'skipping size with missing filename' ); */
|
299 |
continue;
|
300 |
}
|
301 |
-
foreach ( $sizes as $done ) {
|
302 |
if ( empty( $done['height'] ) || empty( $done['width'] ) ) {
|
303 |
continue;
|
304 |
}
|
305 |
if ( $data['height'] === $done['height'] && $data['width'] === $done['width'] ) {
|
|
|
|
|
|
|
306 |
continue( 2 );
|
307 |
}
|
308 |
}
|
@@ -318,10 +324,10 @@ class EWWW_Image {
|
|
318 |
ewwwio_debug_message( "converted $size from meta" );
|
319 |
} // End foreach().
|
320 |
} // End if().
|
321 |
-
/* ewwwio_debug_message( 'next up for conversion search: image_meta resizes' ); */
|
322 |
|
323 |
// Convert sizes from a custom theme.
|
324 |
if ( isset( $meta['image_meta']['resized_images'] ) && ewww_image_optimizer_iterable( $meta['image_meta']['resized_images'] ) ) {
|
|
|
325 |
$imagemeta_resize_pathinfo = pathinfo( $this->file );
|
326 |
$imagemeta_resize_path = '';
|
327 |
foreach ( $meta['image_meta']['resized_images'] as $index => $imagemeta_resize ) {
|
@@ -337,10 +343,9 @@ class EWWW_Image {
|
|
337 |
}
|
338 |
}
|
339 |
|
340 |
-
/* ewwwio_debug_message( 'next up for conversion search: custom_sizes' ); */
|
341 |
-
|
342 |
// and another custom theme.
|
343 |
if ( isset( $meta['custom_sizes'] ) && ewww_image_optimizer_iterable( $meta['custom_sizes'] ) ) {
|
|
|
344 |
$custom_sizes_pathinfo = pathinfo( $file_path );
|
345 |
$custom_size_path = '';
|
346 |
foreach ( $meta['custom_sizes'] as $dimensions => $custom_size ) {
|
@@ -356,9 +361,7 @@ class EWWW_Image {
|
|
356 |
}
|
357 |
}
|
358 |
}
|
359 |
-
|
360 |
-
|
361 |
-
/* ewwwio_debug_message( 'all done converting sizes' ); */
|
362 |
return $meta;
|
363 |
}
|
364 |
|
@@ -369,6 +372,7 @@ class EWWW_Image {
|
|
369 |
* @return array The updated attachment metadata.
|
370 |
*/
|
371 |
public function restore_with_meta( $meta ) {
|
|
|
372 |
if ( empty( $meta ) || ! is_array( $meta ) ) {
|
373 |
ewwwio_debug_message( 'invalid meta for restoration' );
|
374 |
return $meta;
|
@@ -484,11 +488,11 @@ class EWWW_Image {
|
|
484 |
ewwwio_debug_message( 'no file provided to convert' );
|
485 |
return false;
|
486 |
}
|
487 |
-
if (
|
488 |
ewwwio_debug_message( "$file is not a file, cannot convert" );
|
489 |
return false;
|
490 |
}
|
491 |
-
if (
|
492 |
ewwwio_debug_message( "$file is not writable, cannot convert" );
|
493 |
return false;
|
494 |
}
|
@@ -642,7 +646,7 @@ class EWWW_Image {
|
|
642 |
ewwwio_debug_message( "converted JPG size: $jpg_size" );
|
643 |
// If the new JPG is smaller than the original PNG.
|
644 |
if ( ! $check_size && $jpg_size && ewwwio_is_file( $newfile ) && ewww_image_optimizer_mimetype( $newfile, 'i' ) === 'image/jpeg' ) {
|
645 |
-
ewwwio_debug_message( '
|
646 |
// If the user wants originals delted after a conversion.
|
647 |
if ( ewww_image_optimizer_get_option( 'ewww_image_optimizer_delete_originals' ) ) {
|
648 |
// Delete the original PNG.
|
250 |
} else {
|
251 |
$base_dir = trailingslashit( dirname( $this->file ) );
|
252 |
}
|
253 |
+
ewwwio_debug_message( 'about to process db results' );
|
254 |
foreach ( $sizes_queried as $size_queried ) {
|
255 |
$size_queried['path'] = ewww_image_optimizer_absolutize_path( $size_queried['path'] );
|
256 |
|
265 |
ewwwio_debug_message( 'updating regular size' );
|
266 |
$meta['sizes'][ $size_queried['resize'] ]['file'] = basename( $new_name );
|
267 |
$meta['sizes'][ $size_queried['resize'] ]['mime-type'] = ewww_image_optimizer_quick_mimetype( $new_name );
|
268 |
+
// Store height/width in $sizes to make sure we catch meta dups.
|
269 |
+
$sizes[ $size_queried['resize'] ]['width'] = $meta['sizes'][ $size_queried['resize'] ]['width'];
|
270 |
+
$sizes[ $size_queried['resize'] ]['height'] = $meta['sizes'][ $size_queried['resize'] ]['height'];
|
271 |
} elseif ( ewww_image_optimizer_iterable( $meta['custom_sizes'] ) ) {
|
272 |
$dimensions = str_replace( 'custom-size-', '', $size_queried['resize'] );
|
273 |
if ( is_array( $meta['custom_sizes'][ $dimensions ] ) ) {
|
279 |
ewwwio_debug_message( "converted {$size_queried['resize']} from db query" );
|
280 |
}
|
281 |
|
282 |
+
ewwwio_debug_message( 'next up for conversion search: meta' );
|
283 |
if ( isset( $meta['sizes'] ) && ewww_image_optimizer_iterable( $meta['sizes'] ) ) {
|
284 |
$disabled_sizes = ewww_image_optimizer_get_option( 'ewww_image_optimizer_disable_resizes_opt', false, true );
|
285 |
foreach ( $meta['sizes'] as $size => $data ) {
|
301 |
/* ewwwio_debug_message( 'skipping size with missing filename' ); */
|
302 |
continue;
|
303 |
}
|
304 |
+
foreach ( $sizes as $done_size => $done ) {
|
305 |
if ( empty( $done['height'] ) || empty( $done['width'] ) ) {
|
306 |
continue;
|
307 |
}
|
308 |
if ( $data['height'] === $done['height'] && $data['width'] === $done['width'] ) {
|
309 |
+
ewwwio_debug_message( "already did a size with {$done['width']} x {$done['height']}" );
|
310 |
+
$meta['sizes'][ $size ]['file'] = $meta['sizes'][ $done_size ]['file'];
|
311 |
+
$meta['sizes'][ $size ]['mime-type'] = $meta['sizes'][ $done_size ]['mime-type'];
|
312 |
continue( 2 );
|
313 |
}
|
314 |
}
|
324 |
ewwwio_debug_message( "converted $size from meta" );
|
325 |
} // End foreach().
|
326 |
} // End if().
|
|
|
327 |
|
328 |
// Convert sizes from a custom theme.
|
329 |
if ( isset( $meta['image_meta']['resized_images'] ) && ewww_image_optimizer_iterable( $meta['image_meta']['resized_images'] ) ) {
|
330 |
+
ewwwio_debug_message( 'next up for conversion search: image_meta resizes' );
|
331 |
$imagemeta_resize_pathinfo = pathinfo( $this->file );
|
332 |
$imagemeta_resize_path = '';
|
333 |
foreach ( $meta['image_meta']['resized_images'] as $index => $imagemeta_resize ) {
|
343 |
}
|
344 |
}
|
345 |
|
|
|
|
|
346 |
// and another custom theme.
|
347 |
if ( isset( $meta['custom_sizes'] ) && ewww_image_optimizer_iterable( $meta['custom_sizes'] ) ) {
|
348 |
+
ewwwio_debug_message( 'next up for conversion search: custom_sizes' );
|
349 |
$custom_sizes_pathinfo = pathinfo( $file_path );
|
350 |
$custom_size_path = '';
|
351 |
foreach ( $meta['custom_sizes'] as $dimensions => $custom_size ) {
|
361 |
}
|
362 |
}
|
363 |
}
|
364 |
+
ewwwio_debug_message( 'end ' . __METHOD__ . '()' );
|
|
|
|
|
365 |
return $meta;
|
366 |
}
|
367 |
|
372 |
* @return array The updated attachment metadata.
|
373 |
*/
|
374 |
public function restore_with_meta( $meta ) {
|
375 |
+
ewwwio_debug_message( '<b>' . __METHOD__ . '()</b>' );
|
376 |
if ( empty( $meta ) || ! is_array( $meta ) ) {
|
377 |
ewwwio_debug_message( 'invalid meta for restoration' );
|
378 |
return $meta;
|
488 |
ewwwio_debug_message( 'no file provided to convert' );
|
489 |
return false;
|
490 |
}
|
491 |
+
if ( ! ewwwio_is_file( $file ) ) {
|
492 |
ewwwio_debug_message( "$file is not a file, cannot convert" );
|
493 |
return false;
|
494 |
}
|
495 |
+
if ( ! is_writable( $file ) ) {
|
496 |
ewwwio_debug_message( "$file is not writable, cannot convert" );
|
497 |
return false;
|
498 |
}
|
646 |
ewwwio_debug_message( "converted JPG size: $jpg_size" );
|
647 |
// If the new JPG is smaller than the original PNG.
|
648 |
if ( ! $check_size && $jpg_size && ewwwio_is_file( $newfile ) && ewww_image_optimizer_mimetype( $newfile, 'i' ) === 'image/jpeg' ) {
|
649 |
+
ewwwio_debug_message( 'PNG to JPG successful' );
|
650 |
// If the user wants originals delted after a conversion.
|
651 |
if ( ewww_image_optimizer_get_option( 'ewww_image_optimizer_delete_originals' ) ) {
|
652 |
// Delete the original PNG.
|
classes/class-exactdn.php
CHANGED
@@ -1159,7 +1159,7 @@ if ( ! class_exists( 'ExactDN' ) ) {
|
|
1159 |
if ( ! empty( $exactdn_url ) ) {
|
1160 |
$src = $exactdn_url;
|
1161 |
}
|
1162 |
-
if ( $srcset_fill && ( ! defined( 'EXACTDN_PREVENT_SRCSET_FILL' ) || ! EXACTDN_PREVENT_SRCSET_FILL ) && false !== strpos( $src, $this->exactdn_domain ) ) {
|
1163 |
if ( ! $this->get_attribute( $images['img_tag'][ $index ], $this->srcset_attr ) && ! $this->get_attribute( $images['img_tag'][ $index ], 'sizes' ) ) {
|
1164 |
$this->debug_message( "srcset filling with $src" );
|
1165 |
$zoom = false;
|
@@ -2555,7 +2555,7 @@ if ( ! class_exists( 'ExactDN' ) ) {
|
|
2555 |
if ( is_admin() ) {
|
2556 |
return $tag;
|
2557 |
}
|
2558 |
-
if ( false !== strpos( $tag, 'jquery' ) ) {
|
2559 |
return $tag;
|
2560 |
}
|
2561 |
if ( false !== strpos( $tag, 'lazysizes' ) ) {
|
1159 |
if ( ! empty( $exactdn_url ) ) {
|
1160 |
$src = $exactdn_url;
|
1161 |
}
|
1162 |
+
if ( ! is_feed() && $srcset_fill && ( ! defined( 'EXACTDN_PREVENT_SRCSET_FILL' ) || ! EXACTDN_PREVENT_SRCSET_FILL ) && false !== strpos( $src, $this->exactdn_domain ) ) {
|
1163 |
if ( ! $this->get_attribute( $images['img_tag'][ $index ], $this->srcset_attr ) && ! $this->get_attribute( $images['img_tag'][ $index ], 'sizes' ) ) {
|
1164 |
$this->debug_message( "srcset filling with $src" );
|
1165 |
$zoom = false;
|
2555 |
if ( is_admin() ) {
|
2556 |
return $tag;
|
2557 |
}
|
2558 |
+
if ( false !== strpos( $tag, 'jquery.js' ) && ! defined( 'EXACTDN_DEFER_JQUERY' ) ) {
|
2559 |
return $tag;
|
2560 |
}
|
2561 |
if ( false !== strpos( $tag, 'lazysizes' ) ) {
|
common.php
CHANGED
@@ -14,7 +14,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
-
define( 'EWWW_IMAGE_OPTIMIZER_VERSION', '
|
18 |
|
19 |
// Initialize a couple globals.
|
20 |
$eio_debug = '';
|
@@ -6831,7 +6831,8 @@ function ewww_image_optimizer_resize_from_meta_data( $meta, $id = null, $log = t
|
|
6831 |
if ( $scan['height'] === $data['height'] && $scan['width'] === $data['width'] ) {
|
6832 |
// We found a duplicate resize, so...
|
6833 |
// Point this resize at the same image as the previous one.
|
6834 |
-
$meta['sizes'][ $size ]['file']
|
|
|
6835 |
continue( 2 );
|
6836 |
}
|
6837 |
}
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
+
define( 'EWWW_IMAGE_OPTIMIZER_VERSION', '532' );
|
18 |
|
19 |
// Initialize a couple globals.
|
20 |
$eio_debug = '';
|
6831 |
if ( $scan['height'] === $data['height'] && $scan['width'] === $data['width'] ) {
|
6832 |
// We found a duplicate resize, so...
|
6833 |
// Point this resize at the same image as the previous one.
|
6834 |
+
$meta['sizes'][ $size ]['file'] = $meta['sizes'][ $proc ]['file'];
|
6835 |
+
$meta['sizes'][ $size ]['mime-type'] = $meta['sizes'][ $proc ]['mime-type'];
|
6836 |
continue( 2 );
|
6837 |
}
|
6838 |
}
|
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: 5.3.
|
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: 5.3.2
|
17 |
Author URI: https://ewww.io/
|
18 |
License: GPLv3
|
19 |
*/
|
includes/media.js
CHANGED
@@ -15,6 +15,10 @@ jQuery(document).on('click', '.ewww-manual-optimize', function() {
|
|
15 |
} else if (ewww_manual_response.success) {
|
16 |
jQuery('#ewww-media-status-' + post_id ).html( ewww_manual_response.success );
|
17 |
}
|
|
|
|
|
|
|
|
|
18 |
});
|
19 |
return false;
|
20 |
});
|
15 |
} else if (ewww_manual_response.success) {
|
16 |
jQuery('#ewww-media-status-' + post_id ).html( ewww_manual_response.success );
|
17 |
}
|
18 |
+
if (ewww_manual_response.basename) {
|
19 |
+
var attachment_span = jQuery('#post-' + post_id + ' .column-title .filename .screen-reader-text').html();
|
20 |
+
jQuery('#post-' + post_id + ' .column-title .filename').html('<span class="screen-reader-text">' + attachment_span + '</span>' + ewww_manual_response.basename);
|
21 |
+
}
|
22 |
});
|
23 |
return false;
|
24 |
});
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: optimize, image, convert, webp, resize, compress, lazy load, optimization,
|
|
5 |
Requires at least: 5.0
|
6 |
Tested up to: 5.4
|
7 |
Requires PHP: 5.6
|
8 |
-
Stable tag: 5.3.
|
9 |
License: GPLv3
|
10 |
|
11 |
Speed up your website to better connect with your visitors. Properly compress and size/scale images. Includes lazy load and WebP convert.
|
@@ -173,6 +173,16 @@ https://developers.google.com/web/tools/lighthouse/audits/optimize-images
|
|
173 |
* Feature requests can be viewed and submitted at https://github.com/nosilver4u/ewww-image-optimizer/labels/enhancement
|
174 |
* 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/
|
175 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
= 5.3.1 =
|
177 |
* added: defer JS with Easy IO via EXACTDN_DEFER_SCRIPTS override
|
178 |
* fixed: warning related to user-defined exclusions in JS and picture WebP
|
@@ -204,55 +214,6 @@ https://developers.google.com/web/tools/lighthouse/audits/optimize-images
|
|
204 |
* fixed: <picture> tags broken when exluding images from Lazy Load
|
205 |
* fixed: Azure storage plugin doesn't re-upload optimized images
|
206 |
|
207 |
-
= 5.2.5 =
|
208 |
-
* removed: data-pin-media attribute, as Pinterest is handling WebP images properly now
|
209 |
-
|
210 |
-
= 5.2.4 =
|
211 |
-
* fixed: data-pin-media attribute added to linked images incorrectly
|
212 |
-
* fixed: images are not resized to max dimensions when using S3 Uploads plugin
|
213 |
-
|
214 |
-
= 5.2.3 =
|
215 |
-
* added: Easy IO sets pre-scaled image in data-pin-media for Pinterest
|
216 |
-
* added: Envira Pro cache cleared when activating Easy IO
|
217 |
-
* changed: improved compatibility layer with S3 Uploads plugin
|
218 |
-
* fixed: background image lazy-loading could be interrupted by other plugins copying elements
|
219 |
-
* fixed: JS WebP provides .webp images to Pinterest
|
220 |
-
* fixed: JS WebP strips Pinterest data/meta attributes
|
221 |
-
* fixed: Easy IO misses some images with Envira Gallery Pro layouts
|
222 |
-
* fixed: missing www in domain prevents rewrites for Easy IO
|
223 |
-
* fixed: JS WebP and Lazy Load parsing X/Pro theme admin pages
|
224 |
-
|
225 |
-
= 5.2.2 =
|
226 |
-
* added: automatic plan upgrade detection
|
227 |
-
* changed: better compatibility with other implementations of "native lazy load"
|
228 |
-
* updated: lazysizes.js to version 5.2
|
229 |
-
* fixed: custom domain for Easy IO prevents auto-scaling
|
230 |
-
* fixed: full-width background images auto-scaled due to scroll bars
|
231 |
-
* fixed: overrides for array-style exclusions not being applied
|
232 |
-
|
233 |
-
= 5.2.1 =
|
234 |
-
* changed: WebP rewrite rules hidden for Cloudflare-protected sites
|
235 |
-
* fixed: Smart Re-optimize not working for PDF files
|
236 |
-
* fixed: Easy IO detects wrong domain when using separate domains for site and content
|
237 |
-
|
238 |
-
= 5.2.0 =
|
239 |
-
* added: Lazy Load, JS WebP, and Easy IO support background images on link elements
|
240 |
-
* added: JS WebP supports background images on section, span, and li elements
|
241 |
-
* added: exclude images from Easy IO in settings
|
242 |
-
* added: exclude images from Lazy Load by string or class name
|
243 |
-
* added: prevent auto-scaling with skip-autoscale
|
244 |
-
* added: Folders to Optimize, Folders to Ignore, Lazy Load Exclusions, Easy IO Exclusions, and WebP URLs can be defined as overrides (single value as string, multiple values as an array)
|
245 |
-
* added: API key, JPG Background (for conversion only), and Disabled Resizes can be defined as overrides, see https://docs.ewww.io/article/40-override-options
|
246 |
-
* added: PNG placeholders for Lazy Load retrieved direct from API for drastically reduced memory usage (API users only)
|
247 |
-
* added: Smart Re-optimize option available on Bulk Optimizer if you want to re-optimize images that were compressed on a different setting
|
248 |
-
* added: auto-restore for Smart Re-optimize when going from lossy to lossless mode
|
249 |
-
* added: Restore & Re-optimize from Media Library to change individual images from lossy to lossless
|
250 |
-
* added: search function for Optimized Images table (Tools menu)
|
251 |
-
* added: table cleanup for database table (Tools menu)
|
252 |
-
* fixed: errors due to duplicate ssl= arguments in URLs
|
253 |
-
* fixed: JS WebP has incorrect selector for video elements (props @CharlieHawker)
|
254 |
-
* updated: embedded help code for better debug prefill
|
255 |
-
|
256 |
= Earlier versions =
|
257 |
Please refer to the separate changelog.txt file.
|
258 |
|
5 |
Requires at least: 5.0
|
6 |
Tested up to: 5.4
|
7 |
Requires PHP: 5.6
|
8 |
+
Stable tag: 5.3.2
|
9 |
License: GPLv3
|
10 |
|
11 |
Speed up your website to better connect with your visitors. Properly compress and size/scale images. Includes lazy load and WebP convert.
|
173 |
* Feature requests can be viewed and submitted at https://github.com/nosilver4u/ewww-image-optimizer/labels/enhancement
|
174 |
* 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/
|
175 |
|
176 |
+
= 5.3.2 =
|
177 |
+
* added: defer jQuery also with EXACTDN_DEFER_JQUERY override
|
178 |
+
* added: Lazy Load supports VC grid layouts retrieved via AJAX
|
179 |
+
* fixed: Lazy Load and JS WebP prevent loading of images in oEmbed endpoint
|
180 |
+
* fixed: jQuery exclusion was preventing deferral of jQuery extensions also
|
181 |
+
* fixed: Lazy Load parsing Owl Lazy images
|
182 |
+
* fixed: Easy IO adds srcset/sizes to feeds
|
183 |
+
* fixed: filename in attachment metadata not updated for duplicate thumbnails after conversion success
|
184 |
+
* fixed: notices for undefined variables during bulk optimize
|
185 |
+
|
186 |
= 5.3.1 =
|
187 |
* added: defer JS with Easy IO via EXACTDN_DEFER_SCRIPTS override
|
188 |
* fixed: warning related to user-defined exclusions in JS and picture WebP
|
214 |
* fixed: <picture> tags broken when exluding images from Lazy Load
|
215 |
* fixed: Azure storage plugin doesn't re-upload optimized images
|
216 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
= Earlier versions =
|
218 |
Please refer to the separate changelog.txt file.
|
219 |
|