Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    it could be due to the “compatibility logic” which will in some cases ensure jQuery is NOT deferred, you can try disabling that with this code snippet to test/ confirm:

    
    add_filter( 'autoptimize_filter_init_compatibility', '__return_false' );
    Thread Starter willjames

    (@willjames)

    I put that in the functions file, cleared WPSuper cache then tested again and it is still being called out as render blocking… Should I try the ‘Async JavaScript’ plugin?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Weird. You can try adding jquery.min.js to the “async” field on the Extra tab or indeed try with the asyncJS plugin.

    Thread Starter willjames

    (@willjames)

    No luck – still showing as render blocking – do I need to clear the AO cache to test these types of changes?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    well, on farmmachinerypages there is one other JS-file which also is not deferred and which I can’t see on truckpages; wp-content/themes/motors/assets/js/typeahead.jquery.min.js so there likely is a configuration difference at theme level and that difference is (or might be) causing the non-deferral of jQuery?

    Thread Starter willjames

    (@willjames)

    The themes for Plant and Farm are the same – but the cause of this was that I have excluded more files from Truck & Plant using Asset Clean Up than Farm. I have removed this from farm now as well. I will bring both themes up to date. Still confused…?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    if everything is identical (theme, theme config, plugins, plugin config) then indeed all 3 sites _should_ act in identically the same manner.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Hey willjames;
    No feedback so I assume this got resolved? Feel free to follow up if you still encounter issues!

    have a nice day!
    frank

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘jquery nor deferring’ is closed to new replies.