WooCommerce Speed Drain Repair

Description

WooCommerce can really drain server resources and slow down the load of your site. This plugin stops loading the extra items you do not need inside WooCommerce and speeds up WordPress core admin-ajax.php file.

Adds the below function:

add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );

function child_manage_woocommerce_styles() {
    //remove generator meta tag
    remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );

    //first check that woo exists to prevent fatal errors
    if ( function_exists( 'is_woocommerce' ) ) {
        //dequeue scripts and styles
        if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) {
            wp_dequeue_style( 'woocommerce_frontend_styles' );
            wp_dequeue_style( 'woocommerce_fancybox_styles' );
            wp_dequeue_style( 'woocommerce_chosen_styles' );
            wp_dequeue_style( 'woocommerce_prettyPhoto_css' );
            wp_dequeue_script( 'wc_price_slider' );
            wp_dequeue_script( 'wc-single-product' );
            wp_dequeue_script( 'wc-add-to-cart' );
            wp_dequeue_script( 'wc-cart-fragments' );
            wp_dequeue_script( 'wc-checkout' );
            wp_dequeue_script( 'wc-add-to-cart-variation' );
            wp_dequeue_script( 'wc-single-product' );
            wp_dequeue_script( 'wc-cart' );
            wp_dequeue_script( 'wc-chosen' );
            wp_dequeue_script( 'woocommerce' );
            wp_dequeue_script( 'prettyPhoto' );
            wp_dequeue_script( 'prettyPhoto-init' );
            wp_dequeue_script( 'jquery-blockui' );
            wp_dequeue_script( 'jquery-placeholder' );
            wp_dequeue_script( 'fancybox' );
            wp_dequeue_script( 'jqueryui' );
        }
    }
 }

If you are are curious what exactly the above function does, we can explain more clearly as to what its doing. Its important to know what you are installing

This plugin instructs WP to not load the huge variety of WooCommerce scripts unless the user is on a WooCommerce page.

So the Non-WooCommerce pages of the site will surely load faster since many of these WooCommerce scripts are loaded on each and every page. The store itself will have some memory saved using this plugin, so the WooCommerce pages will be faster as well.

To sum it up, this plugin will turn off the WooCommerce heavy script on Non-WooCommerce pages which we see very valuable because if you are marketing your site well, there should be a blog and these pages will be Non-WooCommerce which will be indexed and drive traffic to products. Almost all visitors will land on a Non-WooCommerce page in most e-commerce sites.

There is NO EASIER or FASTER way to speed up WooCommerce sites

Screenshots

  • Before Plugin
  • After Plugin

Installation

Install from WP Dashboard

  • Log into WP dashboard then click Plugins > Add new > Then under the title “Install Plugins” click Upload > choose the zip > Activate the plugin!

Install from FTP

  • Extract the zip file and drop the contents in the wp-content/plugins/ directory of your WP installation and then activate the Plugin from Plugins page.

THAT IS IT: You’re done!

FAQ

Installation Instructions

Install from WP Dashboard

  • Log into WP dashboard then click Plugins > Add new > Then under the title “Install Plugins” click Upload > choose the zip > Activate the plugin!

Install from FTP

  • Extract the zip file and drop the contents in the wp-content/plugins/ directory of your WP installation and then activate the Plugin from Plugins page.

THAT IS IT: You’re done!

Do I need to do anything after plugin is activated

No, once activated yo uare all set and you will see the speed differecne

Reviews

Very helpful.

Thanks for the helpful snippet. Turned a 10 second page load-time to a 1 second load-time!! Just what I was looking for.

It is giving me an error and can’t resolve it, please help

When I installed this plugin and added desired code in funciton.php, it is giving an error as:

Fatal error: Cannot redeclare child_manage_woocommerce_styles() (previously declared in /var/www/clients/client34/web49/web/wp-content/plugins/wc-speed-drain-repair/wcsdr.php:24) in /var/www/clients/client34/web49/web/wp-content/themes/zerif-lite/functions.php on line 1355

How to resolve it I am now able to login in the dashboard, please help!
Thanks in advance!

Awesome

Shaved about 9 seconds off my homepage load time.

Brought my time to first byte from over 5 secs to around 0.4 sec

I was planning to hire a developer to solve my speed issues but this plugin killed it!

Can’t thank you guys enough!!!

Excellent, simple and functional

I had been looking for some information to override some of the functions of Woocommerce. And this plugin or code to insert into the file funtions.php does it in a simple and efficient way.

Woocommerce is a great plugin, but I consume too many resources with functions that sometimes you do not need.

Great job.

Cart button wasn’t working properly

After I installed this plugin, my cart button wasn’t working properly. I am using Mr Tailor theme, and when I press on cart button, right panel should slide out and there should be my added items or “No items added” text. But after this plugin, this panel was blank, no text, nothing, it was only working on product page and shop page, on other pages didn’t. So after I switched this plugin off, it’s working properly again. It might be a problem of theme too, but it wasn’t good for me how it was with this plugin.

Read all 15 reviews

Contributors & Developers

“WooCommerce Speed Drain Repair” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.2 November 21st, 2017

  • Update to run on new version of WordPress core

1.0 September 30th, 2015

  • First release of plugin.