=' ) ) {
return;
}
if ( version_compare( PHP_VERSION, '5.0.0', '<' ) ) {
$text = '
'.__('WARNING! BPS requires at least PHP5 to function correctly. Your PHP version is: ', 'bulletproof-security').PHP_VERSION.''.__('BPS Guide - PHP5 Solution', 'bulletproof-security').''.__('The BPS Guide will open in a new browser window. You will not be directed away from your WordPress Dashboard.', 'bulletproof-security').'
';
echo $text;
}
}
// Heads Up Display w/ Dismiss - Check if PHP Safe Mode is On - 1 is On - 0 is Off
function bps_check_safemode() {
if ( ini_get('safe_mode') == 1 ) {
global $current_user;
$user_id = $current_user->ID;
if ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) != 'wp-admin' ) {
$bps_base = basename(esc_html($_SERVER['REQUEST_URI'])) . '?';
} elseif ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) == 'wp-admin' ) {
$bps_base = basename( str_replace( 'wp-admin', 'index.php?', esc_html($_SERVER['REQUEST_URI'])));
} else {
$bps_base = str_replace( admin_url(), '', esc_html($_SERVER['REQUEST_URI']) ) . '&';
}
if ( ! get_user_meta($user_id, 'bps_ignore_safemode_notice') ) {
$text = ''.__('WARNING! BPS has detected that Safe Mode is set to On in your php.ini file.', 'bulletproof-security').''.__('If you see errors that BPS was unable to automatically create the backup folders this is probably the reason why.', 'bulletproof-security').'
'.__('To Dismiss this Notice click the Dismiss Notice button below. To Reset Dismiss Notices click the Reset|Recheck Dismiss Notices button on the Custom Code page.', 'bulletproof-security').'
';
echo $text;
}
}
}
add_action('admin_init', 'bps_safemode_nag_ignore');
function bps_safemode_nag_ignore() {
global $current_user;
$user_id = $current_user->ID;
if ( isset($_GET['bps_safemode_nag_ignore']) && '0' == $_GET['bps_safemode_nag_ignore'] ) {
add_user_meta($user_id, 'bps_ignore_safemode_notice', 'true', true);
}
}
// Heads Up Display w/ Dismiss - Check if Permalinks are enabled - top error message new activations/installations
function bps_check_permalinks_error() {
if ( current_user_can('manage_options') && get_option('permalink_structure') == '' ) {
global $current_user;
$user_id = $current_user->ID;
if ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) != 'wp-admin' ) {
$bps_base = basename(esc_html($_SERVER['REQUEST_URI'])) . '?';
} elseif ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) == 'wp-admin' ) {
$bps_base = basename( str_replace( 'wp-admin', 'index.php?', esc_html($_SERVER['REQUEST_URI'])));
} else {
$bps_base = str_replace( admin_url(), '', esc_html($_SERVER['REQUEST_URI']) ) . '&';
}
if ( ! get_user_meta($user_id, 'bps_ignore_Permalinks_notice') ) {
$text = ''.__('HUD Check: Custom Permalinks are NOT being used.', 'bulletproof-security').''.__('It is recommended that you use Custom Permalinks: ', 'bulletproof-security').'
'.__('How to setup Custom Permalinks', 'bulletproof-security').''.__('To Dismiss this Notice click the Dismiss Notice button below. To Reset Dismiss Notices click the Reset|Recheck Dismiss Notices button on the Custom Code page.', 'bulletproof-security').'
';
echo $text;
}
}
}
add_action('admin_init', 'bps_Permalinks_nag_ignore');
function bps_Permalinks_nag_ignore() {
global $current_user;
$user_id = $current_user->ID;
if ( isset($_GET['bps_Permalinks_nag_ignore']) && '0' == $_GET['bps_Permalinks_nag_ignore'] ) {
add_user_meta($user_id, 'bps_ignore_Permalinks_notice', 'true', true);
}
}
// Heads Up Display w/Dismiss - Check if Windows IIS server and if IIS7 supports permalink rewriting
function bps_check_iis_supports_permalinks() {
global $wp_rewrite, $is_IIS, $is_iis7, $current_user;
$user_id = $current_user->ID;
if ( current_user_can('manage_options') && $is_IIS && ! iis7_supports_permalinks() ) {
if ( ! get_user_meta($user_id, 'bps_ignore_iis_notice')) {
if ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) != 'wp-admin' ) {
$bps_base = basename(esc_html($_SERVER['REQUEST_URI'])) . '?';
} elseif ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) == 'wp-admin' ) {
$bps_base = basename( str_replace( 'wp-admin', 'index.php?', esc_html($_SERVER['REQUEST_URI'])));
} else {
$bps_base = str_replace( admin_url(), '', esc_html($_SERVER['REQUEST_URI']) ) . '&';
}
$text = ''.__('WARNING! BPS has detected that your Server is a Windows IIS Server that does not support htaccess rewriting.', 'bulletproof-security').''.__('Do NOT activate BulletProof Modes unless you know what you are doing.', 'bulletproof-security').'
'.__('Your Server Type is: ', 'bulletproof-security').esc_html( $_SERVER['SERVER_SOFTWARE'] ).'
'.__('WordPress Codex - Using Permalinks - see IIS section', 'bulletproof-security').''.__('To Dismiss this Notice click the Dismiss Notice button below. To Reset Dismiss Notices click the Reset|Recheck Dismiss Notices button on the Custom Code page.', 'bulletproof-security').'
';
echo $text;
}
}
}
add_action('admin_init', 'bps_iis_nag_ignore');
function bps_iis_nag_ignore() {
global $current_user;
$user_id = $current_user->ID;
if ( isset( $_GET['bps_iis_nag_ignore'] ) && '0' == $_GET['bps_iis_nag_ignore'] ) {
add_user_meta($user_id, 'bps_ignore_iis_notice', 'true', true);
}
}
// Heads Up Display - check if /bps-backup and /bps-backup/master-backups folders exist
function bps_hud_check_bpsbackup() {
$bps_wpcontent_dir = str_replace( ABSPATH, '', WP_CONTENT_DIR );
if ( ! is_dir( WP_CONTENT_DIR . '/bps-backup' ) ) {
$text = ''.__('WARNING! BPS was unable to automatically create the /', 'bulletproof-security').$bps_wpcontent_dir.__('/bps-backup folder.', 'bulletproof-security').''.__('You will need to create the /', 'bulletproof-security').$bps_wpcontent_dir.__('/bps-backup folder manually via FTP. The folder permissions for the bps-backup folder need to be set to 755 in order to successfully perform permanent online backups.', 'bulletproof-security').'
'.__('To remove this message permanently click ', 'bulletproof-security').'
'.__('here.', 'bulletproof-security').' ';
echo $text;
}
if ( ! is_dir( WP_CONTENT_DIR . '/bps-backup/master-backups' ) ) {
$text = ''.__('WARNING! BPS was unable to automatically create the /', 'bulletproof-security').$bps_wpcontent_dir.__('/bps-backup/master-backups folder.', 'bulletproof-security').''.__('You will need to create the /', 'bulletproof-security').$bps_wpcontent_dir.__('/bps-backup/master-backups folder manually via FTP. The folder permissions for the master-backups folder need to be set to 755 in order to successfully perform permanent online backups.', 'bulletproof-security').'
'.__('To remove this message permanently click ', 'bulletproof-security').'
'.__('here.', 'bulletproof-security').' ';
echo $text;
}
}
// Heads Up Display - Bonus Custom Code with Dismiss Notices
function bpsPro_bonus_custom_code_dismiss_notices() {
global $current_user;
$user_id = $current_user->ID;
if ( current_user_can('manage_options') ) {
$text = '';
// Setup Wizard DB option is saved by running the Setup Wizard, on BPS Upgrades & manual BPS setup
if ( ! get_option('bulletproof_security_options_wizard_free') ) {
return;
}
$HFiles_options = get_option('bulletproof_security_options_htaccess_files');
if ( $HFiles_options['bps_htaccess_files'] == 'disabled' ) {
return;
}
if ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) != 'wp-admin' ) {
$bps_base = basename(esc_html($_SERVER['REQUEST_URI'])) . '?';
} elseif ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) == 'wp-admin' ) {
$bps_base = basename( str_replace( 'wp-admin', 'index.php?', esc_html($_SERVER['REQUEST_URI'])));
} else {
$bps_base = str_replace( admin_url(), '', esc_html($_SERVER['REQUEST_URI']) ) . '&';
}
if ( get_user_meta($user_id, 'bps_bonus_code_dismiss_all_notice') && ! get_user_meta($user_id, 'bps_post_request_attack_notice') ) {
$text = ''.__('Bonus Custom Code:', 'bulletproof-security').''.__('Click the links below to get Bonus Custom Code or click the Dismiss Notice links or click this ', 'bulletproof-security').'
'.__('Dismiss All Notices', 'bulletproof-security').''.__(' link. To Reset Dismiss Notices click the Reset|Recheck Dismiss Notices button on the Custom Code page.', 'bulletproof-security').'
';
$text .= '
';
echo $text;
echo '
';
}
if ( ! get_user_meta($user_id, 'bps_bonus_code_dismiss_all_notice') ) {
if ( ! get_user_meta($user_id, 'bps_brute_force_login_protection_notice') || ! get_user_meta($user_id, 'bps_speed_boost_cache_notice') || ! get_user_meta($user_id, 'bps_author_enumeration_notice') || ! get_user_meta($user_id, 'bps_xmlrpc_ddos_notice') || ! get_user_meta($user_id, 'bps_post_request_attack_notice') || ! get_user_meta($user_id, 'bps_sniff_driveby_notice') || ! get_user_meta($user_id, 'bps_iframe_clickjack_notice') ) {
$text = ''.__('Bonus Custom Code:', 'bulletproof-security').''.__('Click the links below to get Bonus Custom Code or click the Dismiss Notice links or click this ', 'bulletproof-security').'
'.__('Dismiss All Notices', 'bulletproof-security').''.__(' link. To Reset Dismiss Notices click the Reset|Recheck Dismiss Notices button on the Custom Code page.', 'bulletproof-security').'
';
}
if ( ! get_user_meta($user_id, 'bps_brute_force_login_protection_notice') ) {
$text .= '
';
}
if ( ! get_user_meta($user_id, 'bps_speed_boost_cache_notice') ) {
$text .= '
';
}
if ( ! get_user_meta($user_id, 'bps_author_enumeration_notice') ) {
$text .= '
';
}
if ( ! get_user_meta($user_id, 'bps_xmlrpc_ddos_notice') ) {
$text .= '
';
}
/*
if ( ! get_user_meta($user_id, 'bps_referer_spam_notice') ) {
$text .= '
';
}
*/
if ( ! get_user_meta($user_id, 'bps_post_request_attack_notice') ) {
$text .= '
';
}
if ( ! get_user_meta($user_id, 'bps_sniff_driveby_notice') ) {
$text .= '
';
}
if ( ! get_user_meta($user_id, 'bps_iframe_clickjack_notice') ) {
$text .= '
';
}
echo $text;
if ( ! get_user_meta($user_id, 'bps_brute_force_login_protection_notice') || ! get_user_meta($user_id, 'bps_speed_boost_cache_notice') || ! get_user_meta($user_id, 'bps_author_enumeration_notice') || ! get_user_meta($user_id, 'bps_xmlrpc_ddos_notice') || ! get_user_meta($user_id, 'bps_post_request_attack_notice') || ! get_user_meta($user_id, 'bps_sniff_driveby_notice') || ! get_user_meta($user_id, 'bps_iframe_clickjack_notice') ) {
echo '
';
}
}
}
}
add_action('admin_init', 'bpsPro_bonus_custom_code_nag_ignores');
function bpsPro_bonus_custom_code_nag_ignores() {
global $current_user;
$user_id = $current_user->ID;
if ( isset($_GET['bps_bonus_code_dismiss_all_nag_ignore']) && '0' == $_GET['bps_bonus_code_dismiss_all_nag_ignore'] ) {
add_user_meta($user_id, 'bps_bonus_code_dismiss_all_notice', 'true', true);
}
if ( isset($_GET['bps_brute_force_login_protection_nag_ignore']) && '0' == $_GET['bps_brute_force_login_protection_nag_ignore'] ) {
add_user_meta($user_id, 'bps_brute_force_login_protection_notice', 'true', true);
}
if ( isset($_GET['bps_speed_boost_cache_nag_ignore']) && '0' == $_GET['bps_speed_boost_cache_nag_ignore'] ) {
add_user_meta($user_id, 'bps_speed_boost_cache_notice', 'true', true);
}
if ( isset($_GET['bps_author_enumeration_nag_ignore']) && '0' == $_GET['bps_author_enumeration_nag_ignore'] ) {
add_user_meta($user_id, 'bps_author_enumeration_notice', 'true', true);
}
if ( isset($_GET['bps_xmlrpc_ddos_nag_ignore']) && '0' == $_GET['bps_xmlrpc_ddos_nag_ignore'] ) {
add_user_meta($user_id, 'bps_xmlrpc_ddos_notice', 'true', true);
}
/*
if ( isset($_GET['bps_referer_spam_nag_ignore']) && '0' == $_GET['bps_referer_spam_nag_ignore'] ) {
add_user_meta($user_id, 'bps_referer_spam_notice', 'true', true);
}
*/
if ( isset($_GET['bps_post_request_attack_nag_ignore']) && '0' == $_GET['bps_post_request_attack_nag_ignore'] ) {
add_user_meta($user_id, 'bps_post_request_attack_notice', 'true', true);
}
if ( isset($_GET['bps_sniff_driveby_nag_ignore']) && '0' == $_GET['bps_sniff_driveby_nag_ignore'] ) {
add_user_meta($user_id, 'bps_sniff_driveby_notice', 'true', true);
}
if ( isset($_GET['bps_iframe_clickjack_nag_ignore']) && '0' == $_GET['bps_iframe_clickjack_nag_ignore'] ) {
add_user_meta($user_id, 'bps_iframe_clickjack_notice', 'true', true);
}
}
// Heads Up Display w/ Dismiss - Check if php.ini handler code exists in root .htaccess file, but not in Custom Code
// .53.6: Additional conditional check added for Wordfence WAF Firewall mess.
function bps_hud_PhpiniHandlerCheck() {
global $current_user;
$user_id = $current_user->ID;
$file = ABSPATH . '.htaccess';
$pre_background_image_url = site_url( '/wp-content/plugins/bulletproof-security/admin/images/pre_bg.png' );
if ( esc_html($_SERVER['QUERY_STRING']) == 'page=bulletproof-security/admin/wizard/wizard.php' && ! get_user_meta($user_id, 'bps_ignore_PhpiniHandler_notice') ) {
if ( file_exists($file) ) {
$file_contents = @file_get_contents($file);
$CustomCodeoptions = get_option('bulletproof_security_options_customcode');
preg_match_all('/AddHandler|SetEnv PHPRC|suPHP_ConfigPath|Action application/', $file_contents, $matches);
preg_match_all('/AddHandler|SetEnv PHPRC|suPHP_ConfigPath|Action application/', $CustomCodeoptions['bps_customcode_one'], $DBmatches);
if ( $matches[0] && ! $DBmatches[0] ) {
preg_match_all('/(([#\s]{1,}|)(AddHandler|SetEnv PHPRC|suPHP_ConfigPath|Action application).*\s*){1,}/', $file_contents, $h_matches );
if ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) != 'wp-admin' ) {
$bps_base = basename(esc_html($_SERVER['REQUEST_URI'])) . '?';
} elseif ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) == 'wp-admin' ) {
$bps_base = basename( str_replace( 'wp-admin', 'index.php?', esc_html($_SERVER['REQUEST_URI'])));
} else {
$bps_base = str_replace( admin_url(), '', esc_html($_SERVER['REQUEST_URI']) ) . '&';
}
if ( stripos( $file_contents, "Wordfence WAF" ) ) {
$text = ''.__('HUD Check: Wordfence PHP/php.ini handler htaccess code detected', 'bulletproof-security').''.__('Wordfence PHP/php.ini handler htaccess code was found in your root .htaccess file, but was NOT found in BPS Custom Code.', 'bulletproof-security').'
'.__('Click Here', 'bulletproof-security').''.__(' for the steps to fix this Wordfence problem before running the Setup Wizard.', 'bulletproof-security').'
'.__('CAUTION: ', 'bulletproof-security').''.__('Using the Wordfence WAF Firewall may cause serious/critical problems for your website and BPS.', 'bulletproof-security').'
'.__('To Dismiss this Notice click the Dismiss Notice button below. To Reset Dismiss Notices click the Reset|Recheck Dismiss Notices button on the Custom Code page.', 'bulletproof-security').'
';
echo $text;
} else {
$text = ''.__('HUD Check: PHP/php.ini handler htaccess code check', 'bulletproof-security').''.__('PHP/php.ini handler htaccess code was found in your root .htaccess file, but was NOT found in BPS Custom Code.', 'bulletproof-security').'
'.__('To automatically fix this click here: ', 'bulletproof-security').'
'.esc_attr__('Setup Wizard Pre-Installation Checks', 'bulletproof-security').''.__('The Setup Wizard Pre-Installation Checks feature will automatically fix this just by visiting the Setup Wizard page.', 'bulletproof-security').'
'.__('To Dismiss this Notice click the Dismiss Notice button below. To Reset Dismiss Notices click the Reset|Recheck Dismiss Notices button on the Custom Code page.', 'bulletproof-security').'
';
echo $text;
echo '';
echo '# PHP/php.ini handler htaccess code
';
foreach ( $h_matches[0] as $Key => $Value ) {
echo $Value;
}
echo '
';
}
}
}
}
if ( esc_html($_SERVER['QUERY_STRING']) != 'page=bulletproof-security/admin/wizard/wizard.php' && ! get_user_meta($user_id, 'bps_ignore_PhpiniHandler_notice') ) {
if ( file_exists($file) ) {
$file_contents = @file_get_contents($file);
$CustomCodeoptions = get_option('bulletproof_security_options_customcode');
preg_match_all('/AddHandler|SetEnv PHPRC|suPHP_ConfigPath|Action application/', $file_contents, $matches);
preg_match_all('/AddHandler|SetEnv PHPRC|suPHP_ConfigPath|Action application/', $CustomCodeoptions['bps_customcode_one'], $DBmatches);
if ( $matches[0] && ! $DBmatches[0] ) {
preg_match_all('/(([#\s]{1,}|)(AddHandler|SetEnv PHPRC|suPHP_ConfigPath|Action application).*\s*){1,}/', $file_contents, $h_matches );
if ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) != 'wp-admin' ) {
$bps_base = basename(esc_html($_SERVER['REQUEST_URI'])) . '?';
} elseif ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) == 'wp-admin' ) {
$bps_base = basename( str_replace( 'wp-admin', 'index.php?', esc_html($_SERVER['REQUEST_URI'])));
} else {
$bps_base = str_replace( admin_url(), '', esc_html($_SERVER['REQUEST_URI']) ) . '&';
}
if ( stripos( $file_contents, "Wordfence WAF" ) ) {
$text = ''.__('HUD Check: Wordfence PHP/php.ini handler htaccess code detected', 'bulletproof-security').''.__('Wordfence PHP/php.ini handler htaccess code was found in your root .htaccess file, but was NOT found in BPS Custom Code.', 'bulletproof-security').'
'.__('Click Here', 'bulletproof-security').''.__(' for the steps to fix this Wordfence problem.', 'bulletproof-security').'
'.__('CAUTION: ', 'bulletproof-security').''.__('Using the Wordfence WAF Firewall may cause serious/critical problems for your website and BPS.', 'bulletproof-security').'
'.__('To Dismiss this Notice click the Dismiss Notice button below. To Reset Dismiss Notices click the Reset|Recheck Dismiss Notices button on the Custom Code page.', 'bulletproof-security').'
';
echo $text;
} else {
$text = ''.__('HUD Check: PHP/php.ini handler htaccess code check', 'bulletproof-security').''.__('PHP/php.ini handler htaccess code was found in your root .htaccess file, but was NOT found in BPS Custom Code.', 'bulletproof-security').'
'.__('To automatically fix this click here: ', 'bulletproof-security').'
'.esc_attr__('Setup Wizard Pre-Installation Checks', 'bulletproof-security').''.__('The Setup Wizard Pre-Installation Checks feature will automatically fix this just by visiting the Setup Wizard page.', 'bulletproof-security').'
'.__('To Dismiss this Notice click the Dismiss Notice button below. To Reset Dismiss Notices click the Reset|Recheck Dismiss Notices button on the Custom Code page.', 'bulletproof-security').'
';
echo $text;
echo '';
echo '# PHP/php.ini handler htaccess code
';
foreach ( $h_matches[0] as $Key => $Value ) {
echo $Value;
}
echo '
';
}
}
}
}
}
add_action('admin_init', 'bps_PhpiniHandler_nag_ignore');
function bps_PhpiniHandler_nag_ignore() {
global $current_user;
$user_id = $current_user->ID;
if ( isset( $_GET['bps_PhpiniHandler_nag_ignore'] ) && '0' == $_GET['bps_PhpiniHandler_nag_ignore'] ) {
add_user_meta($user_id, 'bps_ignore_PhpiniHandler_notice', 'true', true);
}
}
// Heads Up Display w/ Dismiss - Sucuri Restrict wp-content access Hardening Option wp-content .htaccess file problem - breaks BPS and lots of other stuff
// Unfortunately the limited whitelisting options provided by Sucuri in their settings don't provide any workable solutions for BPS.
// Defender Security also does this retarded thing.
## 3.5: updated this check due to changes in the Sucuri wp-content htaccess file.
## 3.7: updated the error message to include Defender Security.
## 3.8: updated the error message to include older versions of iThemes Security. Newer versions of iThemes Security now create root htaccess code that does not break things.
function bps_hud_check_sucuri() {
$filename = WP_CONTENT_DIR . '/.htaccess';
if ( ! file_exists($filename) ) {
return;
}
$file_contents = @file_get_contents($filename);
if ( file_exists($filename) ) {
if ( preg_match( '/(Require\sall\sdenied|Deny\sfrom\sall)/', $file_contents ) ) {
global $current_user;
$user_id = $current_user->ID;
if ( ! get_user_meta($user_id, 'bps_ignore_sucuri_notice') ) {
if ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) != 'wp-admin' ) {
$bps_base = basename(esc_html($_SERVER['REQUEST_URI'])) . '?';
} elseif ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) == 'wp-admin' ) {
$bps_base = basename( str_replace( 'wp-admin', 'index.php?', esc_html($_SERVER['REQUEST_URI'])));
} else {
$bps_base = str_replace( admin_url(), '', esc_html($_SERVER['REQUEST_URI']) ) . '&';
}
$text = ''.__('An htaccess file has been detected in the wp-content folder that breaks BPS features and functionality', 'bulletproof-security').''.__('If you have or had the Sucuri, Defender or iThemes Security plugins installed, they create a wp-content htaccess file that breaks several things in BPS Pro and other plugins as well.', 'bulletproof-security').'
'.__('To fix the Sucuri problem go to the Sucuri Settings page, click the Hardening tab and click the Revert Hardening button for the Block PHP Files in WP-CONTENT Directory option setting.', 'bulletproof-security').'
'.__('To fix the Defender Security problem go to the Security Tweaks page, click the PHP Execution option setting and click the Revert button.', 'bulletproof-security').'
'.__('o fix the iThemes problem go to the System Tweaks page, uncheck the Disable PHP in Plugins option setting.', 'bulletproof-security').'
'.__('To Dismiss this Notice click the Dismiss Notice button below. To Reset Dismiss Notices click the Reset|Recheck Dismiss Notices button on the Custom Code page.', 'bulletproof-security').'
';
echo $text;
}
}
}
}
add_action('admin_init', 'bps_sucuri_nag_ignore');
function bps_sucuri_nag_ignore() {
global $current_user;
$user_id = $current_user->ID;
if ( isset( $_GET['bps_sucuri_nag_ignore'] ) && '0' == $_GET['bps_sucuri_nag_ignore'] ) {
add_user_meta($user_id, 'bps_ignore_sucuri_notice', 'true', true);
}
}
// Heads Up Display w/ Dismiss - WordPress Firewall 2 plugin - breaks BPS and lots of other stuff
function bps_hud_check_wordpress_firewall2() {
$firewall2 = 'wordpress-firewall-2/wordpress-firewall-2.php';
$firewall2_active = in_array( $firewall2, apply_filters('active_plugins', get_option('active_plugins')));
if ( $firewall2_active != 1 && ! is_plugin_active_for_network( $firewall2 ) ) {
return;
}
if ( $firewall2_active == 1 || is_plugin_active_for_network( $firewall2 ) ) {
global $current_user;
$user_id = $current_user->ID;
if ( ! get_user_meta($user_id, 'bps_ignore_wpfirewall2_notice') ) {
if ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) != 'wp-admin' ) {
$bps_base = basename(esc_html($_SERVER['REQUEST_URI'])) . '?';
} elseif ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) == 'wp-admin' ) {
$bps_base = basename( str_replace( 'wp-admin', 'index.php?', esc_html($_SERVER['REQUEST_URI'])));
} else {
$bps_base = str_replace( admin_url(), '', esc_html($_SERVER['REQUEST_URI']) ) . '&';
}
$text = ''.__('The WordPress Firewall 2 plugin is installed and activated', 'bulletproof-security').''.__('It is recommended that you delete the WordPress Firewall 2 plugin.', 'bulletproof-security').'
'.__('Click Here', 'bulletproof-security').''.__(' for more information.', 'bulletproof-security').'
'.__('To Dismiss this Notice click the Dismiss Notice button below. To Reset Dismiss Notices click the Reset|Recheck Dismiss Notices button on the Custom Code page.', 'bulletproof-security').'
';
echo $text;
}
}
}
add_action('admin_init', 'bps_wpfirewall2_nag_ignore');
function bps_wpfirewall2_nag_ignore() {
global $current_user;
$user_id = $current_user->ID;
if ( isset( $_GET['bps_wpfirewall2_nag_ignore'] ) && '0' == $_GET['bps_wpfirewall2_nag_ignore'] ) {
add_user_meta($user_id, 'bps_ignore_wpfirewall2_notice', 'true', true);
}
}
// Check for older BPS Query String Exploits code saved to BPS Custom Code
function bps_hud_BPSQSE_old_code_check() {
$CustomCodeoptions = get_option('bulletproof_security_options_customcode');
if ( $CustomCodeoptions['bps_customcode_bpsqse'] == '' ) {
return;
}
$subject = $CustomCodeoptions['bps_customcode_bpsqse'];
$pattern1 = '/RewriteCond\s%{QUERY_STRING}\s\(\\\.\/\|\\\.\.\/\|\\\.\.\.\/\)\+\(motd\|etc\|bin\)\s\[NC,OR\]/';
$pattern2 = '/RewriteCond\s%\{THE_REQUEST\}\s(.*)\?(.*)\sHTTP\/\s\[NC,OR\]\s*RewriteCond\s%\{THE_REQUEST\}\s(.*)\*(.*)\sHTTP\/\s\[NC,OR\]/';
$pattern3 = '/RewriteCond\s%\{THE_REQUEST\}\s.*\?\+\(%20\{1,\}.*\s*RewriteCond\s%\{THE_REQUEST\}\s.*\+\(.*\*\|%2a.*\s\[NC,OR\]/';
if ( $CustomCodeoptions['bps_customcode_bpsqse'] != '' && preg_match($pattern1, $subject, $matches) || preg_match($pattern2, $subject, $matches) || preg_match($pattern3, $subject, $matches) ) {
$text = ''.__('Notice: BPS Query String Exploits Code Changes', 'bulletproof-security').'
'.__('Older BPS Query String Exploits code was found in BPS Custom Code. Several Query String Exploits rules were changed/added/modified in the root .htaccess file in BPS .49.6, .50.2 & .50.3.', 'bulletproof-security').'
'.__('Copy the new Query String Exploits section of code from your root .htaccess file and paste it into this BPS Custom Code text box: CUSTOM CODE BPSQSE BPS QUERY STRING EXPLOITS and click the Save Root Custom Code button.', 'bulletproof-security').'
'.__('This Notice will go away once you have copied the new Query String Exploits code to BPS Custom Code and clicked the Save Root Custom Code button.', 'bulletproof-security').'
';
echo $text;
}
}
// Heads Up Display - Check if the /bps-backup/.htaccess file exists
function bpsPro_BBM_htaccess_check() {
// New BPS installation - do not check or display error
if ( ! get_option('bulletproof_security_options_wizard_free') ) {
return;
}
$options = get_option('bulletproof_security_options_monitor');
$HFiles_options = get_option('bulletproof_security_options_htaccess_files');
$filename = WP_CONTENT_DIR . '/bps-backup/.htaccess';
$bps_wpcontent_dir = str_replace( ABSPATH, '', WP_CONTENT_DIR );
if ( ! file_exists($filename) && $HFiles_options['bps_htaccess_files'] != 'disabled' && @$_POST['Submit-BBM-Activate'] != true ) {
$text = ''.__('BPS Alert! A BPS htaccess file was NOT found in the BPS Backup folder: ', 'bulletproof-security').'/'.$bps_wpcontent_dir.'/bps-backup/'.__('Go to the ', 'bulletproof-security').'
'.esc_attr__('Security Modes page', 'bulletproof-security').''.__(' and click the BPS Backup Folder BulletProof Mode Activate button.', 'bulletproof-security').'
';
echo $text;
}
}
## Checks for older BPS Speed Boost Cache code saved in BPS Custom Code
## 2.0: Checks for redundant Browser caching code & the BPS NOCHECK Marker in BPS Custom Code
function bpsPro_hud_speed_boost_cache_code() {
$CC_options = get_option('bulletproof_security_options_customcode');
$bps_customcode_one = htmlspecialchars_decode( $CC_options['bps_customcode_one'], ENT_QUOTES );
if ( $CC_options['bps_customcode_one'] == '' || strpos( $bps_customcode_one, "BPS NOCHECK" ) ) {
return;
}
if ( @$_POST['bps_customcode_submit'] == true ) {
return;
}
global $current_user;
$user_id = $current_user->ID;
$pattern1 = '/BEGIN\sWEBSITE\sSPEED\sBOOST/';
$pattern2 = '/AddOutputFilterByType\sDEFLATE\stext\/plain\s*AddOutputFilterByType\sDEFLATE\stext\/html\s*AddOutputFilterByType\sDEFLATE\stext\/xml\s*AddOutputFilterByType\sDEFLATE\stext\/css\s*AddOutputFilterByType\sDEFLATE\sapplication\/xml\s*AddOutputFilterByType\sDEFLATE\sapplication\/xhtml\+xml\s*AddOutputFilterByType\sDEFLATE\sapplication\/rss\+xml\s*AddOutputFilterByType\sDEFLATE\sapplication\/javascript\s*AddOutputFilterByType\sDEFLATE\sapplication\/x-javascript\s*AddOutputFilterByType\sDEFLATE\sapplication\/x-httpd-php\s*AddOutputFilterByType\sDEFLATE\sapplication\/x-httpd-fastphp\s*AddOutputFilterByType\sDEFLATE\simage\/svg\+xml/';
if ( ! get_user_meta($user_id, 'bpsPro_ignore_speed_boost_notice') ) {
if ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) != 'wp-admin' ) {
$bps_base = basename(esc_html($_SERVER['REQUEST_URI'])) . '?';
} elseif ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) == 'wp-admin' ) {
$bps_base = basename( str_replace( 'wp-admin', 'index.php?', esc_html($_SERVER['REQUEST_URI'])));
} else {
$bps_base = str_replace( admin_url(), '', esc_html($_SERVER['REQUEST_URI']) ) . '&';
}
if ( preg_match( $pattern1, htmlspecialchars_decode( $CC_options['bps_customcode_one'], ENT_QUOTES ), $matches1 ) && preg_match( $pattern2, htmlspecialchars_decode( $CC_options['bps_customcode_one'], ENT_QUOTES ), $matches2 ) ) {
$text = ''.__('New Improved BPS Speed Boost Cache Code', 'bulletproof-security').''.__('Older BPS Speed Boost Cache Code was found saved in this BPS Custom Code text box: CUSTOM CODE TOP PHP/PHP.INI HANDLER/CACHE CODE', 'bulletproof-security').'.
'.__('Newer improved BPS Speed Boost Cache Code has been created, which should improve website load speed performance even more.', 'bulletproof-security').'
'.__('Get The New Improved BPS Speed Boost Cache Code', 'bulletproof-security').''.__('. To dismiss this Notice click the Dismiss Notice button below.', 'bulletproof-security').'
'.__('To Reset Dismiss Notices click the Reset|Recheck Dismiss Notices button on the Custom Code page.', 'bulletproof-security').'
';
echo $text;
}
if ( strpos( $bps_customcode_one, "WEBSITE SPEED BOOST" ) ) {
if ( strpos( $bps_customcode_one, "WPSuperCache" ) || strpos( $bps_customcode_one, "W3TC Browser Cache" ) || strpos( $bps_customcode_one, "Comet Cache" ) || strpos( $bps_customcode_one, "GzipWpFastestCache" ) || strpos( $bps_customcode_one, "LBCWpFastestCache" ) || strpos( $bps_customcode_one, "WP Rocket" ) ) {
$text = ''.__('BPS Speed Boost Cache Custom Code Notice', 'bulletproof-security').''.__('BPS Speed Boost Cache Code was found in this BPS Custom Code text box: CUSTOM CODE TOP PHP/PHP.INI HANDLER/CACHE CODE', 'bulletproof-security').'
'.__('and another caching plugin\'s Marker text was also found in this BPS Custom Code text box.', 'bulletproof-security').'
'.__('Click this link: ', 'bulletproof-security').'
'.__('BPS Speed Boost Cache Custom Code Notice Forum Topic', 'bulletproof-security').''.__(' for help information on what this Notice means and what to do next.', 'bulletproof-security').'
';
echo $text;
}
}
}
}
add_action('admin_init', 'bpsPro_hud_speed_boost_nag_ignore');
function bpsPro_hud_speed_boost_nag_ignore() {
global $current_user;
$user_id = $current_user->ID;
if ( isset($_GET['bpsPro_hud_speed_boost_nag_ignore']) && '0' == $_GET['bpsPro_hud_speed_boost_nag_ignore'] ) {
add_user_meta($user_id, 'bpsPro_ignore_speed_boost_notice', 'true', true);
}
}
// Heads Up Display w/ Dismiss - BPS Plugin AutoUpdate
// Notes: Only Display the AutoUpdate Dimiss Notice if the Bonus Custom Code Dismiss Notice is not being displayed (display after the BCC Dimiss Notice).
// There are 3 common scenarios: only the dismiss all notice link was clicked, some of the individual dismiss notices were clicked and
// the dismiss all notice link was clicked and only all individual dimiss notice links were clicked, but not the dismiss all notice link.
// which leaves 2 possible conditions: either the dismiss all notice value == true or all other dismiss notice values == true.
// 1.2: New BPS MU Tools file created.
function bps_hud_check_autoupdate() {
$MUTools_Options = get_option('bulletproof_security_options_MU_tools_free');
if ( $MUTools_Options['bps_mu_tools_enable_disable_autoupdate'] == 'disable' ) {
global $current_user;
$user_id = $current_user->ID;
$bcc_dismiss_all = get_user_meta($user_id, 'bps_bonus_code_dismiss_all_notice');
$bcc1 = get_user_meta($user_id, 'bps_brute_force_login_protection_notice');
$bcc2 = get_user_meta($user_id, 'bps_speed_boost_cache_notice');
$bcc3 = get_user_meta($user_id, 'bps_author_enumeration_notice');
$bcc4 = get_user_meta($user_id, 'bps_xmlrpc_ddos_notice');
$bcc5 = get_user_meta($user_id, 'bps_post_request_attack_notice');
$bcc6 = get_user_meta($user_id, 'bps_sniff_driveby_notice');
$bcc7 = get_user_meta($user_id, 'bps_iframe_clickjack_notice');
if ( true == $bcc_dismiss_all || true == $bcc1 && true == $bcc2 && true == $bcc3 && true == $bcc4 && true == $bcc5 && true == $bcc6 && true == $bcc7 ) {
if ( ! get_user_meta($user_id, 'bps_ignore_autoupdate_notice') ) {
if ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) != 'wp-admin' ) {
$bps_base = basename(esc_html($_SERVER['REQUEST_URI'])) . '?';
} elseif ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) == 'wp-admin' ) {
$bps_base = basename( str_replace( 'wp-admin', 'index.php?', esc_html($_SERVER['REQUEST_URI'])));
} else {
$bps_base = str_replace( admin_url(), '', esc_html($_SERVER['REQUEST_URI']) ) . '&';
}
if ( is_multisite() ) {
$bps_mu_link = ''.esc_attr__('BPS Plugin AutoUpdates', 'bulletproof-security').'';
} else {
$bps_mu_link = ''.esc_attr__('BPS Plugin AutoUpdates', 'bulletproof-security').'';
}
$text = ''.__('BPS Plugin Automatic Update Notice', 'bulletproof-security').''.__('Would you like to have BPS plugin updates installed automatically? Click this link: ', 'bulletproof-security').$bps_mu_link.__(' and click the BPS MU Tools Enable BPS Plugin AutoUpdates link.', 'bulletproof-security').'
'.__('To Dismiss this Notice click the Dismiss Notice button below. To Reset Dismiss Notices click the Reset|Recheck Dismiss Notices button on the Custom Code page.', 'bulletproof-security').'
';
echo $text;
}
}
}
}
add_action('admin_init', 'bps_autoupdate_nag_ignore');
function bps_autoupdate_nag_ignore() {
global $current_user;
$user_id = $current_user->ID;
if ( isset( $_GET['bps_autoupdate_nag_ignore'] ) && '0' == $_GET['bps_autoupdate_nag_ignore'] ) {
add_user_meta($user_id, 'bps_ignore_autoupdate_notice', 'true', true);
}
}
// Heads Up Display w/ Dismiss - MScan first run notice
function bpsPro_hud_mscan_notice() {
if ( esc_html($_SERVER['QUERY_STRING']) == 'page=bulletproof-security/admin/mscan/mscan.php' ) {
global $current_user;
$user_id = $current_user->ID;
if ( ! get_user_meta($user_id, 'bps_ignore_mscan_notice') ) {
$text = ''.__('MScan First Run Notice', 'bulletproof-security').''.__('Please take a few minutes to read the "Basic Info|Recommendations|Limitations|Restrictions" help section in the', 'bulletproof-security').'
'.__('MScan Malware Scanner Guide', 'bulletproof-security').' '.__('before running a scan.', 'bulletproof-security').'
'.__('It is highly recommended that you use the Scan Time Estimate Tool before running an actual scan. The Scan Time Estimate Tool calculates the total estimated time of a scan based on your MScan Option settings without actually running a scan. To Dismiss this Notice click the Dismiss Notice button below. To Reset Dismiss Notices click the Reset|Recheck Dismiss Notices button on the BPS Custom Code page.', 'bulletproof-security').'
';
echo $text;
}
}
}
add_action('admin_init', 'bpsPro_mscan_nag_ignore');
function bpsPro_mscan_nag_ignore() {
global $current_user;
$user_id = $current_user->ID;
if ( isset($_GET['bps_mscan_nag_ignore']) && '0' == $_GET['bps_mscan_nag_ignore'] ) {
add_user_meta($user_id, 'bps_ignore_mscan_notice', 'true', true);
}
}
// Heads Up Display w/ Dismiss - JTC-Lite New Feature Dismiss Notice
function bpsPro_hud_jtc_lite_notice() {
$jtc_options = get_option('bulletproof_security_options_login_security_jtc');
if ( $jtc_options['bps_jtc_login_form'] == '0' ) {
global $current_user;
$user_id = $current_user->ID;
if ( ! get_user_meta($user_id, 'bps_ignore_jtc_lite_notice') ) {
if ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) != 'wp-admin' ) {
$bps_base = basename(esc_html($_SERVER['REQUEST_URI'])) . '?';
} elseif ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) == 'wp-admin' ) {
$bps_base = basename( str_replace( 'wp-admin', 'index.php?', esc_html($_SERVER['REQUEST_URI'])));
} else {
$bps_base = str_replace( admin_url(), '', esc_html($_SERVER['REQUEST_URI']) ) . '&';
}
$text = ''.__('BPS New Feature Notice: JTC-Lite', 'bulletproof-security').''.__('JTC-Lite protects the WordPress Login page Form against automated SpamBot and HackerBot Brute Force Login attacks', 'bulletproof-security').'
'.__('and also prevents User Accounts from being locked repeatedly by Brute Force Login Bot attacks on your Login page Form.', 'bulletproof-security').'
'.__('To enable/turn On JTC-Lite, click this ', 'bulletproof-security').'
'.esc_attr__('JTC-Lite link', 'bulletproof-security').''.__('. Click/check the Login Form Checkbox and click the Save Options button.', 'bulletproof-security').'
'.__('To Dismiss this Notice click the Dismiss Notice button below. To Reset Dismiss Notices click the Reset|Recheck Dismiss Notices button on the BPS Custom Code page.', 'bulletproof-security').'
';
echo $text;
}
}
}
add_action('admin_init', 'bpsPro_jtc_lite_nag_ignore');
function bpsPro_jtc_lite_nag_ignore() {
global $current_user;
$user_id = $current_user->ID;
if ( isset($_GET['bpsPro_jtc_lite_nag_ignore']) && '0' == $_GET['bpsPro_jtc_lite_nag_ignore'] ) {
add_user_meta($user_id, 'bps_ignore_jtc_lite_notice', 'true', true);
}
}
// Heads Up Display w/ Dismiss - BPS plugin 30 day review/rating request Dismiss Notice
function bpsPro_hud_rate_notice() {
global $current_user, $pagenow;
$user_id = $current_user->ID;
if ( ! get_option('bulletproof_security_options_rate_free') ) {
return;
}
$options = get_option('bulletproof_security_options_rate_free');
if ( time() >= $options['bps_free_rate_review'] ) {
if ( preg_match( '/page=bulletproof-security/', esc_html($_SERVER['REQUEST_URI']), $matches) || 'update-core.php' == $pagenow || 'plugins.php' == $pagenow ) {
if ( ! get_user_meta($user_id, 'bps_ignore_rate_notice') ) {
if ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) != 'wp-admin' ) {
$bps_base = basename(esc_html($_SERVER['REQUEST_URI'])) . '?';
} elseif ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) == 'wp-admin' ) {
$bps_base = basename( str_replace( 'wp-admin', 'index.php?', esc_html($_SERVER['REQUEST_URI'])));
} else {
$bps_base = str_replace( admin_url(), '', esc_html($_SERVER['REQUEST_URI']) ) . '&';
}
$text = ''.__('BPS Plugin Star Rating Request', 'bulletproof-security').''.__('A BPS star rating only takes a couple of minutes and would be very much appreciated. We are looking for 5 star ratings and not "fancy" reviews.', 'bulletproof-security').'
'.__('A simple review like "works great" or "has been protecting my website for X months or X years" is perfect.', 'bulletproof-security').'
'.__('Click this link to submit a BPS Plugin Star Rating: ', 'bulletproof-security').'
'.__('BPS Plugin Star Rating', 'bulletproof-security').', '.__('login to the WordPress.org site and scroll to the bottom of the Reviews page.', 'bulletproof-security').'
'.__('To Dismiss this one-time Notice click the Dismiss Notice button below. To Reset Dismiss Notices click the Reset|Recheck Dismiss Notices button on the BPS Custom Code page.', 'bulletproof-security').'
';
echo $text;
}
}
}
}
add_action('admin_init', 'bpsPro_rate_nag_ignore');
function bpsPro_rate_nag_ignore() {
global $current_user;
$user_id = $current_user->ID;
if ( isset($_GET['bpsPro_rate_nag_ignore']) && '0' == $_GET['bpsPro_rate_nag_ignore'] ) {
add_user_meta($user_id, 'bps_ignore_rate_notice', 'true', true);
}
}
// Heads Up Display w/ Dismiss Notice - Check if Mod Security is Loaded|Enabled. Displays a link to a help forum topic.
function bpsPro_hud_mod_security_check() {
$bps_mod_security_options = get_option('bulletproof_security_options_mod_security');
if ( $bps_mod_security_options['bps_mod_security_check'] == '1' ) {
global $current_user;
$user_id = $current_user->ID;
if ( ! get_user_meta($user_id, 'bpsPro_ignore_mod_security_notice')) {
if ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) != 'wp-admin' ) {
$bps_base = basename(esc_html($_SERVER['REQUEST_URI'])) . '?';
} elseif ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) == 'wp-admin' ) {
$bps_base = basename( str_replace( 'wp-admin', 'index.php?', esc_html($_SERVER['REQUEST_URI'])));
} else {
$bps_base = str_replace( admin_url(), '', esc_html($_SERVER['REQUEST_URI']) ) . '&';
}
$text = ''.__('BPS Notice: Mod Security Module is Loaded|Enabled', 'bulletproof-security').''.__('Please take a minute to view this Mod Security help forum topic: ', 'bulletproof-security').'
'.__('Mod Security Common Known Problems', 'bulletproof-security').'.
'.__('If you are not experiencing any of the problems listed in the Mod Security help forum topic then you can dismiss this Dismiss Notice.', 'bulletproof-security').'
'.__('To Dismiss this Notice click the Dismiss Notice button below. To Reset Dismiss Notices click the Reset|Recheck Dismiss Notices button on the BPS Custom Code page.', 'bulletproof-security').'
';
echo $text;
}
}
}
add_action('admin_init', 'bpsPro_mod_security_nag_ignore');
function bpsPro_mod_security_nag_ignore() {
global $current_user;
$user_id = $current_user->ID;
if ( isset($_GET['bpsPro_mod_security_nag_ignore']) && '0' == $_GET['bpsPro_mod_security_nag_ignore'] ) {
add_user_meta($user_id, 'bpsPro_ignore_mod_security_notice', 'true', true);
}
}
// Heads Up Display w/ Dismiss Notice - GDPR Compliance Dismiss Notice. Displays a link to a help forum topic.
function bpsPro_hud_gdpr_compliance() {
global $current_user;
$user_id = $current_user->ID;
if ( ! get_user_meta($user_id, 'bpsPro_ignore_gdpr_compliance_notice')) {
if ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) != 'wp-admin' ) {
$bps_base = basename(esc_html($_SERVER['REQUEST_URI'])) . '?';
} elseif ( esc_html($_SERVER['QUERY_STRING']) == '' && basename(esc_html($_SERVER['REQUEST_URI'])) == 'wp-admin' ) {
$bps_base = basename( str_replace( 'wp-admin', 'index.php?', esc_html($_SERVER['REQUEST_URI'])));
} else {
$bps_base = str_replace( admin_url(), '', esc_html($_SERVER['REQUEST_URI']) ) . '&';
}
$text = ''.__('BPS GDPR Compliance Notice', 'bulletproof-security').''.__('A new Setup Wizard Option has been created which allows you to turn off all IP address logging in BPS to make your website GDPR Compliant.', 'bulletproof-security').'
'.__('Click this ', 'bulletproof-security').'
'.__('GDPR Compliance Setup Wizard Option link', 'bulletproof-security').'. '.__('Choose the GDPR Compliance On setting.', 'bulletproof-security').'
'.__('For more information about GDPR Compliance click this ', 'bulletproof-security').'
'.__('GDPR Compliance Forum Topic link', 'bulletproof-security').'.
'.__('To Dismiss this Notice click the Dismiss Notice button below. To Reset Dismiss Notices click the Reset|Recheck Dismiss Notices button on the BPS Custom Code page.', 'bulletproof-security').'
';
echo $text;
}
}
add_action('admin_init', 'bpsPro_gdpr_compliance_nag_ignore');
function bpsPro_gdpr_compliance_nag_ignore() {
global $current_user;
$user_id = $current_user->ID;
if ( isset($_GET['bpsPro_gdpr_compliance_nag_ignore']) && '0' == $_GET['bpsPro_gdpr_compliance_nag_ignore'] ) {
add_user_meta($user_id, 'bpsPro_ignore_gdpr_compliance_notice', 'true', true);
}
}
?>