• Everything works fine if I have Look for scripts only in <head>? checked. Because this is depreciated I was trying to work out which js is causing an issue.

    When I uncheck this the media player disappears and the tabs in Woo are still there, but the information on each tab is also displayed on the first tab, each under one another. Also the widget, Items in basket, the items disappear.

    I don’t think it’s woo per se as I can go to a non shop page and the media player isn’t displayed (although of course woo scripts are still loaded unless I exclude as below).

    I’ve also added ,plugins/woocommerce in Exclude scripts from Autoptimize: to remove woo and I still have the issue.

    I’ve tried to exclude various js files but it never seems to work, unless I have Look for scripts only in <head>? (deprecated). Note, I don’t have Force JavaScript in <head>? checked.

    Am I chasing the impossible, or is there something I can do to stop checking the Look for scripts only in <head>? (deprecated).

    https://paulhayesfolk.co.uk/product/rhubarb-bramble/

    Many thanks.

    https://www.ads-software.com/plugins/autoptimize/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Frank Goossens

    (@futtta)

    no simple answer, but some pointers;
    * have a look at your browser’s (error) console, the error messages should help identifying the problem (feel free to copy/paste them here)
    * you can try forcing AO not to aggregate inline JS by using API’s autoptimize_js_include_inline filter, cfr. the example code in autoptimize_helper.php_example (optimizing inline code will be the option that will replace “look only in head” actually).
    * “look only in head” will remain visible as an option if you have enabled it and the logic will stay in place and will “for ever” remain accessible via the API.
    * you can try excluding “text/html” to explicitly exclude the javascript template from optimization (the next AO will automatically that, by the way, if you want you can download that version here)

    don’t hesitate to follow up in this forum topic!

    have a nice weekend,
    frank

    Thread Starter Lindsay Heydon

    (@lindsay-heydon)

    Hi Frank…

    Thanks for your help.

    1) Browser’s error codes for JS. Couldn’t find any.
    2) Tried just adding this to my functions.php

    /* autoptimize_js_include_inline: do we want AO to also aggregate inline JS?
    
    @return: boolean true or false */
    add_filter('autoptimize_js_include_inline','ljc_ao_js_include_inline',10,1);
    function ljc_ao_js_include_inline() {
    	return false;
    	}

    But didn’t make a difference.
    3) Understood, great.
    4) I’m not sure how to manually ‘exclude “text/html” to explicitly exclude the javascript template from optimization’ and may come back to it when the update is officially out…

    No worries, really. It is working… just annoying my obsessive mind ??

    Thanks again for all your help though. Much appreciated, Lins

    Plugin Author Frank Goossens

    (@futtta)

    re.: error console; no error what-so-ever? weird!

    re.: excluding text/html; just add that string to the comma separated JS optimization-exclusion field in the settings page.

    frank

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Tracking down a js file to exclude.’ is closed to new replies.