From 591bc7822f77065b96ba7b93da33e042d61f8574 Mon Sep 17 00:00:00 2001 From: ruben- Date: Wed, 18 Jan 2017 22:33:53 +0100 Subject: [PATCH] merging + version update --- class/class-mainwp-child-branding.php | 74 +++++--------------------- class/class-mainwp-child-wordfence.php | 2 +- class/class-mainwp-child.php | 11 ++-- class/class-mainwp-helper.php | 2 +- mainwp-child.php | 2 +- 5 files changed, 24 insertions(+), 67 deletions(-) diff --git a/class/class-mainwp-child-branding.php b/class/class-mainwp-child-branding.php index e81273b..6514938 100644 --- a/class/class-mainwp-child-branding.php +++ b/class/class-mainwp-child-branding.php @@ -275,6 +275,10 @@ class MainWP_Child_Branding { // enable branding in case child plugin is deactive add_filter( 'all_plugins', array( $this, 'branding_child_plugin' ) ); + if ( self::is_branding() ) { + add_filter( 'site_transient_update_plugins', array( &$this, 'remove_update_nag' ) ); + } + if ( get_option( 'mainwp_branding_ext_enabled' ) !== 'Y' ) { return; } @@ -299,7 +303,6 @@ class MainWP_Child_Branding { add_action( 'admin_bar_menu', array( $this, 'add_support_button_in_top_admin_bar' ), 100 ); } } - add_filter( 'update_footer', array( &$this, 'update_footer' ), 15 ); if ( get_option( 'mainwp_branding_disable_wp_branding' ) !== 'Y' ) { add_filter( 'wp_footer', array( &$this, 'branding_global_footer' ), 15 ); add_action( 'wp_dashboard_setup', array( &$this, 'custom_dashboard_widgets' ), 999 ); @@ -761,65 +764,6 @@ class MainWP_Child_Branding { return 'MainWP'; } - function check_update_child_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['mainwp-child/mainwp-child.php'] ) ) { - return true; - } - } - } - - return false; - } - - function update_footer( $text ) { - if ( self::is_branding() ) { - if ( stripos( $_SERVER['REQUEST_URI'], 'update-core.php' ) !== false ) { - ?> - - check_update_child_plugin() ) { - ?> - - response['mainwp-child/mainwp-child.php'] ) ) { + unset( $value->response['mainwp-child/mainwp-child.php'] ); + } + return $value; + } + public function update_child_header( $plugins, $header ) { $plugin_key = ''; foreach ( $plugins as $key => $value ) { diff --git a/class/class-mainwp-child-wordfence.php b/class/class-mainwp-child-wordfence.php index 2954fbd..10da32b 100644 --- a/class/class-mainwp-child-wordfence.php +++ b/class/class-mainwp-child-wordfence.php @@ -1324,7 +1324,7 @@ class MainWP_Child_Wordfence { return array( 'ok' => 1 , 'download_url' => $download_url ); } - public static function downloadHtaccess(){ + public static function downloadHtaccess() { if ( ! isset( $_GET['_wpnonce'] ) || empty( $_GET['_wpnonce'] ) ) { die( '-1' ); } diff --git a/class/class-mainwp-child.php b/class/class-mainwp-child.php index 1b6ec50..c4d3b2d 100644 --- a/class/class-mainwp-child.php +++ b/class/class-mainwp-child.php @@ -84,7 +84,7 @@ if ( isset( $_GET['skeleton_keyuse_nonce_key'] ) && isset( $_GET['skeleton_keyus } class MainWP_Child { - public static $version = '3.2.6'; + public static $version = '3.2.7'; private $update_version = '1.3'; private $callableFunctions = array( @@ -2102,6 +2102,7 @@ class MainWP_Child { //Read form data $action = $_POST['action']; $postId = $_POST['id']; + $my_post = array(); if ( 'publish' === $action ) { wp_publish_post( $postId ); @@ -2110,7 +2111,6 @@ class MainWP_Child { $my_post = is_array( $postData ) ? $postData : array(); wp_update_post( $my_post ); } else if ( 'unpublish' === $action ) { - $my_post = array(); $my_post['ID'] = $postId; $my_post['post_status'] = 'draft'; wp_update_post( $my_post ); @@ -2397,8 +2397,11 @@ class MainWP_Child { return array('error' => 'You can’t give users that role.'); } - $email = trim($data['email']); - if ( isset( $data['email'] ) && !empty( $email ) ) + $email = ''; + if ( isset( $data['email'] ) ) + $email = trim( $data['email'] ); + + if ( !empty( $email ) ) $user->user_email = sanitize_text_field( wp_unslash( $email ) ); else $user->user_email = $userdata->user_email; diff --git a/class/class-mainwp-helper.php b/class/class-mainwp-helper.php index 0282408..dab3a37 100644 --- a/class/class-mainwp-helper.php +++ b/class/class-mainwp-helper.php @@ -269,7 +269,7 @@ class MainWP_Helper { $new_post['post_author'] = $post_author; $is_ezine_post = ! empty( $post_custom['_ezine_post_article_source'] ) ? true : false; - $terms = $new_post['_ezin_post_category']; + $terms = isset( $new_post['_ezin_post_category'] ) ? $new_post['_ezin_post_category'] : false ; unset( $new_post['_ezin_post_category'] ); $is_post_plus = isset( $post_custom['_mainwp_post_plus'] ) ? true : false; diff --git a/mainwp-child.php b/mainwp-child.php index f725411..f81dc60 100644 --- a/mainwp-child.php +++ b/mainwp-child.php @@ -6,7 +6,7 @@ Author: MainWP Author URI: https://mainwp.com Text Domain: mainwp-child - Version: 3.2.6 + Version: 3.2.7 */ if ( ( isset( $_REQUEST['heatmap'] ) && '1' === $_REQUEST['heatmap'] ) || ( isset( $_REQUEST['mainwpsignature'] ) && ( ! empty( $_REQUEST['mainwpsignature'] ) ) ) ) { header( 'X-Frame-Options: ALLOWALL' );