Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 3d205db

Browse files
rrennickvedanshujain
authored andcommitted
fix merge conflits
1 parent 84b96bf commit 3d205db

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Controllers/Version2/class-wc-rest-system-status-tools-v2-controller.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,20 @@ public function execute_tool( $tool ) {
583583
$message = __( 'Template cache cleared.', 'woocommerce-rest-api' );
584584
} else {
585585
$message = __( 'The active version of WooCommerce does not support template cache clearing.', 'woocommerce-rest-api' );
586+
case 'verify_db_tables':
587+
if ( ! method_exists( 'WC_Install', 'verify_base_tables' ) ) {
588+
$message = __( 'You need WooCommerce 4.2 or newer to run this tool.', 'woocommerce-rest-api' );
589+
$ran = false;
590+
break;
591+
}
592+
// Try to manually create table again.
593+
$missing_tables = WC_Install::verify_base_tables( true, true );
594+
if ( 0 === count( $missing_tables ) ) {
595+
$message = __( 'Database verified successfully.', 'woocommerce-rest-api' );
596+
} else {
597+
$message = __( 'Verifying database... One or more tables are still missing: ', 'woocommerce-rest-api' );
598+
$message .= implode( ', ', $missing_tables );
599+
$ran = false;
586600
}
587601
break;
588602

0 commit comments

Comments
 (0)