Make WordPress Core

Opened 8 years ago

Closed 7 years ago

#37898 closed enhancement (duplicate)

Prompt message when removing a plugin is sometimes misleading

Reported by: bradt's profile bradt Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.6
Component: Plugins Keywords: shiny-updates has-screenshots needs-patch ui-feedback ux-feedback
Focuses: ui Cc:


When you attempt to delete a plugin in 4.6, a JS prompt asks "Are you sure you want to delete <plugin name> and its data?" regardless whether or not there's an uninstall.php in the plugin that will actually delete plugin data.

This is misleading users as many plugins do not include uninstall.php files and do leave behind data.

Plugin authors also intentionally leave an uninstall.php out of their plugin and don't remove data to ensure users don't accidentally delete their data when upgrading a plugin via a "delete - upload new zip" process. This message will be confusing to those users who are trying to upgrade using this process without losing data.

The plugin delete prompt prior to 4.6 would detect whether an uninstall.php file exists in the plugin and only change the messaging to say that data would be deleted if the uninstall.php existed.

Attachments (2)

Screen Shot 2016-08-31 at 3.57.53 PM.png (78.1 KB) - added by bradt 8 years ago.
Screen Shot 2016-08-31 at 4.31.05 PM.png (69.0 KB) - added by bradt 8 years ago.

Download all attachments as: .zip

Change History (10)

#1 @bradt
8 years ago

  • Keywords shiny-updates has-screenshots needs-patch ui-feedback ux-feedback added

#2 @swissspidy
8 years ago

  • Type changed from defect (bug) to enhancement
  • Version changed from trunk to 4.6

Hey there,

Thanks for reporting this! The confirmation dialog has been added as part of Shiny Updates, where plugin deletion was now made shiny.

It's not that difficult to make the text context-aware, but with #20578 in mind it would make sense to not use a simple JS confirm() dialog but a custom modal with three options (uninstall completely, delete only, cancel) Tempted to close this one as a duplicate.

#3 follow-up: @OriginalEXE
7 years ago

Not even the existence of uninstall.php can guarantee that the plugin will remove its data (it could be used for something else), I think that's worth thinking about.

#4 in reply to: ↑ 3 @swissspidy
7 years ago

Replying to OriginalEXE:

Not even the existence of uninstall.php can guarantee that the plugin will remove its data (it could be used for something else), I think that's worth thinking about.

Uhm yes, that's what this file is for. It should definitely not be used for something else.


#5 @mordauk
7 years ago

I'd love to see get a filter so that plugins can override it.

Right now the determination of whether a plugin should uninstall its data is far too binary. It's either "yes" or "no", there is no "maybe". A plugin is deemed as uninstallable by the presence of uninstall.php, but what a plugin that should be capable of uninstalling its data but the choice needs to be left up to the site administrator?

It's very common for site admins to delete plugins and then immediately re-install the same plugin (perhaps a different version). In order to be good citizens, plugin authors are encouraged to cleanup after themselves and delete their data with uninstall.php, but what about scenarios where you want to give the site admin the choice of cleaning up the data?

I don't believe determining whether data should be deleted on the simple presence of a file is enough. I typically offer site admins the choice of deleting data through a setting like this:

And then in the uninstall.php only deleting the data if that option is checked.

This works very well except it leaves the site admin with the misleading message that Brad initially mentioned. Even with the Remove Data on Uninstall option unchecked, site admins still see:

If we could filter the uninstallable status for plugins, we could give an accurate message to site admins instead of the current, mis-leading message.

#6 @bradt
7 years ago

@mordauk I think for a plugin to be deleted it has to be deactivated first, and if it's deactivated its filters won't work.

I think the suggestion here is probably the way to go: I think you're right @swissspidy, we should close this as a dupe of #20578.

#7 @mordauk
7 years ago

Ah yes, doh.

#8 @swissspidy
7 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Alright, let's join efforts over at #20578.

Note: See TracTickets for help on using tickets.