security_extension
extends abstract_extension
in package
Extension: security - security features - {eac}Doojigger for WordPress
Tags
Table of Contents
- ALIAS = 'security'
- ALLOW_ADMIN = 0b1
- ALLOW_ALL = self::ALLOW_ADMIN | self::ALLOW_NETWORK | self::ALLOW_CRON | self::ALLOW_CLI
- ALLOW_CLI = 0b10000
- ALLOW_CRON = 0b1000
- ALLOW_NETWORK = 0b100
- ALLOW_NON_PHP = 0b100000
- DEFAULT_DISABLED = 0b1000000
- ENABLE_OPTION = null
- ONLY_ADMIN = 0b10
- TAB_NAME = 'Security'
- VERSION = '24.1113.1'
- __call() : mixed
- magic method to call plugin or extension methods
- __construct() : void
- constructor method
- __destruct() : void
- destructor method
- __get() : mixed
- magic method to call parent plugin __get()
- addActionsAndFilters() : void
- Add filters and actions - called from main plugin
- addShortcodes() : void
- Add extension shortcodes
- admin_options_help() : void
- Add help tab on admin page
- admin_options_settings() : void
- register options on options_settings_page
- block_ip_address() : void
- block ip/host address
- checkCookieFlags() : void
- set flags in Set-Cookie headers before output (used by header_register_callback)
- disable_code_edit() : void
- disable code editor
- disable_code_edit_error() : void
- DISALLOW_FILE_EDIT was already set
- disable_embeds() : void
- disable oEmbed creds: https://kinsta.com/knowledgebase/disable-embeds-wordpress/
- disable_file_mods() : void
- disable file mods
- disable_file_mods_error() : void
- DISALLOW_FILE_MODS was already set
- disable_invalid_json() : mixed
- disable invalid json request
- disable_invalid_xml() : mixed
- disable invalid xml request
- disable_pings() : void|array<string|int, mixed>
- disable xml-rpc pings
- disable_rest() : void
- disable REST API
- disable_rest_all() : WP_Error
- disable All REST API
- disable_rest_auth() : WP_Error
- disable un-authenticated REST API
- disable_rest_core() : void
- disable WP Core REST API
- disable_rest_list() : void
- disable REST API index/list
- disable_rss_feeds() : void
- disable rss feeds
- disable_rss_response() : void
- disable rss feeds
- disable_uris() : void
- disable uri
- disable_xml() : void|array<string|int, mixed>
- disable xml-rpc
- early_addActionsAndFilters() : mixed
- Add filters and actions - called from constructor
- getAlias() : const
- get the extension alias
- getClassName() : bool
- getClassName - get the class/extension name without namespace
- getVersion() : const
- get the extension version
- initialize() : void
- initialize method - called from main plugin
- invalid_rest() : void|array<string|int, mixed>
- invalid rest call
- invalid_rest_auth() : WP_Error
- disable un-authenticated REST API
- invalid_xml() : void|array<string|int, mixed>
- invalid xml-rpc call
- is_network_enabled() : bool
- is_network_enabled - set or test extension enabled for use at the network level
- is_network_option() : bool|mixed
- is this class network enabled and does option match a value
- isEnabled() : bool
- isEnabled - set or test extension enabled for use
- isNetworkPolicy() : bool
- is network option set
- isPolicyEnabled() : bool
- is site or network option set
- match_disabled_uris() : void
- disable uri
- mergePolicies() : mixed
- merge site and network policies
- register_risk_action() : mixed
- default action for 'register_risk', overridden by risk_assessment extension action {plugin}_register_[threat|fraud|abuse|risk]
- set_heartbeat() : array<string|int, mixed>
- heartbeat_settings
- unauthorized_rest() : void|array<string|int, mixed>
- unauthorized rest call
- validate_authentication_attempts() : WP_Error
- validate authentication attempts
- validate_http_header() : void
- require a specific http header
- validate_password_policy() : WP_Error
- validate password policy
- welcome_email_filter() : string
- welcome email filter
- wp_login_authenticate() : object
- wp_login post action - validate custom nonce
- wp_login_filter() : string
- wp_login filter
- wp_login_form() : void
- wp_login form action - add custom nonce
- wp_login_init() : void
- wp_login init action
- wp_login_notice() : void
- wp_login notice
- wp_login_redirect() : void
- wp_login redirect action
- wp_nonce_failure() : void
- wp_nonce_failure (wp_verify_nonce_failed)
Constants
ALIAS
public
string
ALIAS
= 'security'
extension alias
ALLOW_ADMIN
public
constructor
ALLOW_ADMIN
= 0b1
flags (actual values subject to change)
ALLOW_ALL
public
mixed
ALLOW_ALL
= self::ALLOW_ADMIN | self::ALLOW_NETWORK | self::ALLOW_CRON | self::ALLOW_CLI
ALLOW_CLI
public
mixed
ALLOW_CLI
= 0b10000
ALLOW_CRON
public
mixed
ALLOW_CRON
= 0b1000
ALLOW_NETWORK
public
mixed
ALLOW_NETWORK
= 0b100
ALLOW_NON_PHP
public
mixed
ALLOW_NON_PHP
= 0b100000
DEFAULT_DISABLED
public
mixed
DEFAULT_DISABLED
= 0b1000000
ENABLE_OPTION
public
string|array<string|int, mixed>|bool
ENABLE_OPTION
= null
to set (or disable) default group display/switch false disable the 'Enabled'' option for this group string the label for the 'Enabled' option array override options for the 'Enabled' option (label,help,title,info, etc.)
ONLY_ADMIN
public
mixed
ONLY_ADMIN
= 0b10
TAB_NAME
public
string
TAB_NAME
= 'Security'
extension tab name
VERSION
public
string
VERSION
= '24.1113.1'
extension version
Methods
__call()
magic method to call plugin or extension methods
public
__call(mixed $method, mixed $arguments) : mixed
Parameters
- $method : mixed
-
the method name or [extension,method]
- $arguments : mixed
-
the arguments to method name
Return values
mixed —result of method called
__construct()
constructor method
public
__construct(object $plugin) : void
Parameters
- $plugin : object
-
main plugin object
Return values
void —__destruct()
destructor method
public
__destruct() : void
Return values
void —__get()
magic method to call parent plugin __get()
public
__get(string $property) : mixed
Parameters
- $property : string
-
the property name or extension name
Return values
mixed —result of plugin __get()
addActionsAndFilters()
Add filters and actions - called from main plugin
public
addActionsAndFilters() : void
Return values
void —addShortcodes()
Add extension shortcodes
public
addShortcodes() : void
Called after loading, instantiating, and initializing all extensions
Return values
void —admin_options_help()
Add help tab on admin page
public
admin_options_help() : void
Tags
Return values
void —admin_options_settings()
register options on options_settings_page
public
admin_options_settings() : void
Tags
Return values
void —block_ip_address()
block ip/host address
public
block_ip_address() : void
Return values
void —checkCookieFlags()
set flags in Set-Cookie headers before output (used by header_register_callback)
public
checkCookieFlags() : void
Return values
void —disable_code_edit()
disable code editor
public
disable_code_edit() : void
Return values
void —disable_code_edit_error()
DISALLOW_FILE_EDIT was already set
public
disable_code_edit_error() : void
Return values
void —disable_embeds()
disable oEmbed creds: https://kinsta.com/knowledgebase/disable-embeds-wordpress/
public
disable_embeds() : void
Return values
void —disable_file_mods()
disable file mods
public
disable_file_mods() : void
Return values
void —disable_file_mods_error()
DISALLOW_FILE_MODS was already set
public
disable_file_mods_error() : void
Return values
void —disable_invalid_json()
disable invalid json request
public
disable_invalid_json() : mixed
Return values
mixed —disable_invalid_xml()
disable invalid xml request
public
disable_invalid_xml() : mixed
Return values
mixed —disable_pings()
disable xml-rpc pings
public
disable_pings(mixed $methods) : void|array<string|int, mixed>
Parameters
- $methods : mixed
Return values
void|array<string|int, mixed> —- empty array of xmlrpc methods
disable_rest()
disable REST API
public
disable_rest() : void
Return values
void —disable_rest_all()
disable All REST API
public
disable_rest_all(mixed $endpoints) : WP_Error
Parameters
- $endpoints : mixed
Return values
WP_Error —disable_rest_auth()
disable un-authenticated REST API
public
disable_rest_auth(mixed $endpoints) : WP_Error
Parameters
- $endpoints : mixed
Return values
WP_Error —disable_rest_core()
disable WP Core REST API
public
disable_rest_core(mixed $endpoints) : void
Parameters
- $endpoints : mixed
Return values
void —disable_rest_list()
disable REST API index/list
public
disable_rest_list(mixed $response) : void
Parameters
- $response : mixed
Return values
void —disable_rss_feeds()
disable rss feeds
public
disable_rss_feeds() : void
Return values
void —disable_rss_response()
disable rss feeds
public
disable_rss_response() : void
Return values
void —disable_uris()
disable uri
public
disable_uris() : void
Return values
void —disable_xml()
disable xml-rpc
public
disable_xml(mixed $methods) : void|array<string|int, mixed>
Parameters
- $methods : mixed
Return values
void|array<string|int, mixed> —- empty array of xmlrpc methods
early_addActionsAndFilters()
Add filters and actions - called from constructor
public
early_addActionsAndFilters() : mixed
Return values
mixed —getAlias()
get the extension alias
public
getAlias() : const
Return values
const —ALIAS string
getClassName()
getClassName - get the class/extension name without namespace
public
getClassName([object $class = null ]) : bool
Parameters
- $class : object = null
-
optional class object
Return values
bool —getVersion()
get the extension version
public
getVersion() : const
Return values
const —VERSION string
initialize()
initialize method - called from main plugin
public
initialize() : void
Return values
void —invalid_rest()
invalid rest call
public
invalid_rest(mixed $args) : void|array<string|int, mixed>
Parameters
- $args : mixed
Return values
void|array<string|int, mixed> —- empty array of xmlrpc methods
invalid_rest_auth()
disable un-authenticated REST API
public
invalid_rest_auth(mixed $result) : WP_Error
Parameters
- $result : mixed
Return values
WP_Error —invalid_xml()
invalid xml-rpc call
public
invalid_xml(mixed $args) : void|array<string|int, mixed>
Parameters
- $args : mixed
Return values
void|array<string|int, mixed> —- empty array of xmlrpc methods
is_network_enabled()
is_network_enabled - set or test extension enabled for use at the network level
public
is_network_enabled() : bool
Return values
bool —is_network_option()
is this class network enabled and does option match a value
public
is_network_option(string $optionName[, mixed $value = null ]) : bool|mixed
Parameters
- $optionName : string
-
option name
- $value : mixed = null
-
check this value
Return values
bool|mixed —option is set and has value
isEnabled()
isEnabled - set or test extension enabled for use
public
isEnabled([bool|string $enabled = null ][, bool $perm = null ]) : bool
Parameters
- $enabled : bool|string = null
-
true|false or other extension name
- $perm : bool = null
-
optional, to permanently set enabled option
Return values
bool —isNetworkPolicy()
is network option set
public
isNetworkPolicy(string $optionName) : bool
Parameters
- $optionName : string
-
- policy/option name
Return values
bool —isPolicyEnabled()
is site or network option set
public
isPolicyEnabled(string $optionName[, string $value = null ]) : bool
Parameters
- $optionName : string
-
- policy/option name
- $value : string = null
-
- check for specific value
Return values
bool —match_disabled_uris()
disable uri
public
match_disabled_uris(mixed $optionName) : void
Parameters
- $optionName : mixed
Return values
void —mergePolicies()
merge site and network policies
public
mergePolicies(string $optionName[, mixed $default = [] ][, bool $getPost = true ]) : mixed
Parameters
- $optionName : string
-
- policy/option name
- $default : mixed = []
-
- default value & type returned
- $getPost : bool = true
-
- POSTed values
Return values
mixed —register_risk_action()
default action for 'register_risk', overridden by risk_assessment extension action {plugin}_register_[threat|fraud|abuse|risk]
public
register_risk_action([string $message = '' ], int $score[, int $http_status = 403 ]) : mixed
Parameters
- $message : string = ''
-
additional comment text
- $score : int
-
risk score (0-100)
- $http_status : int = 403
-
optional, set http status on die
Return values
mixed —set_heartbeat()
heartbeat_settings
public
set_heartbeat(mixed $options) : array<string|int, mixed>
Parameters
- $options : mixed
Return values
array<string|int, mixed> —heartbeat parameters (interval set)
unauthorized_rest()
unauthorized rest call
public
unauthorized_rest(mixed $args) : void|array<string|int, mixed>
Parameters
- $args : mixed
Return values
void|array<string|int, mixed> —- empty array of xmlrpc methods
validate_authentication_attempts()
validate authentication attempts
public
validate_authentication_attempts( $user, mixed ...$args) : WP_Error
Parameters
Return values
WP_Error —or $user
validate_http_header()
require a specific http header
public
validate_http_header(bool $required) : void
Parameters
- $required : bool
Return values
void —validate_password_policy()
validate password policy
public
validate_password_policy(WP_Error $wpErrors, mixed ...$args) : WP_Error
Parameters
- $wpErrors : WP_Error
- $args : mixed
Return values
WP_Error —welcome_email_filter()
welcome email filter
public
welcome_email_filter(string $content) : string
Parameters
- $content : string
-
email message content
Return values
string —wp_login_authenticate()
wp_login post action - validate custom nonce
public
wp_login_authenticate(object $user, mixed ...$args) : object
Parameters
- $user : object
-
wp_user or wp_error
- $args : mixed
Return values
object —$user
wp_login_filter()
wp_login filter
public
wp_login_filter(string $url, string $path, string $scheme[, int|null $blogId = null ]) : string
Parameters
- $url : string
-
complete url
- $path : string
-
path of url
- $scheme : string
-
http|https
- $blogId : int|null = null
-
site id or null (current)
Return values
string —url
wp_login_form()
wp_login form action - add custom nonce
public
wp_login_form() : void
Return values
void —wp_login_init()
wp_login init action
public
wp_login_init() : void
Return values
void —wp_login_notice()
wp_login notice
public
wp_login_notice([ $newLogin = null ]) : void
Parameters
Return values
void —wp_login_redirect()
wp_login redirect action
public
wp_login_redirect(mixed $location) : void
Parameters
- $location : mixed
Return values
void —wp_nonce_failure()
wp_nonce_failure (wp_verify_nonce_failed)
public
wp_nonce_failure() : void