Apraksts
MegaOptim optimizes the images of your WordPress site on your own server. It creates WebP and AVIF copies of your JPEG, PNG and GIF images, serves them to browsers that support them, and can compress the originals in place. Nothing is uploaded anywhere, and there are no monthly limits.
What it does
- WebP and AVIF copies of every image and thumbnail size, kept next to the original. A copy that would be larger than the original is skipped.
- Delivery through
<picture>markup or Apache/LiteSpeed rewrite rules, with the original as the fallback for older browsers. A CDN URL can be set for the copies. - Compression in place for JPEG and PNG, with three presets: Lossless, Balanced and Smaller files. Advanced settings hold separate WebP and AVIF quality, resizing of large uploads, metadata and the thumbnail sizes to process.
- Backups and restore. Originals are backed up before they are changed, and any image can be restored, one at a time or all at once.
- Bulk optimization of the whole Media Library with one button. It runs in the background, survives closing the page, and shows its progress on the Overview and in Activity.
- New uploads are optimized automatically.
- Folders outside the Media Library, such as theme or plugin image folders.
- Compare an original with its optimized version side by side.
- WP-CLI:
wp megaoptim optimize,restore,statusandstats. - Diagnostics that show which image engines your server offers and what each one can do.
How images are processed
MegaOptim uses what your server already has: the GD or Imagick PHP extensions, and command-line encoders such as cwebp, avifenc, jpegtran, pngquant, oxipng or gifsicle when your host has them installed. The plugin itself contains no executables. AVIF needs GD or Imagick built with AVIF support, or avifenc. Tools Server diagnostics shows what is available on your server.
MegaOptim Pro
MegaOptim Pro is an optional add-on. It brings its own native engine for Linux (MozJPEG, libwebp, libavif, oxipng, pngquant, gifsicle), which compresses noticeably better than GD or Imagick and turns animated GIFs into animated WebP. Its smart quality picks the lowest quality for each image that still looks the same, measured with SSIMULACRA 2. Pro also optimizes media offloaded to S3-compatible storage with S3 Uploads or WP Offload Media, and adds parallel WP-CLI and network-wide tools for multisite. Images are still processed on your server.
Source code
The admin screens are a Vue application. Its source is included in the plugin’s admin folder and is built with bun install && bun run build.
Ekrānuzņēmumi







Uzstādīšana
- Install and activate MegaOptim Image Optimizer.
- Open Media MegaOptim.
- On Settings, pick a preset and the formats to create (WebP, AVIF or both). Tools Server diagnostics shows what your server can do.
- Optimize a few images on the Images screen and compare them with the originals.
- Click Optimize library on the Overview to process everything else. New uploads are optimized automatically.
BUJ
-
Do I need an account or an API key?
-
No. Since version 3.0, everything runs on your server and there is nothing to sign up for.
-
I used MegaOptim with an API key. What happens when I update?
-
The MegaOptim cloud service has been retired, and version 3.0 replaces it with local processing. Your settings, optimization history and backups are kept, and the stored API key is removed. Images that were waiting for the cloud are paused and listed, so you can review the new settings and resume them locally. Former paying customers receive MegaOptim Pro free of charge; watch your inbox.
-
Is AVIF supported?
-
Yes, when your server can encode AVIF: GD or Imagick built with AVIF support, or the
avifenctool. Tools Server diagnostics shows whether it can. MegaOptim Pro includes its own AVIF encoder. -
Are my original images changed?
-
WebP and AVIF copies are separate files; the original stays as it is. Compression does change the original file, so MegaOptim backs it up first (unless you turn backups off) and you can restore it at any time from the Images screen or with
wp megaoptim restore. -
Is compression lossless?
-
Only with the Lossless preset. Balanced and Smaller files reduce quality slightly in exchange for smaller files. Use Compare to check the result on a few images before optimizing the whole library.
-
Why was a WebP or AVIF copy not created?
-
MegaOptim skips a copy that would be larger than the original, which happens with images that are already well compressed. The Images screen marks these as “original smaller”. Other reasons are listed in Activity.
-
How are WebP and AVIF served to visitors?
-
With
<picture>markup (the default), which works on any server and with most caching plugins, or with rewrite rules for Apache and LiteSpeed, which keep your HTML unchanged. Browsers that do not support a format get the original. -
My images are stored on S3 or another cloud storage.
-
The free plugin optimizes files that are on your server and skips offloaded files with an explanation. MegaOptim Pro optimizes media offloaded with S3 Uploads or WP Offload Media and uploads the WebP and AVIF copies with them.
-
Does it work with WP-CLI?
-
Yes.
wp megaoptim optimize --alloptimizes the library,wp megaoptim optimize --folder=<path>a folder,wp megaoptim restore <id>restores an image, andwp megaoptim statusshows the queue. -
Does MegaOptim send my images anywhere?
-
No. Images are processed on your server, and the free plugin does not contact any service.
Atsauksmes
Autori un izstrādātāji
“MegaOptim Image Optimizer – Convert to WebP & AVIF, Compress Images Locally” ir atvērtā pirmkoda programmatūra. Šo spraudni ir veidojuši šādi cilvēki.
LīdzdalībniekiVai jūs interesē attīstība?
Pārlūkojiet kodu, apmeklējiet SVN krātuvi vai abonējiet attīstības žurnālu, ko izveidojis RSS.
Izmaiņu žurnāls
3.0.0
- All optimization now runs on your server. The cloud API, API keys and image credits are gone.
- A redesigned admin: Overview, Images, Settings, Activity and Tools, with one Optimize action for compression and WebP/AVIF.
- Settings presets (Lossless, Balanced, Smaller files) with separate WebP and AVIF quality.
- Better JPEG output with Imagick and GD: progressive encoding, optimized Huffman tables, and never a higher quality than the source.
- Originals are backed up before every change, for media and folder images, and restore no longer re-optimizes the restored file.
- Native encoders keep a photo’s embedded color profile, so photos from cameras and editors no longer fall back to Imagick.
- A new background queue: atomic claims, two images at a time, and progress that continues when the page is closed.
- WebP and AVIF copies that would be larger than the original are recorded as such instead of being retried.
- Offloaded media is detected and skipped with an explanation instead of failing.
- WP-CLI:
wp megaoptim optimize,restoreandstatus. - The plugin no longer contains executables; it uses GD, Imagick and tools installed on the server.
- Upgrades from cloud versions keep settings, history and backups, remove the stored API key and pause pending cloud work for review.
2.0.2
- File System view: Convert and Compress now work on folders and single files, with live progress.
- Fix: Convert no longer drops thumbnail siblings. Every thumbnail size now produces its own WebP and AVIF file.
- Fix: forced re-convert kept the freshly converted files instead of wiping them at the end of the run.
- Polished folder modal (mode-aware hero, force re-process toggle, cancel-during-run, per-file failure list).
2.0.0
- Complete refactor of the plugin (Vue 3 admin, modern PHP architecture, new conversion engine for WebP/AVIF, File System view, queue monitor, WP-CLI commands).
- Backwards compatible: legacy v1.x mode remains available and existing settings and attachment data are migrated in the background.
Older versions are listed in changelog.txt.
