diff --git a/all-in-one-wp-security/admin/wp-security-admin-menu.php b/all-in-one-wp-security/admin/wp-security-admin-menu.php
index 107ae53..f1dad8f 100644
--- a/all-in-one-wp-security/admin/wp-security-admin-menu.php
+++ b/all-in-one-wp-security/admin/wp-security-admin-menu.php
@@ -3,6 +3,63 @@
/* Parent class for all admin menu classes */
abstract class AIOWPSecurity_Admin_Menu
{
+ /* Specify all the tabs of menu in the following array */
+ var $menu_tabs;
+
+ /**
+ * Renders menu page
+ * @param string $title Page title
+ */
+ function __construct($title)
+ {
+ $this->render_menu_page($this->get_current_tab(), $title);
+ }
+
+ /**
+ * Returns current tab from _GET parameter (checks it against defined tabs first).
+ * If no current tab is given or value is invalid, returns first tab.
+ *
+ * @return string Current tab key
+ */
+ function get_current_tab()
+ {
+ $tab_keys = array_keys($this->menu_tabs);
+ return isset($_GET['tab']) && isset($this->menu_tabs[$_GET['tab']]) ? $_GET['tab'] : $tab_keys[0];
+ }
+
+ /**
+ * Render page
+ * @param string $current_tab Current tab key
+ * @param string $title Page title
+ */
+ function render_menu_page($current_tab, $title)
+ {
+ ?>
+
+
+ render_menu_tabs($current_tab); // render page tab navigation ?>
+
+ menu_tabs_handler[$current_tab])); // render current tab content ?>
+
+
+ ';
+ foreach ( $this->menu_tabs as $tab_key => $tab_caption )
+ {
+ $active = $current_tab == $tab_key ? 'nav-tab-active' : '';
+ echo '' . $tab_caption . '';
+ }
+ echo '';
+ }
+
/**
* Shows postbox for settings menu
*
diff --git a/all-in-one-wp-security/admin/wp-security-blacklist-menu.php b/all-in-one-wp-security/admin/wp-security-blacklist-menu.php
index 2e2edb2..172fc34 100644
--- a/all-in-one-wp-security/admin/wp-security-blacklist-menu.php
+++ b/all-in-one-wp-security/admin/wp-security-blacklist-menu.php
@@ -3,68 +3,18 @@
class AIOWPSecurity_Blacklist_Menu extends AIOWPSecurity_Admin_Menu
{
var $menu_page_slug = AIOWPSEC_BLACKLIST_MENU_SLUG;
-
- /* Specify all the tabs of this menu in the following array */
- var $menu_tabs;
var $menu_tabs_handler = array(
'tab1' => 'render_tab1',
- );
-
- function __construct()
- {
- $this->render_menu_page();
- }
-
- function set_menu_tabs()
+ );
+
+ function __construct()
{
$this->menu_tabs = array(
- 'tab1' => __('Ban Users', 'all-in-one-wp-security-and-firewall'),
+ 'tab1' => __('Ban Users', '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 '
'.__('Blacklist Manager','all-in-one-wp-security-and-firewall').'
';//Interface title
- $this->set_menu_tabs();
- $tab = $this->get_current_tab();
- $this->render_menu_tabs();
- ?>
-
- menu_tabs);
- call_user_func(array(&$this, $this->menu_tabs_handler[$tab]));
- ?>
-
-
- 'render_tab1',
@@ -13,72 +10,28 @@ class AIOWPSecurity_Brute_Force_Menu extends AIOWPSecurity_Admin_Menu
'tab3' => 'render_tab3',
'tab4' => 'render_tab4',
'tab5' => 'render_tab5',
- );
-
- function __construct()
- {
- $this->render_menu_page();
- }
-
- function set_menu_tabs()
- {
- $this->menu_tabs = array(
- 'tab1' => __('Rename Login Page','all-in-one-wp-security-and-firewall'),
- 'tab2' => __('Cookie Based Brute Force Prevention', 'all-in-one-wp-security-and-firewall'),
- 'tab3' => __('Login Captcha', 'all-in-one-wp-security-and-firewall'),
- 'tab4' => __('Login Whitelist', 'all-in-one-wp-security-and-firewall'),
- 'tab5' => __('Honeypot', '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()
+ function __construct()
{
- $current_tab = $this->get_current_tab();
-
- echo '';
- foreach ( $this->menu_tabs as $tab_key => $tab_caption )
- {
- if (AIOWPSecurity_Utility::is_multisite_install() && get_current_blog_id() != 1
- && stristr($tab_caption, "Rename Login Page") === false && stristr($tab_caption, "Login Captcha") === false){
- //Suppress the all Brute Force menu tabs if site is a multi site AND not the main site except "rename login" and "captcha"
- }else{
- $active = $current_tab == $tab_key ? 'nav-tab-active' : '';
- echo '' . $tab_caption . '';
- }
+ if (AIOWPSecurity_Utility::is_multisite_install() && get_current_blog_id() != 1) {
+ // Suppress the all Brute Force menu tabs if site is a multi site AND not the main site except "rename login" and "captcha"
+ $this->menu_tabs = array(
+ 'tab1' => __('Rename Login Page','all-in-one-wp-security-and-firewall'),
+ 'tab3' => __('Login Captcha', 'all-in-one-wp-security-and-firewall'),
+ );
}
- echo '
';
- }
-
- /*
- * The menu rendering goes here
- */
- function render_menu_page()
- {
- echo '';
- echo '
'.__('Brute Force','all-in-one-wp-security-and-firewall').'
';//Interface title
- $this->set_menu_tabs();
- $tab = $this->get_current_tab();
- $this->render_menu_tabs();
- ?>
-
- menu_tabs);
- call_user_func(array(&$this, $this->menu_tabs_handler[$tab]));
- ?>
-
-
- menu_tabs = array(
+ 'tab1' => __('Rename Login Page','all-in-one-wp-security-and-firewall'),
+ 'tab2' => __('Cookie Based Brute Force Prevention', 'all-in-one-wp-security-and-firewall'),
+ 'tab3' => __('Login Captcha', 'all-in-one-wp-security-and-firewall'),
+ 'tab4' => __('Login Whitelist', 'all-in-one-wp-security-and-firewall'),
+ 'tab5' => __('Honeypot', 'all-in-one-wp-security-and-firewall'),
+ );
+ }
+
+ parent::__construct(__('Brute Force','all-in-one-wp-security-and-firewall'));
}
function render_tab1()
diff --git a/all-in-one-wp-security/admin/wp-security-dashboard-menu.php b/all-in-one-wp-security/admin/wp-security-dashboard-menu.php
index bd49f2c..7480bb7 100644
--- a/all-in-one-wp-security/admin/wp-security-dashboard-menu.php
+++ b/all-in-one-wp-security/admin/wp-security-dashboard-menu.php
@@ -2,9 +2,7 @@
class AIOWPSecurity_Dashboard_Menu extends AIOWPSecurity_Admin_Menu
{
- var $dashboard_menu_page_slug = AIOWPSEC_MAIN_MENU_SLUG;
-
- var $menu_tabs;
+ var $menu_page_slug = AIOWPSEC_MAIN_MENU_SLUG;
var $menu_tabs_handler = array(
'tab1' => 'render_tab1',
@@ -15,11 +13,6 @@ class AIOWPSecurity_Dashboard_Menu extends AIOWPSecurity_Admin_Menu
);
function __construct()
- {
- $this->render_menu_page();
- }
-
- function set_menu_tabs()
{
$this->menu_tabs = array(
'tab1' => __('Dashboard', 'all-in-one-wp-security-and-firewall'),
@@ -28,49 +21,8 @@ function set_menu_tabs()
'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);
- call_user_func(array(&$this, $this->menu_tabs_handler[$tab]));
- ?>
-
-
- 'render_tab1',
+ 'tab1' => 'render_tab1',
'tab2' => 'render_tab2',
- );
-
- function __construct()
- {
- $this->render_menu_page();
- }
-
- function set_menu_tabs()
+ );
+
+ function __construct()
{
if (AIOWPSecurity_Utility::is_multisite_install() && get_current_blog_id() != 1){
//Suppress the DB prefix change tab if site is a multi site AND not the main site
@@ -31,54 +23,11 @@ function set_menu_tabs()
'tab2' => __('DB Backup', '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 '
';
+ parent::__construct(__('Database Security','all-in-one-wp-security-and-firewall'));
}
-
- /*
- * The menu rendering goes here
- */
- function render_menu_page()
- {
- echo '';
- echo '
'.__('Database Security','all-in-one-wp-security-and-firewall').'
';//Interface title
- $this->set_menu_tabs();
- $tab = $this->get_current_tab();
- $this->render_menu_tabs();
- ?>
-
- menu_tabs);
- call_user_func(array(&$this, $this->menu_tabs_handler[$tab]));
- ?>
-
-
- prefix;
diff --git a/all-in-one-wp-security/admin/wp-security-filescan-menu.php b/all-in-one-wp-security/admin/wp-security-filescan-menu.php
index 469fb48..1da997e 100644
--- a/all-in-one-wp-security/admin/wp-security-filescan-menu.php
+++ b/all-in-one-wp-security/admin/wp-security-filescan-menu.php
@@ -3,74 +3,24 @@
class AIOWPSecurity_Filescan_Menu extends AIOWPSecurity_Admin_Menu
{
var $menu_page_slug = AIOWPSEC_FILESCAN_MENU_SLUG;
-
- /* Specify all the tabs of this menu in the following array */
- var $menu_tabs;
var $menu_tabs_handler = array(
'tab1' => 'render_tab1',
'tab2' => 'render_tab2',
'tab3' => 'render_tab3',
- );
-
- function __construct()
- {
- $this->render_menu_page();
- }
-
- function set_menu_tabs()
+ );
+
+ function __construct()
{
$this->menu_tabs = array(
'tab1' => __('File Change Detection','all-in-one-wp-security-and-firewall'),
'tab2' => __('Malware Scan','all-in-one-wp-security-and-firewall'),
'tab3' => __('DB Scan','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;
+ parent::__construct(__('Scanner','all-in-one-wp-security-and-firewall'));
}
- /*
- * 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 '
'.__('Scanner','all-in-one-wp-security-and-firewall').'
';//Interface title
- $this->set_menu_tabs();
- $tab = $this->get_current_tab();
- $this->render_menu_tabs();
- ?>
-
- menu_tabs);
- call_user_func(array(&$this, $this->menu_tabs_handler[$tab]));
- ?>
-
-
- 'render_tab1',
+ 'tab1' => 'render_tab1',
'tab2' => 'render_tab2',
'tab3' => 'render_tab3',
'tab4' => 'render_tab4',
- );
-
- function __construct()
- {
- $this->render_menu_page();
- add_action( 'admin_footer', array( &$this, 'filesystem_menu_footer_code' ) );
- }
-
- function set_menu_tabs()
+ );
+
+ function __construct()
{
$this->menu_tabs = array(
'tab1' => __('File Permissions','all-in-one-wp-security-and-firewall'),
@@ -28,53 +19,13 @@ function set_menu_tabs()
'tab3' => __('WP File Access','all-in-one-wp-security-and-firewall'),
'tab4' => __('Host System 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();
+ add_action( 'admin_footer', array( &$this, 'filesystem_menu_footer_code' ) );
- 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 '
'.__('Filesystem Security','all-in-one-wp-security-and-firewall').'
';//Interface title
- $this->set_menu_tabs();
- $tab = $this->get_current_tab();
- $this->render_menu_tabs();
- ?>
-
- menu_tabs);
- call_user_func(array(&$this, $this->menu_tabs_handler[$tab]));
- ?>
-
-
- 'render_tab1',
@@ -15,14 +12,9 @@ class AIOWPSecurity_Firewall_Menu extends AIOWPSecurity_Admin_Menu
'tab5' => 'render_tab5',
'tab6' => 'render_tab6',
'tab7' => 'render_tab7',
- );
-
- function __construct()
- {
- $this->render_menu_page();
- }
-
- function set_menu_tabs()
+ );
+
+ function __construct()
{
$this->menu_tabs = array(
'tab1' => __('Basic Firewall Rules', 'all-in-one-wp-security-and-firewall'),
@@ -33,52 +25,10 @@ function set_menu_tabs()
'tab6' => __('404 Detection', 'all-in-one-wp-security-and-firewall'),
'tab7' => __('Custom Rules', '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;
+ parent::__construct(__('Firewall','all-in-one-wp-security-and-firewall'));
}
- /*
- * 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 '
'.__('Firewall','all-in-one-wp-security-and-firewall').'
';//Interface title
- $this->set_menu_tabs();
- $tab = $this->get_current_tab();
- $this->render_menu_tabs();
- ?>
-
- menu_tabs);
- call_user_func(array(&$this, $this->menu_tabs_handler[$tab]));
- ?>
-
-
- 'render_tab1',
- );
-
- function __construct()
- {
- $this->render_menu_page();
- }
+ 'tab1' => 'render_tab1',
+ );
- function set_menu_tabs()
+ function __construct()
{
$this->menu_tabs = array(
'tab1' => __('Visitor Lockout', '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;
+ parent::__construct(__('Maintenance','all-in-one-wp-security-and-firewall'));
}
- /*
- * 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 '
'.__('Maintenance','all-in-one-wp-security-and-firewall').'
';//Interface title
- $this->set_menu_tabs();
- $tab = $this->get_current_tab();
- $this->render_menu_tabs();
- ?>
-
- menu_tabs);
- call_user_func(array(&$this, $this->menu_tabs_handler[$tab]));
- ?>
-
-
- 'render_tab1',
'tab2' => 'render_tab2',
'tab3' => 'render_tab3',
- );
-
- function __construct()
- {
- $this->render_menu_page();
- }
+ );
- function set_menu_tabs()
+ function __construct()
{
$this->menu_tabs = array(
'tab1' => __('Copy Protection', 'all-in-one-wp-security-and-firewall'),
'tab2' => __('Frames', 'all-in-one-wp-security-and-firewall'),
'tab3' => __('Users Enumeration', '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;
+ parent::__construct(__('Miscellaneous','all-in-one-wp-security-and-firewall'));
}
- /*
- * 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 '
'.__('Miscellaneous','all-in-one-wp-security-and-firewall').'
';//Interface title
- $this->set_menu_tabs();
- $tab = $this->get_current_tab();
- $this->render_menu_tabs();
- ?>
-
- menu_tabs);
- call_user_func(array(&$this, $this->menu_tabs_handler[$tab]));
- ?>
-
-
- 'render_tab1',
+ 'tab1' => 'render_tab1',
'tab2' => 'render_tab2',
'tab3' => 'render_tab3',
'tab4' => 'render_tab4',
'tab5' => 'render_tab5',
- );
-
- function __construct()
- {
- $this->render_menu_page();
- }
+ );
- function set_menu_tabs()
+ function __construct()
{
$this->menu_tabs = array(
'tab1' => __('General Settings', 'all-in-one-wp-security-and-firewall'),
@@ -29,52 +21,10 @@ function set_menu_tabs()
'tab4' => __('WP Version Info', 'all-in-one-wp-security-and-firewall'),
'tab5' => __('Import/Export', '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;
+ parent::__construct(__('Settings','all-in-one-wp-security-and-firewall'));
}
- /*
- * 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 '
'.__('Settings','all-in-one-wp-security-and-firewall').'
';//Interface title
- $this->set_menu_tabs();
- $tab = $this->get_current_tab();
- $this->render_menu_tabs();
- ?>
-
- menu_tabs);
- call_user_func(array(&$this, $this->menu_tabs_handler[$tab]));
- ?>
-
-
- 'render_tab1',
'tab2' => 'render_tab2',
'tab3' => 'render_tab3',
- );
-
- function __construct()
- {
- $this->render_menu_page();
- }
-
- function set_menu_tabs()
+ );
+
+ function __construct()
{
$this->menu_tabs = array(
'tab1' => __('Comment SPAM', 'all-in-one-wp-security-and-firewall'),
'tab2' => __('Comment SPAM IP Monitoring', 'all-in-one-wp-security-and-firewall'),
'tab3' => __('BuddyPress', '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;
+ parent::__construct(__('SPAM Prevention','all-in-one-wp-security-and-firewall'));
}
- /*
- * 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 '
'.__('SPAM Prevention','all-in-one-wp-security-and-firewall').'
';//Interface title
- $this->set_menu_tabs();
- $tab = $this->get_current_tab();
- $this->render_menu_tabs();
- ?>
-
- menu_tabs);
- call_user_func(array(&$this, $this->menu_tabs_handler[$tab]));
- ?>
-
-
- 'render_tab1',
+ 'tab1' => 'render_tab1',
'tab2' => 'render_tab2',
'tab3' => 'render_tab3',
- );
- function __construct()
- {
- $this->render_menu_page();
-
- //Add the JS library for password tool - make sure we are on our password tab
- if (isset($_GET['page']) && strpos($_GET['page'], AIOWPSEC_USER_ACCOUNTS_MENU_SLUG ) !== false) {
- if (isset($_GET['tab']) && $_GET['tab'] == 'tab3'){
- wp_enqueue_script('aiowpsec-pw-tool-js');
- }
- }
- }
-
- function set_menu_tabs()
+ );
+
+ function __construct()
{
$this->menu_tabs = array(
'tab1' => __('WP Username', 'all-in-one-wp-security-and-firewall'),
'tab2' => __('Display Name', 'all-in-one-wp-security-and-firewall'),
'tab3' => __('Password', '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();
+ parent::__construct(__('User Accounts','all-in-one-wp-security-and-firewall'));
- echo '';
- foreach ( $this->menu_tabs as $tab_key => $tab_caption )
- {
- $active = $current_tab == $tab_key ? 'nav-tab-active' : '';
- echo '' . $tab_caption . '';
+ //Add the JS library for password tool - make sure we are on our password tab
+ if (isset($_GET['page']) && strpos($_GET['page'], AIOWPSEC_USER_ACCOUNTS_MENU_SLUG ) !== false) {
+ if (isset($_GET['tab']) && $_GET['tab'] == 'tab3'){
+ wp_enqueue_script('aiowpsec-pw-tool-js');
+ }
}
- echo '
';
}
-
- /*
- * The menu rendering goes here
- */
- function render_menu_page()
- {
- echo '';
- echo '
'.__('User Accounts','all-in-one-wp-security-and-firewall').'
';//Interface title
- $this->set_menu_tabs();
- $tab = $this->get_current_tab();
- $this->render_menu_tabs();
- ?>
-
- menu_tabs);
- call_user_func(array(&$this, $this->menu_tabs_handler[$tab]));
- ?>
-
-
- 'render_tab1',
+ 'tab1' => 'render_tab1',
'tab2' => 'render_tab2',
'tab3' => 'render_tab3',
'tab4' => 'render_tab4',
'tab5' => 'render_tab5',
- );
-
- function __construct()
- {
- $this->render_menu_page();
- }
-
- function set_menu_tabs()
+ );
+
+ function __construct()
{
$this->menu_tabs = array(
'tab1' => __('Login Lockdown', 'all-in-one-wp-security-and-firewall'),
@@ -28,53 +21,11 @@ function set_menu_tabs()
'tab4' => __('Account Activity Logs', 'all-in-one-wp-security-and-firewall'),
'tab5' => __('Logged In Users', '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;
+ parent::__construct(__('User Login','all-in-one-wp-security-and-firewall'));
}
- /*
- * 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 '
'.__('User Login','all-in-one-wp-security-and-firewall').'
';//Interface title
- $this->set_menu_tabs();
- $tab = $this->get_current_tab();
- $this->render_menu_tabs();
- ?>
-
- menu_tabs);
- call_user_func(array(&$this, $this->menu_tabs_handler[$tab]));
- ?>
-
-
- 'render_tab1',
'tab2' => 'render_tab2',
);
-
- function __construct()
- {
- $this->render_menu_page();
- }
-
- function set_menu_tabs()
+
+ function __construct()
{
$this->menu_tabs = array(
'tab1' => __('Manual Approval', 'all-in-one-wp-security-and-firewall'),
'tab2' => __('Registration Captcha', '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;
+ parent::__construct(__('User Registration','all-in-one-wp-security-and-firewall'));
}
- /*
- * 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 '
'.__('User Registration','all-in-one-wp-security-and-firewall').'
';//Interface title
- $this->set_menu_tabs();
- $tab = $this->get_current_tab();
- $this->render_menu_tabs();
- ?>
-
- menu_tabs);
- call_user_func(array(&$this, $this->menu_tabs_handler[$tab]));
- ?>
-
-
- 'render_tab1',
- );
-
- function __construct()
- {
- $this->render_menu_page();
- }
-
- function set_menu_tabs()
+ 'tab1' => 'render_tab1',
+ );
+
+ function __construct()
{
$this->menu_tabs = array(
- 'tab1' => __('WhoIS Lookup', 'all-in-one-wp-security-and-firewall'),
+ 'tab1' => __('WHOIS Lookup', '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;
+ parent::__construct(__('WHOIS Lookup','all-in-one-wp-security-and-firewall'));
}
- /*
- * 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 '
'.__('WHOIS Lookup','all-in-one-wp-security-and-firewall').'
';//Interface title
- $this->set_menu_tabs();
- $tab = $this->get_current_tab();
- $this->render_menu_tabs();
- ?>
-
- menu_tabs);
- call_user_func(array(&$this, $this->menu_tabs_handler[$tab]));
- ?>
-
-
-