[SOLVED] WooCommerce purchases are very slow

Issue

It is taking 15 seconds or so from the time the user submits their order for purchase, till they receive the thank you page on my WooCommerce site.

WooCommerce 6.0.0 and WordPress 5.8.3

The other pages on the site load at an acceptable speed, it is only when the user submits the actual order for purchase that I get the lag.

I am printing to the debug.log and am seeing that there is a 10 second delay between when the order status changed to completed: (woocommerce_order_status_changed hook) and when the thank you page hook is triggered (woocommerce_thankyou hook).

Can someone tell me what happens in between these 2 events or how to fix this?

Note that the lag is happening AFTER the payment has happened so it is not the payment processor.

Thanks so much!

Solution

I’m going to leave this here in case it helps someone else.

I have just discovered that this particular lag was caused by Jetpack. As soon as I disabled it, it shaved 10 seconds off of the checkout time. Other pages also sped up.

It still takes about 6 seconds for the whole process but that is for a different post.

Answered By – deathless_being

Answer Checked By – Candace Johnson (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *