Cat dashboard loading time (#34292)
Co-authored-by: Néstor Soriano <konamiman@konamiman.com>
This commit is contained in:
parent
c6c2828f60
commit
332204723b
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: update
|
||||||
|
|
||||||
|
Improve the loading time of WooCommerce setup widget for large databases
|
|
@ -187,7 +187,7 @@ if ( ! class_exists( 'WC_Admin_Dashboard_Setup', false ) ) :
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! $this->get_task_list() || $this->get_task_list()->is_complete() || $this->get_task_list()->is_hidden() ) {
|
if ( ! $this->get_task_list() || $this->get_task_list()->is_hidden() || $this->get_task_list()->is_complete() ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ class WC_Admin_Dashboard_Setup_Test extends WC_Unit_Test_Case {
|
||||||
// Set default country to non-US so that 'payments' task gets added but 'woocommerce-payments' doesn't,
|
// Set default country to non-US so that 'payments' task gets added but 'woocommerce-payments' doesn't,
|
||||||
// by default it won't be considered completed but we can manually change that as needed.
|
// by default it won't be considered completed but we can manually change that as needed.
|
||||||
update_option( 'woocommerce_default_country', 'JP' );
|
update_option( 'woocommerce_default_country', 'JP' );
|
||||||
$password = wp_generate_password( 8, false, false );
|
$password = wp_generate_password( 8, false, false );
|
||||||
$this->admin = wp_insert_user(
|
$this->admin = wp_insert_user(
|
||||||
array(
|
array(
|
||||||
'user_login' => "test_admin$password",
|
'user_login' => "test_admin$password",
|
||||||
|
@ -88,11 +88,16 @@ class WC_Admin_Dashboard_Setup_Test extends WC_Unit_Test_Case {
|
||||||
* Tests widget does not display when task list is complete.
|
* Tests widget does not display when task list is complete.
|
||||||
*/
|
*/
|
||||||
public function test_widget_does_not_display_when_task_list_complete() {
|
public function test_widget_does_not_display_when_task_list_complete() {
|
||||||
$task_list = new class {
|
// phpcs:disable Squiz.Commenting
|
||||||
|
$task_list = new class() {
|
||||||
public function is_complete() {
|
public function is_complete() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
public function is_hidden() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
// phpcs:enable Squiz.Commenting
|
||||||
$widget = $this->get_widget();
|
$widget = $this->get_widget();
|
||||||
$widget->set_task_list( $task_list );
|
$widget->set_task_list( $task_list );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue