How to fix slow WooCommerce 6.01 for wp-admin pages
- Installing Xdebug remotely to debug WordPress and gather profile traces - November 23, 2022
- Speeding up WooCommerce 7 (wp-admin and imports) - November 4, 2022
- More speed boosts for wp-admin and imports with Scalability Pro upgrade - October 12, 2022
I upgraded Foundthru to the latest WooCommerce and after onboarding (updating the database) it keeps checking if I need to update the database with expensive calls on wp-admin.
On foundthru with 1 million products, this increases wp-admin page load time from 3 seconds to 28 seconds.
There’s no easy fix I can apply for this inside Scalability Pro so I had to edit a couple of WooCommerce files to fix this. That should be safe since the next WooCommerce update will overwrite the fixes which will mean onboarding can run again for the next update.
More info about the source files here on this facebook post:
Specifically, the files you need to edit are:
You’re looking for lines at the start of 5 different functions that look like this:
$task = new Task( self::get_task() );
Just put the command return; before that line so it becomes:
return; $task = new Task( self::get_task() );
These edits will be overwritten on the next WooCommerce update when they’ve hopefully fixed this, and because the updates are overwritten it means any required onboarding for the next version will kick in again.
March 11, 2022 @ 1:43 pm
My bad – I’d updated our demo sites where we test everything to WooCommerce 6.31 which is actually the latest version and this issue is already fixed.
Foundthru was still on an older version which I’ve now updated and confirmed this issue is also fixed there.
March 11, 2022 @ 2:01 pm
Spoke too soon again – 6.31 still has this issue. 27 seconds added to wp-admin. Maybe it will go away when the new Product Attribute Table has been created.
I’ll report back once that’s happened.
May 3, 2022 @ 9:42 pm
Did the issue go away after the Product Attribute Lookup Table was created?
May 5, 2022 @ 10:20 pm
It still hasn’t completed on my million product site – I increased the batch size to 10,000 – it should be done soon. I don’t like how they build these tables – they make them super reliable on every site but as a result, they take ages to build.
My tables use MySQL 8 features (recursive CTEs) to make building and maintaining these tables really fast.