[wp-trac] Re: [WordPress Trac] #5625: Include a separate uninstall for plugins

WordPress Trac wp-trac at lists.automattic.com
Mon Aug 4 20:28:29 GMT 2008


#5625: Include a separate uninstall for plugins
---------------------------------------------------------------+------------
 Reporter:  arickmann                                          |        Owner:  jacobsantos
     Type:  enhancement                                        |       Status:  new        
 Priority:  normal                                             |    Milestone:  2.9        
Component:  Administration                                     |      Version:  2.6        
 Severity:  normal                                             |   Resolution:             
 Keywords:  plugins plugin-management has-patch needs-testing  |  
---------------------------------------------------------------+------------
Comment (by strider72):

 I wouldn't regex it from the file.  Only register it if the plugin
 actively registers it -- not just because uninstall.php exists.

 Why?

 1) We don't need an uninstall for a plugin that was never activated.
 2) A plugin may or may not do something to the database, depending on how
 it's used.  The author may only register it after it does X to the
 database.

 So... register_uninstall_hook() should set WP to show the "uninstall" link
 if <a href="#comment:33">criteria 1 and 2</a> are met (i.e. uninstall.php
 exists and the plugin is not activated).  Clicking the uninstall link
 should simply load that plugin's uninstall.php.

 Or do we want to do a lot of abstracting  and only have authors pass
 option names and (maybe) table names into new core WP functions?  If we
 want to do the abstraction, we need to account for a lot of possibilities
 (records added to tables, columns added to tables, tables added to DB....)

-- 
Ticket URL: <http://trac.wordpress.org/ticket/5625#comment:36>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list