Add plugins_loaded action and associated function