From 3d205dbd4ab0cc2b40ee77fee1c067b2d5219174 Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Mon, 15 Jun 2020 13:17:32 -0300 Subject: [PATCH] fix merge conflits --- ...s-wc-rest-system-status-tools-v2-controller.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Controllers/Version2/class-wc-rest-system-status-tools-v2-controller.php b/src/Controllers/Version2/class-wc-rest-system-status-tools-v2-controller.php index 9efd82143d3..3894451dab4 100644 --- a/src/Controllers/Version2/class-wc-rest-system-status-tools-v2-controller.php +++ b/src/Controllers/Version2/class-wc-rest-system-status-tools-v2-controller.php @@ -583,6 +583,20 @@ class WC_REST_System_Status_Tools_V2_Controller extends WC_REST_Controller { $message = __( 'Template cache cleared.', 'woocommerce-rest-api' ); } else { $message = __( 'The active version of WooCommerce does not support template cache clearing.', 'woocommerce-rest-api' ); + case 'verify_db_tables': + if ( ! method_exists( 'WC_Install', 'verify_base_tables' ) ) { + $message = __( 'You need WooCommerce 4.2 or newer to run this tool.', 'woocommerce-rest-api' ); + $ran = false; + break; + } + // Try to manually create table again. + $missing_tables = WC_Install::verify_base_tables( true, true ); + if ( 0 === count( $missing_tables ) ) { + $message = __( 'Database verified successfully.', 'woocommerce-rest-api' ); + } else { + $message = __( 'Verifying database... One or more tables are still missing: ', 'woocommerce-rest-api' ); + $message .= implode( ', ', $missing_tables ); + $ran = false; } break;