• Resolved abeeralam

    (@abeeralam)


    Hey there!

    Recently, I was happy with the woocommerce blocks and that how well they were structured but soon after I integrated SG optimizer plugin and tweaked frontend optimizations like combine JS files and Defer render blocking JS which stopped the blocks from loading, it was taking almost a day to load or sometimes don’t even load. I contacted hosting support but they asked to get the script so that I could place in the exclusion from the above mentioned optimization factors as these factors can’t be disabled as they play an important role in website speed.

    Looking forward for your response.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter abeeralam

    (@abeeralam)

    Need js/jquery scripts for cart and checkout blocks from this plugin.

    • This reply was modified 4 years, 8 months ago by abeeralam.
    Plugin Support Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hi @abeeralam,

    From what you have described the optimizations you’ve made using a plugin called SG Optimizer seems to have broken the loading functionality of the blocks. You’ll either have to tweak the settings within this type of optimisation plugin so that it does not break the loading of the blocks or deactivate that until the developer of the plugin can resolve these issues for you.

    I hope this helps.

    Thread Starter abeeralam

    (@abeeralam)

    Hi Stuart,

    The plugin for optimization i am using is Siteground Optimization plugin which comes together with the siteground hosting that I have, in there is are features (combines JavaScript files & Defer render-blocking JavaScript) and when I enable these both features it crashes with the Gutenberg cart and checkout block. If I disable these both features the cart and checkout work fine.

    As you know that these features are very essential for website page speed on gtmetrix, pingdom or google speed insights therefore for me to disable them is highly discouraged, so is there a possible way out?
    When I enable these optimization features and then reload the cart or checkout page, it does not loads those block and in the google developer console I could see following errors, maybe these would help in problem identification:

    siteground-optimizer-combined-js-f404218ed2b4dc6ce5d7d6a40c781186.js:987 Uncaught TypeError: Object(...) is not a function
        at Module.z7pY (siteground-optimizer-combined-js-f404218ed2b4dc6ce5d7d6a40c781186.js:987)
        at e (siteground-optimizer-combined-js-f404218ed2b4dc6ce5d7d6a40c781186.js:987)
        at wp.keycodes.YLtl (siteground-optimizer-combined-js-f404218ed2b4dc6ce5d7d6a40c781186.js:987)
        at siteground-optimizer-combined-js-f404218ed2b4dc6ce5d7d6a40c781186.js:987
    invisible.js:1 Uncaught DOMException: Failed to execute 'postMessage' on 'Worker': An OffscreenCanvas could not be cloned because it was detached.
        at c.<computed> (https://www.shopfiona.com/cdn-cgi/challenge-platform/h/b/scripts/invisible.js:1:22690)
        at Object.trigger (https://www.shopfiona.com/wp-includes/js/jquery/jquery.min.js:2:71566)
        at s.fn.init.triggerHandler (https://www.shopfiona.com/wp-includes/js/jquery/jquery.min.js:2:72194)
        at o (https://www.shopfiona.com/wp-content/uploads/siteground-optimizer-assets/siteground-optimizer-combined-js-f404218ed2b4dc6ce5d7d6a40c781186.js:545:34809)
        at i (https://www.shopfiona.com/wp-includes/js/jquery/jquery.min.js:2:40027)
        at dispatch (https://www.shopfiona.com/wp-includes/js/jquery/jquery.min.js:2:43064)
        at v.handle (https://www.shopfiona.com/wp-includes/js/jquery/jquery.min.js:2:41048)
    Plugin Support Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hey @abeeralam,

    I’m afraid the behaviour you’re experiencing is not related to the blocks themselves but rather the optimisations the SG Optimizer plugin is making to the site. I’d suggest reaching out to the developers of the SG Optimizer plugin to see if they can assist further. It’s possible the plugin has the ability to exclude certain scripts from being minimized/combined or deferred.

    When using certain optimisation plugins they can cause issues on WordPress sites when combining Javascript files. It seems like this is what’s occurring on your particular site.

    Thread Starter abeeralam

    (@abeeralam)

    Alright, Stuart!

    I will reach them as well, thanks for the support.. 🙂

    Thread Starter abeeralam

    (@abeeralam)

    Hi Stuart,

    I have been in contact with the sg optimizer plugin shortly and they are on it, with the faulty settings deactivated, suddenly my checkout page stopped working instead showing an error (error text attached at the bottom), however, the cart page is working fine. Can you please help me in this regard as this page is of utmost importance..
    ERROR:

    Something went wrong…
    
    The checkout has encountered an unexpected error. . If the error persists, please get in touch with us so we can assist.
    
    Error: Cannot read properties of undefined (reading 'call')
    Plugin Support Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hey @abeeralam,

    I’ve performed some cross-testing for us today on several of my sites which have the latest versions of WordPress, WooCommerce and our free Storefront theme as the only enabled software. When doing so I’ve not been able to replicate the behaviour which you describe with any errors on the WooCommerce Checkout page.

    From what you have described, it could be code from another plugin or theme which has caused a possible conflict and affected the functionality of the WooCommerce checkout page.

    To see if that is the case we’d suggest carrying out a conflict test on your site by disabling all other plugins aside from WooCommerce along with switching to a theme like Storefront. This will help with trying to and locate what software you have installed which could possibly be causing this behaviour? You could use a free plugin called Health Check and Troubleshooting to carry out such testing.

    When in Troubleshooting mode all plugins will be deactivated and only the admin of the site carrying out the troubleshooting would see those changes. Any customers visiting the site would see no changes at all.

    Once you have disabled all other plugins and switched themes if the behaviour is resolved you can then enabled your theme and sites plugins testing after each one is enabled until the behaviour returns to locate the culprit.

    https://docs.woocommerce.com/document/how-to-test-for-conflicts/

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

The topic ‘Need JS scripts to exclude from optimizer’ is closed to new replies.