Plugins now have 4 functions:

1. plugin_loaded
   Optional. Invoked right after the plugin has been loaded.
2. plugin_initialize
   Required. Invoked when the plugin is initialized.
3. plugin_shutdown
   Required. Invoked when the plugin is shutdown.
4. plugin_unloaded
   Optional. Invoked right before the plugin is unloaded.

These functions are invoked in the order they're mentioned here.