예제 #1
0
 function update_values()
 {
     $uniId = isset($_POST['uniqueId']) ? $_POST['uniqueId'] : '';
     MainWP_Helper::update_option('mainwp_child_uniqueId', $uniId);
     MainWP_Helper::write(array('result' => 'ok'));
 }
 function set_showhide()
 {
     $hide = isset($_POST['showhide']) && $_POST['showhide'] === 'hide' ? 'hide' : '';
     MainWP_Helper::update_option('mainwp_wordfence_hide_plugin', $hide);
     $information['result'] = 'SUCCESS';
     return $information;
 }
 public function update_branding()
 {
     $information = array();
     $settings = maybe_unserialize(base64_decode($_POST['settings']));
     if (!is_array($settings)) {
         return $information;
     }
     $current_extra_setting = $this->settings['extra_settings'];
     MainWP_Helper::update_option('mainwp_branding_ext_enabled', 'Y', 'yes');
     $header = array('name' => $settings['child_plugin_name'], 'description' => $settings['child_plugin_desc'], 'author' => $settings['child_plugin_author'], 'authoruri' => $settings['child_plugin_author_uri'], 'pluginuri' => $settings['child_plugin_uri']);
     MainWP_Helper::update_option('mainwp_branding_preserve_branding', $settings['child_preserve_branding']);
     MainWP_Helper::update_option('mainwp_branding_plugin_header', $header, 'yes');
     MainWP_Helper::update_option('mainwp_branding_support_email', $settings['child_support_email']);
     MainWP_Helper::update_option('mainwp_branding_support_message', $settings['child_support_message']);
     MainWP_Helper::update_option('mainwp_branding_remove_restore', $settings['child_remove_restore']);
     MainWP_Helper::update_option('mainwp_branding_remove_setting', $settings['child_remove_setting']);
     MainWP_Helper::update_option('mainwp_branding_remove_server_info', $settings['child_remove_server_info']);
     MainWP_Helper::update_option('mainwp_branding_remove_wp_tools', $settings['child_remove_wp_tools']);
     MainWP_Helper::update_option('mainwp_branding_remove_wp_setting', $settings['child_remove_wp_setting']);
     MainWP_Helper::update_option('mainwp_branding_remove_permalink', $settings['child_remove_permalink']);
     MainWP_Helper::update_option('mainwp_branding_button_contact_label', $settings['child_button_contact_label'], 'yes');
     MainWP_Helper::update_option('mainwp_branding_send_email_message', $settings['child_send_email_message']);
     MainWP_Helper::update_option('mainwp_branding_message_return_sender', $settings['child_message_return_sender']);
     MainWP_Helper::update_option('mainwp_branding_submit_button_title', $settings['child_submit_button_title']);
     if (isset($settings['child_disable_wp_branding']) && ('Y' === $settings['child_disable_wp_branding'] || 'N' === $settings['child_disable_wp_branding'])) {
         MainWP_Helper::update_option('mainwp_branding_disable_wp_branding', $settings['child_disable_wp_branding']);
     }
     $extra_setting = array('show_button_in' => $settings['child_show_support_button_in'], 'global_footer' => $settings['child_global_footer'], 'dashboard_footer' => $settings['child_dashboard_footer'], 'remove_widget_welcome' => $settings['child_remove_widget_welcome'], 'remove_widget_glance' => $settings['child_remove_widget_glance'], 'remove_widget_activity' => $settings['child_remove_widget_activity'], 'remove_widget_quick' => $settings['child_remove_widget_quick'], 'remove_widget_news' => $settings['child_remove_widget_news'], 'site_generator' => $settings['child_site_generator'], 'generator_link' => $settings['child_generator_link'], 'admin_css' => $settings['child_admin_css'], 'login_css' => $settings['child_login_css'], 'texts_replace' => $settings['child_texts_replace'], 'hide_nag' => $settings['child_hide_nag'], 'hide_screen_opts' => $settings['child_hide_screen_opts'], 'hide_help_box' => $settings['child_hide_help_box'], 'hide_metabox_post_excerpt' => $settings['child_hide_metabox_post_excerpt'], 'hide_metabox_post_slug' => $settings['child_hide_metabox_post_slug'], 'hide_metabox_post_tags' => $settings['child_hide_metabox_post_tags'], 'hide_metabox_post_author' => $settings['child_hide_metabox_post_author'], 'hide_metabox_post_comments' => $settings['child_hide_metabox_post_comments'], 'hide_metabox_post_revisions' => $settings['child_hide_metabox_post_revisions'], 'hide_metabox_post_discussion' => $settings['child_hide_metabox_post_discussion'], 'hide_metabox_post_categories' => $settings['child_hide_metabox_post_categories'], 'hide_metabox_post_custom_fields' => $settings['child_hide_metabox_post_custom_fields'], 'hide_metabox_post_trackbacks' => $settings['child_hide_metabox_post_trackbacks'], 'hide_metabox_page_custom_fields' => $settings['child_hide_metabox_page_custom_fields'], 'hide_metabox_page_author' => $settings['child_hide_metabox_page_author'], 'hide_metabox_page_discussion' => $settings['child_hide_metabox_page_discussion'], 'hide_metabox_page_revisions' => $settings['child_hide_metabox_page_revisions'], 'hide_metabox_page_attributes' => $settings['child_hide_metabox_page_attributes'], 'hide_metabox_page_slug' => $settings['child_hide_metabox_page_slug']);
     if (isset($settings['child_login_image_url'])) {
         if (empty($settings['child_login_image_url'])) {
             $extra_setting['login_image'] = array();
         } else {
             try {
                 $upload = $this->uploadImage($settings['child_login_image_url']);
                 //Upload image to WP
                 if (null !== $upload) {
                     $extra_setting['login_image'] = array('path' => $upload['path'], 'url' => $upload['url']);
                     if (isset($current_extra_setting['login_image']['path'])) {
                         $old_file = $current_extra_setting['login_image']['path'];
                         if (!empty($old_file) && file_exists($old_file)) {
                             @unlink($old_file);
                         }
                     }
                 }
             } catch (Exception $e) {
                 $information['error']['login_image'] = $e->getMessage();
             }
         }
     } else {
         if (isset($current_extra_setting['login_image'])) {
             $extra_setting['login_image'] = $current_extra_setting['login_image'];
         }
     }
     if (isset($settings['child_favico_image_url'])) {
         if (empty($settings['child_favico_image_url'])) {
             $extra_setting['favico_image'] = array();
         } else {
             try {
                 $upload = $this->uploadImage($settings['child_favico_image_url']);
                 //Upload image to WP
                 if (null !== $upload) {
                     $extra_setting['favico_image'] = array('path' => $upload['path'], 'url' => $upload['url']);
                     if (isset($current_extra_setting['favico_image']['path'])) {
                         $old_file = $current_extra_setting['favico_image']['path'];
                         if (!empty($old_file) && file_exists($old_file)) {
                             @unlink($old_file);
                         }
                     }
                 }
             } catch (Exception $e) {
                 $information['error']['favico_image'] = $e->getMessage();
             }
         }
     } else {
         if (isset($current_extra_setting['favico_image'])) {
             $extra_setting['favico_image'] = $current_extra_setting['favico_image'];
         }
     }
     MainWP_Helper::update_option('mainwp_branding_extra_settings', $extra_setting, 'yes');
     if ($settings['child_plugin_hide']) {
         MainWP_Helper::update_option('mainwp_branding_child_hide', 'T');
     } else {
         MainWP_Helper::update_option('mainwp_branding_child_hide', '');
     }
     if ($settings['child_show_support_button'] && !empty($settings['child_support_email'])) {
         MainWP_Helper::update_option('mainwp_branding_show_support', 'T');
     } else {
         MainWP_Helper::update_option('mainwp_branding_show_support', '');
     }
     if ($settings['child_disable_change']) {
         MainWP_Helper::update_option('mainwp_branding_disable_change', 'T');
     } else {
         MainWP_Helper::update_option('mainwp_branding_disable_change', '');
     }
     $information['result'] = 'SUCCESS';
     return $information;
 }
 function save_settings()
 {
     global $itsec_globals;
     if (!class_exists('ITSEC_Lib')) {
         require trailingslashit($itsec_globals['plugin_dir']) . '/core/class-itsec-lib.php';
     }
     MainWP_Helper::update_option('mainwp_ithemes_ext_enabled', 'Y', 'yes');
     $settings = maybe_unserialize(base64_decode($_POST['settings']));
     $updated = false;
     $rewrites_changed = false;
     if (isset($settings['itsec_global'])) {
         //            $old_settings = get_site_option( 'itsec_global' );
         //            // keep current value
         //            $settings['itsec_global']['log_location'] = $old_settings['log_location'];
         if (update_site_option('itsec_global', $settings['itsec_global'])) {
             if (isset($settings['itsec_global']['write_files']) && true === $settings['itsec_global']['write_files']) {
                 add_site_option('itsec_rewrites_changed', true);
                 $rewrites_changed = true;
             }
             $updated = true;
         }
     }
     if (isset($settings['itsec_away_mode'])) {
         if (update_site_option('itsec_away_mode', $settings['itsec_away_mode'])) {
             $updated = true;
         }
     }
     if (isset($settings['itsec_backup'])) {
         $backup = get_site_option('itsec_backup');
         if (false !== $backup && isset($backup['last_run'])) {
             $settings['itsec_backup']['last_run'] = $backup['last_run'];
         } else {
             unset($settings['itsec_backup']['last_run']);
         }
         if (update_site_option('itsec_backup', $settings['itsec_backup'])) {
             $updated = true;
         }
     }
     if (isset($settings['itsec_ban_users'])) {
         $old_settings = get_site_option('itsec_ban_users');
         if (update_site_option('itsec_ban_users', $settings['itsec_ban_users'])) {
             $input = $settings['itsec_ban_users'];
             if ($input['host_list'] !== $old_settings['host_list'] || $input['enabled'] !== $old_settings['enabled'] || $input['default'] !== $old_settings['default'] || $input['agent_list'] !== $old_settings['agent_list']) {
                 if (!$rewrites_changed) {
                     add_site_option('itsec_rewrites_changed', true);
                 }
             }
             $updated = true;
         }
     }
     if (isset($settings['itsec_brute_force'])) {
         if (update_site_option('itsec_brute_force', $settings['itsec_brute_force'])) {
             $updated = true;
         }
     }
     if (isset($settings['itsec_file_change'])) {
         $file_change = get_site_option('itsec_file_change');
         if (false !== $file_change && isset($file_change['last_run'])) {
             $settings['itsec_file_change']['last_run'] = $file_change['last_run'];
         } else {
             unset($settings['itsec_file_change']['last_run']);
         }
         if (false !== $file_change && isset($file_change['last_chunk'])) {
             $settings['itsec_file_change']['last_chunk'] = $file_change['last_chunk'];
         } else {
             unset($settings['itsec_file_change']['last_chunk']);
         }
         if (update_site_option('itsec_file_change', $settings['itsec_file_change'])) {
             $updated = true;
         }
     }
     if (isset($settings['itsec_four_oh_four'])) {
         if (update_site_option('itsec_four_oh_four', $settings['itsec_four_oh_four'])) {
             $updated = true;
         }
     }
     if (isset($settings['itsec_hide_backend'])) {
         $old_settings = get_site_option('itsec_hide_backend');
         if (update_site_option('itsec_hide_backend', $settings['itsec_hide_backend'])) {
             $input = $settings['itsec_hide_backend'];
             if ($input['slug'] !== $old_settings['slug'] || $input['register'] !== $old_settings['register'] || $input['enabled'] !== $old_settings['enabled']) {
                 if (!$rewrites_changed) {
                     add_site_option('itsec_rewrites_changed', true);
                 }
             }
             if ($input['slug'] !== $old_settings['slug'] && true === $input['enabled']) {
                 add_site_option('itsec_hide_backend_new_slug', $input['slug']);
             }
             $updated = true;
         }
     }
     if (isset($settings['itsec_ipcheck'])) {
         if (update_site_option('itsec_ipcheck', $settings['itsec_ipcheck'])) {
             $updated = true;
         }
     }
     if (isset($settings['itsec_malware'])) {
         if (update_site_option('itsec_malware', $settings['itsec_malware'])) {
             $updated = true;
         }
     }
     if (isset($settings['itsec_ssl'])) {
         if (update_site_option('itsec_ssl', $settings['itsec_ssl'])) {
             $updated = true;
         }
     }
     if (isset($settings['itsec_strong_passwords'])) {
         if (update_site_option('itsec_strong_passwords', $settings['itsec_strong_passwords'])) {
             $updated = true;
         }
     }
     if (isset($settings['itsec_tweaks'])) {
         $old_settings = get_site_option('itsec_tweaks');
         $is_safe = ITSEC_Lib::safe_jquery_version() === true;
         $raw_version = get_site_option('itsec_jquery_version');
         if (true !== $is_safe && false !== $raw_version) {
             $enable_set_safe_jquery = true;
         }
         if (!$enable_set_safe_jquery) {
             $settings['itsec_tweaks']['safe_jquery'] = 0;
         }
         if (update_site_option('itsec_tweaks', $settings['itsec_tweaks'])) {
             if ($input['protect_files'] !== $old_settings['protect_files'] || $input['directory_browsing'] !== $old_settings['directory_browsing'] || $input['request_methods'] !== $old_settings['request_methods'] || $input['suspicious_query_strings'] !== $old_settings['suspicious_query_strings'] || $input['non_english_characters'] !== $old_settings['non_english_characters'] || $input['comment_spam'] !== $old_settings['comment_spam'] || $input['disable_xmlrpc'] !== $old_settings['disable_xmlrpc'] || $input['uploads_php'] !== $old_settings['uploads_php']) {
                 if (!$rewrites_changed) {
                     add_site_option('itsec_rewrites_changed', true);
                 }
             }
             $updated = true;
         }
     }
     $site_status = array('username_admin_exists' => username_exists('admin') ? 1 : 0, 'user_id1_exists' => ITSEC_Lib::user_id_exists(1) ? 1 : 0, 'backup' => $this->backup_status(), 'permalink_structure' => get_option('permalink_structure'), 'is_multisite' => is_multisite() ? 1 : 0, 'users_can_register' => get_site_option('users_can_register') ? 1 : 0, 'force_ssl_login' => defined('FORCE_SSL_LOGIN') && FORCE_SSL_LOGIN === true ? 1 : 0, 'force_ssl_admin' => defined('FORCE_SSL_ADMIN') && FORCE_SSL_ADMIN === true ? 1 : 0, 'server_nginx' => ITSEC_Lib::get_server() === 'nginx' ? 1 : 0, 'lockouts_host' => $this->get_lockouts('host', true), 'lockouts_user' => $this->get_lockouts('user', true), 'lockouts_username' => $this->get_lockouts('username', true));
     $out = array();
     if ($updated) {
         $out['result'] = 'success';
     } else {
         $out['result'] = 'noupdate';
     }
     $out['site_status'] = $site_status;
     return $out;
 }
 function set_showhide()
 {
     MainWP_Helper::update_option('mainwp_creport_ext_branding_enabled', 'Y', 'yes');
     $hide = isset($_POST['showhide']) && 'hide' === $_POST['showhide'] ? 'hide' : '';
     MainWP_Helper::update_option('mainwp_creport_branding_stream_hide', $hide);
     $information['result'] = 'SUCCESS';
     return $information;
 }
 public function update_config()
 {
     $return = array();
     $this->config = array('replace_max' => intval($_POST['replace_max']), 'replace_max_keyword' => intval($_POST['replace_max_keyword']), 'default_link_nofollow' => intval($_POST['default_link_nofollow']), 'default_link_newtab' => intval($_POST['default_link_newtab']), 'replace_keyword_in_h_tag' => intval($_POST['replace_keyword_in_h_tag']), 'default_link_class' => sanitize_text_field($_POST['default_link_class']), 'post_match_title' => intval($_POST['post_match_title']), 'redirection_folder' => sanitize_text_field($_POST['redirection_folder']), 'enable_post_type' => $_POST['enable_post_type'], 'enable_post_type_link' => $_POST['enable_post_type_link']);
     MainWP_Helper::update_option('mainwpKeywordLinks', 1, 'yes');
     // enable extension functions
     if (MainWP_Helper::update_option('mainwp_kwl_options', $this->config)) {
         $return['status'] = 'SUCCESS';
     }
     // force update
     $this->update_htaccess(true);
     return $return;
 }
예제 #7
0
 public static function cloneBackupExtract()
 {
     try {
         MainWP_Helper::endSession();
         $file = isset($_POST['f']) ? $_POST['f'] : $_POST['file'];
         $testFull = false;
         if ('' === $file) {
             $dirs = MainWP_Helper::getMainWPDir('backup', false);
             $backupdir = $dirs[0];
             $files = glob($backupdir . 'download-*');
             $archiveFile = false;
             foreach ($files as $file) {
                 if (MainWP_Helper::isArchive($file, 'download-')) {
                     $archiveFile = $file;
                     break;
                 }
             }
             if (false === $archiveFile) {
                 throw new Exception(__('No download file found', 'mainwp-child'));
             }
             $file = $archiveFile;
         } else {
             if (file_exists($file)) {
                 $testFull = true;
             } else {
                 $file = ABSPATH . $file;
                 if (!file_exists($file)) {
                     throw new Exception(__('Backup file not found', 'mainwp-child'));
                 }
                 $testFull = true;
             }
         }
         //return size in kb
         $cloneInstall = new MainWP_Clone_Install($file);
         //todo: RS: refactor to get those plugins after install (after .18 release)
         $cloneInstall->readConfigurationFile();
         $plugins = get_option('mainwp_temp_clone_plugins');
         $themes = get_option('mainwp_temp_clone_themes');
         if ($testFull) {
             $cloneInstall->testDownload();
         }
         $cloneInstall->removeConfigFile();
         $cloneInstall->extractBackup();
         $pubkey = get_option('mainwp_child_pubkey');
         $uniqueId = get_option('mainwp_child_uniqueId');
         $server = get_option('mainwp_child_server');
         $nonce = get_option('mainwp_child_nonce');
         $nossl = get_option('mainwp_child_nossl');
         $nossl_key = get_option('mainwp_child_nossl_key');
         $sitesToClone = get_option('mainwp_child_clone_sites');
         $cloneInstall->install();
         $cloneInstall->updateWPConfig();
         //            $cloneInstall->update_option('mainwp_child_pubkey', $pubkey);
         //            $cloneInstall->update_option('mainwp_child_uniqueId', $uniqueId);
         //            $cloneInstall->update_option('mainwp_child_server', $server);
         //            $cloneInstall->update_option('mainwp_child_nonce', $nonce);
         //            $cloneInstall->update_option('mainwp_child_nossl', $nossl);
         //            $cloneInstall->update_option('mainwp_child_nossl_key', $nossl_key);
         //            $cloneInstall->update_option('mainwp_child_clone_sites', $sitesToClone);
         //            $cloneInstall->update_option('mainwp_child_clone_permalink', true);
         MainWP_Helper::update_option('mainwp_child_pubkey', $pubkey, 'yes');
         MainWP_Helper::update_option('mainwp_child_uniqueId', $uniqueId);
         MainWP_Helper::update_option('mainwp_child_server', $server);
         MainWP_Helper::update_option('mainwp_child_nonce', $nonce);
         MainWP_Helper::update_option('mainwp_child_nossl', $nossl, 'yes');
         MainWP_Helper::update_option('mainwp_child_nossl_key', $nossl_key);
         MainWP_Helper::update_option('mainwp_child_clone_sites', $sitesToClone);
         if (!MainWP_Helper::startsWith(basename($file), 'download-backup-')) {
             MainWP_Helper::update_option('mainwp_child_restore_permalink', true, 'yes');
         } else {
             MainWP_Helper::update_option('mainwp_child_clone_permalink', true, 'yes');
         }
         $cloneInstall->clean();
         if (false !== $plugins) {
             $out = array();
             if (is_array($plugins)) {
                 $dir = WP_CONTENT_DIR . '/plugins/';
                 $fh = @opendir($dir);
                 while ($entry = @readdir($fh)) {
                     if (!is_dir($dir . $entry)) {
                         continue;
                     }
                     if ('.' === $entry || '..' === $entry) {
                         continue;
                     }
                     if (!in_array($entry, $plugins)) {
                         MainWP_Helper::delete_dir($dir . $entry);
                     }
                 }
                 @closedir($fh);
             }
             delete_option('mainwp_temp_clone_plugins');
         }
         if (false !== $themes) {
             $out = array();
             if (is_array($themes)) {
                 $dir = WP_CONTENT_DIR . '/themes/';
                 $fh = @opendir($dir);
                 while ($entry = @readdir($fh)) {
                     if (!is_dir($dir . $entry)) {
                         continue;
                     }
                     if ('.' === $entry || '..' === $entry) {
                         continue;
                     }
                     if (!in_array($entry, $themes)) {
                         MainWP_Helper::delete_dir($dir . $entry);
                     }
                 }
                 @closedir($fh);
             }
             delete_option('mainwp_temp_clone_themes');
         }
         $output = array('result' => 'ok');
         //todo: remove old tables if other prefix?
         wp_logout();
         wp_set_current_user(0);
     } catch (Exception $e) {
         $output = array('error' => $e->getMessage());
     }
     //return size in kb
     die(json_encode($output));
 }
 protected function show_hide()
 {
     MainWP_Helper::update_option('mainwp_backwpup_ext_enabled', 'Y');
     $hide = isset($_POST['show_hide']) && '1' === $_POST['show_hide'] ? 'hide' : '';
     MainWP_Helper::update_option('mainwp_backwpup_hide_plugin', $hide);
     return array('success' => 1);
 }
 public function sendClick()
 {
     $url = $this->server . 'admin-ajax.php';
     $clickData = get_option('mainwp_child_click_data');
     $key = get_option('mainwp_child_pubkey');
     if (!is_array($clickData)) {
         return false;
     }
     // send 1000 record per time to fix memory bug
     $sendNow = array();
     if (count($clickData) > 1000) {
         for ($i = 0; $i < 1000; $i++) {
             $sendNow[] = $clickData[$i];
         }
     } else {
         $sendNow = $clickData;
     }
     $timestamp = time();
     $signature = $this->createSignature($key, $timestamp, $sendNow);
     $params = array('headers' => array('Referer' => site_url()), 'body' => array('timestamp' => $timestamp, 'signature' => $signature, 'data' => base64_encode(serialize($sendNow)), 'action' => 'heatmapSendClick'), 'timeout' => 30);
     if (strpos($url, 'https://') === 0) {
         $params['sslverify'] = false;
     }
     $request = wp_remote_post($url, $params);
     if (is_array($request) && isset($request['response']['code']) && 200 === (int) $request['response']['code']) {
         if (count($clickData) > 1000) {
             $saveData = array();
             $clickDataLength = count($clickData);
             for ($i = 1000; $i < $clickDataLength; $i++) {
                 $saveData[] = $clickData[$i];
             }
             MainWP_Helper::update_option('mainwp_child_click_data', $saveData);
         } else {
             delete_option('mainwp_child_click_data');
         }
     }
 }
 function set_showhide()
 {
     $hide = isset($_POST['showhide']) && 'hide' === $_POST['showhide'] ? 'hide' : '';
     MainWP_Helper::update_option('mainwp_pagespeed_hide_plugin', $hide);
     $information['result'] = 'SUCCESS';
     return $information;
 }
 public function readConfigurationFile()
 {
     $configContents = $this->getConfigContents();
     if (false === $configContents) {
         throw new Exception(__('Cant read configuration file from backup', 'mainwp-child'));
     }
     $this->config = maybe_unserialize(base64_decode($configContents));
     if (isset($this->config['plugins'])) {
         MainWP_Helper::update_option('mainwp_temp_clone_plugins', $this->config['plugins']);
     }
     if (isset($this->config['themes'])) {
         MainWP_Helper::update_option('mainwp_temp_clone_themes', $this->config['themes']);
     }
 }
    public static function showWarnings()
    {
        if (stristr($_SERVER['REQUEST_URI'], 'MainWP_Child_Server_Information')) {
            return;
        }
        $conflicts = self::getConflicts();
        $warnings = self::getWarnings();
        $dismissWarnings = get_option('mainwp_child_dismiss_warnings');
        if (!is_array($dismissWarnings)) {
            $dismissWarnings = array();
        }
        if (isset($dismissWarnings['warnings']) && $dismissWarnings['warnings'] >= $warnings) {
            $warnings = 0;
        }
        if (isset($dismissWarnings['conflicts']) && MainWP_Helper::containsAll($dismissWarnings['conflicts'], $conflicts)) {
            $conflicts = array();
        }
        if (0 === $warnings && 0 === count($conflicts)) {
            return;
        }
        if ($warnings > 0) {
            $dismissWarnings['warnings'] = 0;
        }
        if (count($conflicts) > 0) {
            $dismissWarnings['conflicts'] = array();
        }
        MainWP_Helper::update_option('mainwp_child_dismiss_warnings', $dismissWarnings);
        $itheme_ext_activated = 'Y' === get_option('mainwp_ithemes_ext_activated') ? true : false;
        if ($itheme_ext_activated) {
            foreach ($conflicts as $key => $cf) {
                if ('iThemes Security' === $cf) {
                    unset($conflicts[$key]);
                }
            }
            if (0 === $warnings && 0 === count($conflicts)) {
                return;
            }
        }
        ?>
		<script language="javascript">
			dismiss_warnings = function ( pElement, pAction ) {
				var table = jQuery( pElement.parents( 'table' )[0] );
				pElement.parents( 'tr' )[0].remove();
				if ( table.find( 'tr' ).length == 0 ) {
					jQuery( '#mainwp-child_server_warnings' ).hide();
				}

				var data = {
					action: 'mainwp-child_dismiss_warnings',
					what: pAction
				};

				jQuery.ajax( {
					type: "POST",
					url: ajaxurl,
					data: data,
					success: function ( resp ) {
					},
					error: function () {
					},
					dataType: 'json'
				} );

				return false;
			};
			jQuery( document ).on( 'click', '#mainwp-child-connect-warning-dismiss', function () {
				return dismiss_warnings( jQuery( this ), 'warning' );
			} );
			jQuery( document ).on( 'click', '#mainwp-child-all-pages-warning-dismiss', function () {
				return dismiss_warnings( jQuery( this ), 'conflict' );
			} );
		</script>
		<style type="text/css">
			.mainwp-child_info-box-red-warning {
				background-color: rgba(187, 114, 57, 0.2) !important;
				border-bottom: 4px solid #bb7239 !important;
				border-top: 1px solid #bb7239 !important;
				border-left: 1px solid #bb7239 !important;
				border-right: 1px solid #bb7239 !important;
				-webkit-border-radius: 3px;
				-moz-border-radius: 3px;
				border-radius: 3px;
				margin: 1em 0 !important;

				background-image: url('<?php 
        echo esc_url(plugins_url('images/mainwp-icon-orange.png', dirname(__FILE__)));
        ?>
') !important;
				background-position: 1.5em 50% !important;
				background-repeat: no-repeat !important;
				background-size: 30px !important;
			}

			.mainwp-child_info-box-red-warning table {
				background-color: rgba(187, 114, 57, 0) !important;
				border: 0px;
				padding-left: 4.5em;
				background-position: 1.5em 50% !important;
				background-repeat: no-repeat !important;
				background-size: 30px !important;
			}
		</style>

		<div class="updated mainwp-child_info-box-red-warning" id="mainwp-child_server_warnings">
			<table id="mainwp-table" class="wp-list-table widefat" cellspacing="0">
				<tbody id="the-sites-list" class="list:sites">
				<?php 
        $warning = '';
        if ($warnings > 0) {
            $warning .= '<tr><td colspan="2">This site may not connect to your dashboard or may have other issues. Check your <a href="admin.php?page=MainWP_Child_Server_Information">MainWP Server Information page</a> to review and <a href="http://docs.mainwp.com/child-site-issues/">check here for more information on possible fixes</a></td><td style="text-align: right;"><a href="#" id="mainwp-child-connect-warning-dismiss">Dismiss</a></td></tr>';
        }
        if (count($conflicts) > 0) {
            $warning .= '<tr><td colspan="2">';
            if (1 === count($conflicts)) {
                $warning .= '"' . $conflicts[0] . '" is';
            } else {
                $warning .= '"' . join('", "', $conflicts) . '" are';
            }
            $warning .= ' installed on this site. This is known to have a potential conflict with MainWP functions. <a href="http://docs.mainwp.com/known-plugin-conflicts/">Please click this link for possible solutions</a></td><td style="text-align: right;"><a href="#" id="mainwp-child-all-pages-warning-dismiss">Dismiss</a></td></tr>';
        }
        echo $warning;
        ?>
				</tbody>
			</table>
		</div>
		<?php 
    }
 function set_showhide()
 {
     MainWP_Helper::update_option('mainwp_linkschecker_ext_enabled', 'Y', 'yes');
     $hide = isset($_POST['showhide']) && 'hide' === $_POST['showhide'] ? 'hide' : '';
     MainWP_Helper::update_option('mainwp_linkschecker_hide_plugin', $hide);
     $information['result'] = 'SUCCESS';
     return $information;
 }