Version Description
- 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");
Download this release
Release Info
Developer | futtta |
Plugin | Autoptimize |
Version | 1.9.4 |
Comparing to | |
See all releases |
Code changes from version 1.9.3 to 1.9.4
- autoptimize.php +6 -2
- classes/autoptimizeStyles.php +1 -1
- readme.txt +22 -4
autoptimize.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Autoptimize
|
4 |
Plugin URI: http://blog.futtta.be/autoptimize
|
5 |
Description: Optimizes your website, concatenating the CSS and JavaScript code, and compressing it.
|
6 |
-
Version: 1.9.
|
7 |
Author: Frank Goossens (futtta)
|
8 |
Author URI: http://blog.futtta.be/
|
9 |
Domain Path: localization/
|
@@ -312,7 +312,11 @@ if(autoptimizeCache::cacheavail()) {
|
|
312 |
$conf = autoptimizeConfig::instance();
|
313 |
if( $conf->get('autoptimize_html') || $conf->get('autoptimize_js') || $conf->get('autoptimize_css') || $conf->get('autoptimize_cdn_js') || $conf->get('autoptimize_cdn_css')) {
|
314 |
// Hook to wordpress
|
315 |
-
|
|
|
|
|
|
|
|
|
316 |
}
|
317 |
}
|
318 |
|
3 |
Plugin Name: Autoptimize
|
4 |
Plugin URI: http://blog.futtta.be/autoptimize
|
5 |
Description: Optimizes your website, concatenating the CSS and JavaScript code, and compressing it.
|
6 |
+
Version: 1.9.4
|
7 |
Author: Frank Goossens (futtta)
|
8 |
Author URI: http://blog.futtta.be/
|
9 |
Domain Path: localization/
|
312 |
$conf = autoptimizeConfig::instance();
|
313 |
if( $conf->get('autoptimize_html') || $conf->get('autoptimize_js') || $conf->get('autoptimize_css') || $conf->get('autoptimize_cdn_js') || $conf->get('autoptimize_cdn_css')) {
|
314 |
// Hook to wordpress
|
315 |
+
if (defined('AUTOPTIMIZE_INIT_EARLIER')) {
|
316 |
+
add_action('init','autoptimize_start_buffering',-1);
|
317 |
+
} else {
|
318 |
+
add_action('template_redirect','autoptimize_start_buffering',2);
|
319 |
+
}
|
320 |
}
|
321 |
}
|
322 |
|
classes/autoptimizeStyles.php
CHANGED
@@ -355,7 +355,7 @@ class autoptimizeStyles extends autoptimizeBase {
|
|
355 |
if (method_exists($cssmin,"run")) {
|
356 |
$tmp_code = trim($cssmin->run($code));
|
357 |
} elseif (@is_callable(array($cssmin,"minify"))) {
|
358 |
-
$tmp_code = trim(CssMin::minify($code
|
359 |
}
|
360 |
}
|
361 |
if (!empty($tmp_code)) {
|
355 |
if (method_exists($cssmin,"run")) {
|
356 |
$tmp_code = trim($cssmin->run($code));
|
357 |
} elseif (@is_callable(array($cssmin,"minify"))) {
|
358 |
+
$tmp_code = trim(CssMin::minify($code));
|
359 |
}
|
360 |
}
|
361 |
if (!empty($tmp_code)) {
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Autoptimize ===
|
2 |
-
Contributors: futtta, turl
|
3 |
Tags: css, html, javascript, js, optimize, speed, cache, data-uri, aggregate, minimize, minification, performance, pagespeed, booster, multisite
|
4 |
Donate link: http://blog.futtta.be/2013/10/21/do-not-donate-to-me/
|
5 |
Requires at least: 2.7
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 1.9.
|
8 |
|
9 |
Autoptimize speeds up your website and helps you save bandwidth by aggregating and minimizing JS, CSS and HTML.
|
10 |
|
@@ -58,9 +58,17 @@ You can find more information on this topic [in this blog post](http://blog.futt
|
|
58 |
Autoptimize does not have its proper cache purging mechanism, as this could remove optimized CSS/JS which is still referred to in other caches, which would break your site.
|
59 |
|
60 |
You can however keep the cache size at an acceptable level by either:
|
|
|
61 |
* ticking the "look only in head" option for JS and/or CSS.
|
62 |
-
* using the API to force AO not to aggregate inline CSS or JS (see example-code in autoptimize_helper.php_example).
|
63 |
* excluding JS-variables (or sometimes CSS-selectors) that change on a per page (or per pageload) basis. You can read how you can do that [in this blogpost](http://blog.futtta.be/2014/03/19/how-to-keep-autoptimizes-cache-size-under-control-and-improve-visitor-experience/).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
|
65 |
= Why is "look only in head" marked as deprecated =
|
66 |
|
@@ -115,6 +123,11 @@ In some rare cases the [CSS minification component](https://github.com/tubalmart
|
|
115 |
|
116 |
The "legacy minifiers" will remain in Autoptimize "for ever" and changes to wp-config.php are not affected by core-, theme- or plugin-upgrades so you should be good to go.
|
117 |
|
|
|
|
|
|
|
|
|
|
|
118 |
= What is noptimize? =
|
119 |
|
120 |
Starting with version 1.6.6 Autoptimize excludes everything inside noptimize tags, e.g.:
|
@@ -159,6 +172,11 @@ Just [fork Autoptimize on Github](https://github.com/futtta/autoptimize) and cod
|
|
159 |
|
160 |
== Changelog ==
|
161 |
|
|
|
|
|
|
|
|
|
|
|
162 |
= 1.9.3 =
|
163 |
* improvement: more intelligent CDN-replacement logic, thanks [Squazz for reporting and testing](https://wordpress.org/support/topic/enable-cdn-for-images-referenced-in-the-css?replies=9)
|
164 |
* improvement: allow strings (comments) to be excluded from HTML-optimization (comment removal)
|
1 |
=== Autoptimize ===
|
2 |
+
Contributors: futtta, turl, optimizingmatters
|
3 |
Tags: css, html, javascript, js, optimize, speed, cache, data-uri, aggregate, minimize, minification, performance, pagespeed, booster, multisite
|
4 |
Donate link: http://blog.futtta.be/2013/10/21/do-not-donate-to-me/
|
5 |
Requires at least: 2.7
|
6 |
+
Tested up to: 4.3
|
7 |
+
Stable tag: 1.9.4
|
8 |
|
9 |
Autoptimize speeds up your website and helps you save bandwidth by aggregating and minimizing JS, CSS and HTML.
|
10 |
|
58 |
Autoptimize does not have its proper cache purging mechanism, as this could remove optimized CSS/JS which is still referred to in other caches, which would break your site.
|
59 |
|
60 |
You can however keep the cache size at an acceptable level by either:
|
61 |
+
|
62 |
* ticking the "look only in head" option for JS and/or CSS.
|
|
|
63 |
* excluding JS-variables (or sometimes CSS-selectors) that change on a per page (or per pageload) basis. You can read how you can do that [in this blogpost](http://blog.futtta.be/2014/03/19/how-to-keep-autoptimizes-cache-size-under-control-and-improve-visitor-experience/).
|
64 |
+
* using the API to force AO not to aggregate inline JS (this will become an option in the next AO-version), adding e.g. this code to your (child) theme's functions.php:
|
65 |
+
|
66 |
+
`add_filter('autoptimize_js_include_inline','readme_ao_js_include_inline',10,1);
|
67 |
+
function readme_ao_js_include_inline() {
|
68 |
+
return false;
|
69 |
+
}`
|
70 |
+
|
71 |
+
There's also a filter to stop inline CSS from being aggregated ("autoptimize_css_include_inline"), see example-code in autoptimize_helper.php_example if the amount of autoptimized CSS-files would become to high.
|
72 |
|
73 |
= Why is "look only in head" marked as deprecated =
|
74 |
|
123 |
|
124 |
The "legacy minifiers" will remain in Autoptimize "for ever" and changes to wp-config.php are not affected by core-, theme- or plugin-upgrades so you should be good to go.
|
125 |
|
126 |
+
= I use NextGen Galleries and a lot of JS is not aggregated/ minified? =
|
127 |
+
NextGen Galleries does some nifty stuff to add JavaScript. In order for Autoptimize to be able to aggregate that, you'll need to tell it to initialize earlier, by adding this to your wp-config.php:
|
128 |
+
|
129 |
+
`define("AUTOPTIMIZE_INIT_EARLIER","true");`
|
130 |
+
|
131 |
= What is noptimize? =
|
132 |
|
133 |
Starting with version 1.6.6 Autoptimize excludes everything inside noptimize tags, e.g.:
|
172 |
|
173 |
== Changelog ==
|
174 |
|
175 |
+
= 1.9.4 =
|
176 |
+
* 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](https://wordpress.org/support/topic/error-code-500internal-server-error?replies=7)
|
177 |
+
* bugfix: make default add_action hook back into "template_redirect" instead of "init" to fix multiple problems as reported by [schecteracademicservices, bond138, rickenbacker](https://wordpress.org/support/topic/192-concatenated-js-but-193-does-not-for-me?replies=11), [Rick Sportel](https://wordpress.org/support/topic/version-193-made-plugin-wp-cdn-rewrite-crash?replies=3#post-6833159) and [wizray](https://wordpress.org/support/topic/the-page-loads-both-the-auto-combined-css-file-and-origin-raw-file?replies=11#post-6833146). If you do need Autoptimize to initialize earlier (e.g. when using Nextgen Galleries), then add this to your wp-config.php:
|
178 |
+
`define("AUTOPTIMIZE_INIT_EARLIER","true");`
|
179 |
+
|
180 |
= 1.9.3 =
|
181 |
* improvement: more intelligent CDN-replacement logic, thanks [Squazz for reporting and testing](https://wordpress.org/support/topic/enable-cdn-for-images-referenced-in-the-css?replies=9)
|
182 |
* improvement: allow strings (comments) to be excluded from HTML-optimization (comment removal)
|