[wp-trac] [WordPress Trac] #13786: Problems with the current register_uninstall_hook implementation

WordPress Trac wp-trac at lists.automattic.com
Tue Jun 8 15:17:47 UTC 2010


#13786: Problems with the current register_uninstall_hook implementation
--------------------------+-------------------------------------------------
 Reporter:  x3r0ss        |       Owner:  westi         
     Type:  defect (bug)  |      Status:  new           
 Priority:  normal        |   Milestone:  3.0           
Component:  Plugins       |     Version:  3.0           
 Severity:  normal        |    Keywords:  hooks, plugins
--------------------------+-------------------------------------------------
 During my recent plugin development I have discovered some issues with the
 plugin register_uninstall_hook.

 What it does is it saves the callback into the database, one of the
 problems is that it seems to re-save it every time the
 register_uninstall_hook function is called.

 And second is that it stores the entire callback in the database even if
 you're using a class callback.

 Now it seems that this entire uninstall hook is weird in some sense,
 because well the plugin is already deactivated so the hook would be
 inaccessible when deleting the plugin.

 I think that either the plugin hook should be removed (And just leave
 uninstall.php for uninstalling) or that we find a way to fix it to work
 properly.

 So to wrap it up.
  * Somehow saving the hook resaves it every time (Possibly due to trying
 to save a callback to an object)
  * uninstall hook is crooked the way it works now, need a
 reimplementation.

 Hope we can work something out that would work best, I don't mind writing
 the implementation.

 Regards, Xeross

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/13786>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list