Skip to content

Releases: beltoftandersen/beltoft-webp

v2.4.0

Choose a tag to compare

@beltoftandersen beltoftandersen released this 04 Oct 18:42
  • Changed: transparent PNG photos (product cut-outs shown on a coloured background) are now encoded as lossy WebP at the WebP quality setting, with the transparency kept, instead of lossless. Measured on a 768 px product photo: 247 KB lossless -> 46 KB, visually identical at 1.5x zoom; on one shop's library 368 MB -> 95 MB. Flat graphics with transparency (logos, icons, badges: 60 colours or fewer on a 48x48 sample) stay lossless.
  • Added wp beltoft-webp backfill --transparent-photos, which re-encodes only those files - run it once after updating, since existing siblings look current.

v2.3.0

Choose a tag to compare

@beltoftandersen beltoftandersen released this 30 Sep 11:21
  • Added background conversion (on by default, Settings > Beltoft WebP): uploads and thumbnail regenerations are queued with Action Scheduler, or WP-Cron without it, instead of encoding every size during the upload request. WP-CLI stays synchronous, and so does any site running beltoft-media-offload older than 1.6.0.
  • Added the beltoft_webp_conversion_pending filter answer and the beltoft_webp_attachment_conversion_finished action, so beltoft-media-offload 1.6.0+ holds back its "delete local files" until the siblings exist.
  • wp beltoft-webp backfill first runs any background jobs that never ran.
  • Fixed: backfill repaired permissions only on siblings of enabled formats, while nginx still serves an existing sibling of a disabled format. It now repairs every format.

Includes 2.2.0 (not released separately):

  • Fixed: siblings were hardcoded to mode 0640, and a wp --allow-root backfill left them root-owned, so an nginx worker that can read the originals could get a 403 for every AVIF/WebP-accepting browser, and PHP could never overwrite them (a regenerated thumbnail kept serving its old sibling). Siblings now copy their source's permissions (and owner/group when running as root), are written to a temp file and renamed into place, and backfill repairs existing ones.
  • Fixed: PNGs never took the GD WebP path, because getimagesize() never reports channels for PNGs — every PNG went through Imagick, whose WebP ignores quality on this build. Transparency is now read from the PNG header; palette PNGs are converted to truecolor for GD.
  • Fixed: a sibling rejected for not being smaller (or an AVIF not smaller than its WebP) looked stale forever, so every backfill re-encoded it, counted it as converted, and re-fired beltoft_webp_file_converted and beltoft_webp_backfill_complete (making beltoft-media-offload re-sync every run). A .skip marker now records the rejection, and both hooks only fire when a sibling was actually written.
  • Fixed: the documented nginx snippet only served WebP, so AVIF siblings were generated but never served. The readme now has a tested AVIF-first chain.
  • Fixed: reactivating the plugin re-activated a license the admin had deliberately deactivated; plugin deactivation no longer calls the license server when no license is active.
  • Fixed: WebP conversion required Imagick even though it goes through GD.
  • Fixed: JPEG EXIF orientation was stripped without being applied, so siblings of camera originals could show sideways.
  • Fixed: a stale sibling (source changed but not reconverted — format disabled, conversion switched off, or encoding failed) kept being served as the old picture; it is now removed.
  • Backfill skips protected/non-media upload directories (filter beltoft_webp_backfill_excluded_dirs) and hidden ones, and reports failures separately from "not smaller".
  • Added beltoft_webp_conversion_failed action; failures are printed by backfill and logged under --debug=beltoft-webp.
  • Corrected the WebP quality description on the Settings page and a code comment that contradicted the GD path.

v2.1.0

Choose a tag to compare

@beltoftandersen beltoftandersen released this 30 Sep 07:35
  • Added an optional, free ($0) license key (Settings > Beltoft WebP), activated against beltoft.net — the same self-hosted mechanism as this codebase's other Beltoft plugins. It only gates WordPress's built-in automatic-update flow; conversion, the backfill command, and everything else work fully without one, and no admin notice nags anyone who hasn't entered a key.
  • Fixed: wp beltoft-webp backfill checked staleness (and reported byte savings) against every format this plugin can produce, instead of only the formats actually enabled in settings. Disabling a format on the Settings page (added in 2.0.0) made every file look permanently stale on every future backfill run, re-converting the entire media library each time and firing the integration hooks needlessly.

v2.0.0

Choose a tag to compare

@beltoftandersen beltoftandersen released this 30 Sep 07:22

Restructured from a single-file prototype into a proper multi-file plugin matching this codebase's other Beltoft plugins:

  • PSR-4 src/ classes: Converter, AttachmentHooks, Cli\BackfillCommand, Admin\SettingsPage, Support\Options
  • New Settings > Beltoft WebP page exposing the previously-hardcoded WebP/AVIF quality values and format enable toggles
  • readme.txt + README.md + uninstall.php
  • Two new integration actions: beltoft_webp_file_converted (per file) and beltoft_webp_backfill_complete (once per real backfill run) — the latter is now consumed by beltoft-media-offload to resync already-offloaded attachments' siblings