From 86ce816f818b6c58b715c89c4389fab2afdce72b Mon Sep 17 00:00:00 2001 From: davidperezgar Date: Thu, 23 Jan 2025 19:36:37 +0100 Subject: [PATCH 1/2] change base_prefix variable --- includes/Checker/Runtime_Environment_Setup.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/Checker/Runtime_Environment_Setup.php b/includes/Checker/Runtime_Environment_Setup.php index 831116bb8..b5ebb5bee 100644 --- a/includes/Checker/Runtime_Environment_Setup.php +++ b/includes/Checker/Runtime_Environment_Setup.php @@ -102,11 +102,11 @@ static function () use ( $permalink_structure ) { * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. */ public function clean_up() { - global $wpdb, $table_prefix, $wp_filesystem; + global $wpdb, $base_prefix, $wp_filesystem; require_once ABSPATH . '/wp-admin/includes/upgrade.php'; - $old_prefix = $wpdb->set_prefix( $table_prefix . 'pc_' ); + $old_prefix = $wpdb->set_prefix( $base_prefix . 'pc_' ); $tables = $wpdb->tables(); foreach ( $tables as $table ) { From 28e4fef57073064b8b8ea64b2da1be6ede4e4d70 Mon Sep 17 00:00:00 2001 From: davidperezgar Date: Thu, 23 Jan 2025 19:39:08 +0100 Subject: [PATCH 2/2] changes all variables --- includes/Checker/Runtime_Environment_Setup.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/includes/Checker/Runtime_Environment_Setup.php b/includes/Checker/Runtime_Environment_Setup.php index b5ebb5bee..6dd6b8bf4 100644 --- a/includes/Checker/Runtime_Environment_Setup.php +++ b/includes/Checker/Runtime_Environment_Setup.php @@ -20,11 +20,11 @@ final class Runtime_Environment_Setup { * @since 1.0.0 * * @global wpdb $wpdb WordPress database abstraction object. - * @global string $table_prefix The database table prefix. + * @global string $base_prefix The database table prefix. * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. */ public function set_up() { - global $wpdb, $table_prefix, $wp_filesystem; + global $wpdb, $base_prefix, $wp_filesystem; require_once ABSPATH . '/wp-admin/includes/upgrade.php'; @@ -41,7 +41,7 @@ public function set_up() { $permalink_structure = get_option( 'permalink_structure' ); // Set the new prefix. - $old_prefix = $wpdb->set_prefix( $table_prefix . 'pc_' ); + $old_prefix = $wpdb->set_prefix( $base_prefix . 'pc_' ); // Create and populate the test database tables if they do not exist. if ( $wpdb->posts !== $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->posts ) ) ) { @@ -98,7 +98,7 @@ static function () use ( $permalink_structure ) { * @since 1.0.0 * * @global wpdb $wpdb WordPress database abstraction object. - * @global string $table_prefix The database table prefix. + * @global string $base_prefix The database table prefix. * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. */ public function clean_up() { @@ -146,19 +146,19 @@ public function clean_up() { * @since 1.3.0 * * @global wpdb $wpdb WordPress database abstraction object. - * @global string $table_prefix The database table prefix. + * @global string $base_prefix The database table prefix. * * @return bool True if the runtime environment is set up, false if not. */ public function is_set_up() { - global $wpdb, $table_prefix; + global $wpdb, $base_prefix; if ( defined( 'WP_PLUGIN_CHECK_OBJECT_CACHE_DROPIN_VERSION' ) ) { return true; } // Set the custom prefix to check for the runtime environment tables. - $old_prefix = $wpdb->set_prefix( $table_prefix . 'pc_' ); + $old_prefix = $wpdb->set_prefix( $base_prefix . 'pc_' ); $tables_present = $wpdb->posts === $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->posts ) );