Method |
Description |
|
admin_banner_styles ( ) |
|
|
admin_jetpack_manage_notice ( ) |
|
|
block_with_math ( ) |
|
|
check_api_key ( ) |
|
|
check_login_ability ( boolean $preauth = false ) : boolean |
Checks the status for a given IP. API results are cached as transients |
|
check_preauth ( string $user = 'Not Used By Protect', string $username = 'Not Used By Protect', string $password = 'Not Used By Protect' ) : string |
Checks for loginability BEFORE authentication so that bots don't get to go around the log in form. |
|
check_use_math ( ) |
*
Checks if the protect API call has failed, and if so initiates the math captcha fallback. |
|
configuration_head ( ) |
|
|
configuration_load ( ) |
Get or delete API key |
|
configuration_screen ( ) |
Prints the configuration screen |
|
delete_transient ( string $transient ) : boolean |
Wrapper for WordPress delete_transient function, our version deletes
the transient on the main site in the network if this is a multisite network |
|
get_api_host ( ) |
|
|
get_headers ( ) : string |
Get all IP headers so that we can process on our server. |
|
get_local_host ( ) |
|
|
get_main_blog_id ( ) : integer |
If we're in a multisite network, return the blog ID of the primary blog |
|
get_main_blog_jetpack_id ( ) : integer |
Get jetpack blog id, or the jetpack blog id of the main blog in the main network |
|
get_protect_key ( ) : boolean | string |
Request an api key from wordpress.com |
|
get_transient ( string $transient ) : mixed |
Wrapper for WordPress get_transient function, our version gets
the transient on the main site in the network if this is a multisite network |
|
instance ( ) : object |
Singleton implementation |
|
ip_is_whitelisted ( $ip ) |
*
Checks if the IP address has been whitelisted |
|
kill_login ( ) |
*
Kill a login attempt |
|
log_failed_attempt ( ) : void |
Called via WP action wp_login_failed to log failed attempt with the api |
|
log_successful_login ( $user_login, $user ) |
Logs a successful login back to our servers, this allows us to make sure we're not blocking
a busy IP that has a lot of good logins along with some forgotten passwords. Also saves current user's ip
to the ip address whitelist |
|
maybe_display_security_warning ( ) |
|
|
maybe_get_protect_key ( ) |
|
|
maybe_update_headers ( $force = false ) |
Sends a "check_key" API call once a day. This call allows us to track IP-related
headers for this server via the Protect API, in order to better identify the source
IP for login attempts |
|
modules_loaded ( ) |
Set up the Protect configuration page |
|
on_activation ( ) |
On module activation, try to get an api key |
|
on_deactivation ( ) |
On module deactivation, unset protect_active |
|
prepare_jetpack_protect_multisite_notice ( ) |
|
|
protect_call ( string $action = 'check_ip', array $request = [] ) : array |
Calls over to the api using wp_remote_post |
|
set_transient ( string $transient, mixed $value, integer $expiration ) : boolean |
Wrapper for WordPress set_transient function, our version sets
the transient on the main site in the network if this is a multisite network |
|