Timbalu proposed a while ago to add new methods for when a plugin is installed/updated. Currently, plugins like serendipity_event_staticpage execute their own method on each call to see if they are running the latest version.
I have now added new event hooks to the core:
* backend_templates_install
Executed when a new template is selected.
$eventData: Name of the template
$addData: Array of template information (fetchTemplateInfo)
* backend_plugins_install
Executed after a new plugin was (possibly downloaded) installed. This is on top of $plugin->install(), the hook is executed after this. This hook is actually NOT meant for the plugin itself to hook into, but for other plugins to possibly perform actions when a compatible plugin is installed - like, serendiity_event_staticpage could create additional SQL tables, if serendipity_event_freetag is installed. Then the plugin would not need to check everytime if the serendipity_event_freetag plugin is loaded and the tables already exist.
$eventData: Name of the plugin
$addData: Array of $serendipity plus GET data
* backend_plugins_update
Executed after an existing plugin was updated. Plugins can check for updates to their own files by hooking into this, but also for other plugins that may have been updated.
$eventData: Name of the plugin
$addData: Array of $serendipity plus GET data
I am not really sure if this is the best way to solve plugin updates. If the upgrade process somehow fails, or timeouts, maybe this event hook might never get executed - the current way plugins check every time again and again if they are the most recent version is much safer - however, also much more impactful to performance. So let's see how this goes.
Regards,
Garvin