Skip to content

Commit 941b443

Browse files
committed
site-health improvements
1 parent 1154ade commit 941b443

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎src/wp-admin/includes/class-wp-site-health.php‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class WP_Site_Health {
1515
private $is_recommended_mysql_version;
1616

1717
public $is_mariadb = false;
18+
public $is_sqlite = false;
1819
private $mysql_server_version = '';
1920
private $mysql_required_version = '5.5';
2021
private $mysql_recommended_version = '5.7';
@@ -208,6 +209,7 @@ private function prepare_sql_data() {
208209
global $wpdb;
209210

210211
$mysql_server_type = $wpdb->db_server_info();
212+
$this->is_sqlite = defined( 'DATABASE_TYPE' ) && 'sqlite' === DATABASE_TYPE ? 'sqlite' : 'mysql';
211213

212214
$this->mysql_server_version = $wpdb->get_var( 'SELECT VERSION()' );
213215

@@ -1226,7 +1228,7 @@ public function get_test_sql_server() {
12261228

12271229
$db_dropin = file_exists( WP_CONTENT_DIR . '/db.php' );
12281230

1229-
if ( ! $this->is_recommended_mysql_version ) {
1231+
if ( ! $this->is_sqlite && ! $this->is_recommended_mysql_version ) {
12301232
$result['status'] = 'recommended';
12311233

12321234
$result['label'] = __( 'Outdated SQL server' );
@@ -1242,7 +1244,7 @@ public function get_test_sql_server() {
12421244
);
12431245
}
12441246

1245-
if ( ! $this->is_acceptable_mysql_version ) {
1247+
if ( ! $this->is_sqlite && ! $this->is_acceptable_mysql_version ) {
12461248
$result['status'] = 'critical';
12471249

12481250
$result['label'] = __( 'Severely outdated SQL server' );
@@ -1308,6 +1310,10 @@ public function get_test_utf8mb4_support() {
13081310
'test' => 'utf8mb4_support',
13091311
);
13101312

1313+
if ( $this->is_sqlite ) {
1314+
return $result;
1315+
}
1316+
13111317
if ( ! $this->is_mariadb ) {
13121318
if ( version_compare( $this->mysql_server_version, '5.5.3', '<' ) ) {
13131319
$result['status'] = 'recommended';

0 commit comments

Comments
 (0)