diff --git a/includes/sqlite-database-integration/activate.php b/includes/sqlite-database-integration/activate.php index d6d76c377..6af9ba198 100644 --- a/includes/sqlite-database-integration/activate.php +++ b/includes/sqlite-database-integration/activate.php @@ -39,8 +39,10 @@ function sqlite_activation() { // Handle upgrading from the performance-lab plugin. if ( isset( $_GET['upgrade-from-pl'] ) ) { + global $wp_filesystem; + require_once ABSPATH . '/wp-admin/includes/file.php'; // Delete the previous db.php file. - unlink( WP_CONTENT_DIR . '/db.php' ); + $wp_filesystem->delete( WP_CONTENT_DIR . '/db.php' ); // Deactivate the performance-lab SQLite module. $pl_option_name = defined( 'PERFLAB_MODULES_SETTING' ) ? PERFLAB_MODULES_SETTING : 'perflab_modules_settings'; $pl_option = get_option( $pl_option_name, array() ); diff --git a/includes/sqlite-database-integration/load.php b/includes/sqlite-database-integration/load.php index 7844d8297..c082c78f9 100644 --- a/includes/sqlite-database-integration/load.php +++ b/includes/sqlite-database-integration/load.php @@ -3,7 +3,7 @@ * Plugin Name: SQLite Database Integration * Description: SQLite database driver drop-in. * Author: WordPress Performance Team - * Version: 2.1.1 + * Version: 2.1.2 * Requires PHP: 5.6 * Textdomain: sqlite-database-integration * diff --git a/includes/sqlite-database-integration/readme.txt b/includes/sqlite-database-integration/readme.txt index 88ce9a5ae..83f67a866 100644 --- a/includes/sqlite-database-integration/readme.txt +++ b/includes/sqlite-database-integration/readme.txt @@ -2,9 +2,9 @@ Contributors: wordpressdotorg, aristath Requires at least: 6.0 -Tested up to: 6.1 +Tested up to: 6.4 Requires PHP: 5.6 -Stable tag: 2.1.1 +Stable tag: 2.1.2 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Tags: performance, database diff --git a/includes/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php b/includes/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php index 1789cb90e..b3db03574 100644 --- a/includes/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php +++ b/includes/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php @@ -16,8 +16,6 @@ class WP_SQLite_DB extends wpdb { /** * Database Handle * - * @access protected - * * @var WP_SQLite_Translator */ protected $dbh; @@ -315,7 +313,6 @@ public function query( $query ) { * This overrides wpdb::load_col_info(), which uses a mysql function. * * @see wpdb::load_col_info() - * @access protected */ protected function load_col_info() { if ( $this->col_info ) { diff --git a/includes/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-pdo-user-defined-functions.php b/includes/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-pdo-user-defined-functions.php index 2b39033ac..59c6ae607 100644 --- a/includes/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-pdo-user-defined-functions.php +++ b/includes/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-pdo-user-defined-functions.php @@ -446,11 +446,11 @@ public function isnull( $field ) { * * As 'IF' is a reserved word for PHP, function name must be changed. * - * @param unknonw $expression the statement to be evaluated as true or false. - * @param unknown $true statement or value returned if $expression is true. - * @param unknown $false statement or value returned if $expression is false. + * @param mixed $expression the statement to be evaluated as true or false. + * @param mixed $true statement or value returned if $expression is true. + * @param mixed $false statement or value returned if $expression is false. * - * @return unknown + * @return mixed */ public function _if( $expression, $true, $false ) { return ( true === $expression ) ? $true : $false; diff --git a/includes/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-translator.php b/includes/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-translator.php index ab01d42bd..4f8d8401e 100644 --- a/includes/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-translator.php +++ b/includes/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-translator.php @@ -31,8 +31,6 @@ class WP_SQLite_Translator { /** * Class variable to reference to the PDO instance. * - * @access private - * * @var PDO object */ private $pdo; @@ -180,8 +178,6 @@ class WP_SQLite_Translator { /** * Class variable to store the result of the query. * - * @access private - * * @var array reference to the PHP object */ private $results = null; @@ -196,8 +192,6 @@ class WP_SQLite_Translator { /** * Class variable to store the file name and function to cause error. * - * @access private - * * @var array */ private $errors; @@ -205,8 +199,6 @@ class WP_SQLite_Translator { /** * Class variable to store the error messages. * - * @access private - * * @var array */ private $error_messages = array(); @@ -215,7 +207,6 @@ class WP_SQLite_Translator { * Class variable to store the affected row id. * * @var int integer - * @access private */ private $last_insert_id; @@ -1692,9 +1683,9 @@ private function preprocess_string_literal( $value ) { private function preprocess_like_expr( &$token ) { /* * This code handles escaped wildcards in LIKE clauses. - * If we are within a LIKE experession, we look for \_ and \%, the + * If we are within a LIKE expression, we look for \_ and \%, the * escaped LIKE wildcards, the ones where we want a literal, not a - * wildcard match. We change the \ escape for an ASCII \x1a (SUB) character, + * wildcard match. We change the \ escape for an ASCII \x1A (SUB) character, * so the \ characters won't get munged. * These \_ and \% escape sequences are in the token name, because * the lexer has already done stripcslashes on the value. @@ -2424,6 +2415,10 @@ private function strip_sqlite_system_tables( $tables ) { array_filter( $tables, function ( $table ) { + // Bail early if $table is not an object. + if ( ! is_object( $table ) ) { + return true; + } $table_name = property_exists( $table, 'Name' ) ? $table->Name : $table->table_name; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase return ! array_key_exists( $table_name, $this->sqlite_system_tables ); },