Improvement: when all CSS is inlined, try doing so after SEO meta-tags (just before ld+json script tag which most SEO plugins add as last item on their list).
Img opt: also optimize images set in data-background and data-retina attributes (+ filter to easily add other attributes)
CSS opt: filter to enable AO to skip minification of calc formulas in CSS (as the CSS minifier on rare occasions breaks those)
Multiple other filters added
Some other minor changes/ improvements/ filters, see the GitHub commit log.
Quick workaround for an autoload conflict with JetFormBuilder (and maybe other Crocoblock plugins?) that causes a critical error on the AO settings page.
images: when optimizing images and lazyloading is on, then by default do not set an LQIP (low quality image placeholder) any more (reason: it might look nice but it comes with a small-ish perf. penalty). This can be re-enabled by returning true to the autoptimize_filter_imgopt_lazyload_dolqip filter.
security: further improvements to critical CSS settings page (again with the great assistance of WPScan Security).
some other minor changes/ improvements/ filters, see the GitHub commit log.
new: HTML sub-option: "minify inline CSS/ JS" (off by default).
new: Misc option: permanently allow the "do not run compatibility logic" flag to be removed (which was set for users upgrading from AO 2.9.* to AO 3.0.* as the assumption was things were working anyway).
security: improvements to the critical CSS settings page to fix authenticated cross site scripting issues as reported by WPScan Security.
bugfix: "defer inline JS" of very large chunks of inline JS could cause server errors (PCRE crash actually) so not deferring if string is more then 200000 characters (filter available).
some other minor changes/ improvements/ hooks, see the GitHub commit log
rollback automatic "minify inline CSS/ JS" which broke more then expected, this will come back as a separate default off option later and can now be enabled with a simple filter: add_filter( 'autoptimize_html_minify_inline_js_css', '__return_true'); .
fix for "Call to undefined method autoptimizeOptionWrapper::delete_option()" in autoptimizeVersionUpdatesHandler.php
fundamental change for new installations: by default Autoptimize will not aggregate JS/ CSS any more (HTTP/2 is ubiquitous and there are other advantages to not aggregating esp. re. inline JS/ CSS and dependancies)
new: no API needed any more to create manual critical CSS rules.
new: "Remove WordPress blocks CSS" option on the "Extra" tab to remove block- and global styles (and SVG).
new: compatibility logic for "edit with elementor", "revolution slider", for non-aggregated inline JS requiring jQuery even if not excluded (
Improvement: add logic to autoptimize_404_handler.php to differentiate between different multisite sites.
Improvement: remove the different feeds (and all JS to switch between them) on the settings-page, keeping only the "Autoptimize news".
Improvement: reduced autoptimize_enable_site_config option lookups when on multisite and AO is active for network.
Fixed wrong variable name that caused PHP notices (but did not affect normal usage) to $w3tc_minify_on.
Fix for Autoptimize Toolbar being loaded on AMP pages for logged in administrators/ editors
Fix for CDN replacement edge case (if the CDN has the site_url in it).
Fix for service availability checks causing too many outgoing requests (root cause likely to be object caching resulting in the autoptimize_service_availability option not being updated)
Added "exit survey" when Autoptimize is deactivated (with the kind help of Shakeeb of RapidLoad, thanks brother!)
New: per page/ post Autoptimize settings so one can disable specific optimizations (needs to be enabled on the main settings page under "Misc Options").
New: "defer inline JS" as sub-option of "do not aggregate but defer" allowing to defer (almost) all JS.
Improvement: Image optimization now automatically switches between AVIF & WebP & Jpeg even if lazyload is not active (AVIF has to be explicitly enabled).
Improvement: re-ordering of "JavaScript optimization" settings
Misc. other minor fixes, see the GitHub commit log
This release coincides with my father's 76th birthday, who continues to be a big inspritation to me. He's a mechanical engineer who after retirement focused his technical insights, experience and never-ending inquisitiveness on fountain pen design and prototyping, inventing a new bulkfiller mechanism in the process. Search the web for Fountainbel to find out more about him (or read this older blogpost I wrote in Dutch). Love you pops!
Images: only show "did you know shortpixel" notice on Autoptimize settings pages (no more littering all over the backend)
Images: update lazysizes from upstream
Images: misc. improvements such as fix for PHP "undefined index" notice, updated copy, ...
HTML: rename HTML minify class from minify_HTML to AO_minify_HTML to avoid conflicts with e.g. W3TC
Critical CSS: misc. improvements such as detect is_front_page before any other conditional, fix for conditional rules without an actual condition, improved debug logging, ...
JS/ CSS: fix for AO not optimizing multisite child sites when CDN set
Image optimization: add support for AVIF image format for browsers that support it (enabled with the existing WebP-option, also requires lazy-load to be active)
Critical CSS: further security improvements of critical CSS import settings upload, based on the input of Marcin Weglowski of afine.com
Misc. other minor fixes, see the GitHub commit log.
Image optimization: fix webp-detection for Safari (contributed by @pinkasey)
Image lazyload: remove CSS that hides the placeholder image/ sets transistion between placeholder and final image
Critical CSS: new advanced option to unload CCSS on onLoad
Critical CSS improvement: cache templates in a transient to avoid overhead of having to search filesystem time and time again (contributed by @pratham2003)
Critical CSS improvement: better but still experimental jQuery deferring logic
Critical CSS fix: prevent MANUAL template-based rules being overwritten
CSS Inline & defer: move away from old loadCSS-based approach to Filamentgroup's new, simpler method
404 fallback enabled by default for new installations
changed all occurences of blacklist/ whitelist to blocklist/ allowlist. The filters autoptimize_filter_js_whitelist and autoptimize_filter_css_whitelist still work in 2.7.4 but usage is deprecated and should be replaced with autoptimize_filter_js_allowlist and autoptimize_filter_css_allowlist.
updated readme to explicitly confirm this is GPL + praise open source projects used in Autoptimize as praise was long overdue!
tested and confirmed working on WordPress 5.5 beta 2
auto-exclude images from lazyload when they have loading="eager" attribute.
bugfix: don't take querystring into account when deciding as-value for preloaded resources.
bugfix; ensure lqip images (used when both image optimization and lazyload are active) always work by normalizing the URL before sending it to shortpixel.
bugfixes for multiple lazyload bugs causing images not to load or load incorrectly
bugfixes for multiple multisite bugs causing settings-screen to be unavailable
bugfix re-added 3rd parameter to autoptimize_filter_js_minify_excluded-filter to ensure backwards-compatibility and thus avoid breaking Smart Cookie Kit which expected that 3rd parameter.
refactored significantly (no more "classlesses", all is OO), classes are autoloaded, tests added (travis-ci) by zytzagoo who deserves praise for his hard work!
new: image optimization (see "Extra"-tab) using Shortpixel's smart image optimization proxy
new: you can now disable JS/ CSS-files being aggregated, having them minified individually instead
new: Google Fonts can now be "aggregated & preloaded", this uses CSS which is loaded non render-blocking
new: Autoptimize "listens" to page caches being cleared, upon which it purges it's own cache as well. Support depends on known action hooks firing by the page cache, supported by Hyper Cache, WP Rocket, W3 Total Cache, KeyCDN Cache Enabler, Swift, WP Super Cache, WP Fastest Cache and Comet Cache.
new: local JS/ CSS-files that are excluded from optimization are minified by default (can be overridden by filter)
improvement: updated minifiers (with very significant improvements for YUI CSS compressor PHP port)
improvement: "remove all Google Fonts" is now more careful (avoiding removing entire CSS blocks)
misc. under the hood improvements (e.g. more robust cache clearing, better support for multibyte character sets, improved CDN rewrite logic, avoid PHP warnings when writing files to cache, ...)
improvement: updated to latest version of Filamentgroup's loadCSS
improvement: by default exclude wp-content/cache and wp-content/uploads from CSS optimization (Divi, Avada & possibly others store page-specific CSS there)
bugfix: stop double try/catch-blocks
misc. bugfixes (see GitHub commit log)
heads-up: this is (supposed to be) the last minor release of the 2.3 branch, 2.4 is a major change with some big under-the-hood and functional changes
workaround for stale options-data in external object cache such as Redis, Memcached (core bug) resulting in Autoptimize continuously executing the upgrade-procedure including clearing the cache and trying to preload it with HTTP-requests with "cachebuster" in the query string, thanks to Haroon Q. Raja and Tomas Trkulja for their great assistance!
fixes for "undefined index" notices on Extra settings page
now removing respective dns-prefetch resource hints when "remove emojis" or when Google Fonts are optimized or removed.
changed JS code to load webfont.js deferred instead of asynced to make sure the js-file or fonts are not consider render blocking.
new: optimize Google fonts with combine & link and combine and load async (with webload.js), intelligently preconnecting to Googles domains to limit performance impact even further
new: Async JS, can be applied to local or 3rd party JS (if local it will be auto-excluded from autoptimization)
new: Autoptimize minifies first (caching the individual snippets) and aggregrates the minified snippets, resulting in huge performance improvements for uncached JS/ CSS.
new: option to enable/ disable AO for logged in users (on by default)
new: option to enable/ disable AO on WooCommerce, Easy Digital Downloads or WP eCommerce cart/ checkout page (on by default)
improvement: switched to rel=preload + Filamentgroups loadCSS for CSS deferring
improvement: switched to YUI CSS minifier PHP-port 2.8.4-p10 (so not to the 3.x branch yet)
improvements to the logic of which JS/ CSS can be optimized (getPath function) increasing reliability of the aggregation process
security: made placeholder replacement less naive to protect against XSS and LFI vulnerability as reported by Matthew Barry and fixed with great help from Matthew and Tomas Trkulja. Thanks guys!!
API: Lots of extra filters, making AO (even) more flexible.
Lots of bugfixes and smaller improvements (see GitHub commit log)
new: Autoptimize now appears in admin-toolbar with an easy view on cache size and the possibility to purge the cache (pass false to autoptimize_filter_toolbar_show filter to disable), a big thanks to Pablo Custo for his hard work on this nice feature!
new: An extra "More Optimization"-tab is shown (can be hidden with autoptimize_filter_show_partner_tabs-filter) with information about related optimization tools- and services.
new: If cache size becomes too big, a mail will be sent to the site admin (pass false to autoptimize_filter_cachecheck_sendmail filter to disable or pass alternative email to the autoptimize_filter_cachecheck_mailto filter to change email-address)
new: power-users can enable Autoptimize to pre-gzip the autoptimized files by passing true to autoptimize_filter_cache_create_static_gzip, kudo's to (Draikin)[https://github.com/Draikin] for this!
improvement: admin GUI updated (again; thanks Pablo!) with some responsiveness added in the mix (not showing the right hand column on smaller screen-sizes)
improvement: settings-screen now accepts protocol-relative URL for CDN base URL
improvement: new (smarter) defaults for JS (don't force in head + exclude jquery.js) and CSS optimization (include inline CSS)
Misc. bugfixes & small improvements (see commit-log on GitHub)
Improvement: Autoptimize now also tries to purge WP Engine cache when AOs cache is cleared
Improvement: for AMP pages (which are pretty optimized anyway) Autoptimize will not optimize to avoid issues with e.g. "inline & defer" and with AO adding attributes to link-tags that are not allowed in the subset of HTML that AMP is
Improvement: refactored the page cache purging mechanism (removing duplicate code, now nicely hooking into AO's own autoptimize_action_cachepurged action)
Improvement: Re-enable functionality to move non-aggregated JS if also aggregate inline JS is active (can be disabled with autoptiize_filter_js_unmovable filter)
Improvement: script tags with data-noptimize attribute will be excluded from optimization
Bugfix: Better support for renamed wp-content directories
Bugfix: Multiple fixes for late-injected CSS/ JS (changes in those files were not always picked up, fonts or background images were not being CDNed, )
Misc. other fixes & improvements, go read the commit-log on GitHub if youre that curious
Tested & confirmed working with WordPress 4.5 (beta 3)
On average 30% faster minification (more info in this blogpost)!
New: Option to (de-)activate aggregation of inline JS and CSS.
New: Option to remove Google Fonts.
New: Cache-size will be checked daily and a notice will be shown on wp-admin if cache size goes over 512 MB (can be changed by filter).
New: Small autoptimized CSS (less then 256 characters, can be changed by filter) will be inlined instead of linked.
New in API: filters to declare a JS and CSS whitelist, where only files in that whitelist are autoptimized and all others are left untouched.
New in API: filters to declare removable CSS and JS, upon which Autoptimize will simply delete that code (emoji CSS/JS for example, if you prefer not to dequeue them).
New in API: filter to move fonts to CDN as well.
lots of small and bigger bugfixes, I wont bother you with a full list but have a look at the commmit log on GitHub.
bugfix: make sure non-AO CSSmin doesn't get fed 2 parameters (as some only expect one, which resulted in an internal server error), based on feedback from zerooverture and zamba
bugfix: make default add_action hook back into "template_redirect" instead of "init" to fix multiple problems as reported by schecteracademicservices, bond138, rickenbacker, Rick Sportel and wizray. If you do need Autoptimize to initialize earlier (e.g. when using Nextgen Galleries), then add this to your wp-config.php:
define("AUTOPTIMIZE_INIT_EARLIER","true");
improvement: more intelligent CDN-replacement logic, thanks Squazz for reporting and testing
improvement: allow strings (comments) to be excluded from HTML-optimization (comment removal)
improvement: changed priority with which AO gets triggered by WordPress, solving JS not being aggregated when NextGen Galleries is active, with great help from msebald
improvement: extra JS exclude-strings: gist.github.com, text/html, text/template, wp-slimstat.min.js, _stq, nonce, post_id (the latter two were removed from the "manual" exclude list on the settings-page)
new in API: autoptimize_filter_html_exclude, autoptimize_filter_css_defer, autoptimize_filter_css_inline, autoptimize_filter_base_replace_cdn, autoptimize_filter_js_noptimize, autoptimize_filter_css_noptimize, autoptimize_filter_html_noptimize
bugfix: remove some PHP notices, as reported by dimitrov.adrian
bugfix: make sure HTML-optimalization does not gobble a space before a cite as proposed by ecdltf
bugfix: cleaning the cache did not work on non-default directories as encountered by NoahJ Champion
upgraded to yui compressor php port 2.4.8-4
added arabic translation, thanks to the ekleel team
First of all; Happy holidays, all the best for 2015!!
New: support for alternative cache-directory and file-prefix as requested by a.o. Jassi Bacha, Cluster666 and Baris Unver.
Improvement: hard-exclude all linked-data json objects (script type=application/ld+json)
Improvement: several filters added to the API, e.g. to alter optimized HTML, CSS or JS
Bugfix: set Autoptimize priority back from 11 to 2 (as previously) to avoid some pages not being optimized (thanks to CaveatLector for investigating & reporting)
Bugfix (in YUI-CSS-compressor-PHP-port): don't convert bools to percentages in rotate3D-transforms (cfr. bugreport on Github)
Bugfix: background images with a space in the path didn't load, reported by johnh10.
Bugfix: SVG image with fill:url broken after CSS optimization as reported by Tkama
Updated translation for Swedish, new translation for Ukrainian by Zanatoly of SebWeo.com
"Inline and defer CSS" allows one to specify which "above the fold CSS" should be inlined, while the normal optimized CSS is deferred.
Inlined Base64-encoded background Images will now be cached as well and the threshold for inlining these images has been bumped up to 4096 bytes (from 2560).
Separate cache-directories for CSS and JS in /wp-content/cache/autoptimize, which should result in faster cache pruning (and in some cases possibly faster serving of individual aggregated files).
Updated to lastest version of CSS minification component
Improvement: for multi-sites the cache is now written to seperate directories, avoiding one site to clean out the cache for the entire installation. Code contributed by Joern Lund, kudo's Joern!!
Improvement: add WordPress plugin header to autoptimize_helper.php_example to make it easier to enable it as a module
Improvement: nonce and post_id are added to default configuration for JS exclusion
Improvement: explicitely exclude wp-admin from being Autoptimized
Bugfix: plupload.min.js, syntaxhighlighter and "adsbygoogle" are excluded from JS aggregation.
Bugfix: avoid double closing body-tags when Autoptimize adds JS to HTML as reported by Can
Bugfix: make .htaccess compatible with both Apache 2.2 and 2.4 (http://wordpress.org/support/topic/feature-request-support-generating-htaccess-files-for-apache-24?replies=3)
New: Option to inline all CSS as suggested by Hamed
New: set of filters to provide a simple API to change Autoptimize behavior (e.g. replace "defer" with "async", disabling Autoptimization on certain pages, specificy non-aggregatable script to be moved after aggregated one (cfr. http://wordpress.org/support/topic/feature-request-some-extra-options?replies=14), size of image to be data-urized). More info in the included autoptimize_helper.php_example.
Improvement: exclude (css in) noscript-tags as proposed by belg4mit
Improvement: switch default delivery of optimized CSS/JS-files from PHP to static files
Updated upstream CSS minifier
Improvement (force gzip of static files) and Bugfix (force expiry for dynamic files, thanks to Willem Razenberg in .htaccess
Improvement: fail gracefully when things go wrong (e.g. CSS import resulting in empty aggregated CSS-files reported by Danka or when the theme is broken as seen by Prateek Gupta)
Updated translations and Polish added (thanks to Jakub Sierpinski).
Bugfix: stop import-statements in CSS comments to be taken into acccount hat tip to Josef from blog-it-solutions.de
Bugfix: fix for blur in CSS breakeage as reported by Chris of clickpanic.com
improvement: remove cache + options on uninstall as requested by Gingerbreadmen
improvement: set .htaccess to allow PHP execution in wp-content/cache/autoptimize when saving optimized files as PHP, as suggested by (David Mottershead of bermuda4u.com}[http://www.bermuda4u.com/] but forbid PHP execution when saving aggregated script/css as static files (except for multisite).
bugfix: avoid Yoast SEO sitemaps going blank (due optimization of Yoast's dynamically built XML/XSL) as reported by Vance Hallman and Armand Hadife. More info on this issue can be found on my blog.
improvement: extra checks in CSS @import-handling + move import rules to top of CSS if not imported successfully, based a.o. on bug reports by ozum and by Peter Stolwijk
improvement: check if JS and CSS minifier classes exist and only load if they don't to avoid possible conflicts with other themes or plugins that already loaded minifiers
New: support for mapped domains as suggested by Michael for tiremoni.com
Added an .htaccess to wp-content/cache/autoptimize to overwrite other caching directives (fixing a problem with WP Super Cache's .htaccess really, as reported by Hugh of www.unitedworldschools.org)
bugfix: Autoptimize broke data:uri's in CSS in some cases as reported by Joseph from blog-it-solutions.de
bugfix: avoid PHP notice if CSS exclusion list is empty
Updated CDN-support for added simplicity (code & UI-wise), including changing background image url in CSS
Updated/ new translations provided for French: wordpress-hebergement.fr, Persian: Hamed Irani, Swedish: Jonathan Sulo, German: blog-it-solutions.de and Dutch
Removed support for YUI
Flush HTML caching plugin's cache when flushing Autoptimize's one
fix for BOM marker in CSS-files as seen in Frontier theme, kudo's to Download Converter for reporting!
fix for protocol-less 3rd party scripts disappearing, thanks for reporting p33t3r!
fix for stylesheets without type="text/css" not being autoptimized as reported by renzo
tested with WordPress 3.7 beta2 (admin-bar.min.js added to automatically excluded scripts)
New: disable autoptimizatoin by putting part of your HTML, JS or CSS in between noptimize-tags, e.g.;
<!--noptimize--><script>alert('this will not get autoptimized');</script><!--/noptimize-->
Added extra check to prevent plugin-files being called outside of WordPress as suggested in this good article on security.
Added small notice to be displayed after installation/ activation to ask user to configure the plugin as well.
Yet another emergency bugfix I'm afraid: apache_request_headers (again in config/delayed.php) is only available on ... Apache (duh), breaking non-Apache systems such as ngnix, Lighttpd and MS IIS badly. Reported by multiple users, thanks all!
You can now specify scripts that should not be Autoptimized in the admin page. Just add the names (or part of the path) of the scripts in a comma-seperated list and that JavaScript-file will remain untouched by Autoptimize.
Added support for ETag and LastModified (essentially for a better pagespeed score, as the files are explicitely cacheable for 1 year)
Autoptimizing for logged in users is enabled again
Autoptimize now creates an index.html in wp-content/cache/autoptimize to prevent snooping (as proposed by Chris)
bugfix: removed all deprecated functions (reported by Hypolythe and diff by Heiko Adams, thanks guys!)
bugfix for HTTPS-problem as reported by dbs121
bugfix for breakage with unusual WordPress directory layout as reported by Josef from blog-it-solutions.de.
bugfix: add CSS before opening title-tag instead of after closing title, to avoid CSS being loaded in wrong order, as reported by fotofashion and blogitsolutions (thanks guys)