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

WordPress Trac wp-trac at lists.automattic.com
Mon Aug 4 18:41:15 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 agree with Jacob that it should be there when plugin is _not_ activated.
 In fact, I think the "uninstall" link should _ONLY_ be there when the
 plugin is not activated.

 In order for that to work, the uninstall function would have to be a
 separate file in the plugin directory -- in essence a separate mini plugin
 of its own.

 This is because we _can't_ load the main plugin file to check for an
 uninstall, because many plugins run code simply when the file is loaded,
 and we don't want that if it's not activated.

 So... I suggest that we standardize a file inside the plugin folder named
 "uninstall.php".  The uninstall link is added to the Plugin "Action"
 column if three criteria have been met:

 1) The plugin is not currently activated.
 2) The uninstall.php file exists.
 3) At some point while it was activated, the plugin registered itself as
 having an uninstall function (this prevents us for having uninstall
 functions for plugins that haven't added anything to the DB).

 Other notes:
 * The registration noted in criteria 3 would have to be persistent even
 after the plugin is deactivated.

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


More information about the wp-trac mailing list