Ejemplo n.º 1
0
/**
 * On activation we create site options and force redirection to our settings page
 *
 * Also, if there are saved privacy settings we send them over to the API
 * so that we can reapply the settings
 */
function bruteprotect_activate()
{
    update_site_option('bruteprotect_version', BRUTEPROTECT_VERSION);
    $deactivated = get_site_option('bruteprotect_deactivated');
    if (!empty($deactivated)) {
        $saved_settings = get_site_option('bruteprotect_saved_settings', array());
        $bruteProtect = new BruteProtect();
        $action = 'reactive_site';
        $additional_data = array('saved_settings' => serialize($saved_settings));
        $sign = true;
        delete_site_option('bruteprotect_saved_settings');
        delete_site_option('bruteprotect_deactivated');
        $bruteProtect->brute_call($action, $additional_data, $sign);
    }
    add_site_option('bruteprotect_do_activation_redirect', true);
}