Changes between Initial Version and Version 1 of Ticket #26904, comment 7
- Timestamp:
- 01/22/2014 09:27:09 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #26904, comment 7
initial v1 1 So, I've spent the day playing testing a wide variety of plugins with a wide variety ofhooks, and it's clear that everything I've proposed so far has serious drawbacks.1 So, I've spent the day testing a wide variety of plugins with a wide variety of potential hooks, and it's clear that everything I've proposed so far has serious drawbacks. 2 2 3 uninstall_plugin()does not always trigger, so placing any hooks in that function is unhelpful.3 '''1.''' `uninstall_plugin()` does not always trigger, so placing any hooks in that function is unhelpful. 4 4 5 Likewise, putting a hook at the end of `delete_plugins()` means that you can't fetchplugin metadata as the plugins have already been deleted.5 '''2.''' Likewise, placing a hook at the very end of `delete_plugins()` means that you can't fetch/log plugin metadata as the plugins have already been deleted. 6 6 7 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''.7 However, after spending the day testing a massive number of plugins and hook options, I've found that placing a new `'delete_plugin'` hook right in the middle of `delete_plugins()`'s deletion loop (just before `$wp_filesystem->delete()` is called) works ''perfectly''. 8 8 9 9 I've uploaded my final recommendation as a patch: `delete_plugin_hook_FINAL.diff` 10 10 11 One hook, called `'delete_plugin'`, that runs on each loop inside `delete_plugins()` just before each plugin is deleted. 11 One hook, called `'delete_plugin'`, that runs on each loop inside `delete_plugins()` just before each plugin is deleted. Bingo.