[wp-trac] Re: [WordPress Trac] #5625: Include a separate uninstall
for plugins
WordPress Trac
wp-trac at lists.automattic.com
Thu Jan 10 23:55:38 GMT 2008
#5625: Include a separate uninstall for plugins
-------------------------------+--------------------------------------------
Reporter: arickmann | Owner: anonymous
Type: enhancement | Status: new
Priority: normal | Milestone: 2.6
Component: Administration | Version:
Severity: normal | Resolution:
Keywords: plugin-management |
-------------------------------+--------------------------------------------
Comment (by arickmann):
Replying to [comment:5 DD32]:
> Thats true, I guess if WP was to only load what it needs to (ie. no
other plugins, and limited functions) when uninstalling a deactivated
plugin it might work.. But if the user wants to uninstall the plugin
because its corrupt, or malicious, then idealy the user will not want WP
to load the plugin.
Ok. So the way I see it there are two problems here:
1. How do we ring-fence the undesirable code;[[BR]]
2. How do we choose to run the uninstall code;[[BR]]
This is what I now have in mind. If the solution seems reasonable I will
consider the actual code necessary:
* The plugin calls register_uninstaller( $plugin_path ); when it is
activated which adds it to a list of plugins with uninstallers;[[BR]]
* The developer wraps the active plugin content in an if statement that
evaluates whether the plugin is active.[[BR]]
* If the plugin is not active, and has an uninstaller, the option is
available to uninstall it and if called it runs wrapped in an output
buffer in the same way as when it is initially installed.[[BR]]
* If successful it removes itself from the list of uninstallers.
--
Ticket URL: <http://trac.wordpress.org/ticket/5625#comment:6>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list