SQLite and WordPress Playground compatibility
-
Hello!
We’re testing the Wordfence plugin compatibility with the SQLite integration and WordPress Playground. Doing so, we’ve encountered the following error:
PHP Fatal error: Uncaught Error: Call to undefined method WP_SQLite_Driver::prepare() in /wordpress/wp-content/plugins/wordfence/lib/wfConfig.php:883The issue here is that with SQLite, the
$wpdb->dbhproperty doesn’t hold an instance ofmysqli.As a hotfix, we can set
WORDFENCE_ALLOW_DIRECT_MYSQLItofalse, but for a more robust solution, I wanted to suggest adding an$wpdb->dbh instanceof mysqlicheck into the following condition on your side:$useMySQLi = (is_object($dbh) && (PHP_MAJOR_VERSION >= 7 || $wpdb->use_mysqli) && wfConfig::get('allowMySQLi', true) && WORDFENCE_ALLOW_DIRECT_MYSQLI);What do you think?
Here’s an issue tracking this on the SQLite integration side: #284Thanks!
Jan
The topic ‘SQLite and WordPress Playground compatibility’ is closed to new replies.