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:
- 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.
- 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:
- 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.
- 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.