WebberZone Image Optimizer v1.1: Adaptive Quality Retry, Media Library Filters and more

A responsive image is all or nothing. If one size in its srcset has no optimized copy, the browser falls back to the original for every size, including the ones that converted perfectly.

Large photographs that were already heavily compressed are hard to beat. WebP at quality 82 often comes out bigger than the JPEG it came from, even though every thumbnail beneath it wins comfortably. Version 1.0.x discarded that one losing file and moved on, which was the right call for the file and the wrong outcome for the image.

Version 1.1 fixes that while keeping the original safety rule.

Image Optimizer v1.1

One retry at a lower quality

When a lossy encode misses the minimum saving, the plugin now re-encodes that single file once at a lower quality and judges it against the same threshold. If the second attempt fits, it ships. If it doesn’t, it discards the file exactly as before.

The step is a share of the configured quality, not a flat number of points. WebP at 82 retries at 70, AVIF at 50 retries at 42. That matters because the two scales are not comparable: AVIF at 50 looks about the same as WebP at 82, so taking twelve points off both would hit AVIF much harder. There is also a floor at quality 40, so even a filtered retry cannot drop below that.

The min_saving setting still gates the result, so nothing worse than the original can ever be served. Lossless PNG encodes do not use the retry, because dropping the quality number does nothing to a lossless encode.

Developers can change the step with wzio_conversion_retry_step, or return zero to switch the retry off entirely. The settings documentation covers the quality options it builds on.

The retry runs at most once per file per format, so the worst case is one extra encode on files whose first attempt misses the size threshold.

You can see when a copy dropped

A lower-quality result should never be silent. The Optimized column in the Media Library and the attachment’s Image optimization box now say how many copies needed a lower quality to come out smaller than the original, and wp wzio convert reports the same count.

Most images will never show it. On a library of already-compressed photographs, you’ll see it on the largest files and almost nowhere else.

Filtering the Media Library by status

Filter media images by status - Optimized, Not yet Optimized, Skipped, Failed

The Media Library integration now has a status filter for Optimized, Not yet optimized, Skipped and Failed images in the conversion queue. Finding the handful of queued images that failed used to mean paging through the whole library and reading the Optimized column.

Thanks to Muneeb AshrafOpens in a new window, who implemented this.

Bulk Optimize tells you when the worker has stopped

Images left in the background queue are converted only when a worker runs. WP-Cron is the default, but the Bulk Optimize screen and wp wzio run also process the queue. If DISABLE_WP_CRON is set with no system cron behind it, or the loopback request is blocked, the background queue sits there while the screen looks like it’s working.

Bulk Optimize now warns when images are queued and the worker has stopped, names the likely cause, and gives you the wp wzio run command to clear the backlog plus a crontab line for ongoing processing.

The check relies on evidence rather than the scheduled event’s timestamp. WordPress defers cron to shutdown, so an admin page can render before its own request spawns cron, which means the event is overdue on any site that has been quiet for a while. Going by that timestamp would warn every low-traffic install. Instead, the plugin records when the worker last ran and when it last saw a non-empty queue, and only warns after a full fifteen-minute window with work still queued and no worker run. This article explains how the queue works.

Faster AVIF conversion

AVIF conversion should be faster in v1.1.0. The effort setting now maps correctly to each encoder, GD honors AVIF quality and speed, transparent sources avoid the fastest setting, and megapixel banding is gone. PNG lossless mode remains available for WebP, while AVIF uses its configured quality.

Bug fixes

Some images were wrapped in two <picture> elements. With both content and template rewriting enabled, markup that had already been rewritten was rewritten again. Rewritten tags are now marked so a second pass leaves them alone.

One bad image could block the queue forever. If converting an image stopped the background worker outright, the abandoned attempt was never counted against that row’s retry budget, so the queue picked it up again on the next run and every run after that. Abandoned attempts now count, and the image is marked failed once it has used its retries.

A single attachment could run far past the batch time budget. The worker only checked its deadline between attachments, so one attachment with several sizes could overrun by minutes. It now stops between files and hands the attachment back for the next batch, resuming after the last file it attempted.

A newly created site queued nothing. The queue table was reported missing for the rest of the request in which it was created, which affected fresh installs and new sites on multisite.

Other fixes in this release:

  • Settings textarea sanitization is now hardened for users without the unfiltered_html capability.
  • trim(), ltrim() and rtrim() no longer rely on the default character list, which changes in PHP 8.6.

Upgrading

  1. Update the plugin as usual. No settings change and no migration.
  2. To apply the retry to images that were skipped under 1.0.x, run Bulk Optimize with Re-optimize images that are already done ticked. The scan skips anything that already has a conversion record, so without that box, it never revisits the old skips.
  3. Ticking it does not re-encode every file in your library. The bulk worker reuses each up-to-date optimized copy already on disk and revisits work that still needs it, including sizes previously rejected as too large. Those old skips are the cases this retry was added for.
  4. Check the Optimized column afterward. Images that were falling back to the original because of a single size may now convert in full when the retry meets the minimum saving.

If your library is mostly screenshots, graphics, and lightly compressed photographs, you probably won’t see much change, because those were already converting. If it’s full of large camera photographs, this release can serve more of them in an optimized format.

What’s next

Recording the full conversion settings per file so a quality change can be acted on selectively, and Site Health checks that reuse the same worker diagnostics behind the Bulk Optimize warning. Both are on the list for the next couple of releases.

Leave a Reply

Your email address will not be published. Required fields are marked *