Not sure which version this happened but the minified css (both external and inline) have line breaks. Do you know how this may have happened? Has the minifier option changed?
nothing changed really, but e.g. "important comments" are left as is by the PHP YUI CSS optimizer, so ...
My css doesn't have special comments but I still see line breaks.
There's a setting in minifiers and perhaps it's line breaks is default in some, so that old IEs which cannot parse very long lines can read them. I think the limit is large so removing line breaks makes more sense as default.
well, normally AO (well php yui css min) does not leave line breaks (just checked my site, only linebreaks are in the legacy MS-specific inlined background-image stuff). can you share your URL so I can have a look at the goings-on in your CSS?
Yeah, the site is www.concertedaction.com and the AO css file is: http://www.concertedaction.com/wp-content/cache/autoptimize/css/autoptimize_5a174eceff80afd5113b428efe60dfa4.css
I also use W3TC, and have switched off its HTML minification for test. When I enable it, it's the one minifying the inline css. (Also note: inline css provided in minifiers form by me).
Your AO CSS-file indeed does have the linebreaks which PHP YUI CSS would remove, so AO is using a non-default minifier. This can happen for 2 reasons:
Oh possible. W3 Total Cache was recently updated after a long long time and probably explains why I am seeing this new behaviour: dont remember it happening before. Will experiment by disabling it etc.
(Not using legacy minifiers, so that option isn't the case)
That indeed seems to be the issue. Have disabled w3tc and the file has just one line!
You can check. Still disabled. (Clear the cache as the filename seems to be the same)
indeed. check if entirely disabling any/ all minify options in W3TC helps maybe?
Just disabling minify in W3TC while keeping the plugin active doesn't resolve. The file has line breaks. You can check. (Headers in files show "powered by w3tc" or something similar).
darn .. nothing AO can do here I'm afraid; W3TC should simply not instantiate a CSSmin if minification is disabled. you could add some code hooking into AO's API (using autoptimize_css_after_minify filter) to remove linebreaks (or switch page caching plugin)?
What code should I add? Any reference?
W3TC is a nice plugin despite its various shortcomings. I can anyway live with those linebreaks. I use a github fix of the plugin and the developers there are quite fast in fixing. This thread might get referred when I raise an issue there.
well, the code here removes important comments in the optimized JS. you would need something similar (probably simpler as you only need to remove the linebrakes) for CSS.
Thanks. Can manage. Good coding exercise for me :-)
have fun! :)
going to close this ticket here, as not to AO as such.