Dev Added support for the beforeActivate callback, included an example plugin.