wip
This commit is contained in:
+34
-5
@@ -21,7 +21,6 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
*
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @global string $wp_version Used to check against the newest WordPress version.
|
||||
* @global wpdb $wpdb WordPress database abstraction object.
|
||||
* @global string $wp_local_package Locale code of the package.
|
||||
*
|
||||
@@ -107,6 +106,7 @@ function wp_version_check( $extra_stats = array(), $force_check = false ) {
|
||||
'users' => get_user_count(),
|
||||
'multisite_enabled' => $multisite_enabled,
|
||||
'initial_db_version' => get_site_option( 'initial_db_version' ),
|
||||
'myisam_tables' => array(),
|
||||
'extensions' => array_combine( $extensions, array_map( 'phpversion', $extensions ) ),
|
||||
'platform_flags' => array(
|
||||
'os' => PHP_OS,
|
||||
@@ -115,6 +115,39 @@ function wp_version_check( $extra_stats = array(), $force_check = false ) {
|
||||
'image_support' => array(),
|
||||
);
|
||||
|
||||
// Check for default tables using the MyISAM engine.
|
||||
$table_names = implode( "','", $wpdb->tables() );
|
||||
$myisam_tables = $wpdb->get_results(
|
||||
$wpdb->prepare(
|
||||
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- This query cannot use interpolation.
|
||||
"SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = %s AND TABLE_NAME IN ('$table_names') AND ENGINE = %s;",
|
||||
DB_NAME,
|
||||
'MyISAM'
|
||||
),
|
||||
OBJECT_K
|
||||
);
|
||||
|
||||
if ( ! empty( $myisam_tables ) ) {
|
||||
$all_unprefixed_tables = $wpdb->tables( 'all', false );
|
||||
|
||||
// Including the table prefix is not necessary.
|
||||
$unprefixed_myisam_tables = array_reduce(
|
||||
array_keys( $myisam_tables ),
|
||||
function ( $carry, $prefixed_myisam_table ) use ( $all_unprefixed_tables ) {
|
||||
foreach ( $all_unprefixed_tables as $unprefixed ) {
|
||||
if ( str_ends_with( $prefixed_myisam_table, $unprefixed ) ) {
|
||||
$carry[] = $unprefixed;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $carry;
|
||||
},
|
||||
array()
|
||||
);
|
||||
|
||||
$query['myisam_tables'] = $unprefixed_myisam_tables;
|
||||
}
|
||||
|
||||
if ( function_exists( 'gd_info' ) ) {
|
||||
$gd_info = gd_info();
|
||||
// Filter to supported values.
|
||||
@@ -317,8 +350,6 @@ function wp_version_check( $extra_stats = array(), $force_check = false ) {
|
||||
*
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @global string $wp_version The WordPress version string.
|
||||
*
|
||||
* @param array $extra_stats Extra statistics to report to the WordPress.org API.
|
||||
*/
|
||||
function wp_update_plugins( $extra_stats = array() ) {
|
||||
@@ -590,8 +621,6 @@ function wp_update_plugins( $extra_stats = array() ) {
|
||||
*
|
||||
* @since 2.7.0
|
||||
*
|
||||
* @global string $wp_version The WordPress version string.
|
||||
*
|
||||
* @param array $extra_stats Extra statistics to report to the WordPress.org API.
|
||||
*/
|
||||
function wp_update_themes( $extra_stats = array() ) {
|
||||
|
||||
Reference in New Issue
Block a user