From 3829390c898fc6d129e0ab75868a9307333ef915 Mon Sep 17 00:00:00 2001 From: Jan Jakes Date: Wed, 6 Aug 2025 09:31:16 +0200 Subject: [PATCH] Add a fallback for missing DB_NAME constant --- src/SQLiteDriverFactory.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/SQLiteDriverFactory.php b/src/SQLiteDriverFactory.php index 9cf3fb6..b8cd8ed 100644 --- a/src/SQLiteDriverFactory.php +++ b/src/SQLiteDriverFactory.php @@ -21,7 +21,12 @@ public static function create_driver() { 'path' => FQDB, ) ); - return new WP_SQLite_Driver( $connection, DB_NAME ); + if ( defined( 'DB_NAME' ) && '' !== DB_NAME ) { + $db_name = DB_NAME; + } else { + $db_name = 'database_name_here'; + } + return new WP_SQLite_Driver( $connection, $db_name ); } return new WP_SQLite_Translator();