Reduce image file sizes and improve performance for images within WordPress including NextGEN Gallery. Uses jpegtran, optipng, and gifsicle.
|Author:||Shane Bishop (profile at wordpress.org)|
|WordPress version required:||4.4|
|WordPress version tested:||4.7.3|
|Added to WordPress repository:||07-06-2012|
|Total downloads:||4 742 408|
|Active installs:||500 000+|
Click to start download
- Upload the “ewww-image-optimizer” plugin to your /wp-content/plugins/ directory.
- Activate the plugin through the ‘Plugins’ menu in WordPress.
- Ensure jpegtran, optipng, pngout and gifsicle are installed on your Linux server (basic installation instructions are below if they are not). You will receive a warning when you activate the plugin if they are not present. This message will go away once you have them installed.
- The plugin will attempt to install jpegtran, optipng, and gifsicle automatically for you. This requires that the wp-content folder is writable by the user running the web server.
- If the automatic install did not work, find the appropriate binaries for your system in the ewww-image-optimizer plugin folder, copy them to wp-content/ewww/ and remove the OS “tag” (like -linux or -fbsd). No renaming is necessary on Windows, just copy the .exe files to the wp-content/ewww folder. IMPORTANT: Do not symlink or modify the binaries in any way, or they will not pass the security checks. If you transfer files via FTP, be sure to transfer in binary mode, not ascii or text.
- If the binaries don’t run locally, you can sign up for the EWWW IO cloud service to run them via our optimization servers: https://ewww.io/plans/
- Recommended Visit the settings page to enable/disable specific tools and turn on advanced optimization features.
If these steps do not work, additional documentation is available at http://docs.ewww.io. If you need further assistance using the plugin, please visit our Support Page. The forums are community supported only.
In general, these lists only apply to shared hosting services. If the providers below have VPS or dedicated server options, those will likely work just fine. If you have any contributions or corrections to these lists, please contact me via the form at https://ewww.io
Webhosts where things work (mostly) out of the box:
- A2 Hosting: EWWW IO is installed automatically for A2 Optimized sites.
- GoDaddy (only with PHP 5.3+)
- Hetzner Online
- Hosterdam (FreeBSD)
- iFastNet (with custom php.ini from customer support)
- Liquid Web
- [Site5] (https://www.site5.com) (tools must be built manually, or contact Site5 support for assistance)
- Spry Servers (even with PHP 7)
- 1&1 (pngout requires manual upload and permissions fix)
Webhosts where the plugin will only work in cloud mode or only some tools are installed locally:
- ipage (JPG only)
- one.com – may not even work in cloud mode
- WP Engine – use EWWW Image Optimizer Cloud fork: https://wordpress.org/plugins/ewww-image-optimizer-cloud/
Google Pagespeed says my images need compressing or resizing, but I already optimized all my images. What do I do?
Try this for starters: http://docs.ewww.io/article/5-pagespeed-says-my-images-need-more-work
The plugin complains that I’m missing something, what do I do?
This article will walk you through installing the required tools (and the alternatives if installation does not work): http://docs.ewww.io/article/6-the-plugin-says-i-m-missing-something
Does the plugin replace existing images?
Yes, but only if the optimized version is smaller. The plugin should NEVER create a larger image.
Can I resize my images with this plugin?
Yes, you can, set it up on the Advanced tab.
Can I lower the compression setting for JPGs to save more space?
The lossy JPG optimization using TinyJPG and JPEGmini will determine the ideal quality setting and give you the best results, but you can also adjust the default quality for conversion and resizing. More information here: http://docs.ewww.io/article/12-jpq-quality-and-wordpress
The bulk optimizer doesn’t seem to be working, what can I do?
What are the supported operating systems?
I’ve tested it on Windows (with Apache), Linux, Mac OSX, FreeBSD 9, and Solaris (v10). The cloud API will work on any OS.
How are JPGs optimized?
Lossless optimization is done with the command jpegtran -copy all -optimize -progressive -outfile optimized-file original-file. Optionally, the -copy switch gets the ‘none’ parameter if you choose to strip metadata from your JPGs on the options page. Lossy optimization is done using the outstanding TinyJPG and JPEGmini utilities.
How are PNGs optimized?
There are three parts (and all are optional). First, using the command pngquant original-file, then using the commands pngout-static -s2 original-file and optipng -o2 original-file. You can adjust the optimization levels for both tools on the settings page. Optipng is an automated derivative of pngcrush, which is another widely used png optimization utility. EWWW I.O. Cloud uses TinyPNG for 10% better lossy compression than standalone pngquant.
How are GIFs optimized?
Using the command gifsicle -b -O3 –careful original file. This is particularly useful for animated GIFs, and can also streamline your color palette. That said, if your GIF is not animated, you should strongly consider converting it to a PNG. PNG files are almost always smaller, they just don’t do animations. The following command would do this for you on a Linux system with imagemagick: convert somefile.gif somefile.png
I want to know more about image optimization, and why you chose these options/tools.
That’s not a question, but since I made it up, I’ll answer it. See these resources:
Pngout, TinyJPG/TinyPNG, JPEGmini, and Pngquant were recommended by EWWW IO users. Pngout (usually) optimizes better than Optipng, and best when they are used together. TinyJPG is the best lossy compression tool that I have found for JPG images. Pngquant is an excellent lossy optimizer for PNGs, and is one of the tools used by TinyPNG.
- I no longer have a Mac with which to build new binaries. Until I can raise enough funds, there will be no more updates for the Mac OS X tools, and I may have to temporarily remove Mac support if any security issues arise in the meantime: https://www.gofundme.com/ewww-image-optimizer-mac-dev-laptop
- Feature requests can be submitted via https://ewww.io/contact-us/ and commented on here: https://trello.com/b/Fp81dWof/ewww-image-optimizer
- If you would like to help translate this plugin in your language, get started here: https://translate.wordpress.org/projects/wp-plugins/ewww-image-optimizer/
- added: optional image backups for API users, restore images from bulk optimize, or media library list view
- added: relative file location support, automatically enabled for Pantheon, use EWWW_IMAGE_OPTIMIZER_RELATIVE and EWWW_IMAGE_OPTIMIZER_RELATIVE_FOLDER to enable elsewhere
- added: filename as second parameter to ewww_image_optimizer_resize_dimensions filter
- added: prevent accidental regeneration of an image resize with the built-in WP_Image_Editor, disable by defining EWWWIO_EDITOR_OVERWRITE
- changed: JPG quality setting applies to WebP generation also
- changed: retina images can be processed in background
- changed: prevent sleep() and print_r() from running when disabled
- changed: entire ewwwio_images table no longer loaded into memory when running bulk operation on small batches of images, or when the table is too large
- changed: when resize optimization is disabled, Include Media Folders is disabled to prevent optimization of disabled sizes
- changed: Swedish translation moved to wp.org
- changed: permissions check uses is_readable() and is_executable() instead of requiring 755 permissions
- changed: requires at least PHP 5.3
- fixed: WP_Image_Editor integration was not disabled when using Regenerate Thumbs plugin, resulting in disabled resizes being ignored, and optimization not being backgrounded properly
- fixed: Media Library Plus actions triggered optimization too early, preventing background optimization.
- fixed: settings page would not load on very large multisite installs (1,000+ blogs) because of too many queries for total savings achieved
- fixed: background optimization not working properly on multisite installs
- fixed: imported attachments queued multiple times when plugins like Facebook Events Importer use media_sideload_image()
- fixed: notice when clearing queues
- fixed: when a background process is running, queues repopulate even after clearing all items
- fixed: WP-CLI not dropping to low memory mode in constrained environments, causing incomplete scans
- fixed: nextgen not showing optimization stats
- fixed: proper i18n for strings that could contain singular and plural numbers
- fixed: bulk scanner could skip images that need optimization when in ‘low memory’ mode
- fixed: all JPG images down-sampled when only one of max height or max width is set
- fixed: permissions error on tool folder cause media grid to appear empty
- fixed: fatal error when both EWWW I.O. plugins are activated
- fixed: edited images show active and backup compression results in media library
- added: function to remove duplicate records from the ewwwio table when doing a bulk scan or re-optimizing an image
- changed: zero-byte files skipped during bulk scan instead of during optimization
- changed: exec() check rewritten, please report any errors right away
- fixed: plugin status shows All Clear even though exec disabled and warning is displayed
- changed: time elapsed test now runs every 10 attachments
- fixed: time elapsed test during bulk scan was not running every X number of images
- fixed: scan was not returning results directly after detecting a broken attachment
- fixed: maximum number of rows for ewwwio_images was not high enough, bumped to 4 billion
- fixed: db migration function was not linking records to attachments properly
- fixed: converting PNG to JPG with GD did not properly convert resizes
- fixed: broken attachment metadata could halt the bulk scanner
- fixed: background optimization running when sleep is disabled
- changed: when license has been exceeded, visiting the settings page flushes the license cache
- fixed: warnings for illegal string offsets
- fixed: regression with the dreaded duplicate key name
- fixed: scheduled optimization could run during bulk optimization, causing unexpected results
- added: image linker for media images optimized using scheduled optimizer or the old Scan and Optimize
- added: low memory mode for bulk scanner with notice to user
- added: ability to manually configure how much memory is available using EWWW_MEMORY_LIMIT constant
- added: variable query counts depending on available memory
- added: ability to view and remove debug.log from settings page
- added: ability to manually disable background optimization using EWWW_DISABLE_ASYNC constant
- changed: check every 100 images during scan to avoid timeouts and memory errors
- changed: additional folder scanner can stop & resume mid-folder
- fixed: bulk scanner updates timestamps when it should not
- fixed: special characters are mangled during database insert on some systems
- fixed: pending images that were already optimized were not cleared from queue
- fixed: images with invalid updated dates in database corrected
- fixed: images that should be excluded from optimization were still queued even though they would not be optimized
- fixed: results column was too short, causing bulk optimization to get stuck on an image that was previously optimized
- fixed: if two different attachments reference the same image, duplicate records could be inserted into database during media scan
- added: estimated time remaining on bulk optimize
- added: ‘ewww_image_optimizer_image_resized’ hook added right after resizing, before original is overwritten
- changed: image resizing is performed before any thumbnails are generated for reduced resource usage
- fixed: compatibility with Azure storage plugin
- fixed: bulk optimization not playing nice with WP Offload S3
- fixed: optimization results for resized original not displayed when using Imsanity
- fixed: bulk optimization not working for utf-8 filenames – credit to devsporadic on github
- fixed: retina paths not tested correctly in some odd cases
- notice: FreeBSD 9 is EOL, version 10.3 is now the currently supported version
- notice: RHEL 5 and CentOS 5 will be EOL at the end of March, at that point version 6 will be the lowest supported version
- removed: generating full-size retina image automatically when resizing images and WP Retina 2x Pro detected
- fixed: really old versions of PHP (less than 5.5) cannot cope with using empty() on a function return value
- fixed: queue of images not reset when reloading bulk page
- added: option to ignore folders when optimizing
- added: ability to disable optimization or creation for any or all previews of PDF files in WordPress 4.7
- added: optimization results detail for all resizes of an image in media library list view
- added: automatic metadata rebuilding for broken image attachments in media library during bulk scan
- changed: bulk optimizers for media library and everything else have been merged
- changed: bulk optimization processes images in batches for fewer AJAX requests to your server
- changed: tool locations saved for the duration of a request to improve optimization speed
- changed: optimization results no longer stored in attachment metadata
- changed: populating list of optimized images during scan uses less memory
- changed: obsolete options removed from database
- changed: if scan is interrupted, it will automatically retry
- changed: excessive re-optimization warning ignores theme and plugin images
- changed: if full-size image is converted, all resizes, custom sizes, and retina images will be converted
- changed: conversion will not inject extra numbers if possible
- changed: image results message generated on demand to avoid stale results
- removed: ability to use the ImageMagick ‘convert’ binary, use Imagick extension for PHP instead
- removed: unoptimized images page, bulk scanner is now able to accomplish the job more accurately
- fixed: parallel mode prevents successful conversion
- fixed: removing API key on multisite did not fallback to local mode properly
- fixed: pngout enabled after API key removed
- fixed: image paths with special characters stored incorrectly in database
- fixed: parallel optimization for retina and custom sizes was missing parameters
- fixed: bulk optimizing a single image was broken, but who does that anyway?
- fixed: notice when LIBXML_VERSION is undefined and alt webp is enabled
- fixed: invalid default value for timestamp in db records
- fixed: one-click optimization returns no error when running out of API credits
- fixed: background mode was not checked properly in nextgen and flagallery functions
- fixed: incorrect mimetype set after image conversion for PNG2JPG
- fixed: using getimagesize on pdf files