| @@ -3,14 +3,14 @@ | ||
| 3 | 3 | Contributors: wordpressdotorg, aristath, janjakes, zieladam, berislav.grgicak, bpayton, zaerl |
| 4 | 4 | Requires at least: 6.4 |
| 5 | 5 | Tested up to: 7.1 |
| 6 | 6 | Requires PHP: 7.2 |
| 7 | -Stable tag: 3.0.2 | |
| 7 | +Stable tag: 3.1.0 | |
| 8 | 8 | License: GPLv2 or later |
| 9 | 9 | License URI: https://www.gnu.org/licenses/gpl-2.0.html |
| 10 | 10 | Tags: sqlite, database |
| 11 | 11 | |
| 12 | -Run WordPress on SQLite instead of MySQL or MariaDB. | |
| 12 | +Run WordPress on SQLite. | |
| 13 | 13 | |
| 14 | 14 | == Description == |
| 15 | 15 | |
| 16 | 16 | **Run WordPress on SQLite.** |
| @@ -47,8 +47,33 @@ | ||
| 47 | 47 | No. Enabling SQLite starts a fresh WordPress installation in a separate database. Your existing MySQL or MariaDB database remains unchanged, but its content is not copied to SQLite. |
| 48 | 48 | |
| 49 | 49 | Disabling the plugin reconnects WordPress to the previous database. Content created while using SQLite is not transferred back. |
| 50 | 50 | |
| 51 | += Where is the SQLite database stored? = | |
| 52 | + | |
| 53 | +By default, the SQLite database is stored in a **randomized path** under `WP_CONTENT_DIR . '/database'`. The full path is recorded in `db-path.php` and exposed by the `DB_PATH` constant at runtime. | |
| 54 | + | |
| 55 | +For example: | |
| 56 | + | |
| 57 | +1. Database path: `WP_CONTENT_DIR . '/database/.ht.020a33c5d9e5407e8e93b43e55abf62e/.ht.sqlite'` | |
| 58 | +2. Recorded in: `WP_CONTENT_DIR . '/database/db-path.php'` as `return __DIR__ . '/...';` | |
| 59 | +3. Exposed by: `DB_PATH` | |
| 60 | + | |
| 61 | +The random path makes the database location difficult to guess when it is not otherwise protected. We recommend setting `DB_PATH` to an **explicit, protected path** outside the web root that your web server does not expose. | |
| 62 | + | |
| 63 | +Integrations should always read `DB_PATH` after WordPress loads instead of assuming a fixed database path. | |
| 64 | + | |
| 65 | += How can I configure the database location? = | |
| 66 | + | |
| 67 | +To properly **secure the SQLite database**, define the `DB_PATH` constant to an **explicit path** that is protected from public web access. An explicit `DB_PATH` value is used as-is without randomization. Define it in `wp-config.php`: | |
| 68 | + | |
| 69 | + // Use protected DB path that is not exposed by the web server. | |
| 70 | + define( 'DB_PATH', '/private/wordpress/database.sqlite' ); | |
| 71 | + | |
| 72 | +**Caution:** An explicit `DB_PATH` must point to a **protected** location that your web server does not expose. Store the database outside the web root and make sure it's protected. | |
| 73 | + | |
| 74 | +The value of `DB_PATH` must be an absolute path to the SQLite database file, or `:memory:` for an in-memory SQLite database. The database directory must be writable by PHP. Changing `DB_PATH` selects a different database without moving an existing one. | |
| 75 | + | |
| 51 | 76 | = What does the plugin require? = |
| 52 | 77 | |
| 53 | 78 | In addition to the WordPress and PHP versions listed above, the plugin requires the PDO SQLite PHP extension and SQLite 3.37.0 or newer. The setup screen also needs write access to the `wp-content` directory and will detect conflicting database drop-ins. |
| 54 | 79 | |
| @@ -64,8 +89,51 @@ | ||
| 64 | 89 | |
| 65 | 90 | Yes. The plugin replaces the default MySQL-based database layer with an SQLite-backed implementation. WordPress continues to use the `wpdb` API, while queries are internally adapted to SQLite syntax and behavior. |
| 66 | 91 | |
| 67 | 92 | == Changelog == |
| 93 | + | |
| 94 | += 3.1.0 = | |
| 95 | + | |
| 96 | +**SQLite Database Integration 3.1 is here! 🎉** | |
| 97 | + | |
| 98 | +This release improves **database storage and configuration** and fixes several MySQL compatibility issues. | |
| 99 | + | |
| 100 | +**What's new** | |
| 101 | + | |
| 102 | +Version 3.1 improves how WordPress sites store, locate, and protect their SQLite databases. It also fixes SQL behavior and export compatibility: | |
| 103 | + | |
| 104 | +* **Randomized database paths:** The default database location is now a randomized directory under `wp-content/database/`, recorded in `wp-content/database/db-path.php`. ([#502](https://github.com/WordPress/sqlite-database-integration/pull/502)) | |
| 105 | +* **`DB_PATH`:** Configure the database with one full-path constant, also available at runtime for integrations. ([#512](https://github.com/WordPress/sqlite-database-integration/pull/512)) | |
| 106 | +* **SQL compatibility:** Fix `IF()` condition evaluation and make `TRADITIONAL` enable its component SQL modes. ([#518](https://github.com/WordPress/sqlite-database-integration/pull/518), [#509](https://github.com/WordPress/sqlite-database-integration/pull/509)) | |
| 107 | +* **WordPress table collations:** Default to `utf8mb4_unicode_520_ci` for new tables created with WordPress's charset settings, improving exports to MariaDB. Existing tables keep their recorded collation. ([#514](https://github.com/WordPress/sqlite-database-integration/pull/514)) | |
| 108 | +* **Documentation:** A new plugin README and expanded FAQ explain database storage and secure configuration. ([#520](https://github.com/WordPress/sqlite-database-integration/pull/520)) | |
| 109 | + | |
| 110 | +For more information about database paths and secure configuration, read the [database storage guide](https://github.com/WordPress/sqlite-database-integration/blob/trunk/packages/plugin-sqlite-database-integration/README.md#database-storage). | |
| 111 | + | |
| 112 | +**Upgrading to 3.1** | |
| 113 | + | |
| 114 | +Upgrading an existing SQLite site is straightforward: | |
| 115 | + | |
| 116 | +1. **Back up** your SQLite database. | |
| 117 | +2. **Update the plugin** to version 3.1. | |
| 118 | + | |
| 119 | +Existing `.ht.sqlite` and `.ht.sqlite.php` databases move to the randomized layout automatically unless a database file path is explicitly configured. | |
| 120 | + | |
| 121 | +To properly **secure the database**, set `DB_PATH` in `wp-config.php` to an absolute file path outside the web root that your web server does not expose. Its directory must be writable by PHP. Changing `DB_PATH` does not move an existing database. | |
| 122 | + | |
| 123 | +**Breaking changes** | |
| 124 | + | |
| 125 | +Review these changes if you use custom database settings or integrations: | |
| 126 | + | |
| 127 | +* **Database paths:** Default database files now move to randomized paths under `wp-content/database/`. Explicitly configured file paths stay unchanged. Integrations, including backup and migration tools, must read `DB_PATH` after WordPress loads instead of assuming a fixed filename. | |
| 128 | +* **Legacy constants:** `DB_DIR` and `DB_FILE` are now deprecated. They and the previously deprecated `FQDB` and `FQDBDIR` remain supported, but `DB_PATH` takes precedence. Conflicting values trigger warnings. | |
| 129 | +* **Absolute paths:** Relative database file and directory paths are now rejected. `:memory:` remains available for in-memory databases. | |
| 130 | + | |
| 131 | +**Thank you** | |
| 132 | + | |
| 133 | +Thank you to everyone who contributed, tested, and helped update integrations. | |
| 134 | + | |
| 135 | +**Changes since 3.0.2:** [`v3.0.2...v3.1.0`](https://github.com/WordPress/sqlite-database-integration/compare/v3.0.2...v3.1.0) | |
| 68 | 136 | |
| 69 | 137 | = 3.0.2 = |
| 70 | 138 | |
| 71 | 139 | * Fix schema reconstruction with native numeric results ([#506](https://github.com/WordPress/sqlite-database-integration/pull/506)) |