Changeset 54069 for trunk/src/wp-admin/includes/class-wp-site-health.php
- Timestamp:
- 09/05/2022 03:18:13 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-site-health.php
r54065 r54069 11 11 private static $instance = null; 12 12 13 private $mysql_min_version_check; 14 private $mysql_rec_version_check; 15 16 public $is_mariadb = false; 17 private $mysql_server_version = ''; 18 private $health_check_mysql_required_version = '5.5'; 19 private $health_check_mysql_rec_version = ''; 13 private $is_acceptable_mysql_version; 14 private $is_recommended_mysql_version; 15 16 public $is_mariadb = false; 17 private $mysql_server_version = ''; 18 private $mysql_required_version = '5.5'; 19 private $mysql_recommended_version = '5.7'; 20 private $mariadb_recommended_version = '10.3'; 20 21 21 22 public $php_memory_limit; … … 210 211 $this->mysql_server_version = $wpdb->get_var( 'SELECT VERSION()' ); 211 212 212 $this->health_check_mysql_rec_version = '5.6';213 214 213 if ( stristr( $mysql_server_type, 'mariadb' ) ) { 215 $this->is_mariadb 216 $this-> health_check_mysql_rec_version = '10.0';217 } 218 219 $this-> mysql_min_version_check = version_compare( '5.5', $this->mysql_server_version, '<=' );220 $this-> mysql_rec_version_check = version_compare( $this->health_check_mysql_rec_version, $this->mysql_server_version, '<=' );214 $this->is_mariadb = true; 215 $this->mysql_recommended_version = $this->mariadb_recommended_version; 216 } 217 218 $this->is_acceptable_mysql_version = version_compare( $this->mysql_required_version, $this->mysql_server_version, '<=' ); 219 $this->is_recommended_mysql_version = version_compare( $this->mysql_recommended_version, $this->mysql_server_version, '<=' ); 221 220 } 222 221 … … 1198 1197 $db_dropin = file_exists( WP_CONTENT_DIR . '/db.php' ); 1199 1198 1200 if ( ! $this-> mysql_rec_version_check) {1199 if ( ! $this->is_recommended_mysql_version ) { 1201 1200 $result['status'] = 'recommended'; 1202 1201 … … 1209 1208 __( 'For optimal performance and security reasons, you should consider running %1$s version %2$s or higher. Contact your web hosting company to correct this.' ), 1210 1209 ( $this->is_mariadb ? 'MariaDB' : 'MySQL' ), 1211 $this-> health_check_mysql_rec_version1210 $this->mysql_recommended_version 1212 1211 ) 1213 1212 ); 1214 1213 } 1215 1214 1216 if ( ! $this-> mysql_min_version_check) {1215 if ( ! $this->is_acceptable_mysql_version ) { 1217 1216 $result['status'] = 'critical'; 1218 1217 … … 1226 1225 __( 'WordPress requires %1$s version %2$s or higher. Contact your web hosting company to correct this.' ), 1227 1226 ( $this->is_mariadb ? 'MariaDB' : 'MySQL' ), 1228 $this-> health_check_mysql_required_version1227 $this->mysql_required_version 1229 1228 ) 1230 1229 );
Note: See TracChangeset
for help on using the changeset viewer.