Audit
Configure reporting preferences
/src/view/email/audit-report.php
Convert key to human name
/src/component/audit/options-audit.php
Firewall
After login lockout
/src/component/login-lockout.php
“Not found” lockout
/src/component/notfound-lockout.php
Blocklist IP
/src/component/notfound-lockout.php
/src/component/notfound-lockout.php
IP lockout assets
/src/controller/firewall.php
Before lockouts
/src/controller/firewall.php
IP lockout logs store backward
/src/component/firewall.php
Get default allowlist IPs
/src/component/blacklist-lockout.php
Recommendations
Get supported servers
/src/component/security-tweaks/servers/server-factory.php
Get login duration
/src/component/security-tweaks/login-duration.php
Get supported PHP versions
/src/component/security-tweaks/php-version.php
Verify SSL argument
/src/component/security-tweaks/servers/server.php
2FA
Check 2FA user
/src/component/two-fa.php
Mask Login
Filter strict slugs
/src/component/mask-login.php
Filter non-strict slugs
/src/component/mask-login.php
Redirect login page
/src/controller/mask-login.php
Security Headers
Get TTL
/src/component/security-header.php
Notifications
After recipient added
/src/model/notification/notification.php
Configure report preferences
/src/view/email/firewall-report.php
/src/view/email/lockout-404.php
/src/view/email/login-lockout.php
Notify users
/src/component/login-lockout.php
/src/component/notfound-lockout.php
/src/component/scan.php
Change confirmation email
/src/component/notification.php
Change subscription email
/src/component/notification.php
Unsubscribe email
/src/component/notification.php
Additional hooks
Run after Defender activation
/wp-defender.php
Enqueue assets
/src/bootstrap.php
Get time interval
/src/traits/formats.php
Filter user IP
/src/traits/ip.php
Advanced tools data
/src/controller/advanced-tools.php
Filter settings data
/src/controller.php
/src/controller2.php

5.1 Filter: defender_get_supported_servers

Copy chapter anchor to clipboard

Description

Filter. Get supported servers.

Usage

add_filter( ‘defender_get_supported_servers’, ‘custom_defender_filter’ );

Parameters

$servers – array – the list of supported servers

Return

the $servers as an array

Example

5.2 Filter: defender_security_tweaks_login-duration_get_duration

Copy chapter anchor to clipboard

Description

Filter. Get login duration in days or seconds.

Usage

add_filter( ‘defender_security_tweaks_login-duration_get_duration’, ‘custom_defender_filter’ );

Parameters

$duration – int – duration value

Return

the $duration as int

Example

5.3 Filter: defender_php-version_supported_php

Copy chapter anchor to clipboard

Description

Filter. Get supported PHP versions.

Usage

add_filter( ‘defender_php-version_supported_php’, ‘custom_defender_filter’ );

Parameters

$supported_php – array – the list of supported PHP versions

Return

the $supported_php as an array

Example

5.4 Filter: defender_ssl_verify

Copy chapter anchor to clipboard

Description

Filter. Verify SSL argument in an HTTP request.

Usage

add_filter( ‘defender_ssl_verify’, ‘custom_defender_filter’ );

Parameters

$ssl_verify – bool

Return

the $ssl_verify as bool

Example

5.6 Filter: wd_audit_settings_keys

Copy chapter anchor to clipboard

Description

Filter. Convert the key to the human name.

Usage

add_filter( ‘wd_audit_settings_keys’, ‘custom_defender_filter’ );

Parameters

$settings_keys – array – the list of keys.

Return

the $settings_keys as an array

Example

5.7 Action: wd_login_lockout

Copy chapter anchor to clipboard

Description

Action after login lockout.

Usage

add_action( ‘wd_login_lockout’, ‘custom_defender_action’ );

Parameters

$model – object – Record the attempt
$scenario – string – One of them: ‘login_fail’, ‘login_lockout’ or ‘login_ban’

Return

No return.

Example

5.8 Action: wd_404_lockout

Copy chapter anchor to clipboard

Description

Action after ‘Not found’ lockout.

Usage

add_action( ‘wd_404_lockout’, ‘custom_defender_action’ );

Parameters

$model – object – Record the attempt
$scenario – string – One of them: ‘normal’, ‘blacklist’

Return

No return.

Example

5.9 Action: wd_blacklist_this_ip

Copy chapter anchor to clipboard

Description

Action. Add an IP to the blocklist.

Usage

add_action( ‘wd_blacklist_this_ip’, ‘custom_defender_action’ );

Parameters

$ip – string – a new IP for blacklist

Return

No return.

Example

5.10 Action: defender_ip_lockout_action_assets

Copy chapter anchor to clipboard

Description

Action. Add additional script or style assets for IP Lockouts.

Usage

add_action( ‘defender_ip_lockout_action_assets’, ‘custom_defender_action’ );

Parameters

No parameters.

Return

No return.

Example

5.11 Action: wd_before_lockout

Copy chapter anchor to clipboard

Description

Action before any lockouts.

Usage

add_action( ‘wd_before_lockout’, ‘custom_defender_action’ );

Parameters

No parameters.

Return

No return.

Example

5.12 Filter: ip_lockout_logs_store_backward

Copy chapter anchor to clipboard

Description

Filter. Count days for IP logs to be saved to DB

Usage

add_filter( ‘ip_lockout_logs_store_backward’, ‘custom_defender_filter’ );

Parameters

$storage_days – string|int – storage days

Return

the $storage_days as string|int.

Example

5.13 Filter: ip_lockout_default_whitelist_ip

Copy chapter anchor to clipboard

Description

Filter. Get the list of default allowlisted IP addresses.

Usage

add_filter( ‘ip_lockout_default_whitelist_ip’, ‘custom_defender_filter’ );

Parameters

$ips – array – the default IPs that need to whitelisteda

Return

the $ips as an array

Example

5.14 Filter: wp_defender_2fa_user_enabled

Copy chapter anchor to clipboard

Description

Filter. Check if the 2FA option is enabled for a specific user.

Usage

add_filter( ‘wp_defender_2fa_user_enabled’, ‘custom_defender_filter’, 10, 2 );

Parameters

$is_enabled – int. One of them: 1 or 0 $user_id – int.

Return

the $is_enabled as int

Example

5.15 Filter: wd_login_strict_slugs

Copy chapter anchor to clipboard

Description

Filter. Filter strict slugs.

Usage

add_filter( ‘wd_login_strict_slugs’, ‘custom_defender_filter’ );

Parameters

$slugs – array – the list of the slugs

Return

the $slugs as an array

Example

5.16 Filter: wd_login_slugs

Copy chapter anchor to clipboard

Description

Filter. Filter non-strict slugs.

Usage

add_filter( ‘wd_login_slugs’, ‘custom_defender_filter’ );

Parameters

$slugs – array – the list of the slugs

Return

the $slugs as an array

Example

5.17 Filter: defender_redirect_login

Copy chapter anchor to clipboard

Description

Filter. Rredirect to the page

Usage

add_filter( ‘defender_redirect_login’, ‘custom_defender_filter’, 10, 3 );

Parameters

$url – string $raw_url – string $user – object – User object

Return

the $url string.

Example

5.18 Filter: wd_head_request_ttl

Copy chapter anchor to clipboard

Description

Filter. Get TTL.

Usage

add_filter( ‘wd_head_request_ttl’, ‘custom_defender_filter’ );

Parameters

$ttl – null|int|false

Return

the $ttl string

Example

5.19 Action: defender_recipient_added

Copy chapter anchor to clipboard

Description

Action. After adding recipients

Usage

add_action(‘defender_recipient_added’, ‘custom_defender_action’, 10, 2 );

Parameters

$email – string
$name – string

Return

No return.

Example

5.21 Action: defender_notify

Copy chapter anchor to clipboard

Description

Action. Notify users about results from Scan and Firewall modules.

Usage

add_action( ‘defender_notify’, ‘custom_defender_action’ );

Parameters

$slug – string – One of them: ‘firewall-notification’, ‘malware-notification’

$model – module object

Return

No return.

Example

5.22 Filter: wd_confirm_noreply_email

Copy chapter anchor to clipboard

Description

Filter. Change email for confirmation.

Usage

add_filter( ‘wd_confirm_noreply_email’, ‘custom_defender_filter’ );

Parameters

$no_reply_email – string

Return

the $no_reply_email as string.

Example

5.23 Filter: wd_subscribe_noreply_email

Copy chapter anchor to clipboard

Description

Filter. Change email for subscription.

Usage

add_filter( ‘wd_subscribe_noreply_email’, ‘custom_defender_filter’ );

Parameters

$no_reply_email – string

Return

the $no_reply_email as string.

Example

5.24 Filter: wd_unsubscribe_noreply_email

Copy chapter anchor to clipboard

Description

Filter. Change email to unsubscribe.

Usage

add_filter( ‘wd_unsubscribe_noreply_email’, ‘custom_defender_filter’ );

Parameters

$no_reply_email – string

Return

the $no_reply_email as string.

Example

5.25 Action: wp_defender

Copy chapter anchor to clipboard

Description

Action. Run after the activation of the Defender plugin.

Usage

add_action( ‘wp_defender’, ‘custom_defender_action’ );

Parameters

No parameters.

Return

No return.

Example

5.26 Action: defender_enqueue_assets

Copy chapter anchor to clipboard

Description

Action. Enqueue assets and display data.

Usage

add_action( ‘defender_enqueue_assets’, ‘custom_defender_action’ );

Parameters

No parameters.

Return

No return.

Example

5.27 Filter: defender_get_times_interval

Copy chapter anchor to clipboard

Description

Filter. Get time interval.

Usage

add_filter( ‘defender_get_times_interval’, ‘custom_defender_filter’ );

Parameters

$interval – array

Return

the $interval array.

Example

5.28 Filter: defender_user_ip

Copy chapter anchor to clipboard

Description

Filter. Filter user IP.

Usage

add_filter( ‘defender_user_ip’, ‘custom_defender_filter’ );

Parameters

$ip – string

Return

the $ip string

Example

5.29 Filter: wp_defender_advanced_tools_data

Copy chapter anchor to clipboard

Description

Filter. Get and update frontend data for Masc Login and Security Headers pages.

Usage

add_filter( ‘wp_defender_advanced_tools_data’, ‘custom_defender_filter’ );

Parameters

$data – array

Return

the $data array

Example

5.30 Filter: defender_filtering_data_settings

Copy chapter anchor to clipboard

Description

Filter. Filter settings data.

Usage

add_filter( ‘defender_filtering_data_settings’, ‘custom_defender_filter’ );

Parameters

$data – array

Return

the $data array

Example