New “Keep original image” mode (off by default). When enabled, the original stays as the file in your Media Library and a WebP copy is built for the full image and every generated size, so responsive images are covered too, and visitors are served the WebP for speed. When disabled, the upload is replaced by a single WebP and the original is deleted to save storage.
New “Restore original” action in the Media Library for any WebP attachment that still has its original on disk. It points the attachment back at the original, rebuilds the sizes, and removes the WebP copies.
Originals and WebP copies are now cleaned up together when you delete an image, so no files are left orphaned on disk.
Turning “Keep original” off keeps the previous behavior: the upload is replaced by a single WebP and the original is deleted to save storage.
0.3
Tested with WordPress 7
WordPress Coding Standards compliance: documented intentional uses of fopen create-exclusive (atomic WebP filename reservation) and direct $wpdb counter updates (atomic stats increments)
error_log fallback for anonymous upload failures now gated behind WP_DEBUG
Suppressed nonce-verification warning on the post-redirect stats_reset display flag (nonce is checked at the action handler before the redirect)
0.2
Admin notice on conversion failure with the filename, MIME type, and a specific reason (e.g. corrupt source, missing AVIF support, Imagick exception)
Per-user failure log (last 10 events) shown on next admin page load, then cleared automatically
Unique WebP filenames when a same-name image already exists in the upload folder, so re-uploads no longer overwrite or alias the previous attachment
Statistics panel on the settings page showing total images converted, original total size, WebP total size, and bytes saved with a percentage
Reset Statistics button to clear the saved totals
Clean uninstall: removes all plugin options and per-user data when the plugin is deleted
Failure notices now only show on media-related screens, not on every admin page
Per-request cache for filesystem checks in the WebP URL filters to reduce stat calls on image-heavy pages
Atomic SQL increments for stats: concurrent uploads no longer drop counts (split the serialized stats array into three numeric options, migrated automatically)
Atomic WebP filename reservation with create-exclusive open and random-suffix retry, so two concurrent uploads of the same name cannot overwrite each other
PHP error log fallback when an upload fails outside of a logged-in user context, so failures from front-end forms or unauthenticated REST calls are no longer silently dropped
Failure notices now gate on login state rather than the upload_files capability, so any role with stored failures still sees its own notices