Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #26904, comment 7


Ignore:
Timestamp:
01/22/2014 09:27:09 PM (12 years ago)
Author:
Veraxus
Comment:

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 of hooks, and it's clear that everything I've proposed so far has serious drawbacks.
     1So, 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.
    22
    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.
    44
    5 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.
     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.
    66
    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''.
     7However, 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''.
    88
    99I've uploaded my final recommendation as a patch: `delete_plugin_hook_FINAL.diff​`
    1010
    11 One hook, called `'delete_plugin'`, that runs on each loop inside `delete_plugins()` just before each plugin is deleted.
     11One hook, called `'delete_plugin'`, that runs on each loop inside `delete_plugins()` just before each plugin is deleted. Bingo.