[wp-trac] [WordPress Trac] #26904: General 'delete_plugins' hook needed

WordPress Trac noreply at wordpress.org
Wed Jan 22 21:24:49 UTC 2014


#26904: General 'delete_plugins' hook needed
-----------------------------+------------------------------
 Reporter:  Veraxus          |       Owner:
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Plugins          |     Version:  3.8
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |
-----------------------------+------------------------------

Comment (by Veraxus):

 So, I've spent the day playing testing a wide variety of plugins with a
 wide variety of hooks, and it's clear that everything I've proposed so far
 has serious drawbacks.

 uninstall_plugin() does not always trigger, so placing any hooks in that
 function is unhelpful.

 Likewise, putting a hook at the end of `delete_plugins()` means that you
 can't fetch plugin metadata as the plugins have already been deleted.

 However, after spending the day testing a massive number of plugins and
 hook options, I've found that placing a '''delete_plugin''' hook right in
 the middle of `delete_plugins()`'s deletion loop (before
 `$wp_filesystem->delete()` is called) works ''perfectly''.

 I've uploaded my final recommendation as a patch:
 `delete_plugin_hook_FINAL.diff​`

 One hook, called `'delete_plugin'`, that runs on each loop inside
 `delete_plugins()` just before each plugin is deleted.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/26904#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list