'render_tab1',
'tab2' => 'render_tab2',
'tab3' => 'render_tab3',
'tab4' => 'render_tab4',
'tab5' => 'render_tab5',
);
function __construct()
{
$this->render_menu_page();
}
function set_menu_tabs()
{
$this->menu_tabs = array(
'tab1' => __('Dashboard', 'all-in-one-wp-security-and-firewall'),
'tab2' => __('System Info', 'all-in-one-wp-security-and-firewall'),
'tab3' => __('Locked IP Addresses', 'all-in-one-wp-security-and-firewall'),
'tab4' => __('Permanent Block List', 'all-in-one-wp-security-and-firewall'),
'tab5' => __('AIOWPS Logs', 'all-in-one-wp-security-and-firewall'),
);
}
function get_current_tab()
{
$tab_keys = array_keys($this->menu_tabs);
$tab = isset($_GET['tab']) ? sanitize_text_field($_GET['tab']) : $tab_keys[0];
return $tab;
}
/*
* Renders our tabs of this menu as nav items
*/
function render_menu_tabs()
{
$current_tab = $this->get_current_tab();
echo '
';
foreach ($this->menu_tabs as $tab_key => $tab_caption) {
$active = $current_tab == $tab_key ? 'nav-tab-active' : '';
echo '' . $tab_caption . ' ';
}
echo ' ';
}
/*
* The menu rendering goes here
*/
function render_menu_page()
{
echo '';
echo '
' . __('Dashboard', 'all-in-one-wp-security-and-firewall') . ' ';//Interface title
$this->set_menu_tabs();
$tab = $this->get_current_tab();
$this->render_menu_tabs();
?>
menu_tabs_handler[$tab]));
?>
wp_dashboard_setup();
wp_enqueue_script( 'dashboard' );
if ( wp_is_mobile() )
wp_enqueue_script( 'jquery-touch-punch' );
?>
wp_dashboard(); ?>
:
:
WPMU:
MySQL
: db_version();?>
WP
: prefix; ?>
PHP
:
:
WP URL:
:
:
CURL
:
:
' . $plugin_details['Name'] . ' ' . $plugin_details['Version'] . ' ' . $plugin_details['PluginURI'] . ' ';
}
?>
delete_lockdown_records(strip_tags($_REQUEST['lockdown_id']));
}
if ($_REQUEST['action'] == 'unlock_ip') { //Unlock link was clicked for a row in list table
$locked_ip_list->unlock_ip_range(strip_tags($_REQUEST['lockdown_id']));
}
}
?>
Login Lockdown';
echo '
' . __('This tab displays the list of all IP addresses which are currently temporarily locked out due to the Login Lockdown feature:', 'all-in-one-wp-security-and-firewall') . '
' .
'
' . $login_lockdown_feature_url . '
';
?>
prepare_items();
//echo "put table of locked entries here";
?>
unblock_ip_address(strip_tags($_REQUEST['blocked_id']));
}
}
AIOWPSecurity_Admin_Menu::display_bulk_result_message();
?>
' . __('This tab displays the list of all permanently blocked IP addresses.', 'all-in-one-wp-security-and-firewall') . '' .
'
' . __('NOTE: This feature does NOT use the .htaccess file to permanently block the IP addresses so it should be compatible with all web servers running WordPress.', 'all-in-one-wp-security-and-firewall') . '
';
?>
debug_logger->log_debug("Nonce check failed on dashboard view logs!", 4);
wp_die("Error! Nonce check failed on dashboard view logs!");
}
//Let's make sure that the file selected can only ever be the correct log file of this plugin.
$valid_aiowps_log_files = array('wp-security-log.txt', 'wp-security-log-cron-job.txt');
if(!in_array($file_selected, $valid_aiowps_log_files)){
$file_selected = '';
unset($_POST['aiowps_view_logs']);
wp_die(__('Error! The file you selected is not a permitted file. You can only view log files created by this plugin.','all-in-one-wp-security-and-firewall'));
}
if (!empty($file_selected)) {
?>
get_columns() );
$columns_css = '';
if ( $columns ) {
$columns_css = " columns-$columns";
}
?>
configs->get_value('aiowps_enable_brute_force_attack_prevention') == '1' ||
$aio_wp_security->configs->get_value('aiowps_enable_rename_login_page') == '1') {
wp_add_dashboard_widget( 'brute_force', __( 'Brute Force Prevention Login Page' ), array(&$this, 'widget_brute_force') );
}
wp_add_dashboard_widget( 'logged_in_users', __( 'Logged In Users', 'all-in-one-wp-security-and-firewall' ), array(&$this, 'widget_logged_in_users') );
wp_add_dashboard_widget( 'locked_ip_addresses', __( 'Locked IP Addresses', 'all-in-one-wp-security-and-firewall' ), array(&$this, 'widget_locked_ip_addresses') );
do_action( 'aiowps_dashboard_setup' );
$dashboard_widgets = apply_filters( 'aiowps_dashboard_widgets', array() );
foreach ( $dashboard_widgets as $widget_id ) {
$name = empty( $wp_registered_widgets[$widget_id]['all_link'] ) ? $wp_registered_widgets[$widget_id]['name'] : $wp_registered_widgets[$widget_id]['name'] . " " . __('View all') . ' ';
wp_add_dashboard_widget( $widget_id, $name, $wp_registered_widgets[$widget_id]['callback'], $wp_registered_widget_controls[$widget_id]['callback'] );
}
}
function widget_security_strength_meter() {
global $aiowps_feature_mgr;
global $aio_wp_security;
$total_site_security_points = $aiowps_feature_mgr->get_total_site_points();
$total_security_points_achievable = $aiowps_feature_mgr->get_total_achievable_points();
?>
get_total_site_points();
$total_security_points_achievable = $feature_mgr->get_total_achievable_points();
$feature_items = $feature_mgr->feature_items;
$pt_src_chart_data = "";
$pt_src_chart_data .= "['Feature Name', 'Points'],";
foreach ($feature_items as $item) {
if ($item->feature_status == $feature_mgr->feature_active) {
$pt_src_chart_data .= "['" . $item->feature_name . "', " . $item->item_points . "],";
}
}
?>
Follow us on
Google+
Give us a Good Rating
WPSolutions
Tips and Tricks HQ
feature_items;
$username_admin_feature = $aiowps_feature_mgr->get_feature_item_by_id("user-accounts-change-admin-user");
echo '';
echo '
';
$login_lockdown_feature = $aiowps_feature_mgr->get_feature_item_by_id("user-login-login-lockdown");
echo '';
echo '
';
$filesystem_feature = $aiowps_feature_mgr->get_feature_item_by_id("filesystem-file-permissions");
echo '';
echo '
';
$basic_firewall_feature = $aiowps_feature_mgr->get_feature_item_by_id("firewall-basic-rules");
echo '';
echo '
';
}
function widget_last_5_logins() {
global $wpdb;
$login_activity_table = AIOWPSEC_TBL_USER_LOGIN_ACTIVITY;
/* -- Ordering parameters -- */
//Parameters that are going to be used to order the result
isset($_GET["orderby"]) ? $orderby = strip_tags($_GET["orderby"]) : $orderby = '';
isset($_GET["order"]) ? $order = strip_tags($_GET["order"]) : $order = '';
$orderby = !empty($orderby) ? $orderby : 'login_date';
$order = !empty($order) ? $order : 'DESC';
$data = $wpdb->get_results($wpdb->prepare("SELECT * FROM $login_activity_table ORDER BY login_date DESC LIMIT %d", 5), ARRAY_A); //Get the last 5 records
if ($data == NULL) {
echo '' . __('No data found!', 'all-in-one-wp-security-and-firewall') . '
';
} else {
$login_summary_table = '';
echo '' . __('Last 5 logins summary:', 'all-in-one-wp-security-and-firewall') . '
';
$login_summary_table .= '';
$login_summary_table .= '';
$login_summary_table .= '';
$login_summary_table .= '' . __('User', 'all-in-one-wp-security-and-firewall') . ' ';
$login_summary_table .= '' . __('Date', 'all-in-one-wp-security-and-firewall') . ' ';
$login_summary_table .= '' . __('IP', 'all-in-one-wp-security-and-firewall') . ' ';
$login_summary_table .= ' ';
$login_summary_table .= ' ';
foreach ($data as $entry) {
$login_summary_table .= '';
$login_summary_table .= '' . $entry['user_login'] . ' ';
$login_summary_table .= '' . $entry['login_date'] . ' ';
$login_summary_table .= '' . $entry['login_ip'] . ' ';
$login_summary_table .= ' ';
}
$login_summary_table .= '
';
echo $login_summary_table;
}
echo '
';
}
function widget_maintenance_mode_status() {
global $aio_wp_security;
if ($aio_wp_security->configs->get_value('aiowps_site_lockout') == '1') {
echo '' . __('Maintenance mode is currently enabled. Remember to turn it off when you are done', 'all-in-one-wp-security-and-firewall') . '
';
} else {
echo '' . __('Maintenance mode is currently off.', 'all-in-one-wp-security-and-firewall') . '
';
}
echo '';
echo '
';
}
function widget_brute_force() {
global $aio_wp_security;
if ($aio_wp_security->configs->get_value('aiowps_enable_brute_force_attack_prevention') == '1') {
$brute_force_login_feature_link = '' . __('Cookie-Based Brute Force', 'all-in-one-wp-security-and-firewall') . ' ';
$brute_force_feature_secret_word = $aio_wp_security->configs->get_value('aiowps_brute_force_secret_word');
echo '';
echo '
' . sprintf(__('The %s feature is currently active.', 'all-in-one-wp-security-and-firewall'), $brute_force_login_feature_link) . '
';
echo '
' . __('Your new WordPress login URL is now:', 'all-in-one-wp-security-and-firewall') . '
';
echo '
' . AIOWPSEC_WP_URL . '/?' . $brute_force_feature_secret_word . '=1
';
echo '
'; //yellow box div
echo '
';
}//End if statement for Cookie Based Brute Prevention box
//Insert Rename Login Page feature box if this feature is active
if ($aio_wp_security->configs->get_value('aiowps_enable_rename_login_page') == '1') {
if (get_option('permalink_structure')) {
$home_url = trailingslashit(home_url());
} else {
$home_url = trailingslashit(home_url()) . '?';
}
$rename_login_feature_link = '' . __('Rename Login Page', 'all-in-one-wp-security-and-firewall') . ' ';
echo '';
echo '
' . sprintf(__('The %s feature is currently active.', 'all-in-one-wp-security-and-firewall'), $rename_login_feature_link) . '
';
echo '
' . __('Your new WordPress login URL is now:', 'all-in-one-wp-security-and-firewall') . '
';
echo '
' . $home_url . $aio_wp_security->configs->get_value('aiowps_login_page_slug') . '
';
echo '
'; //yellow box div
echo '
';
}//End if statement for Rename Login box
}
function widget_logged_in_users() {
$users_online_link = 'Logged In Users ';
if (AIOWPSecurity_Utility::is_multisite_install()) {
$logged_in_users = get_site_transient('users_online');
$num_users = count($logged_in_users);
if ($num_users > 1) {
echo '' . __('Number of users currently logged in site-wide is:', 'all-in-one-wp-security-and-firewall') . ' ' . $num_users . '
';
$info_msg = '
' . sprintf(__('Go to the %s menu to see more details', 'all-in-one-wp-security-and-firewall'), $users_online_link) . '
';
echo $info_msg . '
';
} else {
echo '' . __('There are no other site-wide users currently logged in.', 'all-in-one-wp-security-and-firewall') . '
';
}
} else {
$logged_in_users = get_transient('users_online');
if ($logged_in_users === false || $logged_in_users == NULL) {
$num_users = 0;
} else {
$num_users = count($logged_in_users);
}
if ($num_users > 1) {
echo '' . __('Number of users currently logged into your site (including you) is:', 'all-in-one-wp-security-and-firewall') . ' ' . $num_users . '
';
$info_msg = '
' . sprintf(__('Go to the %s menu to see more details', 'all-in-one-wp-security-and-firewall'), $users_online_link) . '
';
echo $info_msg . '
';
} else {
echo '' . __('There are no other users currently logged in.', 'all-in-one-wp-security-and-firewall') . '
';
}
}
}
function widget_locked_ip_addresses() {
$locked_ips_link = 'Locked IP Addresses ';
$locked_ips = AIOWPSecurity_Utility::get_locked_ips();
if ($locked_ips === FALSE) {
echo '' . __('There are no IP addresses currently locked out.', 'all-in-one-wp-security-and-firewall') . '
';
} else {
$num_ips = count($locked_ips);
echo '' . __('Number of temporarily locked out IP addresses: ', 'all-in-one-wp-security-and-firewall') . ' ' . $num_ips . '
';
$info_msg = '
' . sprintf(__('Go to the %s menu to see more details', 'all-in-one-wp-security-and-firewall'), $locked_ips_link) . '
';
echo $info_msg . '
';
}
}
} //end class