godaddy-wordpress / wc-plugin-framework

The official SkyVerge WooCommerce plugin framework
Other
138 stars 42 forks source link

Re: The plugin slows down the site by littering the wp_options table #672

Open ramonfincken opened 3 months ago

ramonfincken commented 3 months ago

@see https://wordpress.org/support/topic/the-plugin-slows-down-the-site-by-littering-the-wp_options-table/

the create_job ( https://github.com/godaddy-wordpress/wc-plugin-framework/blob/1c2fb1a31228f754ef7427f15ac034d3d8cb6de0/woocommerce/utilities/class-sv-wp-background-job-handler.php#L391 )

and get_job ( https://github.com/godaddy-wordpress/wc-plugin-framework/blob/1c2fb1a31228f754ef7427f15ac034d3d8cb6de0/woocommerce/utilities/class-sv-wp-background-job-handler.php#L391 0

are really bad for performance as they do not have integer primary keys and use LIKE queries in the option_value's.

It needs to be converted to a dedicated table like this (just an example):

ID (PK, integer or varchar) identifier (key) status (key) created_at (datetime) created_by (int) started_processing_at (datetime) updated_at (datetime) total (int) progress (int) handles (text) completed_at (datetime) data (text)