-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uninstallation Not Deleting Plugin Data #630
Comments
My initial reaction here is to not remove these during plugin deactivation but perhaps during deletion/uninstallation we show an "are you sure" sort of message to alert the admin that this sort of data will be removed. @kasparsd does that approach seem ok to you or some alternate handling? |
You are correct they shouldn't be deleted during deactivation, as the relevant Plugin Handbook section mentions. If an uninstallation method is set up, which would remove those, when clicking the Delete link for the plugin, it would show an alert that says:
Right now it says:
|
Turns out we're not storing any options so we only need to take care of user meta. I've created a pull request for this #637. The only consideration is that running the uninstall logic on a large multisite with many users could potentially time out. We could switch to a single query that deletes all user meta by keys to speed that up but I'll wait for a suggestion from @dd32 on this. |
That's not really an option, as you need to delete from object caches and any other system that sync's data based on hooks. Instead of querying for all users and looping through meta_keys, what you could do is a direct Personally, I don't see this as a security issue, so if not all data is removed, I don't see that as a critical problem. |
@dd32 We're already using that method here: two-factor/providers/class-two-factor-fido-u2f.php Lines 354 to 390 in 8405126
but that still requires a Let's merge it with the current approach and iterate if needed. |
@dd32 Turns out foreach ( $user_meta_keys as $meta_key ) {
delete_metadata( 'user', null, $meta_key, null, true );
} Any concerns with that approach? |
Nope, that works for me too! I didn't realise it had the |
WordPress plugins are supposed to clear out their data when uninstalled. As part of a security review of the plugin, we found that it doesn't currently do that.
It looks like there are 14 metadata keys that can be added to users' metadata that should be removed during uninstallation:
There are several methods that can be used to delete those.
This could be classified as a security issue because of what is stored. You suggest reporting security issues to a bounty program, but that only accepts reports on a limited range of vulnerabilities. We raised that problem (and others) with WordPress' handling of reporting security issues through a bug bounty program with another plugin from WordPress in July, without a response or a change in your handling of the situation so far.
The text was updated successfully, but these errors were encountered: