From c144381cad595183871f37fd561f0b71786f3b26 Mon Sep 17 00:00:00 2001 From: Shane Bishop Date: Tue, 11 Jul 2017 10:13:51 -0600 Subject: [PATCH] final tweaks for 3.5 release --- README.md | 49 ++++++++++++++++++++------------------- common.php | 14 +++++++++-- ewww-image-optimizer.php | 2 +- readme.txt | 50 ++++++++++++++++++---------------------- unique.php | 4 +++- 5 files changed, 63 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index 0951e289..0570a412 100644 --- a/README.md +++ b/README.md @@ -4,33 +4,32 @@ **Tags:** image, attachment, optimize, optimization, lossless, lossy, photo, picture, seo, compression, gmagick, jpegtran, gifsicle, optipng, pngout, pngquant, jpegmini, tinyjpg, tinypng, webp, wp-cli **Requires at least:** 4.4 **Tested up to:** 4.8 -**Stable tag:** 3.4.1 +**Stable tag:** 3.5.0 **License:** GPLv3 **Build Status:** [![Build Status](https://travis-ci.org/nosilver4u/ewww-image-optimizer.svg?branch=master)](https://travis-ci.org/nosilver4u/ewww-image-optimizer) -Reduce image sizes in WordPress including NextGEN, GRAND FlAGallery, FooGallery and more using lossless/lossy methods and image format conversion. +Speed up your website and improve your visitors' experience by automatically compressing and resizing images and PDFs. Boost SEO and improve sales. ## Description -The EWWW Image Optimizer is a WordPress plugin that will automatically optimize your images as you upload them to your blog. It can optimize the images that you have already uploaded, convert your images automatically to the file format that will produce the smallest image size (make sure you read the WARNINGS), and optionally apply lossy compression to achieve huge savings for PNG and JPG images. +The EWWW Image Optimizer will increase your page speeds by way of image optimization. Increased page speeds can result in better search engine rankings, and will also improve conversion rates (increased sales and signups). It will also save you storage space and bandwidth. While EWWW I.O. will automatically optimize new images that you upload, it can also optimize all the images that you have already uploaded, and optionally convert your images to the best file format. You can choose pixel perfect compression or high compression options that are visually lossless. -**Why use EWWW Image Optimizer?** - -1. **Your pages will load faster.** Smaller image sizes means faster page loads. This will make your visitors happy, and can increase revenue. -1. **Faster backups.** Smaller image sizes also means faster backups. -1. **Less bandwidth usage.** Optimizing your images can save you hundreds of KB per image, which means significantly less bandwidth usage. -1. **Super fast.** The plugin can run on your own server, so you don’t have to wait for a third party service to receive, process, and return your images. You can optimize hundreds of images in just a few minutes. PNG files take the longest, but you can adjust the settings for your situation. -1. **Best JPG optimization.** With TinyJPG integration, nothing else comes close (requires an API subscription). -1. **Best PNG optimization.** You can use pngout, optipng, and pngquant in conjunction. And if that isn't enough, try the lossy PNG option powered by TinyPNG. -1. **Root access not needed** Pre-compiled binaries are made available to install directly within the Wordpress folder, and cloud optimization is provided for those who cannot run the binaries locally. -1. **Optimize everything** With the wp_image_editor class extension, and the ability to specify your own folders for scanning, any image in Wordpress can be optimized. +EWWW I.O. will optimize images uploaded and created by any plugin, and features special integrations with many popular plugins, detailed below. -By default, EWWW Image Optimizer uses lossless optimization techniques, so your image quality will be exactly the same before and after the optimization. The only thing that will change is your file size. The one small exception to this is GIF animations. While the optimization is technically lossless, you will not be able to properly edit the animation again without performing an --unoptimize operation with gifsicle. The gif2png and jpg2png conversions are also lossless but the png2jpg process is not lossless. The lossy optimization for JPG and PNG files uses sophisticated algorithms to minimize perceptual quality loss, which is vastly different than setting a static quality/compression level. +**Why use EWWW Image Optimizer?** -The tools used for optimization are [jpegtran](http://jpegclub.org/jpegtran/), [TinyJPG](http://www.tinyjpg.com), [JPEGmini](http://www.jpegmini.com), [optipng](http://optipng.sourceforge.net/), [pngout](http://advsys.net/ken/utils.htm), [pngquant](http://pngquant.org/), [TinyPNG](http://www.tinypng.com), and [gifsicle](http://www.lcdf.org/gifsicle/). Most of these are freely available except TinyJPG/TinyPNG and JPEGmini. Images are converted using the above tools and one of the following: GMagick, IMagick, or GD. +1. **No Speed Limits** and [unlimited file size](https://ewww.io/unlimited-file-size/). Using automatic Background Optimization and optional Parallel Optimization, get rid of upload delays and get back to doing what you love. +1. **Smooth Handling** with pixel-perfect optimization using industry-leading tools and progressive rendering. +1. **High Torque** as we bring you the best compression/quality ratio available with our lossy options for JPG, PNG, and PDF files. +1. **Adaptive Steering** with intelligent conversion options to get the right image format for the job (JPG, PNG, or GIF). +1. **Free Parking** The core plugin is free and always will be. Additionally, if you choose the API, you never pay for an image we can’t compress, you are never billed for a month you do not use the API, and pre-paid credits never expire. Plus, get WebP image generation at no extra cost: any JPG or PNG can be converted to Google’s next-generation image format. +1. **Comprehensive Coverage:** no image gets left behind, optimize everything on your site, beyond just the WordPress Media Library. +1. **Safety First:** all communications are secured with top SSL encryption. +1. **Roadside Assistance:** top-notch support is in our DNA. While API customers get top priority, we answer [every single support question with care](https://ewww.io/contact-us/). +1. **Pack a Spare:** free image backups store your original images for 30 days. -EWWW Image Optimizer calls optimization utilities directly which is well suited to shared hosting situations where these utilities may already be installed. Pre-compiled binaries/executables are provided for optipng, gifsicle, pngquant, cwebp, and jpegtran. Pngout can be installed with one-click from the settings page. If none of that works, there is a cloud option that will work for any site. +Images can be optimized using tools on your own server for free (jpegtran, optipng, pngout, pngquant, gifsicle, cwebp), or can be optimized via specialized servers that utilize the best tools available in lossless or lossy mode. Our lossy compression uses unique algorithms to gain maximum compression while remaining visually losssless. Your images can even be converted to the most suitable file format using the appropriate options. Using the EWWW I.O. API will allow the plugin to work on any hosting platform, and can also be desirable if you cannot, or do not want to use the exec() function on your server, or prefer to offload the resource demands of optimization. If you need a version of this plugin for API use only, see [EWWW Image Optimizer Cloud](https://wordpress.org/plugins/ewww-image-optimizer-cloud/). It is much more compact as it does not contain any binaries or any mention of the exec() function. @@ -45,19 +44,19 @@ If you need assistance using the plugin, please visit our [Support Page](https:/ Optimize all your images from a single page using the Bulk Scanner. This includes the Media Library, your theme, and a handful of pre-configured folders (see Optimize Everything Else below). Officially supported galleries (GRAND FlaGallery, NextCellent and NextGEN) have their own Bulk Optimize pages. -### Skips Previously Optimized Images +### Optimize Everything Else -All optimized images are stored in the database so that the plugin does not attempt to re-optimize them unless they are modified. On the Bulk Optimize page you can view a list of already optimized images. You may also remove individual images from the list, or use the Force optimize option to override the default behavior. The re-optimize links on the Media Library page also force the plugin to ignore the previous optimization status of images. +Configure any folder within your WordPress folder to be optimized. The Bulk Scan under Media->Bulk Optimize will optimize theme images, BuddyPress avatars, BuddyPress Activity Plus images, Meta Slider slides, WP Symposium Pro avatars, GD bbPress attachments, Grand Media Galleries, and any user-specified folders. Additionally, this tool can run on an hourly basis via wp_cron to keep newly uploaded images optimized. Scheduled optimization should not be used for any plugin that uses the built-in Wordpress image functions. -### WP Image Editor +### Skips Previously Optimized Images -All images created by the built-in WP_Image_Editor class will be automatically optimized. Current implementations are GD, Imagick, and Gmagick. Images optimized via this class include Animated GIF Resize, BuddyPress Activity Plus (thumbs), Easy Watermark, Hammy, Imsanity, MediaPress, Meta Slider, MyArcadePlugin, OTF Regenerate Thumbnails, Regenerate Thumbnails, Simple Image Sizes, WP Retina 2x, WP RSS Aggregator and probably countless others. If you are not sure if a plugin uses WP_Image_Editor, send an inquiry on the support page. +All optimized images are stored in the database so that the plugin does not attempt to re-optimize them unless they are modified. On the Bulk Optimize page you can view a list of already optimized images. You may also remove individual images from the list, or use the Force optimize option to override the default behavior. The re-optimize links on the Media Library page also force the plugin to ignore the previous optimization status of images. -### Optimize Everything Else +### WP Image Editor -Site admins can specify any folder within their wordpress folder to be optimized. The Bulk Scan under Media->Bulk Optimize will optimize theme images, BuddyPress avatars, BuddyPress Activity Plus images, Meta Slider slides, WP Symposium images, GD bbPress attachments, Grand Media Galleries, and any user-specified folders. Additionally, this tool can run on an hourly basis via wp_cron to keep newly uploaded images optimized. Scheduled optimization should not be used for any plugin that uses the built-in Wordpress image functions. +All images created by the built-in WP_Image_Editor class will be automatically optimized. Current implementations are GD, Imagick, and Gmagick. Images optimized via this class include Animated GIF Resize, BuddyPress Activity Plus (thumbs), Easy Watermark, Hammy, Imsanity, MediaPress, Meta Slider, MyArcadePlugin, OTF Regenerate Thumbnails, Regenerate Thumbnails, Simple Image Sizes, WP Retina 2x, WP RSS Aggregator and probably countless others. If you are not sure if a plugin uses WP_Image_Editor, [just ask](https://ewww.io/contact-us/). ### WebP Images @@ -137,6 +136,7 @@ Webhosts where things work (mostly) out of the box: * [aghosted](https://aghosted.com/) * [Arvixe](http://www.arvixe.com) * [Bluehost](https://www.bluehost.com) +* [CiviHosting](https://civihosting.com/) * [DigitalBerg](https://www.digitalberg.com) * [Dreamhost](https://www.dreamhost.com) * [GoDaddy](https://www.godaddy.com) (only with PHP 5.3+) @@ -149,10 +149,11 @@ Webhosts where things work (mostly) out of the box: * [inmotion](http://www.inmotionhosting.com) * [Liquid Web](https://www.liquidweb.com) * [Namecheap](https://www.namecheap.com) +* [The Open Host](https://theopenhost.com) * [OVH](https://www.ovh.co.uk) * [Site5] (https://www.site5.com) (tools must be built manually, or contact Site5 support for assistance) * [SiteGround](https://www.siteground.com) -* [Spry Servers](https://www.spryservers.net) (even with PHP 7) +* [Spry Servers](https://www.spryservers.net) * [WebFaction](https://www.webfaction.com) * [1&1](https://www.1and1.com) (pngout requires manual upload and permissions fix) @@ -226,8 +227,8 @@ Using the command *gifsicle -b -O3 --careful original file*. This is particularl ### 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: -http://developer.yahoo.com/performance/rules.html#opt_images https://developers.google.com/speed/docs/insights/OptimizeImages +http://developer.yahoo.com/performance/rules.html#opt_images 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. diff --git a/common.php b/common.php index 8ae00e10..e7306a0a 100644 --- a/common.php +++ b/common.php @@ -31,11 +31,14 @@ // TODO: check this patch, to see if the use of 'full' causes any issues: https://core.trac.wordpress.org/ticket/37840 . // TODO: perhaps have an optional footer thingy that says how many images have been optimized. // TODO: integrate AGR, since it's "abandoned", but possibly using gifsicle for better GIFs. +// TODO: make sure resized images get compressed before comparison/discard. +// TODO: allow an S3 defer override for folks that have the thumbnail broken issue when uploads are delayed. +// TODO: link to wp-cli docs page in readme description. if ( ! defined( 'ABSPATH' ) ) { exit; } -define( 'EWWW_IMAGE_OPTIMIZER_VERSION', '341.0' ); +define( 'EWWW_IMAGE_OPTIMIZER_VERSION', '350.0' ); // Initialize a couple globals. $ewww_debug = ''; @@ -193,7 +196,9 @@ } else { // Loads jQuery and the minified inline webp rewrite script. add_action( 'wp_enqueue_scripts', 'ewww_image_optimizer_webp_load_jquery' ); - add_action( 'wp_head', 'ewww_image_optimizer_webp_inline_script' ); + if ( ! function_exists( 'wp_add_inline_script' ) ) { + add_action( 'wp_head', 'ewww_image_optimizer_webp_inline_script' ); + } } } @@ -2294,6 +2299,11 @@ function ewww_image_optimizer_webp_min_script() { function ewww_image_optimizer_webp_load_jquery() { if ( ! ewww_image_optimizer_ce_webp_enabled() ) { wp_enqueue_script( 'jquery' ); + if ( function_exists( 'wp_add_inline_script' ) ) { + wp_add_inline_script( 'jquery-migrate', + 'function check_webp_feature(a,b){var c={alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"},d=!1,e=new Image;e.onload=function(){var a=e.width>0&&e.height>0;d=!0,b(a)},e.onerror=function(){d=!1,b(!1)},e.src="data:image/webp;base64,"+c[a]}function ewww_load_images(a){jQuery(document).arrive(".ewww_webp",function(){ewww_load_images(a)}),function(b){function d(a,d){for(var e=["align","alt","border","crossorigin","height","hspace","ismap","longdesc","usemap","vspace","width","accesskey","class","contenteditable","contextmenu","dir","draggable","dropzone","hidden","id","lang","spellcheck","style","tabindex","title","translate","sizes","data-attachment-id","data-permalink","data-orig-size","data-comments-opened","data-image-meta","data-image-title","data-image-description"],f=0,g=e.length;f0&&e.checkChildNodesRecursively(g.childNodes,b,c,d)},mergeArrays:function(a,b){var d,c={};for(d in a)c[d]=a[d];for(d in b)c[d]=b[d];return c},toElementsArray:function(b){return void 0===b||"number"==typeof b.length&&b!==a||(b=[b]),b}}}(),f=function(){var a=function(){this._eventsBucket=[],this._beforeAdding=null,this._beforeRemoving=null};return a.prototype.addEvent=function(a,b,c,d){var e={target:a,selector:b,options:c,callback:d,firedElems:[]};return this._beforeAdding&&this._beforeAdding(e),this._eventsBucket.push(e),e},a.prototype.removeEvent=function(a){for(var c,b=this._eventsBucket.length-1;c=this._eventsBucket[b];b--)a(c)&&(this._beforeRemoving&&this._beforeRemoving(c),this._eventsBucket.splice(b,1))},a.prototype.beforeAdding=function(a){this._beforeAdding=a},a.prototype.beforeRemoving=function(a){this._beforeRemoving=a},a}(),g=function(b,d){var g=new f,h=this,i={fireOnAttributesModification:!1};return g.beforeAdding(function(c){var i,e=c.target;c.selector,c.callback;e!==a.document&&e!==a||(e=document.getElementsByTagName("html")[0]),i=new MutationObserver(function(a){d.call(this,a,c)});var j=b(c.options);i.observe(e,j),c.observer=i,c.me=h}),g.beforeRemoving(function(a){a.observer.disconnect()}),this.bindEvent=function(a,b,c){b=e.mergeArrays(i,b);for(var d=e.toElementsArray(this),f=0;f0?e.checkChildNodesRecursively(c,b,k,f):"attributes"===a.type&&k(d,b,f)&&f.push({callback:b.callback,elem:node}),e.callCallbacks(f)})}function k(a,b,f){if(e.matchesSelector(a,b.selector)&&(a._id===c&&(a._id=d++),-1==b.firedElems.indexOf(a._id))){if(b.options.onceOnly){if(0!==b.firedElems.length)return;b.me.unbindEventWithSelectorAndCallback.call(b.target,b.selector,b.callback)}b.firedElems.push(a._id),f.push({callback:b.callback,elem:a})}}var f={fireOnAttributesModification:!1,onceOnly:!1,existing:!1};j=new g(h,i);var l=j.bindEvent;return j.bindEvent=function(a,b,c){void 0===c?(c=b,b=f):b=e.mergeArrays(f,b);var d=e.toElementsArray(this);if(b.existing){for(var g=[],h=0;h0&&e.checkChildNodesRecursively(c,b,h,f),e.callCallbacks(f)})}function h(a,b){return e.matchesSelector(a,b.selector)}var c={};k=new g(d,f);var i=k.bindEvent;return k.bindEvent=function(a,b,d){void 0===d?(d=b,b=c):b=e.mergeArrays(c,b),i.call(this,a,b,d)},k},j=new h,k=new i;b&&m(b.fn),m(HTMLElement.prototype),m(NodeList.prototype),m(HTMLCollection.prototype),m(HTMLDocument.prototype),m(Window.prototype);var n={};return l(j,n,"unbindAllArrive"),l(k,n,"unbindAllLeave"),n}}(window,"undefined"==typeof jQuery?null:jQuery,void 0);"undefined"!=typeof jQuery&&check_webp_feature("alpha",ewww_load_images);' + ); + } } } diff --git a/ewww-image-optimizer.php b/ewww-image-optimizer.php index b4cdf86f..2c8f369b 100644 --- a/ewww-image-optimizer.php +++ b/ewww-image-optimizer.php @@ -14,7 +14,7 @@ Description: Reduce file sizes for images within WordPress including NextGEN Gallery and GRAND FlAGallery. Uses jpegtran, optipng/pngout, and gifsicle. Author: Shane Bishop Text Domain: ewww-image-optimizer -Version: 3.4.1.2 +Version: 3.5.0 Author URI: https://ewww.io/ License: GPLv3 */ diff --git a/readme.txt b/readme.txt index 9ce60f7d..0df1f1f7 100644 --- a/readme.txt +++ b/readme.txt @@ -4,30 +4,30 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i Tags: image, compress, optimize, optimization, lossless, lossy, photo, picture, seo, jpegmini, tinyjpg, tinypng, webp, wp-cli Requires at least: 4.4 Tested up to: 4.8 -Stable tag: 3.4.1 +Stable tag: 3.5.0 License: GPLv3 Speed up your website and improve your visitors' experience by automatically compressing and resizing images and PDFs. Boost SEO and improve sales. == Description == -The EWWW Image Optimizer will automatically compress and resize your images as you upload them to your blog. It can optimize all the images that you have already uploaded, and optionally convert your images to the best file format. Pixel perfect compression is free or you can [use the API to achieve more dramatic savings](https://ewww.io/) with visually lossless compression. +The EWWW Image Optimizer will increase your page speeds by way of image optimization. Increased page speeds can result in better search engine rankings, and will also improve conversion rates (increased sales and signups). It will also save you storage space and bandwidth. While EWWW I.O. will automatically optimize new images that you upload, it can also optimize all the images that you have already uploaded, and optionally convert your images to the best file format. You can choose pixel perfect compression or high compression options that are visually lossless. -**Why use EWWW Image Optimizer?** - -1. **Your pages will load faster.** Smaller image sizes means faster page loads. This will make your visitors happy, and can increase revenue. -1. **Faster backups.** Smaller image sizes also means faster backups. -1. **Less bandwidth usage.** Optimizing your images can save you hundreds of KB per image, which means significantly less bandwidth usage. -1. **Super fast.** The plugin can run on your own server, so you don’t have to wait for a third party service to receive, process, and return your images. You can optimize hundreds of images in just a few minutes. PNG files take the longest, but you can adjust the settings for your situation. -1. **High quality image optimization.** With visually lossless compression, the quality and image savings is unmatched. -1. **Free local compression** The plugin includes tools to compress images right on your own server at no cost, with [cloud optimization available](https://ewww.io) for those who cannot run the local tools. -1. **Optimize everything** No image gets left behind, any image in Wordpress can be optimized. +EWWW I.O. will optimize images uploaded and created by any plugin, and features special integrations with many popular plugins, detailed below. -By default, EWWW Image Optimizer uses lossless optimization techniques, so your image quality will be exactly the same before and after the optimization. Optional lossy optimization for JPG and PNG files uses sophisticated algorithms to preserve the quality of your images and maximize the savings achieved. +**Why use EWWW Image Optimizer?** -The tools used for optimization are [jpegtran](http://jpegclub.org/jpegtran/), [TinyJPG](http://www.tinyjpg.com), [JPEGmini](http://www.jpegmini.com), [optipng](http://optipng.sourceforge.net/), [pngout](http://advsys.net/ken/utils.htm), [pngquant](http://pngquant.org/), [TinyPNG](http://www.tinypng.com), and [gifsicle](http://www.lcdf.org/gifsicle/). Most of these are freely available except TinyJPG/TinyPNG and JPEGmini which are [available via the API](https://ewww.io/). Images are converted using the above tools and one of the following: GMagick, IMagick, or GD. +1. **No Speed Limits** and [unlimited file size](https://ewww.io/unlimited-file-size/). Using automatic Background Optimization and optional Parallel Optimization, get rid of upload delays and get back to doing what you love. +1. **Smooth Handling** with pixel-perfect optimization using industry-leading tools and progressive rendering. +1. **High Torque** as we bring you the best compression/quality ratio available with our lossy options for JPG, PNG, and PDF files. +1. **Adaptive Steering** with intelligent conversion options to get the right image format for the job (JPG, PNG, or GIF). +1. **Free Parking** The core plugin is free and always will be. Additionally, if you choose the API, you never pay for an image we can’t compress, you are never billed for a month you do not use the API, and pre-paid credits never expire. Plus, get WebP image generation at no extra cost: any JPG or PNG can be converted to Google’s next-generation image format. +1. **Comprehensive Coverage:** no image gets left behind, optimize everything on your site, beyond just the WordPress Media Library. +1. **Safety First:** all communications are secured with top SSL encryption. +1. **Roadside Assistance:** top-notch support is in our DNA. While API customers get top priority, we answer [every single support question with care](https://ewww.io/contact-us/). +1. **Pack a Spare:** free image backups store your original images for 30 days. -EWWW Image Optimizer calls optimization utilities directly which is well suited to shared hosting situations where these utilities may already be installed. Pre-compiled binaries/executables are provided for optipng, gifsicle, pngquant, cwebp, and jpegtran. Pngout can be installed with one-click from the settings page. If none of that works, there is a cloud option that will work for any site. +Images can be optimized using tools on your own server for free (jpegtran, optipng, pngout, pngquant, gifsicle, cwebp), or can be optimized via specialized servers that utilize the best tools available in lossless or lossy mode. Our lossy compression uses unique algorithms to gain maximum compression while remaining visually losssless. Your images can even be converted to the most suitable file format using the appropriate options. Using the EWWW I.O. API will allow the plugin to work on any hosting platform, and can also be desirable if you cannot, or do not want to use the exec() function on your server, or prefer to offload the resource demands of optimization. If you need a version of this plugin for API use only, see [EWWW Image Optimizer Cloud](https://wordpress.org/plugins/ewww-image-optimizer-cloud/). It is much more compact as it does not contain any binaries or any mention of the exec() function. @@ -50,7 +50,7 @@ All optimized images are stored in the database so that the plugin does not atte = WP Image Editor = -All images created by the built-in WP_Image_Editor class will be automatically optimized. Current implementations are GD, Imagick, and Gmagick. Images optimized via this class include Animated GIF Resize, BuddyPress Activity Plus (thumbs), Easy Watermark, Hammy, Imsanity, MediaPress, Meta Slider, MyArcadePlugin, OTF Regenerate Thumbnails, Regenerate Thumbnails, Simple Image Sizes, WP Retina 2x, WP RSS Aggregator and probably countless others. If you are not sure if a plugin uses WP_Image_Editor, send an inquiry on the support page. +All images created by the built-in WP_Image_Editor class will be automatically optimized. Current implementations are GD, Imagick, and Gmagick. Images optimized via this class include Animated GIF Resize, BuddyPress Activity Plus (thumbs), Easy Watermark, Hammy, Imsanity, MediaPress, Meta Slider, MyArcadePlugin, OTF Regenerate Thumbnails, Regenerate Thumbnails, Simple Image Sizes, WP Retina 2x, WP RSS Aggregator and probably countless others. If you are not sure if a plugin uses WP_Image_Editor, [just ask](https://ewww.io/contact-us/). = WebP Images = @@ -135,7 +135,7 @@ Webhosts where things work (mostly) out of the box: * [OVH](https://www.ovh.co.uk) * [Site5](https://www.site5.com) (tools must be built manually, or contact Site5 support for assistance) * [SiteGround](https://www.siteground.com) -* [Spry Servers](https://www.spryservers.net) (even with PHP 7) +* [Spry Servers](https://www.spryservers.net) * [WebFaction](https://www.webfaction.com) * [1&1](https://www.1and1.com) (pngout requires manual upload and permissions fix) @@ -171,7 +171,7 @@ 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 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: http://docs.ewww.io/article/12-jpq-quality-and-wordpress = The bulk optimizer doesn't seem to be working, what can I do? = @@ -197,8 +197,8 @@ Using the command *gifsicle -b -O3 --careful original file*. This is particularl = 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: -http://developer.yahoo.com/performance/rules.html#opt_images https://developers.google.com/speed/docs/insights/OptimizeImages +http://developer.yahoo.com/performance/rules.html#opt_images 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. @@ -214,7 +214,7 @@ Pngout, TinyJPG/TinyPNG, JPEGmini, and Pngquant were recommended by EWWW IO user * 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/ -= 3.4.9 = += 3.5.0 = * added: compatibility with S3 Uploads by Human Made * added: MediaPress uploads fully optimized on upload * changed: WebP .htaccess rewrite rule verifier more flexible @@ -244,7 +244,7 @@ Pngout, TinyJPG/TinyPNG, JPEGmini, and Pngquant were recommended by EWWW IO user * fixed: webp migration script sending wrong nonce variable * fixed: wp-cli help text was not being parsed properly * updated: bundled cwebp to version 0.6.0 -* updated: bundled pngquant to verision 2.9.1 (2.8.1 for Windows) +* updated: bundled pngquant to version 2.9.1 (2.8.1 for Windows) * deprecated: cwebp will not be updated for Mac OS X 10.9 past 0.5.1 * obsoleted: FreeBSD 9 and CentOS 5 are "End of Life" and will no longer be tested @@ -266,19 +266,13 @@ Please refer to the separate changelog.txt file. * changed: JPG quality setting applies to conversion AND image editing (but not regular optimization), so that you can override the WP default of 82 (it is NOT recommended to increase the quality) * added: parallel optimization for Media uploads (original and resizes are done concurrently), turn off under Advanced if it affects site performance -= 2.8.4 = -* security fix: remote command execution, please update immediately - -= 2.8.1 = -* KeyCDN added support for WebP images generated by EWWW I.O. into the Cache Enabler plugin. If you are using Cache Enabler, you may wish to use their WebP option instead of Alt WebP Rewriting. Works very nicely with CDNs and is a nice simple caching plugin. - == Contact and Credits == Written by [Shane Bishop](https://ewww.io). Based upon CW Image Optimizer, which was written by [Jacob Allred](http://www.jacoballred.com/) at [Corban Works, LLC](http://www.corbanworks.com/). CW Image Optimizer was based on WP Smush.it. Jpegtran is the work of the Independent JPEG Group. PEL is the work of Martin Geisler, Lars Olesen, and Erik Oskam. = optipng = -Copyright (C) 2001-2014 Cosmin Truta and the Contributing Authors. +Copyright (C) 2001-2017 Cosmin Truta and the Contributing Authors. For the purpose of copyright and licensing, the list of Contributing Authors is available in the accompanying AUTHORS file. @@ -300,7 +294,7 @@ arising from the use of this software. = pngquant.c and rwpng.c/h = © 1997-2002 by Greg Roelofs; based on an idea by Stefan Schneider. - © 2009-2014 by Kornel Lesiński. + © 2009-2017 by Kornel Lesiński. All rights reserved. diff --git a/unique.php b/unique.php index 6cb88caf..27d03ccc 100644 --- a/unique.php +++ b/unique.php @@ -1544,7 +1544,9 @@ function ewww_image_optimizer( $file, $gallery_type = 4, $converted = false, $ne $s3_uploads_image = $file; $s3_uploads_instance = S3_Uploads::get_instance(); $s3_uploads_instance->setup(); - require_once( ABSPATH . 'wp-admin/includes/admin.php' ); + if ( ! function_exists( 'wp_tempnam' ) ) { + require_once( ABSPATH . 'wp-admin/includes/admin.php' ); + } $file = $s3_uploads_instance->copy_image_from_s3( $file ); } // Initialize the original filename.