[wp-trac] [WordPress Trac] #46832: Notice or Warning if a plugin create table and do not delete them

WordPress Trac noreply at wordpress.org
Mon Apr 8 14:29:26 UTC 2019

#46832: Notice or Warning if a plugin create table and do not delete them
 Reporter:  sebastienserre  |       Owner:  (none)
     Type:  enhancement     |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Plugins         |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  2nd-opinion     |     Focuses:

Comment (by subrataemfluence):

 I have a related question. If a plugin is deleted, any table created by it
 should also be deleted, which is reasonable. But I think deactivating a
 plugin should keep a table (if created by it) intact with its data because
 the same plugin could be activated later on. If table is removed when
 deactivated, all data in it will be lost. However, this is kind of off
 topic since this depends on the plugin builders how they see it.

 Now, regarding displaying notice, if a plugin is removed completely what
 is the options left for the core to determine that it was removed but
 table created by it wasn't if there was no signature of this plugin is
 left somewhere?

 Taking both these use cases into consideration the situations are:

 1. Plugin deactivated, but ideally a table created by it should not be
 removed, so notice doesn't have much of an impact.

 2. Plugin is removed from the system means WordPress doesn't know anymore
 that there was a plugin which created a table. So, only displaying notice
 doesn't make any difference here as well. The only option however, as I
 see, is to check if there are only bundled / shipped plugins are present
 and there is/are additional tables exist in the database other than that
 those created by WordPress installation itself.

 The bottom line is, is it really a task of WordPress core to do this stuff
 or it is the responsibility of the plugin developers to clean up tables
 like this?

 Please correct me if I have not understood the underlying issue properly.

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

More information about the wp-trac mailing list