I would like that every time any plugin previously activated, a function from my plugin be called, returning (at least) the name of the plugin, or something that allows to identify it (file name?).
I figured i could use the action hook “deactivated_plugin” but i’m wondering what information from the desactivated plugin is actually available?
You can hook into the action
'deactivate_plugin'
to get the plugin’s base name and (as second parameter) if it was deactivated network wide.See
wp-admin/includes/plugin.php function deactivate_plugins()
.There seems to be no hook for plugin deletion.
Sample logging code:
Now every plugin activation or deactivation will be added to the log option field. You can use this data anywhere. I made a small dashboard widget:
Download as plugin from GitHub: T5 Plugin Log