EWWW Image Optimizer

This plugin started when I was on a quest to find an Image Optimizer plugin. I found two that looked pretty good: WP Smush.it and CW Image Optimizer. WP Smush.it has file size limitations, is a bit slow, and some people have an issue with their images being sent to Yahoo’s servers (even if Yahoo states they only store them temporarily). In practice, I didn’t care about the privacy issues, but I did have technical problems using WP Smush.it and only got it to work about 75% of the time. So it was down to CW Image Optimizer, and then I discovered it used littleutils for optimization. I’m on shared hosting, and it wasn’t installed. I looked around the littleutils site hoping for precompiled binaries, but found nothing. Then I looked at the dependency list, and it was long. Some of them would already be on my shared host, but I quickly discovered two that weren’t: pngcrush, and gifsicle. These are the programs that littleutils uses ‘under the hood’ to optimize PNGs and GIFs. It uses jpegtran for JPGs, which my host does have. This created two problems:

  1. I would need to compile several programs before I could even start on littleutils, and then I would need to install them in my /home folderĀ  since I’m on shared hosting. Once I had those compiled, I would have to figure out how to tell littleutils where I had put all the dependencies, since they wouldn’t be in the usual places. Not fun.
  2. Then, once I had compiled littleutils, it would still be in my /home folder. Uh-oh, CW Image Optimizer doesn’t let me tell it where I’ve installed the utilities. Bummer.

I had two possible solutions to my two problems:

  1. Compile everything, and then hack the CW Image Optimizer plugin with the appropriate paths. This would unfortunately render it impossible to upgrade in the future without re-editing the plugin code, something I try very hard to avoid.
  2. Create a derivative of CW Image Optimizer (since it is GPL3 after all) using the underlying tools that littleutils uses, and allow it to have configurable paths to the binary files of those tools.

I chose option two, because it also allows me to include some more flexibility in the future. For example, I already have an option to keep (by default) metadata for jpegs in case that information (comments and EXIF info) is important to you. I also chose optipng for PNG optimization which is a derivative of pngcrush. So, without further ado, I introduce to you:
EWWW Image Optimizer
If you need support using the plugin, click the link above, and click on Support.

56 thoughts on “EWWW Image Optimizer

  1. Dear Shane, on wordpress plugin you are using the same txt as CW, if i were you i would edit it. It says ‘EWWW Image Optimizer requires jpegtran, optipng, and gifsicle (imagemagick). You are missing: optipng, gifsicle.’, why not put some links to those add-ons in there? :) Cause i have no idea how to install them lol

    Good luck! Greets :)

    1. Hmm, good point. I was thinking people would follow the Installation instructions on the plugin page, but I suppose you’d never see that page if you installed the plugin from within WP (which is probably what most people would do). Would it be better to just have links to each tool, or a single link to the Installation instructions (or maybe both)?

  2. Hi Shane,

    Love what is being said about what it will do. I do have one question,though.

    After uploading a file which is 982kb, in the WP Media Library it says it is reduced by 100% and the size is 982kb. But… it is still the same size…?

    Also when I then use it as a background image and on the internet I right click for the file size, it is said that it is scaled from 1600×937 to 1246×730 but the size is 982kb…

    Does it load faster or not? What is the advantage here? I don’t understand. Can you please explain it to me?

    Thanks and kind regards,

    1. Not sure what is going on there, sounds like there was some issue and it returned a 0 for the size of the new image accidentally. The 982kb that you’re seeing on the Media Library page is the amount reduced. Would be nice to see the final size though, I think I’ll put that on my future features plan. I would try the Re-optimize link and see what it does this time. If it gives you the same message, we’ll want to investigate a little deeper to see what’s going on.

  3. THX. This plugin simply deleted all my images and made the file size 0. :-/ No backup for the last two days. To bad right?

    1. Unfortunately, that’s pretty much true. One of the changes I plan to make in the next release is to ensure that the new image was actually created for jpegs (instead of an empty file). As far as I know, the only way this happens is if someone doesn’t have jpegtran installed, and tells the plugin to skip the utils check. If you’ve found a different scenario, please let me know, as it ought to be fixed also. As you probably noticed, someone else seems to have had a similar issue (but just with one image), although they never gave much for details as to what they did either.

  4. Hi Shane,

    Re-optimizing did not give a different result and maybe my host doesn’t have jpegtran installed. But as I haven’t checked the box to skip the utils check, I assume that if the latter was the case I would have been notified…?

    I was testing the plugin for a friend and luckily am not desperately needing to have it working myself.

    Thanks and kind regards!

    1. If you did not have jpegtran installed, it should have alerted you when you activated the plug-in, and on the Settings page. Can you test it out with 1.0.6 and see if it does anything different?

  5. Well, that confirms half of my suspicions. I think the Bulk Optimize tool is the other half of the culprit, in that it either doesn’t check the utilities properly, or it couldn’t because of the PHP errors I fixed in 1.0.6. I’ll be doing some more testing for 1.0.7 (due out today or tomorrow).

  6. Hi Shane,

    I installaed EWWW plugin on my site, when I did bulk optimize, it first says I have 98 images but when started it just showed me running like 7-8 files and that’s it?

    Wouldn’t it be a good idea to have like progress bar or loading image showing percentage perhaps when it started doing bulk optimize?


  7. That sounds like the operation is timing out. You may need to increase the max execution time in PHP. I think the default is usually 30 seconds, which is probably not going to be enough for a Bulk Optimize on 98 images.

    You could also try running smaller batches at a time via the Media Library page. There is a Bulk Optimize action in the drop-down menu which lets you run it on selected groups of images.

    Lastly, you can visit the Media Library to see which images were optimized. Based on your comment, you should only see 7 or 8 images that have results, whereas the rest would say that they have not been optimized yet.

  8. Hi
    I have installed EWWW and can bulk optimise in the media library. Does EWWW have an option to bulk optimise images in the galleries I have created. The only bulk option I can find in galleries is resize, I can see “optimise” in blue text on the right hand side under the thumbnail image but it looks like I have to individually optimise each image.
    Also how do I optimise the images as I upload them.

  9. Hi. This is probably a dumb question, but I’m having a hard time getting the optimizer to identify the locations of optipng and gifsicle. Perhaps I’ve put them in the wrong spot?

    I have shared hosting and I put them in the home folder.

    Could you let me know what the filepath should look like?


  10. Hi Shane,

    When I upload an image in my Media Library it comes up with “HTTP Error” and won’t show the file I have uploaded. I have to deactivate the plug-in, then upload an image, then activate the plugin again.

    Do you know why I would be getting this error?

    1. That sounds like the bug I just fixed last night in 1.4.2. If you are still having trouble after upgrading to that version, please post in the plugin support forum.

  11. Hi Shane,

    After your most recent update, all of my thumbnails have been changed! They used to have a maximum width/height of 150, but maintained their original dimensions. Now they are all cropped to exactly 150×150, and that is NOT what I wanted!

    (I did find an option under Settings > Media where a box was checked to crop thumbnails to those exact dimensions. I am NOT the one who checked this box on! I have since UNchecked it, but my thumbnails are still showing up as 150×150 boxes.)

    Is there any way to change them back? Any help would be greatly appreciated.

      1. Hmm, super weird. Thanks for the reply and the explanation! I guess I’ll have to do some more digging. Thanks again (and sorry for the false accusation!).

  12. I’ve tried to optimize images through the bulk optimize and also in the media library. Both ways get errors before they optimize. Any idea what could cause this?

    1. Also, when I try to upload an image I get an http error… I would love to use this plugin but I will have to disable it until I get a response. Hopefully you can help. Thanks..

    2. Generally it is a javascript conflict. Try disabling plugins, and see if you can track down the culprit. Also, make sure you are using the latest version of the plugin, it has some extra sanity checking on the javascript includes.

  13. Hi, activating the plugin it works well, it seems. BUT, the upload feature from Adobe Lightroom with the nextgen gallery plugin there crashes! it will not upload images anymore. As soon as i deactivate you plugin, i can upload from Lightroom again. This is not as it should be off course. Any help is appreciated, untill then I cannot use EWWW.

    Regards, rolf smeets

  14. Hi Shane,

    Thanks for the wonderful plugin. I guess my question doesn’t qualify for the support forum so I thought I’ll post them here. When each image is optimized, is it necessary that the 2 more image sizes be created. I surmise that these image sizes are only used on the admin side and probably don’t need to be separately created and stored on the host’s space because they end up taking extra space in there. Isn’t that true?

    Plus, I wasn’t able to find the place where the images whose length or width is 300px. Can you please tell me where they are used?

    Finally :), I haven’t ticked the “Delete originals” and am wondering, if the originals aren’t replaced by the optimized images, where do they go?

    Thanks for your answers in advance.

    1. Actually, that would qualify for the support forums, but I’ll answer them here anyway.
      1. Regarding the extra images sizes, those are created by wordpress, not by the plugin.
      2. They are used wherever you put them. WordPress generates a thumbnail and a medium size so you can use those in posts instead of full-size images that may not fit within the constraints of your theme.
      3. If you are doing optimizing only, and no conversion (GIF2PNG and friends), that setting doesn’t do anything, which is indicated on the settings page…

      Optimization is done ‘in place’, so there are no originals to delete. With conversion between formats, the converted version has a new file name, so the original stays where it is.

  15. hey great plugin!
    not sure if it’s just me but I get the following file failing to load (404 not found error) and I think it is EWWW because I did a search and found ‘min.map’ in the source somewhere:
    jquery-1.10.2.min.map (file not found)
    not sure if this is a bug or my server but thought it might be worth mentioning. cheers!

    1. Hey Tony,
      That wasn’t ringing any bells, so I checked the source myself, and that file is not mentioned anywhere, and is not included by my plugin at all. Try looking for that file in other plugins and you’ll probably find the culprit.

  16. Ok I take it back it just doesn’t work on either Multisite WP installations or with the Headway Theme. Deactivating the plugin put everything back to normal.

  17. Receiving the following error message from what appears to be the featured image. Can only fix by disabling the plugin, any ideas ?

    Fatal error: Call to undefined method EWWWIO_GD_Editor::remove_exif() in /home/formbetc/public_html/wp-content/themes/hybrid/core/spark-framework/thumb.php on line 472

  18. I have the ewww-image-optimizer plugin installed on my wordpress 3.7.1 site. I have optimized my media library and my theme. Google page speed reported that I have 28 images out of 158 images in my media library that are not optimized. When I ran Go Daddy’s website accelerator service against my site, it reported that my images were only 58% optimized. Either your plugin is not optimizing everything or the outside services are not picking up the information.

    How can I get the remaining images to be optimized and recognized by Google page speed and GoDaddy’s website accelerator service as being optimized?

    Thanks for your help!


  19. LOVE EWWW Image Optimizer!!!! Now that I have my WordPress sites all optimized I’m looking at optimizing my joomla sites… any chance you can provide a stand alone version that can run directly on the server? Maybe you would be interested to help me develop it as a component for joomla?

    1. I had one other person ask about Joomla support a long time ago. It might be worth considering, but I haven’t used Joomla for several years. At one point, I was going to make a standalone version, but other things have taken priority. Keeping track of optimization is the tricky part with a standalone setup, would almost have to do some sort of file-based tracking instead of via a database. Definitely worth considering, but the wordpress plugin and cloud service take up so much of my spare time already, have to make sure I don’t take on too much.

  20. I really like that you have offloaded some of the work to cloud server that is very smart.
    If you could simply make it so the plug-in runs once than that person uses your web service or something else to compress photos from then on I think that I would be a winner.
    Chrome as you most likely know has a huge part of the web therefore WebP images are in my opinion extremely important. Integration with Web P would be fantastic

  21. Just a line to say thank you for this awesome (and free) plugin. I was using the smush.it at my website but I like the fact that you actually see how much optimized each picture becomes in real time.

    Thanks again and keep it up (and keep it free :) )

Leave a Reply

Your email address will not be published. Required fields are marked *