Merhaba,

Woocommerce kullanıcısı olarak binlerce ürün yelpazeniz var ise, maalesef kasan sisteminiz için bir çok eklenti yükleyip de Cache sistemleri ile çare bulmaya çalışırsınız.

Ancak Woocommerce tüm dünyaya hitap eden bir sistem olduğu için, gerekli gereksiz bir çok fonksiyonu eş zamanlı mecburen çalıştıran bir sistemdir. Bu yükü hafifletmek için gereksiz gördüğünüz fonksiyon dağılımını hafifletebilirsiniz, bu sayede kullanmadığınız özellikler sistem tarafından çağırılmaz ve size hız/zaman kazandırır.

Aşağıda vermiş olduğum kodu temanızın functions.php dosyasına eklemeniz yeterli, sonrasında dilediğiniz satırları silebilir veya başkalarını da siz ekleyebilirsiniz. Bu sayede gözle görünür bir hız kazanacağınızdan eminim!

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' );
}
}
}

kaynak