[wp-trac] [WordPress Trac] #50799: Clean orphaned custom database tables

WordPress Trac noreply at wordpress.org
Tue Jul 28 18:27:40 UTC 2020


#50799: Clean orphaned custom database tables
-----------------------------+------------------------------
 Reporter:  stuffradio       |       Owner:  (none)
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Site Health      |     Version:
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:
-----------------------------+------------------------------

Comment (by stuffradio):

 Replying to [comment:1 SergeyBiryukov]:
 > 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
 [https://developer.wordpress.org/plugins/plugin-basics/uninstall-methods/
 uninstall methods] instead of a deactivation hook.
 >
 > As noted in the [https://developer.wordpress.org/plugins/plugin-basics
 /activation-deactivation-hooks/ plugin handbook]:
 > > The deactivation hook is sometimes confused with the
 [https://developer.wordpress.org/plugins/plugin-basics/uninstall-methods/
 uninstall hook]. The uninstall hook is best suited to **delete all data
 permanently** such as deleting plugin options and custom tables, etc.
 >
 > Related: #50346

 What do you think about the idea of having an "orphaned" table section in
 site health that shows all the tables un-associated with a plugin, or just
 something that shows all the tables not created by WordPress itself so a
 person can decide whether they want to "clean"(remove) that table and free
 up more resources?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50799#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list