added plugin activation/deactivation hooks to flush rewrites. fixed a bug that prevented plugin from activating when IP not whitelisted