Ejemplo n.º 1
0
            //no response from the API host?  Let's use math!
            set_site_transient('brute_use_math', 1, 600);
            $response['status'] = 'ok';
            $response['math'] = true;
        }
        if (isset($response['error'])) {
            update_site_option('bruteprotect_error', $response['error']);
        } else {
            delete_site_option('bruteprotect_error');
        }
        return $response;
    }
}
$bruteProtect = new BruteProtect();
if (isset($pagenow) && $pagenow == 'wp-login.php') {
    $bruteProtect->brute_check_loginability();
} else {
    //	This is in case the wp-login.php pagenow variable fails
    add_action('login_head', array(&$bruteProtect, 'brute_check_loginability'));
}
register_activation_hook(__FILE__, 'bruteprotect_activate');
register_deactivation_hook(__FILE__, 'bruteprotect_deactivate');
/**
 * When someone deactivates bruteprotect, we need to do some cleanup
 *
 * Privacy settings are saved to a separate option, in case we need to re-activate
 *
 * @return void
 */
function bruteprotect_deactivate()
{