Skip to content

Commit 60eefc3

Browse files
committed
Add a hotfix for Wordfence issue "Call to undefined method WP_SQLite_Driver::prepare()"
1 parent d982450 commit 60eefc3

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

wp-includes/sqlite/class-wp-sqlite-db.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@
66
* @since 1.0.0
77
*/
88

9+
/*
10+
* A compatibility hotfix for the Wordfence plugin.
11+
*
12+
* Wordfence directly uses the $wpdb->dbh property, considering it an instance
13+
* of mysqli, without checking if it really is. As a hotfix, we will disable
14+
* the Wordfence mysqli usage using the WORDFENCE_ALLOW_DIRECT_MYSQLI constant.
15+
*
16+
* TODO: Remove this once the issue is resolved in Wordfence.
17+
*
18+
* See: https://github.com/WordPress/sqlite-database-integration/issues/284
19+
*/
20+
if ( ! defined( 'WORDFENCE_ALLOW_DIRECT_MYSQLI' ) ) {
21+
define( 'WORDFENCE_ALLOW_DIRECT_MYSQLI', false );
22+
}
23+
924
/**
1025
* This class extends wpdb and replaces it.
1126
*

0 commit comments

Comments
 (0)