Connect with us

load

How to Improve Site Performance when using Stripe in WooCommerce

Published

on

How to Improve Site Performance when using Stripe in WooCommerce


The WooCommerce Stripe Gateway is a widely used plugin for adding Stripe integration to your WooCommerce store.

A recent release in version 5.7.0 of the Stripe plugin would cause a number of Stripe-related assets requests and external Stripe requests to load on single product pages and cart pages on your site. This would cause product pages and the cart page of the site to be much slower due to the extra requests being loaded from Stripe on them.

The express checkout options can be controlled in the Stripe payment gateway from;

WooCommerce > Settings > Payments > Stripe

If you are using the current version of the WooCommerce Stripe Gateway plugin which at this time is version 5.8.1 then you will still need to use the code snippet to disable the Stripe scripts from loading on cart and product pages.

Code snippet to use

add_filter( 'wc_stripe_load_scripts_on_product_page_when_prbs_disabled', '__return_false' );
add_filter( 'wc_stripe_load_scripts_on_cart_page_when_prbs_disabled', '__return_false' );

Manage all your WordPress sites with the MainWP Dashboard

WordPress Management for Professionals

Are you ready to go Pro?

All MainWP Pro Extensions are available through one of our convenient bundled packages.

MainWP has a code snippets extension that will allow you to save and execute code snippets to all connected child sites.

Making sure that the Stripe plugin is updated to the current version and using the code snippet will help improve your WooCommerce stores loading time before any Black Friday and Cyber Monday sales.

Useful links
https://github.com/woocommerce/woocommerce-gateway-stripe/issues/2065
https://github.com/woocommerce/woocommerce-gateway-stripe/pull/2179
https://github.com/woocommerce/woocommerce-gateway-stripe/pull/2110
https://wordpress.org/plugins/woocommerce-gateway-stripe/
https://raw.githubusercontent.com/woocommerce/woocommerce-gateway-stripe/trunk/changelog.txt
https://woocommerce.com/document/stripe/#express-checkouts

 



Source link

Continue Reading
Click to comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.