Comments (14)
Thanks. Can manage. Good coding exercise for me :-)
from autoptimize.
nothing changed really, but e.g. "important comments" are left as is by the PHP YUI CSS optimizer, so ...
from autoptimize.
Hi Frank,
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.
from autoptimize.
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?
from autoptimize.
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).
from autoptimize.
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:
- if you activated the legacy minifiers (see FAQ on how to do that)? OR
- AO detects that there already is a
CSSmin
class (loaded by another plugin, W3TC maybe) and hence does not load its own (php css yui)?
from autoptimize.
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)
from autoptimize.
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)
from autoptimize.
indeed. check if entirely disabling any/ all minify options in W3TC helps maybe?
from autoptimize.
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).
from autoptimize.
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)?
from autoptimize.
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.
from autoptimize.
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.
from autoptimize.
have fun! :)
going to close this ticket here, as not to AO as such.
from autoptimize.
Related Issues (20)
- Make compatibility configurable HOT 8
- Compatible wih WP 6 and PHP 8.1 HOT 1
- Keep the code base clean HOT 3
- Undefined offset autoptimizeStyles.php HOT 3
- autoptimizecriticalcsscron PHP array key warnings HOT 5
- Avif support broken HOT 6
- Minified JS broken with private class identifiers HOT 4
- Disable emoji dns-prefetch in ClassicPress HOT 1
- PHP8 Warning HOT 1
- Optimized JS and inline script order HOT 3
- Problem with media="print" HOT 3
- Inline "background" not replaced with shortpixel HOT 5
- Security risk reported by Kaspersky HOT 6
- Proposal: stronger default settings HOT 9
- Optimised Google Fonts still blocking for 1.3s according to PageSpeed HOT 2
- Add: option to enable WebP as default output format HOT 1
- PHP Warning in cronjob: Trying to access array offset on value of type int in autoptimizeCacheChecker.php HOT 3
- Creation of dynamic property in autoptimizeProTab.php HOT 4
- Proposal: add Plugin Check workflow HOT 6
- Autoptimize deletes all subfolders in /cache/ HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autoptimize.