Commit 9e02903
authored
Skip plugin auto-activation if plugin file doesn't exist (#332)
## What
I propose adding a `file_exists()` check before calling
`is_plugin_inactive()` in the `admin_footer` action inside `db.copy`.
## Why
If the SQLite plugin is inactive for some reason but the `db.php`
drop-in file exists, the logic automatically activates the plugin. This
works only when the SQLite plugin is installed into the `plugins/`
directory and throws warnings if plugin is installed into the
`mu-plugins/` directory.
The new guard ensures that the plugin is installed in `plugins/` before
running activation logic.
## Testing
1. Install WordPress
2. Install the SQLite plugin from the .org directory
3. Activate the plugin - confirm `db.php` drop-in is created
4. Deactivate the plugin by bypassing normal logic:
```
wp option delete active_plugins
```
6. Confirm `db.php` still exists
7. Reload WP Admin
8. Confirm the plugin is auto-activated1 parent 7be6b9c commit 9e02903
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
| |||
0 commit comments