function render_tab2()
    {
        global $aio_wp_security;
        include_once 'wp-security-list-comment-spammer-ip.php';
        //For rendering the AIOWPSecurity_List_Table in tab2
        $spammer_ip_list = new AIOWPSecurity_List_Comment_Spammer_IP();
        if (isset($_POST['aiowps_ip_spam_comment_search'])) {
            $error = '';
            $nonce = $_REQUEST['_wpnonce'];
            if (!wp_verify_nonce($nonce, 'aiowpsec-spammer-ip-list-nonce')) {
                $aio_wp_security->debug_logger->log_debug("Nonce check failed for list SPAM comment IPs!", 4);
                die(__('Nonce check failed for list SPAM comment IPs!', 'aiowpsecurity'));
            }
            $min_comments_per_ip = sanitize_text_field($_POST['aiowps_spam_ip_min_comments']);
            if (!is_numeric($min_comments_per_ip)) {
                $error .= '<br />' . __('You entered a non numeric value for the minimum SPAM comments per IP field. It has been set to the default value.', 'aiowpsecurity');
                $min_comments_per_ip = '5';
                //Set it to the default value for this field
            }
            if ($error) {
                $this->show_msg_error(__('Attention!', 'aiowpsecurity') . $error);
            }
            //Save all the form values to the options
            $aio_wp_security->configs->set_value('aiowps_spam_ip_min_comments', absint($min_comments_per_ip));
            $aio_wp_security->configs->save_config();
            $info_msg_string = sprintf(__('Displaying results for IP addresses which have posted a minimum of %s SPAM comments', 'aiowpsecurity'), $min_comments_per_ip);
            $this->show_msg_updated($info_msg_string);
        }
        if (isset($_REQUEST['action'])) {
            if ($_REQUEST['action'] == 'block_spammer_ip') {
                //The "block" link was clicked for a row in the list table
                $spammer_ip_list->block_spammer_ip_records(strip_tags($_REQUEST['spammer_ip']));
            }
        }
        ?>
        <div class="aio_blue_box">
            <?php 
        echo '<p>' . __('This tab displays a list of the IP addresses of the people or bots who have left SPAM comments on your site.', 'aiowpsecurity') . '
                <br />' . __('This information can be handy for identifying the most persistent IP addresses or ranges used by spammers.', 'aiowpsecurity') . '
                <br />' . __('By inspecting the IP address data coming from spammers you will be in a better position to determine which addresses or address ranges you should block by adding them to your blacklist.', 'aiowpsecurity') . '
                <br />' . __('To add one or more of the IP addresses displayed in the table below to your blacklist, simply click the "Block" link for the individual row or select more than one address 
                            using the checkboxes and then choose the "block" option from the Bulk Actions dropdown list and click the "Apply" button.', 'aiowpsecurity') . '
            </p>';
        ?>
        </div>
        <div class="postbox">
        <h3><label for="title"><?php 
        _e('List SPAMMER IP Addresses', 'aiowpsecurity');
        ?>
</label></h3>
        <div class="inside">
        <form action="" method="POST">
        <?php 
        wp_nonce_field('aiowpsec-spammer-ip-list-nonce');
        ?>
        <table class="form-table">
            <tr valign="top">
                <th scope="row"><?php 
        _e('Minimum number of SPAM comments per IP', 'aiowpsecurity');
        ?>
:</th>
                <td><input type="text" size="5" name="aiowps_spam_ip_min_comments" value="<?php 
        echo $aio_wp_security->configs->get_value('aiowps_spam_ip_min_comments');
        ?>
" />
                <span class="description"><?php 
        _e('This field allows you to list only those IP addresses which have been used to post X or more SPAM comments.', 'aiowpsecurity');
        ?>
</span>
                <span class="aiowps_more_info_anchor"><span class="aiowps_more_info_toggle_char">+</span><span class="aiowps_more_info_toggle_text"><?php 
        _e('More Info', 'aiowpsecurity');
        ?>
</span></span>
                <div class="aiowps_more_info_body">
                    <?php 
        echo '<p class="description">' . __('Example 1: Setting this value to "0" or "1" will list ALL IP addresses which were used to submit SPAM comments.', 'aiowpsecurity') . '</p>';
        echo '<p class="description">' . __('Example 2: Setting this value to "5" will list only those IP addresses which were used to submit 5 SPAM comments or more on your site.', 'aiowpsecurity') . '</p>';
        ?>
                </div>

                </td> 
            </tr>
        </table>
        <input type="submit" name="aiowps_ip_spam_comment_search" value="<?php 
        _e('Find IP Addresses', 'aiowpsecurity');
        ?>
" class="button-primary" />
        </form>
        </div></div>
        <div class="postbox">
        <h3><label for="title"><?php 
        _e('SPAMMER IP Address Results', 'aiowpsecurity');
        ?>
</label></h3>
        <div class="inside">
            <?php 
        if (AIOWPSecurity_Utility::is_multisite_install() && get_current_blog_id() != 1) {
            echo '<div class="aio_yellow_box">';
            echo '<p>' . __('The plugin has detected that you are using a Multi-Site WordPress installation.', 'aiowpsecurity') . '</p>
                          <p>' . __('Only the "superadmin" can block IP addresses from the main site.', 'aiowpsecurity') . '</p>
                          <p>' . __('Take note of the IP addresses you want blocked and ask the superadmin to add these to the blacklist using the "Blacklist Manager" on the main site.', 'aiowpsecurity') . '</p>';
            echo '</div>';
        }
        //Fetch, prepare, sort, and filter our data...
        $spammer_ip_list->prepare_items();
        //echo "put table of locked entries here";
        ?>
            <form id="tables-filter" method="get" onSubmit="return confirm('Are you sure you want to perform this bulk operation on the selected entries?');">
            <!-- For plugins, we also need to ensure that the form posts back to our current page -->
            <input type="hidden" name="page" value="<?php 
        echo $_REQUEST['page'];
        ?>
" />
            <input type="hidden" name="tab" value="<?php 
        echo $_REQUEST['tab'];
        ?>
" />
            <!-- Now we can render the completed list table -->
            <?php 
        $spammer_ip_list->display();
        ?>
            </form>
        </div></div>
        <?php 
    }
    function render_tab2()
    {
        global $aio_wp_security;
        global $aiowps_feature_mgr;
        include_once 'wp-security-list-comment-spammer-ip.php';
        //For rendering the AIOWPSecurity_List_Table in tab2
        $spammer_ip_list = new AIOWPSecurity_List_Comment_Spammer_IP();
        //Do form submission tasks for auto block spam IP
        if (isset($_POST['aiowps_auto_spam_block'])) {
            $error = '';
            $nonce = $_REQUEST['_wpnonce'];
            if (!wp_verify_nonce($nonce, 'aiowpsec-auto-block-spam-ip-nonce')) {
                $aio_wp_security->debug_logger->log_debug("Nonce check failed on auto block SPAM IPs options save!", 4);
                die("Nonce check failed on auto block SPAM IPs options save!");
            }
            $spam_ip_min_comments = sanitize_text_field($_POST['aiowps_spam_ip_min_comments_block']);
            if (!is_numeric($spam_ip_min_comments)) {
                $error .= '<br />' . __('You entered a non numeric value for the minimum number of spam comments field. It has been set to the default value.', 'all-in-one-wp-security-and-firewall');
                $spam_ip_min_comments = '3';
                //Set it to the default value for this field
            } elseif (empty($spam_ip_min_comments)) {
                $error .= '<br />' . __('You must enter an integer greater than zero for minimum number of spam comments field. It has been set to the default value.', 'all-in-one-wp-security-and-firewall');
                $spam_ip_min_comments = '3';
                //Set it to the default value for this field
            }
            if ($error) {
                $this->show_msg_error(__('Attention!', 'all-in-one-wp-security-and-firewall') . $error);
            }
            //Save all the form values to the options
            $aio_wp_security->configs->set_value('aiowps_enable_autoblock_spam_ip', isset($_POST["aiowps_enable_autoblock_spam_ip"]) ? '1' : '');
            $aio_wp_security->configs->set_value('aiowps_spam_ip_min_comments_block', absint($spam_ip_min_comments));
            $aio_wp_security->configs->save_config();
            //Recalculate points after the feature status/options have been altered
            $aiowps_feature_mgr->check_feature_status_and_recalculate_points();
            $this->show_msg_settings_updated();
        }
        if (isset($_POST['aiowps_ip_spam_comment_search'])) {
            $error = '';
            $nonce = $_REQUEST['_wpnonce'];
            if (!wp_verify_nonce($nonce, 'aiowpsec-spammer-ip-list-nonce')) {
                $aio_wp_security->debug_logger->log_debug("Nonce check failed for list SPAM comment IPs!", 4);
                die(__('Nonce check failed for list SPAM comment IPs!', 'all-in-one-wp-security-and-firewall'));
            }
            $min_comments_per_ip = sanitize_text_field($_POST['aiowps_spam_ip_min_comments']);
            if (!is_numeric($min_comments_per_ip)) {
                $error .= '<br />' . __('You entered a non numeric value for the minimum SPAM comments per IP field. It has been set to the default value.', 'all-in-one-wp-security-and-firewall');
                $min_comments_per_ip = '5';
                //Set it to the default value for this field
            }
            if ($error) {
                $this->show_msg_error(__('Attention!', 'all-in-one-wp-security-and-firewall') . $error);
            }
            //Save all the form values to the options
            $aio_wp_security->configs->set_value('aiowps_spam_ip_min_comments', absint($min_comments_per_ip));
            $aio_wp_security->configs->save_config();
            $info_msg_string = sprintf(__('Displaying results for IP addresses which have posted a minimum of %s SPAM comments', 'all-in-one-wp-security-and-firewall'), $min_comments_per_ip);
            $this->show_msg_updated($info_msg_string);
        }
        if (isset($_REQUEST['action'])) {
            if ($_REQUEST['action'] == 'block_spammer_ip') {
                //The "block" link was clicked for a row in the list table
                $spammer_ip_list->block_spammer_ip_records(strip_tags($_REQUEST['spammer_ip']));
            }
        }
        ?>
        <div class="postbox">
            <h3 class="hndle"><label for="title"><?php 
        _e('Auto Block SPAMMER IPs', 'all-in-one-wp-security-and-firewall');
        ?>
</label></h3>
            <div class="inside">
                <?php 
        if ($aio_wp_security->configs->get_value('aiowps_enable_autoblock_spam_ip') == '1' && !class_exists('Akismet')) {
            $akismet_link = '<a href="https://wordpress.org/plugins/akismet/" target="_blank">Akismet</a>';
            $info_msg = sprintf(__('This feature has detected that %s is not active. It is highly recommended that you activate the Akismet plugin to make the most of this feature.', 'all-in-one-wp-security-and-firewall'), $akismet_link);
            echo '<div class="aio_orange_box" id="message"><p><strong>' . $info_msg . '</strong></p></div>';
        }
        ?>
                <form action="" method="POST">
                <div class="aio_blue_box">
                    <?php 
        echo '<p>' . __('This feature allows you to automatically and permanently block IP addresses which have exceeded a certain number of comments labelled as SPAM.', 'all-in-one-wp-security-and-firewall') . '</p>' . '<p>' . __('Comments are usually labelled as SPAM either by the Akismet plugin or manually by the WP administrator when they mark a comment as "spam" from the WordPress Comments menu.', 'all-in-one-wp-security-and-firewall') . '</p>' . '<p><strong>' . __('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') . '</strong></p>';
        ?>
                </div>
                    <?php 
        $min_block_comments = $aio_wp_security->configs->get_value('aiowps_spam_ip_min_comments_block');
        if (!empty($min_block_comments)) {
            global $wpdb;
            $sql = $wpdb->prepare('SELECT * FROM ' . AIOWPSEC_TBL_PERM_BLOCK . ' WHERE block_reason=%s', 'spam');
            $total_res = $wpdb->get_results($sql);
            ?>
                        <div class="aio_yellow_box">
                            <?php 
            if (empty($total_res)) {
                echo '<p><strong>' . __('You currently have no IP addresses permanently blocked due to SPAM.', 'all-in-one-wp-security-and-firewall') . '</strong></p>';
            } else {
                $total_count = count($total_res);
                $todays_blocked_count = 0;
                foreach ($total_res as $blocked_item) {
                    $now = date_i18n('Y-m-d H:i:s');
                    $now_date_time = new DateTime($now);
                    $blocked_date = new DateTime($blocked_item->blocked_date);
                    if ($blocked_date->format('Y-m-d') == $now_date_time->format('Y-m-d')) {
                        //there was an IP added to permanent block list today
                        ++$todays_blocked_count;
                    }
                }
                echo '<p><strong>' . __('Spammer IPs Added To Permanent Block List Today: ', 'all-in-one-wp-security-and-firewall') . $todays_blocked_count . '</strong></p>' . '<hr><p><strong>' . __('All Time Total: ', 'all-in-one-wp-security-and-firewall') . $total_count . '</strong></p>' . '<p><a class="button" href="admin.php?page=' . AIOWPSEC_MAIN_MENU_SLUG . '&tab=tab4" target="_blank">' . __('View Blocked IPs', 'all-in-one-wp-security-and-firewall') . '</a></p>';
            }
            ?>
                        </div>

                    <?php 
        }
        //Display security info badge
        //$aiowps_feature_mgr->output_feature_details_badge("auto-block-spam-ip");
        ?>
                    <?php 
        wp_nonce_field('aiowpsec-auto-block-spam-ip-nonce');
        ?>
                <table class="form-table">
                    <tr valign="top">
                        <th scope="row"><?php 
        _e('Enable Auto Block of SPAM Comment IPs', 'all-in-one-wp-security-and-firewall');
        ?>
:</th>
                        <td>
                            <input name="aiowps_enable_autoblock_spam_ip" type="checkbox"<?php 
        if ($aio_wp_security->configs->get_value('aiowps_enable_autoblock_spam_ip') == '1') {
            echo ' checked="checked"';
        }
        ?>
 value="1"/>
                            <span class="description"><?php 
        _e('Check this box if you want this plugin to automatically block IP addresses which submit SPAM comments.', 'all-in-one-wp-security-and-firewall');
        ?>
</span>
                        </td>
                    </tr>
                    <tr valign="top">
                        <th scope="row"><?php 
        _e('Minimum number of SPAM comments', 'all-in-one-wp-security-and-firewall');
        ?>
:</th>
                        <td><input type="text" size="5" name="aiowps_spam_ip_min_comments_block" value="<?php 
        echo $aio_wp_security->configs->get_value('aiowps_spam_ip_min_comments_block');
        ?>
" />
                            <span class="description"><?php 
        _e('Specify the minimum number of SPAM comments for an IP address before it is permanently blocked.', 'all-in-one-wp-security-and-firewall');
        ?>
</span>
                            <span class="aiowps_more_info_anchor"><span class="aiowps_more_info_toggle_char">+</span><span class="aiowps_more_info_toggle_text"><?php 
        _e('More Info', 'all-in-one-wp-security-and-firewall');
        ?>
</span></span>
                            <div class="aiowps_more_info_body">
                                <?php 
        echo '<p class="description">' . __('Example 1: Setting this value to "1" will block ALL IP addresses which were used to submit at least one SPAM comment.', 'all-in-one-wp-security-and-firewall') . '</p>';
        echo '<p class="description">' . __('Example 2: Setting this value to "5" will block only those IP addresses which were used to submit 5 SPAM comments or more on your site.', 'all-in-one-wp-security-and-firewall') . '</p>';
        ?>
                            </div>
                        </td>
                    </tr>
<!--                    <tr valign="top">-->
<!--                        <th scope="row">--><?php 
        //_e('Run Now', 'all-in-one-wp-security-and-firewall')
        ?>
<!--:</th>-->
<!--                        <td><input type="submit" name="aiowps_auto_spam_block_run" value="--><?php 
        //_e('Run SPAM IP Blocking Now', 'all-in-one-wp-security-and-firewall')
        ?>
<!--" class="button-secondary" />-->
<!--                            <span class="description">--><?php 
        //_e('This feature normally runs automatically whenever a comment is submitted but you can run it manually by clicking this button. (useful for older comments)', 'all-in-one-wp-security-and-firewall');
        ?>
<!--</span>-->
<!--                        </td>-->
<!--                    </tr>-->

                </table>
                <input type="submit" name="aiowps_auto_spam_block" value="<?php 
        _e('Save Settings', 'all-in-one-wp-security-and-firewall');
        ?>
" class="button-primary" />
                </form>
            </div></div>

        <div class="postbox">
        <h3 class="hndle"><label for="title"><?php 
        _e('List SPAMMER IP Addresses', 'all-in-one-wp-security-and-firewall');
        ?>
</label></h3>
        <div class="inside">
            <div class="aio_blue_box">
                <?php 
        echo '<p>' . __('This section displays a list of the IP addresses of the people or bots who have left SPAM comments on your site.', 'all-in-one-wp-security-and-firewall') . '
                <br />' . __('This information can be handy for identifying the most persistent IP addresses or ranges used by spammers.', 'all-in-one-wp-security-and-firewall') . '
                <br />' . __('By inspecting the IP address data coming from spammers you will be in a better position to determine which addresses or address ranges you should block by adding them to your blacklist.', 'all-in-one-wp-security-and-firewall') . '
                <br />' . __('To add one or more of the IP addresses displayed in the table below to your blacklist, simply click the "Block" link for the individual row or select more than one address
                            using the checkboxes and then choose the "block" option from the Bulk Actions dropdown list and click the "Apply" button.', 'all-in-one-wp-security-and-firewall') . '
            </p>';
        ?>
            </div>

        <form action="" method="POST">
        <?php 
        wp_nonce_field('aiowpsec-spammer-ip-list-nonce');
        ?>
        <table class="form-table">
            <tr valign="top">
                <th scope="row"><?php 
        _e('Minimum number of SPAM comments per IP', 'all-in-one-wp-security-and-firewall');
        ?>
:</th>
                <td><input type="text" size="5" name="aiowps_spam_ip_min_comments" value="<?php 
        echo $aio_wp_security->configs->get_value('aiowps_spam_ip_min_comments');
        ?>
" />
                <span class="description"><?php 
        _e('This field allows you to list only those IP addresses which have been used to post X or more SPAM comments.', 'all-in-one-wp-security-and-firewall');
        ?>
</span>
                <span class="aiowps_more_info_anchor"><span class="aiowps_more_info_toggle_char">+</span><span class="aiowps_more_info_toggle_text"><?php 
        _e('More Info', 'all-in-one-wp-security-and-firewall');
        ?>
</span></span>
                <div class="aiowps_more_info_body">
                    <?php 
        echo '<p class="description">' . __('Example 1: Setting this value to "0" or "1" will list ALL IP addresses which were used to submit SPAM comments.', 'all-in-one-wp-security-and-firewall') . '</p>';
        echo '<p class="description">' . __('Example 2: Setting this value to "5" will list only those IP addresses which were used to submit 5 SPAM comments or more on your site.', 'all-in-one-wp-security-and-firewall') . '</p>';
        ?>
                </div>

                </td> 
            </tr>
        </table>
        <input type="submit" name="aiowps_ip_spam_comment_search" value="<?php 
        _e('Find IP Addresses', 'all-in-one-wp-security-and-firewall');
        ?>
" class="button-primary" />
        </form>
        </div></div>
        <div class="postbox">
        <h3 class="hndle"><label for="title"><?php 
        _e('SPAMMER IP Address Results', 'all-in-one-wp-security-and-firewall');
        ?>
</label></h3>
        <div class="inside">
            <?php 
        if (AIOWPSecurity_Utility::is_multisite_install() && get_current_blog_id() != 1) {
            echo '<div class="aio_yellow_box">';
            echo '<p>' . __('The plugin has detected that you are using a Multi-Site WordPress installation.', 'all-in-one-wp-security-and-firewall') . '</p>
                          <p>' . __('Only the "superadmin" can block IP addresses from the main site.', 'all-in-one-wp-security-and-firewall') . '</p>
                          <p>' . __('Take note of the IP addresses you want blocked and ask the superadmin to add these to the blacklist using the "Blacklist Manager" on the main site.', 'all-in-one-wp-security-and-firewall') . '</p>';
            echo '</div>';
        }
        //Fetch, prepare, sort, and filter our data...
        $spammer_ip_list->prepare_items();
        //echo "put table of locked entries here";
        ?>
            <form id="tables-filter" method="get" onSubmit="return confirm('Are you sure you want to perform this bulk operation on the selected entries?');">
            <!-- For plugins, we also need to ensure that the form posts back to our current page -->
            <input type="hidden" name="page" value="<?php 
        echo esc_attr($_REQUEST['page']);
        ?>
" />
            <input type="hidden" name="tab" value="<?php 
        echo esc_attr($_REQUEST['tab']);
        ?>
" />
            <!-- Now we can render the completed list table -->
            <?php 
        $spammer_ip_list->display();
        ?>
            </form>
        </div></div>
        <?php 
    }