• Resolved Ashish

    (@ashishseo18)


    After updating WordPress from version 5.4.15 to 6.4.4 and WooCommerce from 3.7.3 to 8.6, my website started experiencing issues. Despite clearing all caches(website, browser) the problems persisted. However, upon deactivating my cache plugin, the website began functioning properly again.

    • This topic was modified 2 months ago by Ashish.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    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 🙂

    frank

    Thread Starter Ashish

    (@ashishseo18)

    I disabled it, but still same think happened

    getting errors of similar type
    GET https://www.absolute-aromas.in/wp-includes/js/dist/vendor/regenerator-runtime.min.js’%20defer=’defer net::ERR_ABORTED 404 (Not Found)
    GET https://www.absolute-aromas.in/wp-includes/js/dist/vendor/wp-polyfill.min.js’%20defer=’defer net::ERR_ABORTED 404 (Not Found)

    • This reply was modified 2 months ago by Ashish.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    I’m indeed seeing links like

    <script type="text/javascript" src="https://www.absolute-aromas.in/wp-includes/js/dist/vendor/regenerator-runtime.min.js?ver=0.14.0' defer='defer" id="regenerator-runtime-js"></script>

    which is wrong, it should be

    <script type="text/javascript" src="https://www.absolute-aromas.in/wp-includes/js/dist/vendor/regenerator-runtime.min.js?ver=0.14.0" defer="defer" id="regenerator-runtime-js"></script>

    no idea what’s causing this, but it’s not Autoptimize (as proven by the fact you disabled it and you still see the problem) :-/

    Thread Starter Ashish

    (@ashishseo18)


    Thanks for getting back to me. When I log into my website, everything appears fine. However, when I open it in another window, it crashes, with large images and misaligned elements. Upon checking the console, I noticed three errors.

    At product page
    Uncaught ReferenceError: jQuery is not defined
    at custom.js?ver=6.5.3%27%20defer=%27defer:24:1
    lavender-bulgarian-10ml/:2708 Uncaught ReferenceError: wp is not defined
    at lavender-bulgarian-10ml/:2708:1
    lavender-bulgarian-10ml/:2719 Uncaught ReferenceError: jQuery is not defined
    at lavender-bulgarian-10ml/:2719:1
    lavender-bulgarian-10ml/:2810 Uncaught ReferenceError: jQuery is not defined
    at lavender-bulgarian-10ml/:2810:1

    At home page

    (index):2233 Uncaught ReferenceError: jQuery is not defined
    at (index):2233:9
    (index):2973 Uncaught ReferenceError: jQuery is not defined
    at (index):2973:9
    (index):4145 Uncaught ReferenceError: wp is not defined
    at (index):4145:1
    (index):4156 Uncaught ReferenceError: jQuery is not defined
    at (index):4156:1
    (anonymous) @ (index):4156
    (index):4248 Uncaught ReferenceError: jQuery is not defined
    at (index):4248:1
    (anonymous) @ (index):4248
    http://www.mydomain.in/:4303

       GET wp-content/plugins/woocommerce-products-slider/assets/front/js/slick.js%20defer=defer net::ERR_ABORTED 404 (Not Found)

    http://www.mydomain.in/:1 Refused to execute script from ‘wp-content/plugins/woocommerce-products-slider/assets/front/js/slick.js%20defer=defer’ because its MIME type (‘text/html’) is not executable, and strict MIME type checking is enabled.
    autoptimize_145da8402f032ca50d9519cf564d2372.js:2 Uncaught ReferenceError: jQuery is not defined
    at autoptimize_145da8402f032ca50d9519cf564d2372.js:2:382

    Is there any Idea why when I’m login it’s looks fine.

    • This reply was modified 1 month, 4 weeks ago by Ashish.
    • This reply was modified 1 month, 4 weeks ago by Ashish.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    all of this is due to whatever is adding that defer flag the wrong way (see my explanation above), once you disable that (a plugin? a theme? a code snippet in your functions.php?) the problem will be solved 🙂

    Thread Starter Ashish

    (@ashishseo18)

    Hi, I corrected my function code from return “$url defer=‘defer”; to return “$url defer=‘defer’“; below but still face the same issue.

    function defer_parsing_js($url) {
    //Add the files to exclude from defer. Add jquery.js by default
    $exclude_files = array('jquery.js');
    //Bypass JS defer for logged in users
    if (!is_user_logged_in()) {
    if (false === strpos($url, '.js')) {
    return $url;
    }
    
        foreach ($exclude_files as $file) {
            if (strpos($url, $file)) {
                return $url;
            }
        }
    } else {
        return $url;
    }
    return "$url defer='defer'";
    
    }
    add_filter('clean_url', 'defer_parsing_js', 11, 1);
    
    add_filter( 'autoptimize_filter_css_fonts_cdn', '__return_true' );

    But after removing the above function, my website is working properly. So, are there any suggestions for me because I want defer my js

    • This reply was modified 1 month, 4 weeks ago by Ashish.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    why don’t you simply use “don’t aggregate but defer” + “also defer inline JS”? 🙂

    Thread Starter Ashish

    (@ashishseo18)

    Thank you for helping me solve my problem. I really appreciate your efforts.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    you’re welcome, feel free to leave a review of the plugin and support here! 🙂

    enjoy your thursday!
    frank

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.