\MainWP\ChildMainWP_Child_Wordfence

Class MainWP_Child_Wordfence

MainWP Wordfence extension handler.

Summary

Methods
Properties
Constants
instance()
__construct()
wordfence_init()
admin_init()
do_site_stats()
do_reports_log()
init_cron()
wfc_cron_scan()
all_plugins()
remove_menu()
deactivation()
action()
get_section_settings()
set_showhide()
get_log()
update_log()
load_issues()
ajax_load_issues_callback()
load_waf_data()
count_attacks_blocked()
get_lastscan()
update_all_issues()
update_issue_status()
update_issues_status()
delete_issues()
bulk_operation()
bulk_ajax_operation()
delete_file()
restore_file()
simple_crypt()
save_settings_new()
recent_traffic()
save_setting()
export_settings()
import_settings()
get_settings()
ticker()
load_live_traffic()
whitelist_waf_param_key()
hide_file_htaccess()
fix_fpd()
disable_directory_listing()
delete_database_option()
mis_configured_how_get_ips_choice()
delete_admin_user()
revoke_admin_user()
clear_all_blocked()
permanently_block_all_ips()
unlock_out_ip()
unblock_range()
block_ip_ua_range()
load_block_ranges()
save_waf_config()
whitelist_bulk_delete()
whitelist_bulk_enable()
whitelist_bulk_disable()
update_config()
reverse_lookup()
save_options()
ajax_get_blocks_callback()
ajax_create_block_callback()
ajax_delete_blocks_callback()
ajax_make_permanent_blocks_callback()
ajax_block_ip_callback()
whois()
unblock_ip()
save_country_blocking()
load_static_panel()
downgrade_license()
save_cache_config()
check_falcon_htaccess()
check_htaccess()
download_htaccess()
save_cache_options()
clear_page_cache()
get_cache_stats()
add_cache_exclusion()
load_cache_exclusions()
remove_cache_exclusion()
get_diagnostics()
update_waf_rules()
update_waf_rules_new()
save_debugging_config()
$instance
$is_wordfence_installed
$plugin_translate
$options_filter
$diagnosticParams
$firewall_options_filter
OPTIONS_TYPE_GLOBAL
OPTIONS_TYPE_FIREWALL
OPTIONS_TYPE_BLOCKING
OPTIONS_TYPE_SCANNER
OPTIONS_TYPE_TWO_FACTOR
OPTIONS_TYPE_LIVE_TRAFFIC
OPTIONS_TYPE_COMMENT_SPAM
OPTIONS_TYPE_DIAGNOSTICS
OPTIONS_TYPE_ALL
No protected methods found
No protected properties found
N/A
start_scan()
kill_scan()
request_scan()
kill_ajax_scan()
get_waf_data()
No private properties found
N/A

Constants

OPTIONS_TYPE_GLOBAL

OPTIONS_TYPE_GLOBAL = 'global'

OPTIONS_TYPE_FIREWALL

OPTIONS_TYPE_FIREWALL = 'firewall'

OPTIONS_TYPE_BLOCKING

OPTIONS_TYPE_BLOCKING = 'blocking'

OPTIONS_TYPE_SCANNER

OPTIONS_TYPE_SCANNER = 'scanner'

OPTIONS_TYPE_TWO_FACTOR

OPTIONS_TYPE_TWO_FACTOR = 'twofactor'

OPTIONS_TYPE_LIVE_TRAFFIC

OPTIONS_TYPE_LIVE_TRAFFIC = 'livetraffic'

OPTIONS_TYPE_COMMENT_SPAM

OPTIONS_TYPE_COMMENT_SPAM = 'commentspam'

OPTIONS_TYPE_DIAGNOSTICS

OPTIONS_TYPE_DIAGNOSTICS = 'diagnostics'

OPTIONS_TYPE_ALL

OPTIONS_TYPE_ALL = 'alloptions'

Properties

$instance

$instance : mixed

Public static variable to hold the single instance of the class.

Type

mixed — Default null

$is_wordfence_installed

$is_wordfence_installed : boolean

Public variable to hold the information if the Wordfence plugin is installed on the child site.

Type

boolean — If Wordfence intalled, return true, if not, return false.

$plugin_translate

$plugin_translate : string

Public variable to hold the information about the language domain.

Type

string — 'mainwp-child' languge domain.

$options_filter

$options_filter : array

Public static variable to hold the information about Wordfence options.

Type

array — Supported Wordfence options.

$diagnosticParams

$diagnosticParams : array

Public static variable to hold the information about Wordfence diagnostic parameters.

Type

array — Supported diagnostic parameters.

$firewall_options_filter

$firewall_options_filter : array

Public static variable to hold the information about Wordfence firewall options.

Type

array — Supported firewall options.

Methods

instance()

instance() : mixed

Method instance()

Create a public static instance.

Returns

mixed —

Class instance.

__construct()

__construct() 

MainWP_Child_Wordfence constructor.

Run any time class is called.

wordfence_init()

wordfence_init() : void

Method wordfence_init()

Initiate action hooks.

admin_init()

admin_init() 

Method admin_init()

Remove remove the Wordfence meta-box (widget) when 'admin_init' action fires.

do_site_stats()

do_site_stats() 

Method do_site_stats()

Add support for the reporting system.

do_reports_log()

do_reports_log(string  $ext = '') 

Method do_reports_log()

Add Wordfence data to the reports reports database table.

Parameters

string $ext

Current extension.

init_cron()

init_cron() 

Method init_cron()

Manage scheduled events.

wfc_cron_scan()

wfc_cron_scan() 

Method wfc_cron_scan()

Trigger the Wordfence scan via Cron job.

all_plugins()

all_plugins(array  $plugins) : array

Method all_plugins()

Remove the Wordfence plugin from the list of all plugins when the plugin is hidden.

Parameters

array $plugins

Array containing all installed plugins.

Returns

array —

$plugins Array containing all installed plugins without the Wordfence.

remove_menu()

remove_menu() 

Method remove_menu()

Remove the Wordfence menu item when the plugin is hidden.

deactivation()

deactivation() 

Method deactivation()

Unschedule scheduled events on MainWP Child plugin deactivation.

action()

action() : void

Method actions()

Fire off certain Wordfence plugin actions.

Throws

\Exception

get_section_settings()

get_section_settings(string  $section) : array

Method get_section_settings()

Parameters

string $section

Contains the group (section) of Wordfence settings options.

Returns

array —

Array containing the selected section options.

set_showhide()

set_showhide() : array

Method set_showhide()

Hide or unhide the Wordfence plugin.

Returns

array —

Action result.

get_log()

get_log() : array

Method get_log()

Get the Wordfence log.

Returns

array —

Action result.

update_log()

update_log() : array

Method update_log()

Updated the Wordfence activity log via wordfence::ajax_activityLogUpdate_callback().

Returns

array —

Action result.

load_issues()

load_issues() : array

Method load_issues()

Load issues detected by Wordfence.

Returns

array —

Action result.

ajax_load_issues_callback()

ajax_load_issues_callback() : array

Method ajax_load_issues_callback()

Load issues detected by Wordfence (Callback).

Returns

array —

Action result.

load_waf_data()

load_waf_data() : array

Method load_waf_data()

Load the web application firewall (WAF) data.

Returns

array —

Action result.

count_attacks_blocked()

count_attacks_blocked(integer  $maxAgeDays) : array

Method count_attacks_blocked()

Get the number of blocked attackes.

Parameters

integer $maxAgeDays

Contains the number of days to count blocked attacks form.

Returns

array —

Action result.

get_lastscan()

get_lastscan() : string

Method get_lastscan()

Get date and time of the last Wordfence scan.

Returns

string —

Last scan timestamp.

update_all_issues()

update_all_issues() : array

Method update_all_issues()

Handle (delete ignored, delete new or ignore all new) all issues detected by Wordfence.

Returns

array —

Action result.

update_issue_status()

update_issue_status() : array

Method update_issue_status()

Update status of an issue detected by Wordfence.

Returns

array —

Action result.

update_issues_status()

update_issues_status() : array

Method update_issue_status()

Update status of issues detected by Wordfence.

Returns

array —

Action result.

delete_issues()

delete_issues() : array

Method delete_issues()

Delete issues detected by Wordfence.

Returns

array —

Action result.

bulk_operation()

bulk_operation() : array

Method bulk_operation()

Handle the Wordfence bulk operations.

Returns

array —

Action result.

bulk_ajax_operation()

bulk_ajax_operation() : array

Method bulk_ajax_operation()

Handle the Wordfence bulk operations via AJAX.

Returns

array —

Action result.

delete_file()

delete_file() : array

Method delete_file()

Delete corrupted files to fix issues detected by Wordfence.

Returns

array —

Action result.

restore_file()

restore_file() : array

Method restore_file()

Restore files deleted by Wordfence.

Returns

array —

Action result.

simple_crypt()

simple_crypt(string  $key, array  $data, string  $action = 'encrypt') : string

Method simple_crypt()

Encrypt or decrypt data.

Parameters

string $key

Contains the cryption key.

array $data

Array containing data that needs to be encrypted or decrypted.

string $action

Contains preferred action, encrypt or decrypt.

Returns

string —

Encrypted or decrypted data.

save_settings_new()

save_settings_new() : array

Method save_settings_new()

Save new Wordfence settings.

Throws

\Exception

Error message.

Returns

array —

Action result.

recent_traffic()

recent_traffic() : array

Method recent_traffic()

Load the recent traffic.

Returns

array —

Action result.

save_setting()

save_setting() : array

Method save_settings()

Save Wordfence settings.

Throws

\Exception

Error message.

Returns

array —

Action result.

export_settings()

export_settings() : array

Method export_settings()

Export the Wordfence settings.

Throws

\Exception

Error message.

Returns

array —

Action result.

import_settings()

import_settings() : array

Method import_settings()

Import the Wordfence settings.

Throws

\Exception

Error message.

Returns

array —

Action result.

get_settings()

get_settings() : array

Method get_settings()

Get the Wordfence settings.

Returns

array —

Action result.

ticker()

ticker() : array

Method ticker()

Wordfence ticker.

Returns

array —

Action result.

load_live_traffic()

load_live_traffic() : array

Method load_live_traffic()

Load the Wordfence live traffic.

Returns

array —

Action result.

whitelist_waf_param_key()

whitelist_waf_param_key() : array

Method whitelist_waf_param_key()

Whitelist WAF parameter key.

Returns

array —

Action result.

hide_file_htaccess()

hide_file_htaccess() : array

Method hide_file_htaccess()

Hide the .htaccess file.

Returns

array —

Action result.

fix_fpd()

fix_fpd() : array

Method fix_fpd()

Fix the FPD issue.

Returns

array —

Action result.

disable_directory_listing()

disable_directory_listing() : array

Method disable_directory_listing()

Disable the directory listing security issue.

Returns

array —

Action result.

delete_database_option()

delete_database_option() : array

Method delete_database_option()

Delete the database option.

Returns

array —

Action result.

mis_configured_how_get_ips_choice()

mis_configured_how_get_ips_choice() : array

Method mis_configured_how_get_ips_choice()

Misconfigured how to get IPs choice.

Returns

array —

Action result.

delete_admin_user()

delete_admin_user() : array

Method delete_admin_user()

Delete the 'admin' user.

Returns

array —

Action result.

revoke_admin_user()

revoke_admin_user() : array

Method revoke_admin_user()

Revoke the 'admin' user.

Returns

array —

Action result.

clear_all_blocked()

clear_all_blocked() : array

Method clear_all_blocked()

Clear all blocked IPs.

Returns

array —

Action result.

permanently_block_all_ips()

permanently_block_all_ips() : array

Method permanently_block_all_ips()

Permanently block all IPs.

Returns

array —

Action result.

unlock_out_ip()

unlock_out_ip() : array

Method unlock_out_ip()

Unlock out IP.

Returns

array —

Action result.

unblock_range()

unblock_range() : array

Method unblock_range()

Unblock IP range.

Returns

array —

Action result.

block_ip_ua_range()

block_ip_ua_range() : array

Method block_ip_ua_range()

Blcock IP UA range.

Returns

array —

Action result.

load_block_ranges()

load_block_ranges() : array

Method load_block_ranges()

Load blocked IP ranges.

Returns

array —

Action result.

save_waf_config()

save_waf_config() : array

Method save_waf_config()

Save WAF settigns.

Returns

array —

Action result.

whitelist_bulk_delete()

whitelist_bulk_delete() : array

Method whitelist_bulk_delete()

Delete in bulk whitelist items.

Returns

array —

Action result.

whitelist_bulk_enable()

whitelist_bulk_enable() : array

Method whitelist_bulk_enable()

Enable in bulk whitelist items.

Returns

array —

Action result.

whitelist_bulk_disable()

whitelist_bulk_disable() : array

Method whitelist_bulk_disable()

Disable in bulk whitelist items.

Returns

array —

Action result.

update_config()

update_config() : array

Method update_config()

Update Wordfence configuration.

Returns

array —

Action result.

reverse_lookup()

reverse_lookup() : array

Method reverse_lookup()

Reverse lookup.

Returns

array —

Action result.

save_options()

save_options() : array

Method save_options()

Save Wordfence options.

Returns

array —

Action result.

ajax_get_blocks_callback()

ajax_get_blocks_callback() : array

Method ajax_get_blocks_callback()

Get the list of blocked items.

Returns

array —

Action result.

ajax_create_block_callback()

ajax_create_block_callback() : array

Method ajax_create_block_callback()

Create the block rule.

Returns

array —

Action result.

ajax_delete_blocks_callback()

ajax_delete_blocks_callback() : array

Method ajax_delete_blocks_callback()

Delete blocked item.

Returns

array —

Action result.

ajax_make_permanent_blocks_callback()

ajax_make_permanent_blocks_callback() : array

Method ajax_make_permanent_blocks_callback()

Make permanent blocks.

Returns

array —

Action result.

ajax_block_ip_callback()

ajax_block_ip_callback() : array

Method ajax_block_ip_callback()

Block IP address.

Returns

array —

Action result.

whois()

whois() : array

Method whois()

Trigger the WhoIS check.

Returns

array —

Action result.

unblock_ip()

unblock_ip() : array

Method unblock_ip()

Unblock IP address.

Returns

array —

Action result.

save_country_blocking()

save_country_blocking() : array

Method save_country_blocking()

Save country blocknig settings.

Returns

array —

Action result.

load_static_panel()

load_static_panel() : array

Method load_static_panel()

Load static panel.

Returns

array —

Action result.

downgrade_license()

downgrade_license() : array

Method downgrade_license()

Downgrade Wordfence license.

Returns

array —

Action result.

save_cache_config()

save_cache_config() : array

Method save_cache_config()

Save caching configuration.

Returns

array —

Action result.

check_falcon_htaccess()

check_falcon_htaccess() : array

Method check_falcon_htaccess()

Check the .htaccess for the Wordfence falcon settings.

Returns

array —

Action result.

check_htaccess()

check_htaccess() : array

Method check_htaccess()

Check the .htaccess file.

Returns

array —

Action result.

download_htaccess()

download_htaccess() : void

Method download_htaccess()

Download the .htaccess file.

save_cache_options()

save_cache_options() : array

Method save_cache_options()

Save the caching options.

Returns

array —

Action result.

clear_page_cache()

clear_page_cache() : array

Method clear_page_cache()

Clear the page cache.

Returns

array —

Action result.

get_cache_stats()

get_cache_stats() : array

Method get_cache_stats()

Get the cache statistics data.

Returns

array —

Action result.

add_cache_exclusion()

add_cache_exclusion() : array

Method add_cache_exclusion()

Add caching exclusions.

Returns

array —

Action result.

load_cache_exclusions()

load_cache_exclusions() : array

Method load_cache_exclusions()

Load caching exclusions.

Returns

array —

Action result.

remove_cache_exclusion()

remove_cache_exclusion() : array

Method remove_cache_exclusion()

Remove caching exclusions.

Returns

array —

Action result.

get_diagnostics()

get_diagnostics() : array

Method get_diagnostics()

Get the diagnostics data.

Returns

array —

Action result.

update_waf_rules()

update_waf_rules() : array

Method update_waf_rules()

Update WAF rules.

Returns

array —

Action result.

update_waf_rules_new()

update_waf_rules_new() : array

Method update_waf_rules_new()

Update new WAF rules.

Returns

array —

Action result.

save_debugging_config()

save_debugging_config() : array

Method save_debugging_config()

Save the debugging configuration.

Returns

array —

Action result.

start_scan()

start_scan() : array

Method start_scan()

Start the Wordfence scan by calling wordfence::ajax_scan_callback().

Returns

array —

Action result.

kill_scan()

kill_scan() : array

Method kill_scan()

Stop the Wordfence scan by calling wordfence::status(), \wfUtils::clearScanLock() and \wfScanEngine::requestKill().

Returns

array —

Action result.

request_scan()

request_scan() : array

Method request_scan()

Request the Wordfence scan by returning wordfence::ajax_scan_callback().

Returns

array —

Action result.

kill_ajax_scan()

kill_ajax_scan() : array

Method kill_ajax_scan()

Stop the Wordfence AJAX scan by returning wordfence::ajax_killScan_callback().

Returns

array —

Action result.

get_waf_data()

get_waf_data(boolean  $updated = null) : array

Method get_waf_data()

Get the WAF data.

Parameters

boolean $updated

If updated, set true, if not, set false.

Returns

array —

Action result.