• Resolved timholz

    (@timholz)


    Hi – woocommerce 8.5.2 triggers a lot of unnecessary scripts.

    Up to now i used:

    add_action( 'template_redirect', 'remove_woocommerce_styles_scripts', 999 );
    
    function remove_woocommerce_styles_scripts() {
    if ( function_exists( 'is_woocommerce' ) ) {
        if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) {
            remove_action('wp_enqueue_scripts', [WC_Frontend_Scripts::class, 'load_scripts']);
            remove_action('wp_print_scripts', [WC_Frontend_Scripts::class, 'localize_printed_scripts'], 5);
            remove_action('wp_print_footer_scripts', [WC_Frontend_Scripts::class, 'localize_printed_scripts'], 5);
            }
        }
    }

    This worked fine with versions prior to 8.5.2. With the newest release woocommerce triggers loading a ton of scripts on non-woocommerce pages: dom-react.min.js, compose.js, wp-polyfill-inert.min.js and many more. This has an impact on performance. How can i prevent woocommerce from triggering the loading of unnecessary scripts? regards to

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @timholz,

    Have you had a chance to disable the Order Attribution feature? You can find it under WooCommerce > Settings > Advanced > Features. After disabling it, check if it resolves the issue.

    We introduced this new feature, which loads additional resources on the front end. This could be the reason behind the loading of unnecessary script issues you’re experiencing.

    Let us know how that goes.

    Thread Starter timholz

    (@timholz)

    Hi@Shameem

    Thanks a lot for your support. It is indeed this new feature that triggers the loading of the scripts mentioned above.

    All the best to you. regards TO

    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @timholz,

    I’m glad we were able to help! Should you have further inquiries, kindly create a new topic here.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘wc 8.5.2 loads a ton of unnecessary scripts’ is closed to new replies.