First and foremost try to identify what is breaking things by just disabling CSS or JS or HTML or Image optimization (incl. lazyload). Based on that we can see what the next steps need to be 🙂
Additionally: Autoptimize is not active now, but I’m still seeing a jQuery is not defined error on the browser console. Chances are that error is what’s causing (more) issues when Autoptimize JS optimization is active.
frank
Hi Frank, I had disabled the plugin, but it is now active.
I have tried what you said (check what option is really causing the issue) and after unselecting the “Optimise JavaScript Code?” option, I am able to see the images again.
This is what I found out:
1) Disabling “Optimise JavaScript Code?” (able to see the pictures): Below 2 errors:
a) acf_googlemap.js:287 Uncaught ReferenceError: jQuery is not defined
at acf_googlemap.js:287
(anonymous) @ acf_googlemap.js:287
b) 4111705.js:1 Failed to load resource: the server responded with a status of 404 ()
2) Enabling “Optimise JavaScript Code?” (not able to see the pictures): Below 2 errors:
a) autoptimize_ecac21ff4512a234341d9aa39db0f2f7.js:47 Uncaught ReferenceError: jQuery is not defined
at autoptimize_ecac21ff4512a234341d9aa39db0f2f7.js:47
(anonymous) @ autoptimize_ecac21ff4512a234341d9aa39db0f2f7.js:47
b) 4111705.js:1 Failed to load resource: the server responded with a status of 404 ()
I am not sure what is really causing this to happen, but it looks like there is a missing reference for autoptimize.
I needed to leave the “Optimise JavaScript Code?” disabled, but let me know if you need to replicate the error.
Thanks in advance for your help with this.
the fact you have missing jQuery (even with AO not active) is very likely the problem, are you using some plugin/ solution that dequeues jQuery maybe?
I am not sure, but I have done some more testing and it looks like the problem is with the “BJ Lazy Load” plugin, after disabling it, I am able to see the image again. However, I still see the same errors in the console. Is the issue from “BJ Lazy Load” plugin then? or maybe just an incompatibility thing?
BJ Lazy Load is unlikely to be dequeuing jQuery, but the fact that disabling it makes the images appear is interesting. either try excluding plugin/bj-lazy-load/ from JS optimization and re-test OR keep is disabled and activate lazyload in Autoptimize (on the “images” tab).
Regarding that jQuery error; try adding this code snippet maybe;
function rockbanger_load_scripts() {
wp_enqueue_script( 'jquery' );
}
add_action('wp_enqueue_scripts', 'rockbanger_load_scripts');
No feedback so I assume this got resolved Carolina ? Feel free to follow up if you still encounter issues!
have a nice day!
frank