well, there seems to be some JS/ CSS optimized and other not, weird … I guess a theme or plugin conflict, try identifying by disabling/ enabling plugins and/ or switching a default theme to identify?
frank
Well, it’s worked with this theme in the past, so I don’t think that’s the issue. I’m disabling plugins now. There are a lot of them though. Do you have a list of ones which interfere with AO?
Just removed all plugins and checked in Incognito. It’s still doing the same thing. Any other suggestions?
and when switching themes @zetland (I know you wrote it worked before, but still to be absolutely sure …)
Well, this plugin used to work fine with my old theme, but let me take a look…
well, the only logical conclusion would be Autoptimize (and hence PHP and the user under which the PHP-process is running) cannot read those files from the filesystem, in which case AO indeed leaves the files in place (in order not to break anything). could that be the case somehow?
I’d be surprised if that were the case. How can I find out if it can’t read those files, and what could I do to fix it?
1. check the permissions of the files that are not aggregated on the server
2. change the permission
but I see something that might help us find the root cause; your unoptimized HTML has resources with a full URL, e.g.:
<script type='text/javascript' src='https://vocularapp.com/wp-content/plugins/revslider/public/assets/js/jquery.themepunch.tools.min.js'></script>
and some without a full URL, e.g.:
<script type='text/javascript' src='/wp-content/themes/appdev/js/libs/jquery.easing.1.3.js'></script>
and it looks as though the files that have a full URL are aggregated and the ones that don’t have a full URL are not.
so, the question; what code is causing this difference? is it something you can turn off?
Hi Frank,
I’ll be honest, I’m not getting anywhere with this. Is there any chance I could enlist your help here? I’d be very happy to pay for your help, or make a charitable donation in your name as a token of gratitude.
Thanks,
James
OK, so to answer the question from your other post; AO should not bail on something like
<script type='text/javascript' src='/wp-content/themes/appdev/js/libs/jquery.easing.1.3.js'></script>
(I tested on my local dev to be 100% sure).
Now this would just be a workaround, but maybe give this code snippet a try;
add_filter('autoptimize_html_before_minify','vocularapp_fix');
function vocularapp_fix($htmlIn) {
return str_replace("<script type='text/javascript' src='/wp-content","<script type='text/javascript' src='https://vocularapp.com/wp-content",$htmlIn);
}
frank
Hi Frank,
Thanks! I added this snippet to the AO code and then tried deactivating and reactivating it, looks like it’s not working yet though. Have I added the snippet to the wrong place?
James
ah, but you shouldn’t add that to the autoptimize code, use something like code snippets to add it instead 🙂
Thanks for your amazing patience with this. I’ve added that code as via Code Snippets (although I had to swap the " with ' and vice versa to match my browser. I’m not seeing any differences though. Can you think of any reason why this might be? I’ve given it about 15 minutes to update, purged all my caches and done a hard refresh in Incognito…
James