From c06edcf95e39742788c4e7c7feae40b7b033f0ce Mon Sep 17 00:00:00 2001 From: Thang Hoang Van Date: Mon, 25 Mar 2019 22:11:41 +0700 Subject: [PATCH] Merged with branch01 * Fixed: an issue with checking Page Speed data * Fixed: an issue with empty update data * Fixed: an issue with incorrect plugin update data * Added: Send From field in the Branding support form * Updated: compatibility with the latest Yoast SEO plugin version --- class/class-mainwp-child-branding.php | 10 ++- class/class-mainwp-child-pagespeed.php | 3 +- ...lass-mainwp-child-updraft-plus-backups.php | 3 +- class/class-mainwp-child.php | 14 +++- class/class-mainwp-helper.php | 51 +++++++++++-- class/class-mainwp-wordpress-seo.php | 74 ++++++++++++++----- mainwp-child.php | 2 +- readme.txt | 11 ++- 8 files changed, 131 insertions(+), 37 deletions(-) diff --git a/class/class-mainwp-child-branding.php b/class/class-mainwp-child-branding.php index 861c780..529d8b6 100644 --- a/class/class-mainwp-child-branding.php +++ b/class/class-mainwp-child-branding.php @@ -793,13 +793,15 @@ class MainWP_Child_Branding { public function send_support_mail() { $email = $this->child_branding_options['support_email']; $sub = wp_kses_post( nl2br( stripslashes( $_POST['mainwp_branding_contact_message_subject'] ) ) ); + $from = trim($_POST['mainwp_branding_contact_send_from']); $subject = !empty( $sub ) ? $sub : "MainWP - Support Contact"; $content = wp_kses_post( nl2br( stripslashes( $_POST['mainwp_branding_contact_message_content'] ) ) ); $mail = $headers = ''; if ( ! empty( $_POST['mainwp_branding_contact_message_content'] ) && ! empty( $email ) ) { global $current_user; $headers .= "Content-Type: text/html;charset=utf-8\r\n"; - //$headers .= "From: \"" . $current_user->user_email . "\" <" . $current_user->user_email . ">\r\n"; + if (!empty($from)) + $headers .= "From: \"" . $from . "\" <" . $from . ">\r\n"; $mail .= "

Support Email from: " . site_url() . "

\r\n\r\n"; $mail .= "

Sent from WordPress page: " . ( ! empty( $_POST["mainwp_branding_send_from_page"] ) ? "" . esc_url( $_POST["mainwp_branding_send_from_page"] ) . "

\r\n\r\n" : "" ); $mail .= "

Client Email: " . $current_user->user_email . "

\r\n\r\n"; @@ -817,6 +819,7 @@ class MainWP_Child_Branding { } function contact_support() { + global $current_user; ?>