good catch. problem appears when you don’t exclude anything from CSS optimization (which is not the case by default) and is due to this block that starts on line 33;
if ($excludeCSS!=="") {
$this->dontmove = array_filter(array_map('trim',explode(",",$excludeCSS)));
}
if you change that into;
if ($excludeCSS!=="") {
$this->dontmove = array_filter(array_map('trim',explode(",",$excludeCSS)));
} else {
$this->dontmove = "";
}
all should be fine?
frank
Yes, that’s a better way to fix it… Everything is fine now..
I reordered some of our css-styles and js-files to work properly with AO. That means that in our case (more than 100 active modules together with Plugin Organizer) no exclusions are needed..
We have to do some tests for special cases, but you’ve done a really amazing work with AO.. Thanks a lot for it !
The only thing that is really hard stuff is the theme “above the fold”, cause it’s various on our website from page to page.. I think it makes more sense in this case to work with a server-side solution.. We tried googles mod_pagespeed, but it seems to work not very well (PageSpeed Insights itself do not recognize that it is turned on and on GTMetrix and Pingdoms you will be downgraded and pageload itself rises up)
We will see : )
Thank you and best regards,
Bruno
P.S. we build up a plattform to help other peoples to reach their personal goals.. In order to your donation rules I hope it’s ok for you to donate to a project in africa from a friend of us..
ok, checked in on GitHub; https://github.com/futtta/autoptimize/commit/332e7194d4e7d098d5541dac48bd88cb992e2bb2
The only thing that is really hard stuff is the theme “above the fold”, cause it’s various on our website from page to page.
you can actually use the API (“autoptimize_filter_css_defer_inline”-filter) to override the inline CSS on a per-URL basis (although ideally you wouldn’t have different above the fold CSS for each page).
does your CSS really vary from page to page, or do you have a number of “pagetypes” for which the above-the-fold would be the same (e.g. “typical” blog post, standard page, homepage, …)?
frank
does your CSS really vary from page to page, or do you have a number of “pagetypes” for which the above-the-fold would be the same (e.g. “typical” blog post, standard page, homepage, …)?
To find this out is the goal : ) We start on various pages with another pagelayout and with different elements at the beginning. And a lot of this “above the fold” elements are heavy customized in special areas inside our custom_stylesheet. And we also work a lot with media-queries..
You’re definitely right. On pagetypes like posts the above-the-fold css will not vary.. But here we need also to include our media-queries..?
although ideally you wouldn’t have different above the fold CSS for each page)
Yes, you’re definitely right with this. I never recognized this above-the-fold theme till yesterday (we use PO, Caching, AO : ), and a lot of optimization on the server (VPS) itself). During reading your faq I realized that it really makes sense to work with it, but I think this means a lot of refacturing our code especially with our responsive design..
you can actually use the API (“autoptimize_filter_css_defer_inline”-filter) to override the inline CSS on a per-URL basis
Thanks you for this tip! I will definitely take care of it. But I think here we also have to find out a way to include our media queries 🙂
Bruno