static function run_deactivation_tasks()
 {
     global $wpdb;
     global $aio_wp_security;
     //Let's first save the current aio_wp_security_configs options in a temp option
     update_option('aiowps_temp_configs', $aio_wp_security->configs->configs);
     //Deactivate all firewall and other .htaccess rules
     AIOWPSecurity_Configure_Settings::turn_off_all_firewall_rules();
 }
    function render_tab1()
    {
        global $aio_wp_security;
        if (isset($_POST['aiowpsec_disable_all_features'])) {
            $nonce = $_REQUEST['_wpnonce'];
            if (!wp_verify_nonce($nonce, 'aiowpsec-disable-all-features')) {
                $aio_wp_security->debug_logger->log_debug("Nonce check failed on disable all security features!", 4);
                die("Nonce check failed on disable all security features!");
            }
            AIOWPSecurity_Configure_Settings::turn_off_all_security_features();
            //Now let's clear the applicable rules from the .htaccess file
            $res = AIOWPSecurity_Utility_Htaccess::write_to_htaccess();
            //Now let's revert the disable editing setting in the wp-config.php file if necessary
            $res2 = AIOWPSecurity_Utility::enable_file_edits();
            if ($res) {
                $this->show_msg_updated(__('All the security features have been disabled successfully!', 'aiowpsecurity'));
            } else {
                if ($res == -1) {
                    $this->show_msg_error(__('Could not write to the .htaccess file. Please restore your .htaccess file manually using the restore functionality in the ".htaccess File".', 'aiowpsecurity'));
                }
            }
            if (!$res2) {
                $this->show_msg_error(__('Could not write to the wp-config.php. Please restore your wp-config.php file manually using the restore functionality in the "wp-config.php File".', 'aiowpsecurity'));
            }
        }
        if (isset($_POST['aiowpsec_disable_all_firewall_rules'])) {
            $nonce = $_REQUEST['_wpnonce'];
            if (!wp_verify_nonce($nonce, 'aiowpsec-disable-all-firewall-rules')) {
                $aio_wp_security->debug_logger->log_debug("Nonce check failed on disable all firewall rules!", 4);
                die("Nonce check failed on disable all firewall rules!");
            }
            AIOWPSecurity_Configure_Settings::turn_off_all_firewall_rules();
            //Now let's clear the applicable rules from the .htaccess file
            $res = AIOWPSecurity_Utility_Htaccess::write_to_htaccess();
            if ($res) {
                $this->show_msg_updated(__('All firewall rules have been disabled successfully!', 'aiowpsecurity'));
            } else {
                if ($res == -1) {
                    $this->show_msg_error(__('Could not write to the .htaccess file. Please restore your .htaccess file manually using the restore functionality in the ".htaccess File".', 'aiowpsecurity'));
                }
            }
        }
        ?>
        <div class="aio_grey_box">
 	<p>For information, updates and documentation, please visit the <a href="https://www.tipsandtricks-hq.com/wordpress-security-and-firewall-plugin" target="_blank">AIO WP Security & Firewall Plugin</a> Page.</p>
        <p><a href="https://www.tipsandtricks-hq.com/development-center" target="_blank">Follow us</a> on Twitter, Google+ or via Email to stay upto date about the new security features of this plugin.</p>
        </div>
        
        <div class="postbox">
        <h3><label for="title"><?php 
        _e('WP Security Plugin', 'aiowpsecurity');
        ?>
</label></h3>
        <div class="inside">
        <p><?php 
        _e('Thank you for using our WordPress security plugin. There are a lot of security features in this plugin.', 'aiowpsecurity');
        ?>
</p>
        <p><?php 
        _e('Go through each menu items and enable the security options to add more security to your site. Start by activating the basic features first.', 'aiowpsecurity');
        ?>
</p>
        <p><?php 
        _e('It is a good practice to take a backup of your .htaccess file, database and wp-config.php file before activating the security features. This plugin has options that you can use to backup those resources easily.', 'aiowpsecurity');
        ?>
</p>
        <p>
        <ul class="aiowps_admin_ul_grp1">
            <li><a href="admin.php?page=aiowpsec_database&tab=tab2" target="_blank"><?php 
        _e('Backup your database', 'aiowpsecurity');
        ?>
</a></li>
            <li><a href="admin.php?page=aiowpsec_settings&tab=tab2" target="_blank"><?php 
        _e('Backup .htaccess file', 'aiowpsecurity');
        ?>
</a></li>
            <li><a href="admin.php?page=aiowpsec_settings&tab=tab3" target="_blank"><?php 
        _e('Backup wp-config.php file', 'aiowpsecurity');
        ?>
</a></li>
        </ul>
        </p>
        </div></div>
        
        <div class="postbox">
        <h3><label for="title"><?php 
        _e('Disable Security Features', 'aiowpsecurity');
        ?>
</label></h3>
        <div class="inside">
        <form method="post" action="<?php 
        echo $_SERVER["REQUEST_URI"];
        ?>
">
        <?php 
        wp_nonce_field('aiowpsec-disable-all-features');
        ?>
        <div class="aio_blue_box">
            <?php 
        echo '<p>' . __('If you think that some plugin functionality on your site is broken due to a security feature you enabled in this plugin, then use the following option to turn off all the security features of this plugin.', 'aiowpsecurity') . '</p>';
        ?>
        </div>      
        <div class="submit">
            <input type="submit" class="button" name="aiowpsec_disable_all_features" value="<?php 
        _e('Disable All Security Features');
        ?>
" />
        </div>
        </form>   
        </div></div>

        <div class="postbox">
        <h3><label for="title"><?php 
        _e('Disable All Firewall Rules', 'aiowpsecurity');
        ?>
</label></h3>
        <div class="inside">
        <form method="post" action="<?php 
        echo $_SERVER["REQUEST_URI"];
        ?>
">
        <?php 
        wp_nonce_field('aiowpsec-disable-all-firewall-rules');
        ?>
        <div class="aio_blue_box">
            <?php 
        echo '<p>' . __('This feature will disable all firewall rules which are currently active in this plugin and it will also delete these rules from your .htacess file. Use it if you think one of the firewall rules is causing an issue on your site.', 'aiowpsecurity') . '</p>';
        ?>
        </div>      
        <div class="submit">
            <input type="submit" class="button" name="aiowpsec_disable_all_firewall_rules" value="<?php 
        _e('Disable All Firewall Rules');
        ?>
" />
        </div>
        </form>   
        </div></div>
        <?php 
    }