Hi, there!
I tested http://www.creatifpassion.ch/ with Gtmetrix and indeed it works. So, if you agree too, I will add this to the new version. Thanks for helping me in debugging…
🙂
Hi Nevma
Thanks for the message.
No, problem, it is anyway your intelligence at work.
But to be absolutely sure, i suggest to run more tests.
I am not sure whether the presence of other plugins like w3 Total Cache,
WP Super Cache or Autoptimize have an impact.
It can be quite tricky.
all the best to you
theo
Thanks for the tip, I will do that too!
Hi Nevma
My observation is, that autoptimize plug is causing the main problem.
The plug in has three sections: html, scripts, css.
When deactivating the script section the your plugin works fine.
I don’t think that W3 Total cache and WP Supercache interfere in any way.
good luck with further tests
theo
hiya there;
I’m AO’s developer. If AI relies on JS to have the browser download the correct image-file, then one indeed might need to exclude that JS (and dependancies) from being aggregated/ minified in AO’s settings page.
Hope this helps,
frank
Hi Frank
Thanks for watching and the message.
The problem is, that it’s not a specific JS but rather a php (if am not wrong: ai-cookie.php) that generates the cookie. I don’t find any other js file in the plugin.
But anyway thanks for your tip. Maybe Nevma has an idea.
regards
theo
there is, in adaptive-images-front.php;
<script type = "text/javascript">
document.cookie = 'resolution=' + Math.max( screen.width, screen.height ) + '; path=/';
</script>
try adding “resolution=” (without the quotes) to the comma-seperated JS exclusion file.
frank
Did it. Works fine.
Thank you Frank.
theo
Hey, guys,
Indeed the AI plugin depends on that tiny bit of Javascript which only needs to run once to set the cookie. And it added to the HEAD of the theme via the PHP file you mentioned. I was not aware of the fact that the Autoptimize plugin might need to take something into account in order for this to work.
I will check it out and see if I can work around it!
Frank, was the problem cause by the single quotes?
no, reason was that (for now by default) AO aggregates & minifies all JS, both inline & in local referenced JS-files and added late in the HTML. in this case there might have been some other JS-file breaking due to the aggregation, which leads to all other JS in the optimized JS-file to be aborted.
working around this can be as simple as wrapping the inline JS in noptimize-tags, like this;
<!--noptimize--><script>alert('this will not get autoptimized');</script><!--/noptimize-->
that way users of both our plugins don’t have to do a thing; AO will leave noptimized code as is.
kind regards,
frank
Will do that, thanks, Frank!