mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Site Health: Only get MySQL server information in tests where it's actually needed.
This resolves an issue with plugins like HyperDB, which doesn't have a database connection until a query is made. Props xkon, Otto42, Clorith. See #47606. git-svn-id: https://develop.svn.wordpress.org/trunk@47215 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
95f3bdbaac
commit
ca37df8027
@ -33,8 +33,6 @@ class WP_Site_Health {
|
||||
public function __construct() {
|
||||
$this->maybe_create_scheduled_event();
|
||||
|
||||
$this->prepare_sql_data();
|
||||
|
||||
$this->timeout_late_cron = 0;
|
||||
$this->timeout_missed_cron = - 5 * MINUTE_IN_SECONDS;
|
||||
|
||||
@ -1095,6 +1093,10 @@ class WP_Site_Health {
|
||||
* @return array The test results.
|
||||
*/
|
||||
public function get_test_sql_server() {
|
||||
if ( ! $this->mysql_server_version ) {
|
||||
$this->prepare_sql_data();
|
||||
}
|
||||
|
||||
$result = array(
|
||||
'label' => __( 'SQL server is up to date' ),
|
||||
'status' => 'good',
|
||||
@ -1182,6 +1184,10 @@ class WP_Site_Health {
|
||||
public function get_test_utf8mb4_support() {
|
||||
global $wpdb;
|
||||
|
||||
if ( ! $this->mysql_server_version ) {
|
||||
$this->prepare_sql_data();
|
||||
}
|
||||
|
||||
$result = array(
|
||||
'label' => __( 'UTF8MB4 is supported' ),
|
||||
'status' => 'good',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user