WordPress.org

Make WordPress Core

Changeset 47215


Ignore:
Timestamp:
02/08/2020 08:08:31 PM (8 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-site-health.php

    r47198 r47215  
    3333    public function __construct() {
    3434        $this->maybe_create_scheduled_event();
    35 
    36         $this->prepare_sql_data();
    3735
    3836        $this->timeout_late_cron   = 0;
     
    10961094     */
    10971095    public function get_test_sql_server() {
     1096        if ( ! $this->mysql_server_version ) {
     1097            $this->prepare_sql_data();
     1098        }
     1099
    10981100        $result = array(
    10991101            'label'       => __( 'SQL server is up to date' ),
     
    11821184    public function get_test_utf8mb4_support() {
    11831185        global $wpdb;
     1186
     1187        if ( ! $this->mysql_server_version ) {
     1188            $this->prepare_sql_data();
     1189        }
    11841190
    11851191        $result = array(
Note: See TracChangeset for help on using the changeset viewer.