The auto update feature cannot be enabled because a plugin or code change forces automatic updates to be disabled. (AUTOMATIC_UPDATER_DISABLED)
', $this->allowed_html );
return;
}
$selected = get_site_option( 'patchstack_auto_update', array() );
$selected = ! is_array( $selected ) ? array() : $selected;
$options = array(
'core' => 'WordPress Core',
'plugin' => 'Plugins',
'theme' => 'Themes',
'vulnerable' => 'Vulnerable Plugins',
);
$out = '';
foreach ( $options as $option => $text ) {
$out .= ''
. ' ';
}
$string1 = __( 'Select what needs to be automatically updated each time WordPress looks for updates in the background. Keep in mind that if a plugin update contains a bug or a fatal error, it could break your site.', 'patchstack' );
echo wp_kses( ( '
' . $out ), $this->allowed_html );
}
public function patchstack_basic_firewall_geo_enabled_input() {
$string1 = __( 'If enabled and valid countries are specified to be blocked, will block these countries.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_geo_block_enabled' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_basic_firewall_geo_inverse_input() {
$string1 = __( 'If enabled, instead of checking if the country of the visitor is in the list, check if it is not in the list instead.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_geo_block_inverse' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_basic_firewall_geo_countries_input() {
$string1 = __( 'Specify which countries should be blocked. Note that this will also block any type of (legitimate) bot traffic coming from this country. IP to country resolution might also not be 100% accurate.', 'patchstack' );
$countries = $this->get_option( 'patchstack_geo_block_countries', array() );
$country_list = '';
if ( ! empty( $countries ) ) {
foreach ( $countries as $country ) {
$country_list .= esc_attr( $country ) . ",";
}
}
echo wp_kses( '', $this->allowed_html );
echo wp_kses( '' , $this->allowed_html );
}
public function patchstack_xmlrpc_input() {
$string1 = __( 'Restrict access to xmlrpc.php by only allowing authenticated users to access it.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_xmlrpc_is_disabled' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_application_passwords_disabled_input() {
$string1 = __( 'Disables the application passwords feature introduced in WordPress 5.6.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_application_passwords_disabled' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_json_is_disabled_input() {
$string1 = __( 'Restrict access to the WP Rest API by only allowing authenticated users to access it.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_json_is_disabled' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_register_email_blacklist_input() {
$string1 = __( '
Enter patterns here, seperated by commas, which email addresses we should block upon registration. For example if you enter @badsite.com it will block all email addresses that contain @badsite.com.', 'patchstack' );
echo wp_kses( '' , $this->allowed_html );
}
public function patchstack_activity_log_input() {
$string1 = __( 'If enabled, a large number of user related activities will be logged.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_activity_log_is_enabled' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_activity_log_failed_logins_input() {
$string1 = __( 'If this is checked along with the activity logs, we will also log failed login attempts.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_activity_log_failed_logins' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_activity_log_failed_logins_db_input() {
$string1 = __( 'If this is checked along with the failed login logger, we will also upload the failed login logs to Patchstack.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_activity_log_failed_logins_db' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_captcha_on_comments_callback() {
$string1 = __( 'Check this if you want to enable reCAPTCHA on post comments.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_captcha_on_comments' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_cookie_notice_credits_callback() {
$string1 = __( 'Check this if you want to display "Powered by Patchstack"', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_cookie_notice_credits' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_enable_cookie_notice_callback() {
$string1 = __( 'Check this if you want to enable cookie notice message.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_enable_cookie_notice_message' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_cookie_notice_message_callback() {
echo wp_kses( '', $this->allowed_html );
}
public function patchstack_cookie_notice_accept_text_callback() {
echo wp_kses( "", $this->allowed_html );
}
public function patchstack_cookie_notice_backgroundcolor_callback() {
echo wp_kses( "", $this->allowed_html );
}
public function patchstack_cookie_notice_textcolor_callback() {
echo wp_kses( "", $this->allowed_html );
}
public function patchstack_cookie_notice_privacypolicy_enable_callback() {
$string1 = __( 'Check this if you want to enable policy link.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_cookie_notice_privacypolicy_enable' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_cookie_notice_privacypolicy_text_callback() {
echo wp_kses( "", $this->allowed_html );
}
public function patchstack_cookie_notice_privacypolicy_link_callback() {
echo wp_kses( "" , $this->allowed_html );
echo wp_kses( ' ', $this->allowed_html );
}
public function patchstack_cookie_notice_cookie_expiration_callback() {
echo wp_kses ( '
', $this->allowed_html );
}
public function patchstack_cookie_notice_opacity_callback() {
echo wp_kses( "", $this->allowed_html );
echo wp_kses( ' ', $this->allowed_html );
}
public function patchstack_hidewplogin_input() {
$string1 = __( 'Block access to the default wp-login.php page. This will require you to visit the URL below which will whitelist your IP address for 10 minutes to login.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_mv_wp_login' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_hidewplogin_rename_input() {
if ( $this->get_option( 'patchstack_mv_wp_login' ) == 0 && $this->get_option( 'patchstack_rename_wp_login' ) == 'swlogin' ) {
update_site_option( 'patchstack_rename_wp_login', md5( wp_generate_password( 32, true, true ) ) );
}
echo wp_kses( '
', $this->allowed_html );
echo wp_kses( ' ', $this->allowed_html );
}
}
public function patchstack_pluginedit_input() {
$string1 = __( 'Disable the theme editor. This could protect you from potential automated attacks that involve the theme editor.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_pluginedit' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_add_security_headers_input() {
$string1 = __( 'Add security headers to the response by your webserver.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_add_security_headers' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_basicscanblock_input() {
$string1 = __( 'This will attempt to stop basic readme.txt scans. These scans are generally used to determine the version of installed plugins on the site.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_basicscanblock' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_userenum_input() {
$string1 = __( 'Make it harder for malicious people to find your WordPress username.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_userenum' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_hidewpversion_input() {
$string1 = __( 'Removes the WordPress version in the meta tag in the HTML output.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_hidewpversion' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_rm_readme_input() {
$string1 = __( 'Removes the readme.html file from the WordPress root folder.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_rm_readme' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_prevent_default_file_access_input() {
$string1 = __( 'Prevent direct access to files such as license.txt, readme.html and wp-config.php', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_prevent_default_file_access' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_basic_firewall_input() {
$string1 = __( 'Check this if you want to turn on the advanced firewall protection on your site.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_basic_firewall' ), false ) . '/>
Block IP for minutes after blocked requests over a period of minutes', $this->allowed_html);
}
public function patchstack_basic_firewall_roles_input() {
$selected = $this->get_option( 'patchstack_basic_firewall_roles', array( 'administrator', 'editor', 'author' ) );
$selected = ! is_array( $selected ) ? array() : $selected;
$roles = wp_roles();
$roles = $roles->get_names();
$text = '';
foreach ( $roles as $key => $val ) {
$text .= ' ';
}
$string1 = __( 'Against which user roles should the firewall not run against? The firewall will always run against guests. ', 'patchstack' );
echo wp_kses( ( ' ' . $text ), $this->allowed_html );
}
public function patchstack_known_blacklist_input() {
$string1 = __( 'Check this if you want to block known malicious connections.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_known_blacklist' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_firewall_ip_header_input() {
$string1 = __( 'If you would like to override the IP address header that we use to grab the IP address of the visitor, enter the value here. This must be a valid value in the $_SERVER array, for example HTTP_X_FORWARDED_FOR. If the $_SERVER value you enter does not exist, it will fallback to the Patchstack IP grab function so ask your hosting company if you are unsure. Leave this empty to use the Patchstack IP address grabbing function.', 'patchstack' );
echo wp_kses( '
' , $this->allowed_html );
}
public function patchstack_disable_htaccess_input() {
$string1 = __( 'Check this if you want to stop us from writing to your .htaccess file. Note that the current changes to the .htaccess file will remain.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_disable_htaccess' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_block_debug_log_access_input() {
$string1 = __( 'Check this if you want to block access to the debug.log file that WordPress creates when debug logging is enabled.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_block_debug_log_access' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_index_views_input() {
$string1 = __( 'Check this if you want to disable directory and file listing.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_index_views' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_proxy_comment_posting_input() {
$string1 = __( 'Check this if you want to forbid proxy comment posting.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_proxy_comment_posting' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_block_bruteforce_ips_input() {
$string1 = __( 'Check this if you want to automatically ban IP addresses that fail to login multiple times in a short span of time. For this feature to work, make sure that "Log failed logins" is turned on at the hardening settings page.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_block_bruteforce_ips' ), false ) . '/>
Block IP for minutes after failed login attempts over a period of minutes' , $this->allowed_html );
}
public function patchstack_login_time_block_input() {
$string1 = __( 'Check this if you want to enforce specific logon hours.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_login_time_block' ), false ) . '/>
Allow login between and Times must be in the 24 hour clock format. The logon hours are also based on the current time of your site: ' . current_time( 'H:i:s' ) . '', $this->allowed_html );
}
public function patchstack_login_2fa_input() {
$string1 = __( 'Check this if you want to make it possible for users to enable two factor authentication (2FA) on their account.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_login_2fa' ), false ) . '/> ' , $this->allowed_html );
}
public function patchstack_login_blocked_input() {
// Calculate block time.
$minutes = (int) $this->get_option( 'patchstack_anti_bruteforce_minutes', 30 );
$timeout = (int) $this->get_option( 'patchstack_anti_bruteforce_blocktime', 60 );
if ( empty( $minutes ) || empty( $timeout ) ) {
$time = 30 + 60;
} else {
$time = $minutes + $timeout;
}
// Check if X failed login attempts were made.
global $wpdb;
$results = $wpdb->get_results(
$wpdb->prepare( 'SELECT id, ip, date FROM ' . $wpdb->prefix . "patchstack_event_log WHERE action = 'failed login' AND date >= ('" . current_time( 'mysql' ) . "' - INTERVAL %d MINUTE) GROUP BY ip HAVING COUNT(ip) >= %d ORDER BY date DESC", array( $time, $this->get_option( 'patchstack_anti_bruteforce_attempts', 10 ) ) ),
OBJECT
);
// Render the rows.
$rows = '';
if ( count( $results ) == 0 ) {
$rows = '
';
}
}
$string1 = __( 'These are the IP addresses that are currently blocked because of too many failed login attempts. These are not the IP addresses banned by the firewall itself.
Each entry must be on its own line. Your current IP address is: ' . esc_html( $this->get_ip() ) . '
Following formats are accepted:
127.0.0.1
127.0.0.*
127.0.0.0/24
127.0.0.0-127.0.0.255
', $this->allowed_html );
}
public function patchstack_image_hotlinking_input() {
$string1 = __( 'Check this if you want to prevent hotlinking to images on your site.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_image_hotlinking' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_firewall_custom_rules_input() {
$string1 = __( 'Add custom .htaccess rules here if you know what you are doing, otherwise you may break your site. So be careful.', 'patchstack' );
echo wp_kses( '', $this->allowed_html );
echo wp_kses( '
If the custom .htaccess rules above cause an error, they will be removed automatically.
', $this->allowed_html );
}
public function patchstack_firewall_custom_rules_loc_input() {
echo wp_kses( '', $this->allowed_html );
}
public function patchstack_captcha_login_form_input() {
$string1 = __( 'Check this if you want to enable reCAPTCHA on user login.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_captcha_login_form' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_captcha_registration_form_input() {
$string1 = __( 'Check this if you want to enable reCAPTCHA on registration.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_captcha_registration_form' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_captcha_reset_pwd_form_input() {
$string1 = __( 'Check this if you want to enable reCAPTCHA on password reset.', 'patchstack' );
echo wp_kses( 'get_option( 'patchstack_captcha_reset_pwd_form' ), false ) . '/>' , $this->allowed_html );
}
public function patchstack_captcha_type_callback() {
echo wp_kses( '
', $this->allowed_html );
}
public function patchstack_captcha_public_key_input() {
$string1 = __( '
Enter the reCAPTCHA site key here. Click here for a guide on how to get the site / secret key.', 'patchstack' );
echo wp_kses( '' , $this->allowed_html );
}
public function patchstack_captcha_private_key_input() {
$string1 = __( '
Enter the reCAPTCHA secret key here. Click here for a guide on how to get the site / secret key.', 'patchstack' );
echo wp_kses( '' , $this->allowed_html );
}
public function patchstack_blackhole_log_input() {
$ip_list = esc_textarea( rtrim( $this->get_option( 'patchstack_ip_block_list', '' ) ) );
echo wp_kses( '
Each entry must be on its own line.
Following formats are accepted:
127.0.0.1
127.0.0.*
127.0.0.0/24
127.0.0.0-127.0.0.255
', $this->allowed_html );
}
public function patchstack_whitelist_input() {
echo wp_kses( '', $this->allowed_html );
echo wp_kses( __( '
Each rule must be on a new line.
The following keywords are accepted IP:IPADDRESS PAYLOAD:someval URL:/someurl
Definitions IP = firewall will not run against the IP PAYLOAD = if the entire payload contains the keyword, the firewall will not proceed URL = if the URL contains given URL, firewall will not proceed
Example IP:192.168.1.1 PAYLOAD:contact_form URL:water URL:/some-form
In this scenario, the firewall will not run if the IP address is 192.168.1.1 or if the payload contains contact_form or if the URL contains water or if the URL contains /some-form.