suppress_errors( true ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching -- Both connections must report their actual database identity before a non-reconnecting removal transaction can proceed; caching would defeat this check. if ( ! $this->ready || is_wp_error( $this->set_prefix( $wpdb->prefix ) ) || (string) $this->get_var( 'SELECT DATABASE()' ) !== (string) $wpdb->get_var( 'SELECT DATABASE()' ) ) { $this->close(); throw new \RuntimeException( 'Could not establish the dedicated data removal database connection.' ); } } public function db_connect( $allow_bail = true ) { return parent::db_connect( false ); } public function check_connection( $allow_bail = true ) { $this->last_error = 'The data removal transaction connection was lost. No statement was retried on another connection.'; return false; } }