Skip to content

Preserve settings until the plugin is uninstalled - #45

Merged
adriaandotcom merged 2 commits into
simpleanalytics:mainfrom
jdevalk:codex/preserve-settings-on-deactivation
Sep 15, 2026
Merged

adriaandotcom merged 2 commits into
simpleanalytics:mainfrom
jdevalk:codex/preserve-settings-on-deactivation

Conversation

@jdevalk

@jdevalk jdevalk commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Deactivation now preserves the plugin's configuration. Cleanup runs only through WordPress's guarded uninstall.php entry point when the plugin is deleted, including per-site options across a multisite network in batches of 100.

Fixes #36.

Validation: a WordPress regression test fails on the original deactivation hook, then passes with the fix. It checks deactivation, the activation callback, actual uninstall_plugin() cleanup, and preservation of unrelated options using an isolated temporary options table. PHP syntax and diff checks pass. The automated integration check runs on a single-site WordPress installation.

Combined validation: all six proposed fixes were applied to a local integration branch; all 23 browser and WordPress regression tests, the asset build, PHP syntax checks and diff checks passed. GitHub workflows currently report action_required for these fork pull requests.

@adriaandotcom
adriaandotcom merged commit 8592316 into simpleanalytics:main Sep 15, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deactivating the plugin deletes all saved settings

2 participants