Repository navigation
Clean up data left behind by the old OpenID Connect Generic plugin - #224
Merged
Merged
Conversation
"Delete subscribers" only removed the capabilities row of each subscriber, so their other user meta stayed in the database, including the openid-connect-generic-* tokens and claims of the old plugin. - The button now also removes the user meta of deleted users, the openid-connect-generic-* user meta of the remaining users, the old plugin's options and transients, and expired transients. - A daily WP-Cron task deletes any openid-connect-generic-* user meta, so sites are cleaned up automatically once they update, and again if the data comes back (e.g. from a restored backup). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The cleanup has CSRF exposure, multisite deletion failures, inaccurate success reporting, and legacy logout compatibility risk.
2 open findings
What changed in this PR
Adds automated and manual cleanup of legacy OpenID Connect Generic data.
Changes:
- Removes orphaned and legacy user metadata.
- Deletes legacy options and expired transients.
- Schedules daily cleanup and unschedules it on deactivation.
| File | Description |
|---|---|
class-bcc-login-settings.php |
Expands maintenance cleanup and reporting. |
class-bcc-login-cleanup.php |
Implements daily legacy-data cleanup. |
bcc-login.php |
Registers cleanup and deactivation handling. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The handler ran whenever the referer contained delete_subscribers=true, which a link or form on another site can set through _wp_http_referer. An administrator opening such a link deleted all subscribers without clicking anything. It now requires the form's nonce and an administrator. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


"Delete subscribers" (Settings → BCC Login → Maintenance) only removed the
capabilitiesrow of each subscriber. The rest of their user meta stayed in the database, including theopenid-connect-generic-*tokens and claims stored by the old OpenID Connect Generic plugin.Changes
openid-connect-generic-*user meta of the remaining users (e.g. admins and editors)openid_connect_generic_settingsis kept, as it's still the fallback for the client ID and secret)BCC_Login_Cleanup) that deletes anyopenid-connect-generic-*user meta. Activation hooks don't run on plugin updates, so it schedules itself on the first request that loads the new code. Sites are cleaned up after updating without anyone clicking the button, and again if the data comes back (e.g. from a restored backup). Deactivating the plugin unschedules it.Notes for review
$wpdb->users/$wpdb->usermeta, so it also works on multisite subsites. The existing subscriberDELETEstill uses the{$wpdb->prefix}tables, as before.buildcheck fails on pull requests in this repo, because it tries to commit a release.Lint PHP - validate codeis the relevant check.Testing
On a throwaway WordPress 7.0.2 / PHP 7.4 install, starting from v1.2.9 with about 10,000 legacy rows:
🤖 Generated with Claude Code