Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #50799


Ignore:
Timestamp:
07/28/2020 06:22:26 PM (5 years ago)
Author:
SergeyBiryukov
Comment:

Hi there, welcome back to WordPress Trac! Thanks for the ticket.

Another part to this could be to slightly alter the plugin deactivation to have a hard and soft deactivate/delete plugin link where the soft delete/deactivate would simply remove the plugin, and the hard delete/deactivate would delete the associated tables and data.

Just noting that plugins can already do this by using one of the uninstall methods instead of a deactivation hook.

As noted in the plugin handbook:

The deactivation hook is sometimes confused with the uninstall hook. The uninstall hook is best suited to delete all data permanently such as deleting plugin options and custom tables, etc.

Related: #50346

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #50799 – Description

    initial v1  
    1 There was a ticket I just commented today where someone suggested forcing a plugin developer to use the deactivation hook and cleaning the custom created tables. I pointed out how some people might want to keep some data in case they want to activate the plugin again in the future and still have their data.
     1There was a ticket I just commented today (#46832) where someone suggested forcing a plugin developer to use the deactivation hook and cleaning the custom created tables. I pointed out how some people might want to keep some data in case they want to activate the plugin again in the future and still have their data.
    22
    33My idea is to create a section in Site Health where it lists all the non-standard WordPress tables and the plugin that created the tables so an administrator could clean up their database from the admin panel. Another part to this could be to slightly alter the plugin deactivation to have a hard and soft deactivate/delete plugin link where the soft delete/deactivate would simply remove the plugin, and the hard delete/deactivate would delete the associated tables and data.