Feature Highlights: Setup Wizard • MScan Malware Scanner • .htaccess Website Security Protection (Firewalls) • Security Logging|HTTP Error Logging • DB Backup • DB Table Prefix Changer • Login Security & Monitoring • JTC-Lite Login Form Bot Lockout Protection • Idle Session Logout (ISL) • Auth Cookie Expiration (ACE) • UI Theme Skin Changer • System Info: Extensive System, Server and Security Status Information • FrontEnd|BackEnd Maintenance Mode
Version: 4.0
Author: AITpro Website Security
Author URI: https://forum.ait-pro.com/read-me-first/
*/
/* Copyright (C) 2010-2019 Edward Alexander | AITpro.com
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// BPS Global variables
// 3.4: It is not a mistake or retarded to add the global keyword to global variables outside of functions per PHP.net, but yeah it does appear to be retarded.
// WP_CLI requires that all global variables outside of functions MUST explicitly use the global keyword since WP_CLI loads WP within a function
// and cannot access the global variables within functions in BPS. Luckily this does not break BPS or WordPress in any way and PHP.net states this is technically not an error.
global $bps_last_version, $bps_version, $aitpro_bullet, $bps_topDiv, $bps_bottomDiv, $bpsPro_remote_addr, $bpsPro_http_client_ip, $bpsPro_http_forwarded, $bpsPro_http_x_forwarded_for, $bpsPro_http_x_cluster_client_ip, $bps_wpcontent_dir, $bps_plugin_dir;
define( 'BULLETPROOF_VERSION', '4.0' );
$bps_last_version = '3.9';
$bps_version = '4.0';
$aitpro_bullet = '
';
// Top div & bottom div
$bps_topDiv = '
';
$bps_wpcontent_dir = str_replace( ABSPATH, '', WP_CONTENT_DIR );
$bps_plugin_dir = str_replace( ABSPATH, '', WP_PLUGIN_DIR );
// Setup Wizard Options: GDPR Compliance Global Variables
$GDPR_Options = get_option('bulletproof_security_options_gdpr');
if ( $GDPR_Options['bps_gdpr_on_off'] != 'On' ) {
$bpsPro_remote_addr = @$_SERVER['REMOTE_ADDR'];
$bpsPro_http_client_ip = @$_SERVER['HTTP_CLIENT_IP'];
$bpsPro_http_forwarded = @$_SERVER['HTTP_FORWARDED'];
$bpsPro_http_x_forwarded_for = @$_SERVER['HTTP_X_FORWARDED_FOR'];
$bpsPro_http_x_cluster_client_ip = @$_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];
} else {
$bpsPro_remote_addr = 'GDPR Compliance On';
$bpsPro_http_client_ip = 'GDPR Compliance On';
$bpsPro_http_forwarded = 'GDPR Compliance On';
$bpsPro_http_x_forwarded_for = 'GDPR Compliance On';
$bpsPro_http_x_cluster_client_ip = 'GDPR Compliance On';
}
// Load BPS Global class - not doing anything with this Class in BPS Free
//require_once( WP_PLUGIN_DIR . '/bulletproof-security/includes/class.php' );
add_action( 'init', 'bulletproof_security_load_plugin_textdomain' );
// Load i18n Language Translation
function bulletproof_security_load_plugin_textdomain() {
load_plugin_textdomain('bulletproof-security', FALSE, dirname(plugin_basename(__FILE__)).'/languages/');
}
// BPS upgrade functions
require_once( WP_PLUGIN_DIR . '/bulletproof-security/includes/functions.php' );
// MScan AJAX functions
require_once( WP_PLUGIN_DIR . '/bulletproof-security/includes/mscan-ajax-functions.php' );
// BPS HUD Dimiss functions - includes AutoFix AutoSetup checks
require_once( WP_PLUGIN_DIR . '/bulletproof-security/includes/hud-autofix-setup.php' );
// BPS HUD Dimiss functions - includes AutoFix AutoWhitelist checks
require_once( WP_PLUGIN_DIR . '/bulletproof-security/includes/hud-autofix-whitelist.php' );
// BPS HUD Dimiss functions - General Error Checks & Misc checks
require_once( WP_PLUGIN_DIR . '/bulletproof-security/includes/hud-dismiss-functions.php' );
// BPS Zip & Email Log File Cron functions
require_once( WP_PLUGIN_DIR . '/bulletproof-security/includes/zip-email-cron-functions.php' );
// General functions
require_once( WP_PLUGIN_DIR . '/bulletproof-security/includes/general-functions.php' );
// BPS Login Security
require_once( WP_PLUGIN_DIR . '/bulletproof-security/includes/login-security.php' );
// BPS DB Backup
require_once( WP_PLUGIN_DIR . '/bulletproof-security/includes/db-security.php' );
// BPS Hidden Plugin Folders|Files (HPF) Cron
require_once( WP_PLUGIN_DIR . '/bulletproof-security/includes/hidden-plugin-folders-cron.php' );
// Idle Session Logout (ISL)
$BPS_ISL_options = get_option('bulletproof_security_options_idle_session');
if ( $BPS_ISL_options['bps_isl'] == 'On' ) {
require_once( WP_PLUGIN_DIR . '/bulletproof-security/includes/idle-session-logout.php' );
}
// PHP Encryption|Decryption class using openssl_decrypt() and openssl_encrypt()
// Web hosts may see this file as malicious and block or delete it. So a file_exists check needs to be here.
$bpsPro_encrypt_decrypt_class = WP_PLUGIN_DIR . '/bulletproof-security/includes/encrypt-decrypt-class.php';
if ( file_exists ( $bpsPro_encrypt_decrypt_class ) ) {
require_once( WP_PLUGIN_DIR . '/bulletproof-security/includes/encrypt-decrypt-class.php' );
}
// If in single site Admin Dashboard
if ( is_admin() ) {
require_once( WP_PLUGIN_DIR . '/bulletproof-security/admin/includes/admin.php' );
register_activation_hook(__FILE__, 'bulletproof_security_install');
register_deactivation_hook(__FILE__, 'bulletproof_security_deactivation');
register_uninstall_hook(__FILE__, 'bulletproof_security_uninstall');
add_action( 'admin_init', 'bulletproof_security_admin_init' );
add_action( 'admin_menu', 'bulletproof_security_admin_menu' );
}
// If in Network Admin Dashboard for BPS Uninstaller
if ( is_multisite() && is_network_admin() ) {
add_action( 'network_admin_menu', 'bulletproof_security_network_admin_menu' );
}
// "Settings" link on Plugins Options Page
function bps_plugin_actlinks( $links, $file ) {
static $this_plugin;
if ( ! $this_plugin )
$this_plugin = plugin_basename(__FILE__);
if ( $file == $this_plugin ) {
if ( ! is_multisite() ) {
$links[] = '
'.__('Setup Wizard', 'bulletproof-security').'';
$links[] = '
'.__('Uninstall Options', 'bulleproof-security').'';
} elseif ( is_multisite() ) {
$links[] = '
'.__('Setup Wizard', 'bulletproof-security').'';
// The Uninstall Options Form does not work on Network|Multisite so do not show the Uninstall Options link in Action Links
//$links[] = '
'.__('Uninstall Options', 'bulleproof-security').'';
}
}
return $links;
}
add_filter( 'plugin_action_links', 'bps_plugin_actlinks', 10, 2 );
add_filter( 'network_admin_plugin_action_links', 'bps_plugin_actlinks', 10, 2 );
// Add links on plugins page
function bps_plugin_extra_links( $links, $file ) {
static $this_plugin;
if ( ! current_user_can('install_plugins') )
return $links;
if ( ! $this_plugin )
$this_plugin = plugin_basename(__FILE__);
if ( $file == $this_plugin ) {
$links[] = ''.__('Forum - Support', 'bulleproof-security').'';
$links[] = ''.__('Upgrade', 'bulleproof-security').'';
$links[] = ''.__('BPS Pro Features', 'bulleproof-security').'';
}
return $links;
}
add_filter( 'plugin_row_meta', 'bps_plugin_extra_links', 10, 2 );
?>