From c5defa6a1e476eddf3aa50f4b051ae5b97a800ff Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Thu, 21 Mar 2019 14:39:33 +0000 Subject: [PATCH] Add engine to system status --- includes/admin/views/html-admin-page-status-report.php | 8 ++++---- .../v2/class-wc-rest-system-status-v2-controller.php | 10 ++++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/includes/admin/views/html-admin-page-status-report.php b/includes/admin/views/html-admin-page-status-report.php index 6f1e4765ea6..625f7045f88 100644 --- a/includes/admin/views/html-admin-page-status-report.php +++ b/includes/admin/views/html-admin-page-status-report.php @@ -475,8 +475,8 @@ $untested_plugins = $plugin_updates->get_untested_plugins( WC()->version, 'min if ( ! $table_data ) { echo ' ' . esc_html__( 'Table does not exist', 'woocommerce' ) . ''; } else { - /* Translators: %1$f: Table size, %2$f: Index size. */ - printf( esc_html__( 'Data: %1$.2fMB + Index: %2$.2fMB', 'woocommerce' ), esc_html( wc_format_decimal( $table_data['data'], 2 ) ), esc_html( wc_format_decimal( $table_data['index'], 2 ) ) ); + /* Translators: %1$f: Table size, %2$f: Index size, %3$s Engine. */ + printf( esc_html__( 'Data: %1$.2fMB + Index: %2$.2fMB + Engine %3$s', 'woocommerce' ), esc_html( wc_format_decimal( $table_data['data'], 2 ) ), esc_html( wc_format_decimal( $table_data['index'], 2 ) ), esc_html( $table_data['engine'] ) ); } ?> @@ -489,8 +489,8 @@ $untested_plugins = $plugin_updates->get_untested_plugins( WC()->version, 'min   diff --git a/includes/api/v2/class-wc-rest-system-status-v2-controller.php b/includes/api/v2/class-wc-rest-system-status-v2-controller.php index b2c305cb181..af2d4c6fa3d 100644 --- a/includes/api/v2/class-wc-rest-system-status-v2-controller.php +++ b/includes/api/v2/class-wc-rest-system-status-v2-controller.php @@ -696,10 +696,11 @@ class WC_REST_System_Status_V2_Controller extends WC_REST_Controller { public function get_database_info() { global $wpdb; - $database_table_sizes = $wpdb->get_results( + $database_table_information = $wpdb->get_results( $wpdb->prepare( "SELECT table_name AS 'name', + engine, round( ( data_length / 1024 / 1024 ), 2 ) 'data', round( ( index_length / 1024 / 1024 ), 2 ) 'index' FROM information_schema.TABLES @@ -754,7 +755,7 @@ class WC_REST_System_Status_V2_Controller extends WC_REST_Controller { $site_tables_prefix = $wpdb->get_blog_prefix( get_current_blog_id() ); $global_tables = $wpdb->tables( 'global', true ); - foreach ( $database_table_sizes as $table ) { + foreach ( $database_table_information as $table ) { // Only include tables matching the prefix of the current site, this is to prevent displaying all tables on a MS install not relating to the current. if ( is_multisite() && 0 !== strpos( $table->name, $site_tables_prefix ) && ! in_array( $table->name, $global_tables, true ) ) { continue; @@ -762,8 +763,9 @@ class WC_REST_System_Status_V2_Controller extends WC_REST_Controller { $table_type = in_array( $table->name, $core_tables ) ? 'woocommerce' : 'other'; $tables[ $table_type ][ $table->name ] = array( - 'data' => $table->data, - 'index' => $table->index, + 'data' => $table->data, + 'index' => $table->index, + 'engine' => $table->engine, ); $database_size['data'] += $table->data;