Show non existing tables in system status report #8147
This commit is contained in:
parent
cc213de455
commit
fd772e41fa
|
@ -41,11 +41,6 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The version of WooCommerce installed on your site.', 'woocommerce' ) . '">[?]</a>'; ?></td>
|
||||
<td><?php echo esc_html( WC()->version ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="WC Database Version"><?php _e( 'WC Database Version', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The version of WooCommerce that the database is formatted for. This should be the same as your WooCommerce Version.', 'woocommerce' ) . '">[?]</a>'; ?></td>
|
||||
<td><?php echo esc_html( get_option( 'woocommerce_db_version' ) ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-export-label="Log Directory Writable"><?php _e( 'Log Directory Writable', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'Several WooCommerce extensions can write logs which makes debugging problems easier. The directory must be writable for this to happen.', 'woocommerce' ) . '">[?]</a>'; ?></td>
|
||||
|
@ -281,6 +276,43 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="wc_status_table widefat" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3" data-export-label="Database"><?php _e( 'Database', 'woocommerce' ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td data-export-label="WC Database Version"><?php _e( 'WC Database Version', 'woocommerce' ); ?>:</td>
|
||||
<td class="help"><?php echo '<a href="#" class="help_tip" data-tip="' . esc_attr__( 'The version of WooCommerce that the database is formatted for. This should be the same as your WooCommerce Version.', 'woocommerce' ) . '">[?]</a>'; ?></td>
|
||||
<td><?php echo esc_html( get_option( 'woocommerce_db_version' ) ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
$tables = array(
|
||||
'woocommerce_attribute_taxonomies',
|
||||
'woocommerce_termmeta',
|
||||
'woocommerce_downloadable_product_permissions',
|
||||
'woocommerce_order_items',
|
||||
'woocommerce_order_itemmeta',
|
||||
'woocommerce_tax_rates',
|
||||
'woocommerce_tax_rate_locations'
|
||||
);
|
||||
|
||||
foreach ( $tables as $table ) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo esc_html( $table ); ?></td>
|
||||
<td class="help"> </td>
|
||||
<td><?php echo $wpdb->get_var( $wpdb->prepare( "SHOW TABLES LIKE %s;", $wpdb->prefix . $table ) ) !== $wpdb->prefix . $table ? '<mark class="error">' . __( 'Table does not exist', 'woocommerce' ) . '</mark>' : '✔'; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="wc_status_table widefat" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
Loading…
Reference in New Issue