• 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 woocommerce blocks support and they said that the issue is arising from the sg optimizer plugin itself and its optimization features and that it happens sometimes, the developers of this plugin could tell you about the specific scripts to exclude from render blocking JS and combine JS features as these factors can’t be disabled as they play an important role in website speed.

    When I enable them, the cart and checkout fields don’t load and when I disable them they start to work perfectly! I also checked in the google search console when they weren’t loading and that it might help in problem rectification, please see below and guide me for exclusion of those specific scripts for load:

    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)

    Looking forward for your response.

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

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Stoyan Georgiev

    (@stoyangeorgiev)

    Hey there @abeeralam,

    When you enable Defer render-blocking JS, look for the following script from the exclude dropdown

    /wp-includes/js/dist/vendor/regenerator-runtime.min.js

    Exclude the script and the checkout fields should be working again.
    You can then enable the JS combination and it should be all working as expected.

    I am marking this thread as resolved, however, if you have any issues after that, feel free to reopen it and provide details if any further issue occurs.

    Kind regards,
    Stoyan

    Thread Starter abeeralam

    (@abeeralam)

    Hello Stoyan,

    I have tweaked the settings as you described above in the solution, and still the same error happens the cart page never loads even after selecting the runtime.min.js in exclusion. Please allow me to send a screenshot so you could see what I have done and might be this may be a problem.

    On the cart page I opened google developer console and it still showed:

    siteground-optimizer-combined-js-20dc14d65ab67bba199266fe2da5ff2f.js:986 Uncaught TypeError: Object(...) is not a function
        at Module.z7pY (siteground-optimizer-combined-js-20dc14d65ab67bba199266fe2da5ff2f.js:986)
        at e (siteground-optimizer-combined-js-20dc14d65ab67bba199266fe2da5ff2f.js:986)
        at wp.keycodes.YLtl (siteground-optimizer-combined-js-20dc14d65ab67bba199266fe2da5ff2f.js:986)
        at siteground-optimizer-combined-js-20dc14d65ab67bba199266fe2da5ff2f.js:986
    Plugin Author Stoyan Georgiev

    (@stoyangeorgiev)

    Hey there @abeeralam,

    I would suggest checking the optimizations one by one. First, enable the defer render-blocking js and exclude the file I’ve mentioned. After that, check if the cart page is loading as expected. Second, enable the JS Combination and locate the script that is having issues when combined. You can then exclude that script from the exclude from js combination dropdown menu.

    Kind regards,
    Stoyan

    Thread Starter abeeralam

    (@abeeralam)

    Hi Stoyan,

    Got editing on the website, after tweaking the settings I noticed that the issue is arising only on the combine JS files setting, I had successfully switched on Defer render blocking Js with the told file to exclude and it is working but on the next step when I switched on Combine JS files with that runtime.js file excluded or even without exclusion the cart and checkout pages stop loading…

    One more thing, when I deactivated the sg optimizer plugin and activated WP Rocket plugin and enabled both combine JS files and defer render blocking JS in that plugin then even with these both settings turned on the cart and checkout pages were operating normally, I don’t what’s the specific issue with SG optimizer plugin…

    Please help.

    Thread Starter abeeralam

    (@abeeralam)

    Now, just after some time the cart and checkout pages don’t loads on desktop or laptops but is loading on mobile devices… please check these following URLs on your end on desktop/laptop and mobile to visually see error:

    https://www.shopfiona.com/cart/
    https://www.shopfiona.com/checkout/

    Why is this even happening, and this shouldn’t be occurring as this is an e-commerce website and where cart and checkout page are the most essential pages… Please help.

    Thread Starter abeeralam

    (@abeeralam)

    Its been sometime since your response, kindly look for this and none of the techniques and I need this option for better page speed results. We want to launch soon and this will the basic feature… The solution you proposed JS script didn’t also worked..

    Plugin Author Ignat Georgiev

    (@ignatggeorgiev)

    Hey @abeeralam, hope you are doing well!

    After excluding the file from the defer rendering blocking JS functionality and enabling the Combine JS files toggle, have you added it to the exclusion there as well? This will ensure that it won’t be combined with all of the other JS files detected on your site

    Kind Regards,
    Ignat

    Thread Starter abeeralam

    (@abeeralam)

    Hello @ignatggeorgiev,

    Yes, i had already tried excluding the file : /wp-includes/js/dist/vendor/regenerator-runtime.min.js

    from the exclusion list on both the toggles of combining and defer render blocking… but still it doesn’t seems to be working…

    Hope you would solve this matter ASAP..

    Plugin Author Elena Chavdarova

    (@elenachavdarova)

    Hello @abeeralam,

    I had a close look into the case and found that if you exclude all scripts from the “Defer Render-blocking JS” OTHERS list, the Cart and Checkout Page is loading as expected.

    Note that those files are part of WordPress core and they should not cause issues with the optimization options by default.

    There must be a combination between the WordPress core, woo-gutenberg-products-block plugin and JS combination/defer which causes the issues you are reporting.

    What I recommend is to exclude all JS files from the OTHERS list, make sure that the page is loading as expected, and then you can remove them one by one from the list, so you can isolate the problematic ones.

    Note that the way scripts are enqueued by the blocks plugin is causing their JS files not present in the exclude list. Still you can use the SiteGround Optimizer filter to exclude their scripts handlers from the combination and asynchronous loading. More information about the filter you can use can be found at the plugin readme file or directly from here: https://ww.wp.xz.cn/plugins/sg-cachepress/.

    Best Regards,
    Elena

    Thread Starter abeeralam

    (@abeeralam)

    Hello @elenachavdarova,

    I just tried your said solution and now it works, what I did was that exclude all others list and then manually exclude one by one and seeing that the page was working… the elements in the list I found to be causing issue are:

    /wp-includes/js/dist/vendor/react.min.js

    /wp-includes/js/dist/vendor/react-dom.min.js

    /wp-includes/js/dist/vendor/moment.min.js`

    /wp-includes/js/jquery/jquery.min.js

    /wp-includes/js/underscore.min.js

    These were the ones… hope that you would consider these in your next updates, and then I would be able to remove them from exclusion list for a better loading result in the future..

    Plugin Author Hristo Pandjarov

    (@hristo-sg)

    SiteGround Representative

    They are there for a reason. Unfortunately, older scripts rely on those and if we don’t exclude them by default that would break a lot of sites πŸ™

    Thread Starter abeeralam

    (@abeeralam)

    Great!

    Now that this problem is solved, can I know how to let slider revolution to show immediately as the first content painful is visible… as you can see when you load shopfiona.com the banners below the slider revolution load up first and then the slider itself and even after that it animates so it is costing another 2 seconds after largest content paintful.. is there a solution?

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

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