Alert in status report if base table is not present.

Also add a tool to rerun the check. This needs newer API version to work.
This commit is contained in:
vedanshujain 2020-05-11 23:40:58 +05:30
parent b45373fe0c
commit e00f79417f
2 changed files with 32 additions and 2 deletions

View File

@ -339,6 +339,29 @@ class WC_Admin_Status {
}
}
/**
* Prints table info if a base table is not present.
*/
private static function output_tables_info() {
$missing_tables = WC_Install::verify_base_tables( false );
if ( 0 === count( $missing_tables ) ) {
return;
}
?>
<br>
<strong style="color:#a00;">
<span class="dashicons dashicons-warning"></span>
<?php
esc_html_e( 'Missing base tables: ', 'woocommerce' );
echo esc_html( implode( ', ', $missing_tables ) );
esc_html_e( '. Some WooCommerce functionality may not work as expected.', 'woocommerce' );
?>
</strong>
<?php
}
/**
* Prints the information about plugins for the system status report.
* Used for both active and inactive plugins sections.

View File

@ -496,10 +496,17 @@ $untested_plugins = $plugin_updates->get_untested_plugins( WC()->version, 'min
?>
</tbody>
</table>
<table class="wc_status_table widefat" cellspacing="0">
<table id="status-database" class="wc_status_table widefat" cellspacing="0">
<thead>
<tr>
<th colspan="3" data-export-label="Database"><h2><?php esc_html_e( 'Database', 'woocommerce' ); ?></h2></th>
<th colspan="3" data-export-label="Database">
<h2>
<?php
esc_html_e( 'Database', 'woocommerce' );
self::output_tables_info();
?>
</h2>
</th>
</tr>
</thead>
<tbody>