Description
Oneway Image Optimizer makes your images smaller without a visible loss in quality. Everything runs on your own server with Imagick or GD: there is no account, no API key and no monthly quota, and no image ever leaves your site.
What it does
- Compresses every image size – JPEG (progressive, optimized Huffman tables), PNG (maximum compression, optional 256-color palette) and WebP. A recompressed file is only kept if it is actually smaller.
- Creates WebP and AVIF versions next to each file (
photo.jpgphoto.jpg.webp,photo.jpg.avif). They are encoded from the original pixels, never from an already compressed copy, and are only kept when they are smaller. - Adaptive quality (Imagick) – finds the lowest quality that still reaches a target fidelity (PSNR), image by image, instead of one fixed quality for everything.
- Optional: convert originals to WebP – replaces the JPEG/PNG file itself with a
.webpfile and updates the attachment and the links in your post content. One click restores the original. - Removes EXIF and GPS data while keeping non-sRGB color profiles, so Display P3 photos keep their colors.
- Scales down huge uploads to a maximum size you choose (2560 px by default).
- Backs up every original in
uploads/oneway-image-optimizer/, in a folder with a random name and with random file names, and protected from direct access. Backups keep the original metadata (including EXIF/GPS), so they are never linked or published. “Restore original” brings back the exact file.
Serving WebP and AVIF
<picture>tag (recommended) – rewrites the images in your pages to<picture>with AVIF and WebP sources, including themes, page builders, blocks and lazy-load attributes. Works on Apache, Nginx, LiteSpeed and behind any CDN, without changing your layout.- .htaccess rewrite – keeps the same URL and picks the format by the browser’s Accept header (Apache/LiteSpeed).
- Nginx – a ready-to-paste configuration is shown in the settings.
Optimizing an existing library
- Background optimization – every few minutes WP-Cron processes a small batch of images and stops, so shared hosting is never overloaded. Interval, batch size and time limit are adjustable, with presets for shared hosting and VPS. You can close the browser.
- Respects your server’s limits – the plugin never raises the PHP time limit. It works within the time your host allows, stops between files before the limit is reached and continues the rest in the next run. Files are written to a temporary file first and only then swapped in, so an interrupted run never leaves a broken image.
- Bulk optimization in the browser – faster while the page stays open, with pause and resume.
- WP-CLI –
wp owio optimize --allfor very large libraries.
In the Media Library
An “Optimization” column and a field in the attachment details show the savings per image, with buttons to optimize, re-optimize or restore the original.
External services
This plugin does not connect to any external service. Images are processed only on your own server with Imagick or GD.
Privacy
The plugin has no account, no tracking and no telemetry, and it does not send anything to any external server. Original images are kept as private backups in your uploads folder (see FAQ) and are deleted when you restore an image or delete the attachment.
Installation
- Install the plugin from Plugins Add New by searching for “Oneway Image Optimizer”, or upload the zip file.
- Activate it. New uploads are optimized automatically from now on.
- Open Media Image Optimizer to see which formats your server supports, adjust the settings and optimize your existing images.
For reliable background processing on low-traffic sites, add define( 'DISABLE_WP_CRON', true ); to wp-config.php and set up a real server cron job. The exact command for your site is shown on the settings page.
FAQ
-
Do I need an account or an API key?
-
No. Images are processed on your own server with Imagick or GD.
-
Are my images sent to another server?
-
No. The plugin does not connect to any external service; all processing happens with Imagick or GD on your own server.
-
My server does not support AVIF. What happens?
-
The plugin checks each format separately and uses whatever your server can do. AVIF needs Imagick with AVIF support, or GD on PHP 8.1+ with libavif. Without it, WebP versions are still created. The settings page shows which engine handles which format.
-
Will my images look worse?
-
With adaptive quality, each image gets the lowest quality that still reaches the target fidelity you choose (Balanced, 40 dB, by default). You can also set fixed quality values. Originals are kept as backups, so every image can be restored.
-
Does it work with Cloudflare or another CDN?
-
Yes, with the
<picture>delivery mode (the default). The .htaccess mode needs a CDN that varies its cache by the Accept header, which the Cloudflare free plan does not do. -
What is the difference between “Generate WebP” and “Convert originals to WebP”?
-
“Generate WebP” keeps your JPEG/PNG files and adds a WebP version next to them, which is served to browsers that support it. “Convert originals to WebP” replaces the file itself, so the image is WebP everywhere, but its URL changes. Links in post content are updated automatically; URLs typed by hand into page builders, theme settings or CSS are not.
-
How do I exclude an image?
-
Add the
data-owio-skipattribute or theno-owioclass to the<img>tag. Developers can skip the<picture>rewrite for a request with theowio_skip_picturefilter. -
Where are the backups stored?
-
In
wp-content/uploads/oneway-image-optimizer/backups-…/, using the same year/month folders as your uploads. The folder name and every file name contain a random part, and an.htaccessfile blocks direct access on Apache and LiteSpeed. On Nginx the random names keep the backups from being found; you can also deny the folder in your server configuration. -
What happens when I uninstall the plugin?
-
Settings and plugin data are removed. Optimized images and their WebP/AVIF versions stay, so your site keeps working. Backups are kept unless you add
define( 'OWIO_DELETE_BACKUPS', true );towp-config.phpbefore uninstalling. -
Which WP-CLI commands are there?
-
wp owio optimize --all– optimizes all images that are not optimized yet.wp owio optimize 123 456 --force– re-optimizes the given images from their backups, for example after turning on AVIF.wp owio restore --all– restores every original.wp owio stats– shows the savings and server capabilities.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“Oneway Image Optimizer” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “Oneway Image Optimizer” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.0.1
- Backups moved to
uploads/oneway-image-optimizer/with random folder and file names. - Images are written to a temporary file and swapped in only when complete; an original is never replaced when its backup failed.
- No longer changes the PHP time limit: work stops before the host’s limit and continues in the next run.
- The
<picture>delivery uses the WordPress 6.9 template output buffer. Requires WordPress 6.9. - Shell commands for a server cron are quoted correctly.
- Removed the Remote API engine: images are now always processed on your own server.
1.0.0
- Initial release.
