diff --git a/src/wp-admin/includes/class-wp-debug-data.php b/src/wp-admin/includes/class-wp-debug-data.php index 895f12fdc4..5f433ad741 100644 --- a/src/wp-admin/includes/class-wp-debug-data.php +++ b/src/wp-admin/includes/class-wp-debug-data.php @@ -705,22 +705,7 @@ class WP_Debug_Data { $extension = null; } - /* - * Check what database engine is used, this will throw compatibility - * warnings from PHP compatibility testers, but `mysql_*` is - * still valid in PHP 5.6, so we need to account for that. - */ - if ( method_exists( $wpdb, 'db_version' ) ) { - if ( $wpdb->use_mysqli ) { - // phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysqli_get_server_info - $server = mysqli_get_server_info( $wpdb->dbh ); - } else { - // phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysql_get_server_info - $server = mysql_get_server_info( $wpdb->dbh ); - } - } else { - $server = null; - } + $server = $wpdb->db_version(); if ( isset( $wpdb->use_mysqli ) && $wpdb->use_mysqli ) { $client_version = $wpdb->dbh->client_info; diff --git a/src/wp-admin/includes/class-wp-site-health.php b/src/wp-admin/includes/class-wp-site-health.php index 6b9bb6d418..46a745c90a 100644 --- a/src/wp-admin/includes/class-wp-site-health.php +++ b/src/wp-admin/includes/class-wp-site-health.php @@ -130,7 +130,7 @@ class WP_Site_Health { $mysql_server_type = mysql_get_server_info( $wpdb->dbh ); } - $this->mysql_server_version = $wpdb->get_var( 'SELECT VERSION()' ); + $this->mysql_server_version = $wpdb->db_version(); } $this->health_check_mysql_rec_version = '5.6';