Skip to content

MM Optimizer 1.0.0

Choose a tag to compare

@inalto inalto released this 27 Sep 18:24
· 3 commits to main since this release

First release.

MM Optimizer starts from a question most image plugins skip: what can this
server actually do?
It runs a detection pass, shows a capability matrix built
from real encoding tests, and recommends a configuration with the reason next to
every choice.

Original files are never modified.

Highlights

Detection that does not trust declared support. Imagick::queryFormats()
lists WEBP even when the delegate is broken; a cwebp on the PATH is
sometimes a placeholder script. Both report success to a naive check and then
produce corrupted files in silence. For every library and format, MM Optimizer
encodes a known sample, checks the magic bytes, verifies the size is plausible,
and reads the result back. A format that is claimed but not verified stays
disabled, and the diagnostics screen says why.

Engine ranking on the right sample. Verification uses a 64×64 probe;
ranking uses a 512×384 photograph, because the two questions are different. On
the small probe cwebp -m 6 comes out two bytes larger than -m 4; on the
photograph it is 7% smaller. Ranking on the wrong sample picks the wrong engine.
There is no hand-written preference table — whichever engine produces the
smallest file on your server wins.

Recommendations with reasons. Every proposed setting carries the measurement
or condition behind it, including the unwelcome ones: if your host has no
lossless JPEG tool, it says so and names the package to ask for rather than
pretending.

The AVIF MIME-type trap, handled. <source type="image/avif"> is a hint the
browser trusts before fetching. On a server whose MIME list predates AVIF, the
file comes back as application/octet-stream and Firefox and Safari fail with
no fallback to the <img>. The plugin probes this with a real request, writes
an AddType line, and if it cannot, disables AVIF delivery rather than ship
something half your visitors cannot display.

What it does

  • Detects GD, Imagick, Gmagick and system binaries (cwebp, avifenc, jpegoptim, jpegtran, optipng, pngquant, gifsicle)
  • Generates WebP and AVIF derivatives across four optimization levels
  • Delivers responsively with <picture> and one srcset per format, or via .htaccess negotiation
  • Stands down when another optimizer is active — conversion keeps running, delivery switches off
  • Imports settings and existing files from Converter for Media
  • Browser-driven bulk conversion that survives unreliable WordPress cron

Measured results

On a 2048×1367 photograph of 721,366 bytes at the Balanced level:

Format Size Saving
AVIF 244,780 B −66.1%
WebP 380,730 B −47.2%

Requirements

WordPress 6.0+, PHP 7.4+, and GD or Imagick with WebP and/or AVIF support. The
plugin tells you what you have and what to request if you have neither.

Installation

Download mm-optimizer.zip below and upload it through Plugins → Add New →
Upload Plugin
. See the wiki for
setup, and docs/ for
the technical reference.

Language

Source strings are English; an Italian translation ships in languages/.

Known limitations

  • Multisite is untested rather than supported.
  • Wrapping images in <picture> breaks CSS written with direct-child selectors
    (.gallery > img). Use the exclusion list or .htaccess mode.