diff --git a/class/MainWPChild.class.php b/class/MainWPChild.class.php index 4a864cb..328dba2 100644 --- a/class/MainWPChild.class.php +++ b/class/MainWPChild.class.php @@ -11,7 +11,7 @@ include_once(ABSPATH . '/wp-admin/includes/plugin.php'); class MainWPChild { - private $version = '2.0.18'; + private $version = '2.0.19'; private $update_version = '1.2'; private $callableFunctions = array( @@ -356,6 +356,12 @@ class MainWPChild MainWPClone::init_restore_menu($this->branding, $mainwp_child_menu_slug); } } + $subpageargs = array( + 'child_slug' => $mainwp_child_menu_slug, + 'branding' => $this->branding + ); + do_action('mainwp-child-subpages', $subpageargs); + } } @@ -1468,7 +1474,9 @@ class MainWPChild $post_tags = rawurldecode(isset($new_post['post_tags']) ? $new_post['post_tags'] : null); $post_featured_image = base64_decode ($_POST['post_featured_image']); $upload_dir = unserialize(base64_decode ($_POST['mainwp_upload_dir'])); - $new_post['_ezin_post_category'] = unserialize(base64_decode ($_POST['_ezin_post_category'])); + + if (isset($_POST['_ezin_post_category'])) + $new_post['_ezin_post_category'] = unserialize(base64_decode ($_POST['_ezin_post_category'])); $res = MainWPHelper::createPost($new_post, $post_custom, $post_category, $post_featured_image, $upload_dir, $post_tags); $created = $res['success']; @@ -2374,6 +2382,10 @@ class MainWPChild include_once(ABSPATH . '/wp-admin/includes/update.php'); + $timeout = 3 * 60 * 60; // 3minutes + @set_time_limit($timeout); + @ini_set('max_execution_time', $timeout); + //Check for new versions if ($this->filterFunction != null) add_filter( 'pre_site_transient_update_core', $this->filterFunction, 99 ); if ($this->filterFunction != null) add_filter( 'pre_transient_update_core', $this->filterFunction, 99 ); diff --git a/class/MainWPChildBackUpWordPress.class.php b/class/MainWPChildBackUpWordPress.class.php index 1ae53e6..027f33b 100644 --- a/class/MainWPChildBackUpWordPress.class.php +++ b/class/MainWPChildBackUpWordPress.class.php @@ -23,11 +23,16 @@ class MainWPChildBackUpWordPress if (get_option('mainwp_backupwordpress_hide_plugin') === "hide") { add_filter('all_plugins', array($this, 'all_plugins')); - add_action('admin_menu', array($this, 'remove_menu')); - add_filter('update_footer', array(&$this, 'update_footer'), 15); + add_action('admin_menu', array($this, 'remove_menu')); + add_filter('site_transient_update_plugins', array(&$this, 'remove_update_nag')); } } + function remove_update_nag($value) { + if (isset($value->response['backupwordpress/backupwordpress.php'])) + unset($value->response['backupwordpress/backupwordpress.php']); + return $value; + } public function action() { $information = array(); @@ -112,9 +117,13 @@ class MainWPChildBackUpWordPress if (!empty($existing_backup)) { $backups_time = array_merge( $backups_time, array_keys($existing_backup)); } - } + } - $return = array('lasttime_backup' => max($backups_time)); + $lasttime_backup = 0; + if(!empty($backups_time)) + $lasttime_backup = max($backups_time); + + $return = array('lasttime_backup' => $lasttime_backup); return $return; } @@ -879,62 +888,6 @@ class MainWPChildBackUpWordPress wp_redirect(get_option('siteurl') . '/wp-admin/index.php'); exit(); } - } - - function update_footer($text){ - if (stripos($_SERVER['REQUEST_URI'], 'update-core.php') !== false) { - ?> - - check_update_child_plugin()) { - ?> - - response )) { - $response = $update_plugins->response; - if (is_array($response) && isset($response['backupwordpress/backupwordpress.php'])) - return true; - } - } - return false; - } - + } } diff --git a/class/MainWPChildReportsConnectorBackups.class.php b/class/MainWPChildReportsConnectorBackups.class.php new file mode 100644 index 0000000..0e148e2 --- /dev/null +++ b/class/MainWPChildReportsConnectorBackups.class.php @@ -0,0 +1,77 @@ + __( 'Backup', 'default' ), + ); + } + + /** + * Return translated context labels + * + * @return array Context label translations + */ + public static function get_context_labels() { + return array( + 'mainwp_backups' => __( 'MainWP Backups', 'mainwp-child' ), + ); + } + + /** + * Add action links to Stream drop row in admin list screen + * + * @filter wp_stream_action_links_{connector} + * @param array $links Previous links registered + * @param int $record Stream record + * @return array Action links + */ + public static function action_links( $links, $record ) { + if (isset($record->object_id)) { + } + return $links; + } + + public static function callback_mainwp_backup($destination, $message, $size, $status, $type) { + self::log( + $message, + compact('destination', 'status', 'type', 'size'), + 0, + array( 'mainwp_backups' => 'mainwp_backup' ) + ); + } + } +} + diff --git a/class/MainWPChildReportsConnectorSucuri.class.php b/class/MainWPChildReportsConnectorSucuri.class.php new file mode 100644 index 0000000..2a12fee --- /dev/null +++ b/class/MainWPChildReportsConnectorSucuri.class.php @@ -0,0 +1,94 @@ + __( 'Scan', 'default' ), + ); + } + + /** + * Return translated context labels + * + * @return array Context label translations + */ + public static function get_context_labels() { + return array( + 'mainwp_sucuri' => __( 'MainWP Sucuri', 'default' ), + ); + } + + /** + * Add action links to Stream drop row in admin list screen + * + * @filter wp_stream_action_links_{connector} + * @param array $links Previous links registered + * @param int $record Stream record + * @return array Action links + */ + public static function action_links( $links, $record ) { + if ( isset($record->object_id )) { + + } + return $links; + } + + public static function callback_mainwp_sucuri_scan($data, $scan_status) { + $message = ""; + if ($scan_status == "success") { + $message = __("Sucuri scan success", "mainwp-child"); + $scan_status = "success"; + } else { + $message = __("Sucuri scan failed", "mainwp-child"); + $scan_status = "failed"; + } + + $scan_result = unserialize(base64_decode($data)); + $status = $webtrust = ""; + if (is_array($scan_result)) { + $status = isset($scan_result['status']) ? $scan_result['status'] : ""; + $webtrust = isset($scan_result['webtrust']) ? $scan_result['webtrust'] : ""; + } + + self::log( + $message, + compact('scan_status', 'status', 'webtrust'), + 0, + array( 'mainwp_sucuri' => 'mainwp_sucuri_scan' ) + ); + } + } +} + diff --git a/class/MainWPChildServerInformation.class.php b/class/MainWPChildServerInformation.class.php index 53d3cf2..56dc19a 100644 --- a/class/MainWPChildServerInformation.class.php +++ b/class/MainWPChildServerInformation.class.php @@ -279,6 +279,20 @@ class MainWPChildServerInformation ?>
Pass'; + } else { + echo ' Warning'; + } + } + public static function render() { ?> @@ -304,12 +318,14 @@ class MainWPChildServerInformation ?>=', '5.3', 'getPHPVersion'); self::renderRow('PHP Max Execution Time', '>=', '30', 'getMaxExecutionTime', 'seconds', '=', '0'); - self::renderRow('PHP Upload Max Filesize', '>=', '2M', 'getUploadMaxFilesize', '(2MB+ best for upload of big plugins)'); - self::renderRow('PHP Post Max Size', '>=', '2M', 'getPostMaxSize', '(2MB+ best for upload of big plugins)'); -// self::renderRow('PHP Memory Limit', '>=', '128M', 'getPHPMemoryLimit', '(256M+ best for big backups)'); + self::renderRow('PHP Upload Max Filesize', '>=', '2M', 'getUploadMaxFilesize', '(2MB+ best for upload of big plugins)', null, null, true); + self::renderRow('PHP Post Max Size', '>=', '2M', 'getPostMaxSize', '(2MB+ best for upload of big plugins)', null, null, true); + self::renderRow('PHP Memory Limit', '>=', '128M', 'getPHPMemoryLimit', '(256M+ best for big backups)' , null, null, true); + self::renderRow('SSL Extension Enabled', '=', true, 'getSSLSupport'); ?>=', '10000', 'getOutputBufferSize'); - self::renderRow('SSL Extension Enabled', '=', true, 'getSSLSupport'); + ?>=', '5.0', 'getMySQLVersion'); ?> + + Pass' : ' Warning'); ?> + Pass' : ' Warning'); ?> + set_showhide(); break; case "save_settings": $information = $this->save_settings(); - break; + break; + case "addons_connect": + $information = $this->addons_connect(); + break; case "backup_now": $information = $this->backup_now(); break; @@ -100,8 +107,7 @@ class MainWPChildUpdraftplusBackups MainWPHelper::write($information); } - function set_showhide() { - MainWPHelper::update_option('mainwp_updraftplus_ext_enabled', "Y", 'yes'); + function set_showhide() { $hide = isset($_POST['showhide']) && ($_POST['showhide'] === "hide") ? 'hide' : ""; MainWPHelper::update_option('mainwp_updraftplus_hide_plugin', $hide); $information['result'] = 'SUCCESS'; @@ -178,13 +184,13 @@ class MainWPChildUpdraftplusBackups 'updraft_copycom', 'updraft_sftp_settings', 'updraft_webdav_settings', - 'updraft_dreamobjects' + 'updraft_dreamobjects', + 'updraft_onedrive' ); } function save_settings() { - MainWPHelper::update_option('mainwp_updraftplus_ext_enabled', "Y", 'yes'); $settings = unserialize(base64_decode($_POST['settings'])); $keys = $this->get_settings_keys(); @@ -210,6 +216,14 @@ class MainWPChildUpdraftplusBackups $opts['folder'] = $settings[$key]['folder']; UpdraftPlus_Options::update_updraft_option($key, $opts); } + } else if ($key == "updraft_onedrive") { + if (isset($settings[$key])) { + $opts = UpdraftPlus_Options::get_updraft_option('updraft_onedrive'); + $opts['clientid'] = $settings[$key]['clientid']; + $opts['secret'] = $settings[$key]['secret']; + $opts['folder'] = $settings[$key]['folder']; + UpdraftPlus_Options::update_updraft_option($key, $opts); + } } else { UpdraftPlus_Options::update_updraft_option($key, $settings[$key]); } @@ -246,6 +260,78 @@ class MainWPChildUpdraftplusBackups return $out; } + function addons_connect() { + if (!defined('UDADDONS2_SLUG')) + return array('error' => 'NO_PREMIUM'); + + $addons_options = unserialize(base64_decode($_POST['addons_options'])); + if (!is_array($addons_options)) $addons_options = array(); + + $updated = $this->update_wpmu_options($addons_options); + + $out = array(); + if ($updated) + $out['result'] = 'success'; + return $out; + } + + public function update_wpmu_options($value) { + + if ( !UpdraftPlus_Options::user_can_manage() ) return; + $options = $this->addons2_get_option(UDADDONS2_SLUG.'_options'); + if (!is_array($options)) $options=array(); + + $options['email'] = isset($value['email']) ? $value['email'] : ""; + $options['password'] = isset($value['password']) ? $value['password'] : ""; + + $options = $this->options_validate($options); + $this->addons2_update_option(UDADDONS2_SLUG.'_options', $options); + return true; + } + + // Funnelling through here a) allows for future flexibility and b) allows us to migrate elegantly from the previous non-MU-friendly setup + public function addons2_get_option($option) { + $val = get_site_option($option); + # On multisite, migrate options into the site options + if (false === $val && is_multisite()) { + $blog_id = get_current_blog_id(); + if ($blog_id>1) { + $val = get_option($option); + if ($val !== false) { + delete_option($option); + update_site_option($option, $val); + return $val; + } + } + # $val is still false + switch_to_blog(1); + $val = get_option($option); + if ($val !== false) { + delete_option($option); + update_site_option($option, $val); + } + restore_current_blog(); + } + return $val; + } + + public function addons2_update_option($option, $val) { + return update_site_option($option, $val); + } + + public function options_validate($input) { + # See: http://codex.wordpress.org/Function_Reference/add_settings_error + + // When the options are re-saved, clear any previous cache of the connection status + $ehash = substr(md5($input['email']), 0, 23); + delete_site_transient('udaddons_connect_'.$ehash); + + // add_settings_error( UDADDONS2_SLUG."_options", UDADDONS2_SLUG."_options_nodb", "Whinge, whinge", "error" ); + + return $input; + } + + /* *Plugin: UpdraftPlus - Backup/Restore *PluginURI: http://updraftplus.com @@ -2649,8 +2735,14 @@ ENDHERE; { add_filter('all_plugins', array($this, 'all_plugins')); add_action( 'admin_menu', array($this, 'remove_menu')); - add_filter('update_footer', array(&$this, 'update_footer'), 15); + add_filter('site_transient_update_plugins', array(&$this, 'remove_update_nag')); } + } + + function remove_update_nag($value) { + if (isset($value->response['updraftplus/updraftplus.php'])) + unset($value->response['updraftplus/updraftplus.php']); + return $value; } public function syncData() { @@ -2687,60 +2779,5 @@ ENDHERE; } } - function update_footer($text){ - if (stripos($_SERVER['REQUEST_URI'], 'update-core.php') !== false) { - ?> - - check_update_child_plugin()) { - ?> - - response )) { - $response = $update_plugins->response; - if (is_array($response) && isset($response['updraftplus/updraftplus.php'])) - return true; - } - } - return false; - } - } diff --git a/class/MainWPClientReport.class.php b/class/MainWPClientReport.class.php index 46ac56f..9252343 100644 --- a/class/MainWPClientReport.class.php +++ b/class/MainWPClientReport.class.php @@ -3,7 +3,8 @@ class MainWPClientReport { public static $instance = null; - + public static $mainwpChildReports = false; + static function Instance() { if (MainWPClientReport::$instance == null) { MainWPClientReport::$instance = new MainWPClientReport(); @@ -11,22 +12,15 @@ class MainWPClientReport return MainWPClientReport::$instance; } - public function __construct() { - global $wpdb; - add_action('mainwp_child_deactivation', array($this, 'child_deactivation')); - + } public static function init() { add_filter('wp_stream_connectors', array('MainWPClientReport', 'init_stream_connectors'), 10, 1); + add_filter('mainwp_client_reports_connectors', array('MainWPClientReport', 'init_connectors'), 10, 1); } - - public function child_deactivation() - { - - } - + public static function init_stream_connectors($classes) { $connectors = array( 'Backups', @@ -40,20 +34,31 @@ class MainWPClientReport return $classes; } + public static function init_connectors($classes) { + $connectors = array( + 'Backups', + 'Sucuri', + ); + + foreach ( $connectors as $connector ) { + $class = "MainWPChildReportsConnector$connector"; + $classes[] = $class; + } + return $classes; + } + public function action() { + $information = array(); - if (!function_exists('wp_stream_query') || !class_exists('WP_Stream') ) { + if (function_exists('mainwp_wp_stream_query') && class_exists('MainWP_WP_Stream') ) { + self::$mainwpChildReports = true; + } else if (function_exists('wp_stream_query') && class_exists('WP_Stream') ) { + self::$mainwpChildReports = false; + } else { $information['error'] = 'NO_STREAM'; MainWPHelper::write($information); } - if (version_compare(WP_Stream::VERSION, '2.0.0', '>=') && function_exists('WP_Stream::is_connected')) { - if (!WP_Stream::is_connected()) { - $information['error'] = 'NOT_CONNECT_STREAM'; - MainWPHelper::write($information); - } - } - if (isset($_POST['mwp_action'])) { switch ($_POST['mwp_action']) { case "save_sucuri_stream": @@ -82,12 +87,7 @@ class MainWPClientReport do_action("mainwp_backup", $_POST['destination'] , $_POST['message'], $_POST['size'], $_POST['status'], $_POST['type']); return true; } - - public function save_ga_stream() { - do_action("mainwp_ga"); - return true; - } - + public function get_stream() { // Filters $allowed_params = array( @@ -120,11 +120,15 @@ class MainWPClientReport unset($_POST['other_tokens']); $args = array(); - foreach ( $allowed_params as $param ) { - $paramval = wp_stream_filter_input( INPUT_POST, $param ); - if ( $paramval || '0' === $paramval ) { - $args[ $param ] = $paramval; - } + foreach ( $allowed_params as $param ) { + if (self::$mainwpChildReports) { + $paramval = mainwp_wp_stream_filter_input( INPUT_POST, $param ); + } else { + $paramval = wp_stream_filter_input( INPUT_POST, $param ); + } + if ( $paramval || '0' === $paramval ) { + $args[ $param ] = $paramval; + } } foreach ( $args as $arg => $val ) { @@ -133,27 +137,23 @@ class MainWPClientReport } } - $args['action__not_in'] = array('login'); - - if (self::is_version_2()) { - if (isset($args['date_from'])) - $args['date_from'] = date("Y-m-d", $args['date_from']); + $args['action__not_in'] = array('login'); + + $args['fields'] = 'with-meta'; + if (isset($args['date_from'])) + $args['date_from'] = date("Y-m-d H:i:s", $args['date_from']); - if (isset($args['date_to'])) - $args['date_to'] = date("Y-m-d", $args['date_to']); - } else { - $args['fields'] = 'with-meta'; - if (isset($args['date_from'])) - $args['date_from'] = date("Y-m-d H:i:s", $args['date_from']); - - if (isset($args['date_to'])) - $args['date_to'] = date("Y-m-d H:i:s", $args['date_to']); - } + if (isset($args['date_to'])) + $args['date_to'] = date("Y-m-d H:i:s", $args['date_to']); $args['records_per_page'] = 9999; -// error_log(print_r($args, true)); +// error_log(print_r($args, true)); - $records = wp_stream_query( $args ); + if (self::$mainwpChildReports) { + $records = mainwp_wp_stream_query( $args ); + } else { + $records = wp_stream_query( $args ); + } // if (count($records) > 0) // error_log(print_r($records, true)); @@ -206,10 +206,7 @@ class MainWPClientReport } function get_other_tokens_data($records, $tokens) { - if (self::is_version_2()) { - return $this->get_other_tokens_data_two($records, $tokens); - } - + $convert_context_name = array( "comment" => "comments", "plugin" => "plugins", @@ -307,110 +304,7 @@ class MainWPClientReport } return $token_values; } - - function get_other_tokens_data_two($records, $tokens) { - - $convert_context_name = array( - "comment" => "comments", - "plugin" => "plugins", - "profile" => "profiles", - "session" => "sessions", - "setting" => "settings", - "setting" => "settings", - "theme" => "themes", - "posts" => "post", - "pages" => "page", - "user" => "users", - "widget" => "widgets", - "menu" => "menus", - "backups" => "mainwp_backups", - "backup" => "mainwp_backups", - "sucuri" => "mainwp_sucuri", - ); - - $convert_action_name = array( - "restored" => "untrashed", - "spam" => "spammed", - "backups" => "mainwp_backup", - "backup" => "mainwp_backup" - ); - - $allowed_data = array( - 'count' - ); - - $token_values = array(); - - if (!is_array($tokens)) - $tokens = array(); - - foreach ($tokens as $token) { - $str_tmp = str_replace(array('[', ']'), "", $token); - $array_tmp = explode(".", $str_tmp); - - if (is_array($array_tmp)) { - $context = $action = $data = ""; - if (count($array_tmp) == 2) { - list($context, $data) = $array_tmp; - } else if (count($array_tmp) == 3) { - list($context, $action, $data) = $array_tmp; - } - - $context = isset($convert_context_name[$context]) ? $convert_context_name[$context] : $context; - if (isset($convert_action_name[$action])) { - $action = $convert_action_name[$action]; - } - - switch ($data) { - case "count": - $count = 0; - foreach ($records as $record) { - if ($context == "plugins" && $action == "edited") { - if ($record->action !== "updated" || $record->connector !== "editor") - continue; - } else if ($context == "themes" && $action == "edited") { - if ($record->action !== "updated" || $record->connector !== "editor") - continue; - } else if ($context == "users" && $action == "updated") { - if ($record->context !== "profiles" || $record->connector !== "users") - continue; - } else if ($context == "mainwp_backups") { - if ($record->context !== "mainwp_backups") { - continue; - } - } else if ($context == "mainwp_sucuri") { - if ($record->context !== "mainwp_sucuri") { - continue; - } - } else { - if ($action != $record->action) - continue; - - if ($context == "comments" && $record->context != "page" && $record->context != "post") - continue; - else if ($context == "media" && $record->connector != "media") - continue; - else if ($context == "widgets" && $record->connector != "widgets") - continue; - else if ($context == "menus" && $record->connector != "menus") - continue; - - if ($context !== "comments" && $context !== "media" && - $context !== "widgets" && $context !== "menus" && - $record->context != $context) - continue; - } - $count++; - } - $token_values[$token] = $count; - break; - } - } - } - return $token_values; - } - - + function get_section_loop_data($records, $tokens, $section) { $convert_context_name = array( @@ -466,16 +360,6 @@ class MainWPClientReport foreach ($records as $record) { $theme_edited = $users_updated = $plugin_edited = false; - if (self::is_version_2()) { - if ($context == "plugins" && $action == "edited") { - if ($record->action !== "updated" || $record->connector !== "editor") - continue; - else { - $plugin_edited = true; - } - } - } - if($plugin_edited) { // ok next } else if ($context == "themes" && $action == "edited") { @@ -622,19 +506,12 @@ class MainWPClientReport } // foreach $records return $loops; } - - public static function is_version_2() { - return version_compare(WP_Stream::VERSION, '2.0.0', '>='); - } - + function get_stream_meta_data($record, $data) { if (empty($record)) return ""; - - if (self::is_version_2()) - return $this->get_stream_meta_data_two($record, $data); - + $record_id = $record->ID; $meta_key = $data; @@ -655,28 +532,7 @@ class MainWPClientReport return $value; } - - function get_stream_meta_data_two($record, $data) { - $meta_key = $data; - $stream_meta = $author_meta = false; - - if (is_object($record)) { - if (isset($record->stream_meta)) - $stream_meta = $record->stream_meta; - if (isset($record->author_meta)) - $author_meta = $record->author_meta; - } - $value = ""; - if ($meta_key == "author_meta") { - if (is_object($author_meta) && isset($author_meta->display_name)) - $value = $author_meta->display_name; - } else if (is_object($stream_meta) && isset($stream_meta->{$meta_key})){ - $value = $stream_meta->{$meta_key}; - } - - return $value; - } - + function set_showhide() { MainWPHelper::update_option('mainwp_creport_ext_branding_enabled', "Y", 'yes'); $hide = isset($_POST['showhide']) && ($_POST['showhide'] === "hide") ? 'hide' : ""; @@ -694,80 +550,33 @@ class MainWPClientReport { add_filter('all_plugins', array($this, 'creport_branding_plugin')); add_action( 'admin_menu', array($this, 'creport_remove_menu')); - add_filter('update_footer', array(&$this, 'update_footer'), 15); + add_filter('site_transient_update_plugins', array(&$this, 'remove_update_nag')); } } - + function remove_update_nag($value) { + if (isset($value->response['stream/stream.php'])) + unset($value->response['stream/stream.php']); + + if (isset($value->response['mainwp-child-reports/mainwp-child-reports.php'])) + unset($value->response['mainwp-child-reports/mainwp-child-reports.php']); + return $value; + } + + public function creport_branding_plugin($plugins) { foreach ($plugins as $key => $value) { $plugin_slug = basename($key, '.php'); - if ($plugin_slug == 'stream') - unset($plugins[$key]); + if ($plugin_slug == 'stream' || $plugin_slug == 'mainwp-child-reports') + unset($plugins[$key]); } return $plugins; } public function creport_remove_menu() { remove_menu_page('wp_stream'); + remove_menu_page('mainwp_wp_stream'); } - - - function check_update_stream_plugin() { - if ( $plugins = current_user_can( 'update_plugins' ) ) { - $update_plugins = get_site_transient( 'update_plugins' ); - if (!empty( $update_plugins->response )) { - $response = $update_plugins->response; - if (is_array($response) && isset($response['stream/stream.php'])) - return true; - } - } - return false; - } - - function update_footer($text){ - if (stripos($_SERVER['REQUEST_URI'], 'update-core.php') !== false) - { - ?> - - check_update_stream_plugin()) { - ?> - - 'mainwp_backup' ) - ); - } + public static function callback_mainwp_backup($destination, $message, $size, $status, $type) { + self::log( + $message, + compact('destination', 'status', 'type', 'size'), + 0, + array( 'mainwp_backups' => 'mainwp_backup' ) + ); } } } diff --git a/class/MainWPStreamConnectorSucuri.class.php b/class/MainWPStreamConnectorSucuri.class.php index f46d2a3..897ce34 100644 --- a/class/MainWPStreamConnectorSucuri.class.php +++ b/class/MainWPStreamConnectorSucuri.class.php @@ -81,23 +81,12 @@ if (class_exists('WP_Stream_Connector')) { $status = isset($scan_result['status']) ? $scan_result['status'] : ""; $webtrust = isset($scan_result['webtrust']) ? $scan_result['webtrust'] : ""; } - - if (MainWPClientReport::is_version_2()) { - self::log( - $message, - compact('scan_status', 'status', 'webtrust'), - 0, - 'mainwp_sucuri', - 'mainwp_sucuri_scan' - ); - } else { - self::log( - $message, - compact('scan_status', 'status', 'webtrust'), - 0, - array( 'mainwp_sucuri' => 'mainwp_sucuri_scan' ) - ); - } + self::log( + $message, + compact('scan_status', 'status', 'webtrust'), + 0, + array( 'mainwp_sucuri' => 'mainwp_sucuri_scan' ) + ); } } } diff --git a/js/tracker.js b/js/tracker.js index 8d01f6e..7b0eb0e 100644 --- a/js/tracker.js +++ b/js/tracker.js @@ -1,5 +1,5 @@ /** - * Mouse click tracking + * Mouse click tracking */ var trackerData = []; @@ -27,7 +27,7 @@ jQuery(document).ready(function($){ }); $(window).unload(function(){ - sendTrackData(true); // Make sure to send track data before going off from page, set it synchronious + sendTrackData(false); // Make sure to send track data before going off from page, set it synchronious }); function getSelector() diff --git a/mainwp-child.php b/mainwp-child.php index 3fa7b3c..8d73b3f 100644 --- a/mainwp-child.php +++ b/mainwp-child.php @@ -5,9 +5,11 @@ Description: Child Plugin for MainWP. The plugin is used so the installed blog can be securely managed remotely by your network. Plugin documentation and options can be found here http://docs.mainwp.com Author: MainWP Author URI: http://mainwp.com - Version: 2.0.19-beta + Version: 2.0.19 */ -header('X-Frame-Options: ALLOWALL'); +if ((isset($_REQUEST['heatmap']) && $_REQUEST['heatmap'] == '1') || (isset($_REQUEST['mainwpsignature']) && (!empty($_REQUEST['mainwpsignature'])))) { + header('X-Frame-Options: ALLOWALL'); +} //header('X-Frame-Options: GOFORIT'); include_once(ABSPATH . 'wp-includes' . DIRECTORY_SEPARATOR . 'version.php'); //Version information from wordpress