Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

WP_Site_Health::prepare_sql_data() WordPress Method

The WP_Site_Health::prepare_sql_data() method is used to prepare the data for an SQL query. The method takes an array of data as input and outputs a string of SQL code. The method is used to clean up the data before it is stored in the database.

WP_Site_Health::prepare_sql_data() #

Run the SQL version checks.


Description

These values are used in later tests, but the part of preparing them is more easily managed early in the class for ease of access and discovery.


Top ↑

Source

File: wp-admin/includes/class-wp-site-health.php

	private function prepare_sql_data() {
		global $wpdb;

		if ( $wpdb->use_mysqli ) {
			// phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysqli_get_server_info
			$mysql_server_type = mysqli_get_server_info( $wpdb->dbh );
		} else {
			// phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysql_get_server_info,PHPCompatibility.Extensions.RemovedExtensions.mysql_DeprecatedRemoved
			$mysql_server_type = mysql_get_server_info( $wpdb->dbh );
		}

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

		$this->health_check_mysql_rec_version = '5.6';

		if ( stristr( $mysql_server_type, 'mariadb' ) ) {
			$this->is_mariadb                     = true;
			$this->health_check_mysql_rec_version = '10.0';
		}

		$this->mysql_min_version_check = version_compare( '5.5', $this->mysql_server_version, '<=' );
		$this->mysql_rec_version_check = version_compare( $this->health_check_mysql_rec_version, $this->mysql_server_version, '<=' );
	}


Top ↑

Changelog

Changelog
VersionDescription
5.2.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.