Annoying notice bar about excessive re-optimization
-
Hello,
every time I open WordPress, I see a hint bar at the top with the words
“The EWWW Image Optimizer has detected excessive re-optimization of multiple images Please use the Tools page to Show Re-Optimized Images. Reset Counters”
I have already used “Reset Counters”, so the bar has disappeared. But it keeps popping up – why? This is quite annoying and I haven’t found a way to hide the bar or solve this “problem” (seems to be some kind of problem, I guess?).
-
I had a feeling you’d be asking about that, since only sites affected by repeated re-optimization of images would have seen the error in 5.6.1 ??
Hang tight until 5.7 is released next week, and you can follow the steps below to track down the problem (it CAN be done in 5.6.2, but it’s a bit cumbersome).
Alternatively, if you want to get 5.7 ahead of time, you can install it from GitHub: https://docs.ewww.io/article/73-update-from-github
1. Enable Debugging from the Support tab of the settings.
2. Reset the counters.
3. Wait a few hours (long enough for the warning to come back at least). Don’t reset counters at this point, or the re-optimized images won’t be sorted properly.
4. Go to Tools->Show Re-optimized ImagesThere you’ll see trace logs that should help determine the plugin responsible for triggering re-optimization. You can post a couple trace logs here, or send them via https://ewww.io/contact-us/ if you need any assistance figuring out what the “traces” mean.
Lastly, a bit more explanation about Why you are seeing that message:
EWWW IO integrates with the built-in WordPress image resizing and image generation functions, so that any image created on your site is automatically optimized. That sounds great, until something on your site is generating images dynamically without saving (caching) them to disk. In some cases, it’s because that “something” is checking for the wrong file name with mismatched dimensions. As a result, the “dynamic” images keep getting overwritten with unoptimized versions, and EWWW IO keeps optimizing those same images.
So not only do you have a plugin wasting CPU by regenerating images, now you have EWWW IO re-optimizing those images too. That said, EWWW IO should stop trying to re-optimize once it reaches 5-6x.
Once EWWW IO reaches the max re-optimizations, that means any such images will remain un-optimized if you do nothing. Since those images are usually dynamically created during page load by a plugin/theme that intends to display them in the page, that’s not good for performance on that end either.Okay, I’m looking forward to the update and then follow the steps. Optimized images always keep the original filename, right? Because on my site it is indeed the case that some images are generated in a certain size on the first call – but only once.
Example: I upload an image with 1000x1000px. But this image is shown in the theme e.g. in some areas in 500x500px, elsewhere in 300x150px, 100x100px etc. In addition to the standard sizes specified in WordPress, these additional sizes are generated once (!) the FIRST time you call them up. So the files remain (for example example_300x150.jpg).
But that should not be the problem, because these images are generated only once.
Yeah, it shouldn’t be any of the sizes generated by WP during the initial upload. If the theme is generating some of those “on demand” though, it’s entirely possible there could be a glitch in that routine. With most of the cases we’ve seen over the years, it is *intended* that the images only be generated once, but sometimes PHP will produce an image that is just a pixel or two different than the intended one, and that ends up bypassing the “only once” check.
When EWWW IO is showing the warning message consistently, that should be pretty easy to nail down with the info available in 5.7.
I’m looking forward. I have never had problems with the creation of the mentioned images “on the fly”. I can also see exactly which files are created via FTP and are exactly the sizes I have set up in the theme – no images with 1px more or less or similar. Works perfectly.
Hello,
even after the recent update the bar still appears (there was no problem about that in the past).
“The EWWW Image Optimizer has detected excessive re-optimization of multiple images. Please use the Werkzeuge page to Show Re-Optimized Images. Reset Counters”
Annoying.
Right, sorry if I wasn’t more clear about that. The notice is going to keep popping up as long as the underlying problem isn’t resolved. You’ll now want to use the steps I mentioned earlier to find out where the underlying problem actually IS.
1. Enable Debugging from the Support tab of the settings.
2. Reset the counters.
3. Wait a few hours (long enough for the warning to come back at least). Don’t reset counters at this point, or the re-optimized images won’t be sorted properly.
4. Go to Tools->Show Re-optimized ImagesThere you’ll see trace logs that should help determine the plugin (or theme) responsible for triggering re-optimization. You can post a couple trace logs here, or send them via https://ewww.io/contact-us/ if you need any assistance figuring out what the “traces” mean.
Okay, I will try that. But for whatever reason the debugging was already activated (I never activated that manually, I was never in this support-section) and there is a veeeery long error log. I will delete that and then reset the counter. We will see the results in a couple of hours.
The hint bar is back, I have the log file. What exactly am I supposed to look for in this one? At “Show Re-Optimized Images” I only see images with the dimensions 600×448, which I defined in functions.php as follows:
add_image_size( ‘yarpp-thumbnail’, 600, 448, true );
This way a 600x448px variant of the image is created with every upload. This also works fine with other sizes (e.g. 200x200px). Next to each image is “Nothing saved”.
I do not see where the problem lies. I do not want to copy & paste the log-file in here.
You can send the trace logs via https://ewww.io/contact-us/ and we’ll see what that tells us.
Note, we’re not talking about EWWW IO’s debug log, we are specifically looking for the trace logs next to those images in the re-optimized images table.
A screenshot of the table would also suffice, just in case you’re not seeing trace logs, or have no idea what that means!Hello,
do you mean this here? I changed details such as my domain adress:
...wp-content/uploads/2013/05/example-600x448.jpg Number of attempted optimizations: 6 PHP trace:#0 ewww_image_optimizer() called at /is/htdocs/wp1111111_ABCDEFGH/www.abcdefghijkl.de/htdocs/wp-content/plugins/ewww-image-optimizer/classes/class-ewwwio-imagick-editor.php:625 #1 _save() called at /is/htdocs/wp1111111_ABCDEFGH/www.abcdefghijkl.de/htdocs/wp-includes/class-wp-image-editor-imagick.php:647 #2 save() called at /is/htdocs/wp1111111_ABCDEFGH/www.abcdefghijkl.de/htdocs/wp-content/themes/exampleblog-v1_04/include/plugin/filosofo-image/filosofo-custom-image-sizes.php:157 #3 generate_attachment() called at /is/htdocs/wp1111111_ABCDEFGH/www.abcdefghijkl.de/htdocs/wp-content/themes/exampleblog-v1_04/include/plugin/filosofo-image/filosofo-custom-image-sizes.php:97 #4 filter_image_downsize() called at /is/htdocs/wp1111111_ABCDEFGH/www.abcdefghijkl.de/htdocs/wp-includes/class-wp-hook.php:287 #5 apply_filters() called at /is/htdocs/wp1111111_ABCDEFGH/www.abcdefghijkl.de/htdocs/wp-includes/plugin.php:206 #6 apply_filters() called at /is/htdocs/wp1111111_ABCDEFGH/www.abcdefghijkl.de/htdocs/wp-includes/media.php:208 #7 image_downsize() called at /is/htdocs/wp1111111_ABCDEFGH/www.abcdefghijkl.de/htdocs/wp-includes/media.php:955 #8 wp_get_attachment_image_src() called at /is/htdocs/wp1111111_ABCDEFGH/www.abcdefghijkl.de/htdocs/wp-includes/media.php:1025 #9 wp_get_attachment_image() called at /is/htdocs/wp1111111_ABCDEFGH/www.abcdefghijkl.de/htdocs/wp-includes/post-thumbnail-template.php:181 #10 get_the_post_thumbnail() called at /is/htdocs/wp1111111_ABCDEFGH/www.abcdefghijkl.de/htdocs/wp-content/themes/exampleblog-v1_04/yarpp-template-abc-medium-blog.php:37 #11 include() called at /is/htdocs/wp1111111_ABCDEFGH/www.abcdefghijkl.de/htdocs/wp-content/plugins/yet-another-related-posts-plugin/classes/YARPP_Core.php:1159 #12 display_related() called at /is/htdocs/wp1111111_ABCDEFGH/www.abcdefghijkl.de/htdocs/wp-content/plugins/yet-another-related-posts-plugin/includes/related_functions.php:15 #13 yarpp_related() called at /is/htdocs/wp1111111_ABCDEFGH/www.abcdefghijkl.de/htdocs/wp-content/plugins/yet-another-related-posts-plugin/includes/related_functions.php:48 #14 related_posts() called at /is/htdocs/wp1111111_ABCDEFGH/www.abcdefghijkl.de/htdocs/wp-content/themes/exampleblog-v1_04/additional_items.php:352 #15 include_once() called at /is/htdocs/wp1111111_ABCDEFGH/www.abcdefghijkl.de/htdocs/wp-content/themes/exampleblog-v1_04/single.php:411 #16 include() called at /is/htdocs/wp1111111_ABCDEFGH/www.abcdefghijkl.de/htdocs/wp-includes/template-loader.php:106 #17 require_once() called at /is/htdocs/wp1111111_ABCDEFGH/www.abcdefghijkl.de/htdocs/wp-blog-header.php:19 #18 require() called at /is/htdocs/wp1111111_ABCDEFGH/www.abcdefghijkl.de/htdocs/index.php:17
I am using the functions.php to automatically create specific version of an uploaded image:
add_image_size( ‘yarpp-thumbnail’, 600, 448, true );
In the settings of EWWW I even disabled the optimization of this image size, but that didn’t help either, the hint bar still appears (despite “Reset counter”)
Though I do remember some issues way (way) back with YARPP that they refused to fix, this isn’t that.
This is your theme, see this line:
#3 generate_attachment() called at /is/htdocs/wp1111111_ABCDEFGH/www.abcdefghijkl.de/htdocs/wp-content/themes/exampleblog-v1_04/include/plugin/filosofo-image/filosofo-custom-image-sizes.php:97The theme is generating custom sizes there WITHOUT using add_image_size(), which is the correct method for themes to add sizes in WordPress. Mostly likely, the theme is *trying* to cache the generated images, but obviously unsuccessfully, or you wouldn’t be seeing this error.
To be clear, the bug isn’t that the theme is generating custom sizes without using add_image_size(). It’s one of these:
1. The theme isn’t caching the generated sizes. OR, more likely…
2. The dimensions that the theme is requesting from the WP image editor class are different than the resulting image dimensions–I don’t remember why that happens exactly, but it does sadly.You can report the problem to the theme developers directly and point them to this thread, I’ll be happy to clarify any questions they might have.
@nosilver4u eager and willing if it is something on our side ?? YARPP is very actively maintained now. – jay at yarpp dot com
Glad to hear that @jeffparker (and it’s entirely possible I’m confusing YARPP with some other RPP)!
The trace log (above) seems to indicate that YARPP IS triggering the image_downsize filter, but that the real issue is the theme hooking onto that and doing some auto-generation of image sizes (via wp-image-editor-imagick, where EWWW IO hooks in to optimize/compress). It could be YARPP is requesting a size slightly different than what is available, but ultimately, it’s the theme doing the image generation.It only happens with these thumbnails from Yarpp, which show related articles. I’ve been using the same image size in the normal post list in my blog for years – without any problems. To contact the developer of the original theme would be pointless, that was 7 years ago and I myself have adapted and optimized the theme so much to my needs that the original is no longer recognizable.
Filosofo automatically creates image sizes, e.g. if an image with Width 333 and Height 444 is called, an image file with exactly these dimensions is automatically created (and not everytime again and again, just once). And these dimensions ALWAYS match. Also with these images now the 600×448 pixels are correct.
At Yarpp I use a custom template that I have created. Maybe this is where the problem lies buried:
<?php if ( !$this->diagnostic_using_thumbnails() ) $this->set_option( 'manually_using_thumbnails', true ); $options = array( 'thumbnails_heading', 'thumbnails_default', 'no_results' ); extract( $this->parse_args( $args, $options ) ); // a little easter egg: if the default image URL is left blank, // default to the theme's header image. (hopefully it has one) if ( empty($thumbnails_default) ) $thumbnails_default = get_header_image(); $dimensions = $this->thumbnail_dimensions(); $output .= '<h2>' . $thumbnails_heading . '</h2>' . "\n"; if (have_posts()) { $output .= '<div class="abcb-blog-medium abcb-border-x bottom">' . "\n"; while (have_posts()) { the_post(); if ( ( get_field('hervorheben') == 'Ja' ) || in_category (array (138)) ) { $output .= "<div class='blog-content-wrapper-verwandt blog-medium-highlight'><div class='blog-media-wrapper abcb-image'><a href='" . get_permalink() . "' title='" . the_title_attribute('echo=0') . "'>" . "\n"; } else { $output .= "<div class='blog-content-wrapper-verwandt'><div class='blog-media-wrapper abcb-image'><a href='" . get_permalink() . "' title='" . the_title_attribute('echo=0') . "'>" . "\n"; } $post_thumbnail_html = ''; if ( has_post_thumbnail() ) { if ( $this->diagnostic_generate_thumbnails() ) $this->ensure_resized_post_thumbnail( get_the_ID(), $dimensions ); $post_thumbnail_html = get_the_post_thumbnail(null, $dimensions['size'], array('data-pin-nopin' => 'true') ); } if ( trim($post_thumbnail_html) != '' ) $output .= $post_thumbnail_html; else $output .= '<span class="yarpp-thumbnail-default"><img src="' . esc_url($thumbnails_default) . '" alt="Default Thumbnail" data-pin-nopin="true" /></span>'; $output .= '</a></div><div class="blog-context-wrapper">'; $output .= '<h3 class="blog-title"><a href="' . get_permalink() . '" title="' . the_title_attribute('echo=0') . '">' . get_the_title() . '</a></h3>'; $output .= '<div class="blog-content auszug"><p class="entry-summary">' . get_the_excerpt() . '</p></div><p><a class="weiterlesen" href="' . get_permalink() . '" title="Den kompletten Artikel "' . get_the_title() . '" anzeigen »">Weiterlesen ?</a></p></div></div>' . "\n"; } $output .= "</div>\n"; } else { $output .= $no_results; } $this->enqueue_thumbnails( $dimensions );
And in functions.php I define the following size, so that it is automatically created with every new image. By the way: If I remove this from functions.php, the preview images will be displayed in a different, wrong size in Yarpp (120x120px, scaled to 174x174px). Why, I do not know.
add_image_size( 'yarpp-thumbnail', 600, 448, true );
- The topic ‘Annoying notice bar about excessive re-optimization’ is closed to new replies.