Some questions:
* when you disable “optimize cart/ checkout” and you save and then re-open the AO settings page, does the option remain unchecked?
* does your host do page caching by any chance?
* can you share your site’s URL?
frank
Thread Starter
gore.m
(@gorem)
1) Yes. Checking / unchecking works as I would expect. (Additionally – there is not any error in DevTools Console).
2) As I know it shouldn’t.
3) kvetiny-floris.cz
Thanks you
Tom
I *think* there is a plugin or code snippet (or your theme) using the API incorrectly and forcing the noptimize flag to true
(because the condition in the snippet was not met, my example snippet has that problem even so one can blame me π ). Are you using any code snippets that you know of? If not can you disable plugins to see if you can identify a culprit?
Thread Starter
gore.m
(@gorem)
Aaaaaggrr! Yes, you are right.
I’m using this code to exclude one page (but it is affecting cart and checkout too). It worked until update, what is wrong with it?
add_filter('autoptimize_filter_noptimize','noptimize_quiz',10,0);
function noptimize_quiz() {
if (strpos($_SERVER['REQUEST_URI'],'/doporucene-produkty')!==false) {
return true;
} else {
return false;
}
}
Thanks you
Tom
simply change it to;
add_filter('autoptimize_filter_noptimize','noptimize_quiz',10,1);
function noptimize_quiz($flag_in) {
if (strpos($_SERVER['REQUEST_URI'],'/doporucene-produkty')!==false) {
return true;
} else {
return $flag_in;
}
}
It works ,-)
happy to hear so, i’ll now go and update the examples π
thanks you
you’re welcome, feel free to leave a review of the plugin and support here! π