Defer javasript on x theme

I am interested in improve the speed of the mine website , do you recommend to use this code ?? ( Defer Parsing Javascript)
code into the secret note

and for example if 1 plugin is working on page domain.com/pluginsliders could be his javascript limited only for this page ? For example if I do not have a revolution slider on the mine home page there is no need to charge it on the home page isnt it ? How could be this done even manuallly . any tip or advice would be helpful thanks

For example WOOCommerce is really heavy and it is charging even on the wordpress pages ( where there is not woocommerce elements ) Could be possible to give me a tip advice how to reject the charging of the woocommerce on the homepage or normal wordpress pages and make it work only on the shop page , any solution is welcome , subdomains or anything else thanks

Hi Borislav.VD

Actually, I don’t recommend deferring all JS files on your website, not all the scripts can be loaded in the footer. Some JS files require certain libraries to be loaded first, so altering the order of loading of such files might cause different problems.

Also, this script you shared use a deprecated function clean_url, that’s another reason not to recommend it. It will require a lot of work to selectively defer certain JS files without causing any problem or fixing any problem that might appear because of that, I’m afraid to tell this is out of our support scope.

Talking about WooCommerce, I’m pretty sure you will find this tutorial helpful as it includes some snippets that will not load certain libraries on every page.

Thanks.

thank you anyway could be possible to confirm if this is the last language version without deprecated things thanks

In fact the webpage is working better and I have gained 2 seconds just changing the deprecated version to the last one , thank you !!!

Must i put something into the esc_url()

or just leave it empty just as i have put it thanks @Alaa great support as always applause +1

Hi,

Replacing clean_url with esc_url should be enough. I mean without the brackets ().

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.