Only load tables for system that is part of current multisite, this avoids displaying all tables in a MS speeding up page load, and also prevent divulding tables on other sites in the MS environment.

This commit is contained in:
Gerhard Potgieter 2018-07-09 13:48:05 +02:00
parent 404fbca655
commit beaa610cc0
1 changed files with 6 additions and 0 deletions

View File

@ -722,6 +722,12 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
); );
foreach ( $database_table_sizes as $table ) { foreach ( $database_table_sizes 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() ) {
if ( 0 !== strpos( $table->name, $wpdb->prefix ) ) {
continue;
}
}
$table_type = in_array( $table->name, $core_tables ) ? 'woocommerce' : 'other'; $table_type = in_array( $table->name, $core_tables ) ? 'woocommerce' : 'other';
$tables[ $table_type ][ $table->name ] = array( $tables[ $table_type ][ $table->name ] = array(