check_login_ability() public method

Checks the status for a given IP. API results are cached as transients
public check_login_ability ( boolean $preauth = false ) : boolean
$preauth boolean Whether or not we are checking prior to authorization
return boolean Either returns true, fires $this->kill_login, or includes a math fallback and returns false
Esempio n. 1
0
            return $this->api_endpoint;
        }
        //Check to see if we can use SSL
        $this->api_endpoint = Jetpack::fix_url_for_bad_hosts(JETPACK_PROTECT__API_HOST);
        return $this->api_endpoint;
    }
    function get_local_host()
    {
        if (isset($this->local_host)) {
            return $this->local_host;
        }
        $uri = 'http://' . strtolower($_SERVER['HTTP_HOST']);
        if (is_multisite()) {
            $uri = network_home_url();
        }
        $uridata = parse_url($uri);
        $domain = $uridata['host'];
        // If we still don't have the site_url, get it
        if (!$domain) {
            $uri = get_site_url(1);
            $uridata = parse_url($uri);
            $domain = $uridata['host'];
        }
        $this->local_host = $domain;
        return $this->local_host;
    }
}
Jetpack_Protect_Module::instance();
if (isset($pagenow) && 'wp-login.php' == $pagenow) {
    Jetpack_Protect_Module::check_login_ability();
}