Make proper use of plugin_loaded() and plugin_unloaded() functions, declare constants on module-scope