summaryrefslogtreecommitdiff
path: root/Postman
diff options
context:
space:
mode:
Diffstat (limited to 'Postman')
-rw-r--r--Postman/Extensions/Core/Notifications/PostmanPushoverNotify.php4
-rw-r--r--Postman/Extensions/Core/StatusSolution.php56
-rw-r--r--Postman/Extensions/License/PostmanLicenseManager.php6
-rw-r--r--Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php2
-rw-r--r--Postman/Postman-Connectivity-Test/PostmanConnectivityTestController.php2
-rw-r--r--Postman/Postman-Email-Log/PostmanEmailLogController.php29
-rw-r--r--Postman/Postman-Email-Log/PostmanEmailLogService.php4
-rw-r--r--Postman/Postman-Email-Log/PostmanEmailLogView.php31
-rw-r--r--Postman/Postman-Mail/PostmanSmtpModuleTransport.php2
-rw-r--r--Postman/Postman-Send-Test-Email/PostmanSendTestEmailController.php3
-rw-r--r--Postman/Postman.php12
-rw-r--r--Postman/PostmanLogFields.php12
12 files changed, 124 insertions, 39 deletions
diff --git a/Postman/Extensions/Core/Notifications/PostmanPushoverNotify.php b/Postman/Extensions/Core/Notifications/PostmanPushoverNotify.php
index 14ef7d2..c1f2661 100644
--- a/Postman/Extensions/Core/Notifications/PostmanPushoverNotify.php
+++ b/Postman/Extensions/Core/Notifications/PostmanPushoverNotify.php
@@ -6,7 +6,7 @@ class PostmanPushoverNotify implements Postman_Notify {
public function send_message($message)
{
- $options = PostmanOptions::getInstance();
+ $options = PostmanNotifyOptions::getInstance();
$api_url = "https://api.pushover.net/1/messages.json";
$app_token = $options->getPushoverToken();
@@ -31,4 +31,4 @@ class PostmanPushoverNotify implements Postman_Notify {
error_log( __CLASS__ . ': ' . print_r( $body, true ) );
}
}
-} \ No newline at end of file
+}
diff --git a/Postman/Extensions/Core/StatusSolution.php b/Postman/Extensions/Core/StatusSolution.php
new file mode 100644
index 0000000..67ac768
--- /dev/null
+++ b/Postman/Extensions/Core/StatusSolution.php
@@ -0,0 +1,56 @@
+<?php
+
+class StatusSolution {
+
+ private $status;
+
+ public function __construct() {
+ add_filter( 'post_smtp_log_solution', array( $this, 'find_solution' ), 10, 4 );
+ }
+
+ public function find_solution( $solution, $status, $log, $message ) {
+
+ if ( empty( $status ) ) {
+ return 'All good, mail sent.';
+ }
+
+ $this->status = addslashes( $status );
+ $possible_solution = [];
+
+ if ( $this->strExists('timed out') ) {
+ $possible_solution[] = $this->make_clickable('https://postmansmtp.com/office365-smtp-connection-timed-out/');
+ } elseif ( $this->strExists('timeout') || $this->strExists('open socket' ) ) {
+ $possible_solution[] = 'Your hosting is blocking the connection, contact their support';
+ } elseif ( $this->strExists( 'DATA NOT ACCEPTED' ) || $this->strExists('Exception:SendAsDeniedException' ) ) {
+ $possible_solution[] = $this->make_clickable('https://postmansmtp.com/storedrv-submission-exceptionsendasdeniedexception-mapiexceptionsendasdenied/');
+ } elseif ( $this->strExists( 'Incorrect authentication data') ) {
+ $possible_solution[] = $this->make_clickable( 'https://postmansmtp.com/incorrect-authentication-data/' );
+ } elseif ( $this->strExists( 'Unrecognized authentication type' ) ) {
+ $possible_solution[] = 'Change "Authentication" type on plugin settings to "Login"';
+ } elseif ( $this->strExists( 'Error executing "SendRawEmail"' ) ) {
+ $possible_solution[] = 'Amazon SES - account permission error (review account configuration)';
+ } elseif ( $this->strExists( 'Please log in via your web browser and then try again' ) ) {
+ $possible_solution[] = $this->make_clickable( 'https://postmansmtp.com/gmail-gsuite-please-log-in-via-your-web-browser-and-then-try-again/' );
+ } elseif ( $this->strExists( 'Application-specific password required' ) ) {
+ $possible_solution[] = 'Two factor authentication is enabled, replace your password with app password.';
+ $possible_solution[] = $this->make_clickable( 'https://support.google.com/mail/?p=InvalidSecondFactor' );
+ } elseif ( $this->strExists( 'Username and Password not accepted' ) || $this->strExists( 'Authentication unsuccessful' ) ) {
+ $possible_solution[] = 'Check you credentials, wrong email or password.';
+ } else {
+ $possible_solution[] = 'Not found, check status column for more info.';
+ }
+
+ return ! empty( $possible_solution ) ? implode( '<br>', $possible_solution ) : '';
+ }
+
+ private function make_clickable($url) {
+ return '<a target="_blank" href="' . esc_url($url ) . '">' . esc_html( 'Read here' ) . '</a>';
+ }
+
+ private function strExists( $value ) {
+ return strpos( strtolower( $this->status ), strtolower( addslashes( $value ) ) ) !== false;
+ }
+
+}
+
+new StatusSolution(); \ No newline at end of file
diff --git a/Postman/Extensions/License/PostmanLicenseManager.php b/Postman/Extensions/License/PostmanLicenseManager.php
index 280b564..cb10852 100644
--- a/Postman/Extensions/License/PostmanLicenseManager.php
+++ b/Postman/Extensions/License/PostmanLicenseManager.php
@@ -68,11 +68,9 @@ class PostmanLicenseManager {
$this->extensions[$slug]['plugin_dir_and_filename'] = $plugin_dir_and_filename;
$this->extensions[$slug]['license_manager'] = new PostmanLicenseHandler(
$plugin_path, $plugin_data['Name'],
- $plugin_data['Version'], $plugin_data['Author']
+ $plugin_data['Version'], $plugin_data['Author'], null, self::ENDPOINT
);
if ( $this->extensions[$slug]['license_manager']->is_licensed() ) {
- include_once $plugin_path;
-
$this->extensions[$slug]['instance'] = new $class;
}
}
@@ -99,4 +97,4 @@ class PostmanLicenseManager {
public function get_extensions() {
return $this->extensions;
}
-} \ No newline at end of file
+}
diff --git a/Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php b/Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php
index 9c0170b..0910cc9 100644
--- a/Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php
+++ b/Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php
@@ -271,7 +271,7 @@ class PostmanSettingsRegistry {
}
print '</select>';
?>
- <p class="description" id="mailer-type-description"><?php _e( 'Beta Feature: Change this to <strong>PHPMailer</strong> only if you see <code>wp_mail</code> conflict message, conflicts when another plugin is activated, and <strong><u>sometimes</u></strong> spam issues.', 'post-smtp' ); ?></p>
+ <p class="description" id="mailer-type-description"><?php _e( 'Beta Feature: ONLY change this to <strong>PHPMailer</strong> only if you see <code>wp_mail</code> conflict message, conflicts when another plugin is activated, and <strong><u>sometimes</u></strong> your mail marked as spam.', 'post-smtp' ); ?></p>
<?php
}
diff --git a/Postman/Postman-Connectivity-Test/PostmanConnectivityTestController.php b/Postman/Postman-Connectivity-Test/PostmanConnectivityTestController.php
index 6ff5a69..b7ac6a8 100644
--- a/Postman/Postman-Connectivity-Test/PostmanConnectivityTestController.php
+++ b/Postman/Postman-Connectivity-Test/PostmanConnectivityTestController.php
@@ -170,7 +170,7 @@ class PostmanConnectivityTestController {
}
print '</table>';
/* Translators: Where %s is the name of the service providing Internet connectivity test */
- printf( '<p class="portquiz" style="display:none; font-size:0.8em">* %s</p>', sprintf( __( 'According to %s', 'post-smtp' ), '<a target="_blank" href="https://downor.me/portquiz.net">portquiz.net</a>' ) );
+ printf( '<p class="portquiz" style="display:none; font-size:0.8em">* %s</p>', sprintf( __( 'According to %s', 'post-smtp' ), '<a target="_blank" href="http://portquiz.net">portquiz.net</a>' ) );
printf( '<p class="ajax-loader" style="display:none"><img src="%s"/></p>', plugins_url( 'post-smtp/style/ajax-loader.gif' ) );
print '<section id="conclusion" style="display:none">';
print sprintf( '<h3>%s:</h3>', __( 'Summary', 'post-smtp' ) );
diff --git a/Postman/Postman-Email-Log/PostmanEmailLogController.php b/Postman/Postman-Email-Log/PostmanEmailLogController.php
index dd8f650..a6e5179 100644
--- a/Postman/Postman-Email-Log/PostmanEmailLogController.php
+++ b/Postman/Postman-Email-Log/PostmanEmailLogController.php
@@ -76,10 +76,10 @@ class PostmanEmailLogController {
}
function handleCsvExport() {
- if ( ! empty( $_POST ) && ! wp_verify_nonce( $_REQUEST['post-smtp-log'], 'post-smtp' ) )
+ if ( isset( $_REQUEST['post-smtp-log-nonce'] ) && ! wp_verify_nonce( $_REQUEST['post-smtp-log-nonce'], 'post-smtp' ) )
die( 'Security check' );
- if ( isset( $_POST['postman_export_csv'] ) && current_user_can( Postman::MANAGE_POSTMAN_CAPABILITY_LOGS ) ) {
+ if ( isset( $_GET['postman_export_csv'] ) && current_user_can( Postman::MANAGE_POSTMAN_CAPABILITY_LOGS ) ) {
$args = array(
'post_type' => PostmanEmailLogPostType::POSTMAN_CUSTOM_POST_TYPE_SLUG,
'post_status' => PostmanEmailLogService::POSTMAN_CUSTOM_POST_STATUS_PRIVATE,
@@ -411,16 +411,17 @@ class PostmanEmailLogController {
</div>
<?php
- $from_date = isset( $_POST['from_date'] ) ? sanitize_text_field( $_POST['from_date'] ) : '';
- $to_date = isset( $_POST['to_date'] ) ? sanitize_text_field( $_POST['to_date'] ) : '';
- $search = isset( $_POST['search'] ) ? sanitize_text_field( $_POST['search'] ) : '';
+ $from_date = isset( $_GET['from_date'] ) ? sanitize_text_field( $_GET['from_date'] ) : '';
+ $to_date = isset( $_GET['to_date'] ) ? sanitize_text_field( $_GET['to_date'] ) : '';
+ $search = isset( $_GET['search'] ) ? sanitize_text_field( $_GET['search'] ) : '';
$page_records = apply_filters( 'postman_log_per_page', array( 10, 15, 25, 50, 75, 100 ) );
- $postman_page_records = isset( $_POST['postman_page_records'] ) ? absint( $_POST['postman_page_records'] ) : '';
+ $postman_page_records = isset( $_GET['postman_page_records'] ) ? absint( $_GET['postman_page_records'] ) : '';
?>
- <form id="postman-email-log-filter" method="post">
- <input type="hidden" action="post-smtp-filter" value="1">
- <?php wp_nonce_field('post-smtp', 'post-smtp-log'); ?>
+ <form id="postman-email-log-filter" action="<?php echo admin_url( PostmanUtils::POSTMAN_EMAIL_LOG_PAGE_RELATIVE_URL ); ?>" method="get">
+ <input type="hidden" name="page" value="postman_email_log">
+ <input type="hidden" name="post-smtp-filter" value="1">
+ <?php wp_nonce_field('post-smtp', 'post-smtp-log-nonce'); ?>
<div id="email-log-filter" class="postman-log-row">
<div class="form-control">
@@ -447,13 +448,13 @@ class PostmanEmailLogController {
</select>
</div>
- <div class="form-control">
- <button type="submit" id="postman_export_csv" name="postman_export_csv" class="button button-primary"><?php _e( 'Export To CSV', 'post-smtp' ); ?></button>
+ <div class="form-control" style="padding: 0 5px 0 5px;">
+ <button type="submit" name="filter" class="button button-primary"><?php _e( 'Filter/Search', 'post-smtp' ); ?></button>
</div>
- <div class="form-control" style="padding: 0 5px 0 5px; margin-right: 50px;">
- <button type="submit" name="filter" class="button button-primary"><?php _e( 'Filter/Search', 'post-smtp' ); ?></button>
- </div>
+ <div class="form-control" style="padding: 0 5px 0 0px;">
+ <button type="submit" id="postman_export_csv" name="postman_export_csv" class="button button-primary"><?php _e( 'Export To CSV', 'post-smtp' ); ?></button>
+ </div>
<div class="form-control">
<button type="submit" id="postman_trash_all" name="postman_trash_all" class="button button-primary"><?php _e( 'Trash All', 'post-smtp' ); ?></button>
diff --git a/Postman/Postman-Email-Log/PostmanEmailLogService.php b/Postman/Postman-Email-Log/PostmanEmailLogService.php
index 457baf9..17269e1 100644
--- a/Postman/Postman-Email-Log/PostmanEmailLogService.php
+++ b/Postman/Postman-Email-Log/PostmanEmailLogService.php
@@ -5,6 +5,7 @@ if ( ! defined( 'ABSPATH' ) ) {
require_once dirname(__DIR__ ) . '/PostmanLogFields.php';
require_once POST_SMTP_PATH . '/Postman/Extensions/Core/Notifications/PostmanNotify.php';
+require_once POST_SMTP_PATH . '/Postman/Extensions/Core/StatusSolution.php';
if ( ! class_exists( 'PostmanEmailLog' ) ) {
class PostmanEmailLog {
@@ -175,7 +176,10 @@ if ( ! class_exists( 'PostmanEmailLogService' ) ) {
$this->logger->debug( sprintf( 'Saved message #%s to the database', $post_id ) );
$this->logger->trace( $log );
+ $solution = apply_filters( 'post_smtp_log_solution', null, $new_status, $log, $message );
+
// Write the meta data related to the email
+ PostmanLogFields::get_instance()->update( $post_id, 'solution', $solution );
PostmanLogFields::get_instance()->update( $post_id, 'success', $log->success );
PostmanLogFields::get_instance()->update( $post_id, 'from_header', $log->sender );
if ( ! empty( $log->toRecipients ) ) {
diff --git a/Postman/Postman-Email-Log/PostmanEmailLogView.php b/Postman/Postman-Email-Log/PostmanEmailLogView.php
index 52cdd4d..2b06ba3 100644
--- a/Postman/Postman-Email-Log/PostmanEmailLogView.php
+++ b/Postman/Postman-Email-Log/PostmanEmailLogView.php
@@ -60,6 +60,7 @@ class PostmanEmailLogView extends WP_List_Table {
function column_default( $item, $column_name ) {
switch ( $column_name ) {
case 'sent_to' :
+ case 'solution' :
case 'date' :
case 'status' :
return $item [ $column_name ];
@@ -167,6 +168,7 @@ class PostmanEmailLogView extends WP_List_Table {
'title' => _x( 'Subject', 'What is the subject of this message?', 'post-smtp' ),
'sent_to' => __( 'Sent To', 'post-smtp' ),
'status' => __( 'Status', 'post-smtp' ),
+ 'solution' => __( 'Solution', 'post-smtp' ),
'date' => _x( 'Delivery Time', 'When was this email sent?', 'post-smtp' ),
);
return $columns;
@@ -263,13 +265,13 @@ class PostmanEmailLogView extends WP_List_Table {
* ************************************************************************
*/
function prepare_items() {
- if ( ! empty( $_POST ) && ! wp_verify_nonce( $_REQUEST['post-smtp-log'], 'post-smtp' ) )
+ if ( isset( $_REQUEST['post-smtp-log-nonce'] ) && ! wp_verify_nonce( $_REQUEST['post-smtp-log-nonce'], 'post-smtp' ) )
die( 'Security check' );
/**
* First, lets decide how many records per page to show
*/
- $per_page = isset( $_POST['postman_page_records'] ) ? absint( $_POST['postman_page_records'] ) : 10;
+ $per_page = isset( $_GET['postman_page_records'] ) ? absint( $_GET['postman_page_records'] ) : 10;
/**
* REQUIRED.
@@ -324,36 +326,36 @@ class PostmanEmailLogView extends WP_List_Table {
'suppress_filters' => true,
);
- if ( isset( $_POST['from_date'] ) && ! empty( $_POST['from_date'] ) ) {
- $from_date = sanitize_text_field( $_POST['from_date'] );
+ if ( isset( $_GET['from_date'] ) && ! empty( $_GET['from_date'] ) ) {
+ $from_date = sanitize_text_field( $_GET['from_date'] );
$args['date_query']['after'] = $from_date;
$args['date_query']['column'] = 'post_date';
$args['date_query']['inclusive'] = false;
}
- if ( isset( $_POST['to_date'] ) && ! empty( $_POST['to_date'] ) ) {
- $to_date = sanitize_text_field( $_POST['to_date'] );
+ if ( isset( $_GET['to_date'] ) && ! empty( $_GET['to_date'] ) ) {
+ $to_date = sanitize_text_field( $_GET['to_date'] );
$args['date_query']['before'] = $to_date;
$args['date_query']['column'] = 'post_date';
$args['date_query']['inclusive'] = true;
}
- if ( ! empty( $_POST['search'] ) ) {
+ if ( ! empty( $_GET['search'] ) ) {
if ( isset( $args['date_query'] ) ) {
unset( $args['date_query'] ); }
- $args['s'] = sanitize_text_field( $_POST['search'] );
+ $args['s'] = sanitize_text_field( $_GET['search'] );
}
- if ( isset( $_POST['postman_trash_all'] ) ) {
+ if ( isset( $_GET['postman_trash_all'] ) ) {
$args['posts_per_page'] = -1;
}
$posts = new WP_query( $args );
- if ( isset( $_POST['postman_trash_all'] ) ) {
+ if ( isset( $_GET['postman_trash_all'] ) && current_user_can(Postman::MANAGE_POSTMAN_CAPABILITY_LOGS ) ) {
foreach ( $posts->posts as $post ) {
wp_delete_post( $post->ID, true );
}
@@ -374,10 +376,19 @@ class PostmanEmailLogView extends WP_List_Table {
}
$meta_values = PostmanLogFields::get_instance()->get( $post->ID );
$sent_to = array_map( 'esc_html', explode( ',' , $meta_values ['to_header'] [0] ) );
+ $solution_meta = $meta_values ['solution'] [0];
+
+ if ( empty( $solution_meta ) && empty( $post->post_excerpt ) ) {
+ $solution = 'No need - Mail sent';
+ } else {
+ $solution = $solution_meta;
+ }
+
$flattenedPost = array(
// the post title must be escaped as they are displayed in the HTML output
'sent_to' => implode( ', ', $sent_to ),
'title' => esc_html( $post->post_title ),
+ 'solution' => $solution,
// the post status must be escaped as they are displayed in the HTML output
'status' => ($post->post_excerpt != null ? esc_html( $post->post_excerpt ) : __( 'Sent', 'post-smtp' )),
'date' => date( "$date_format $time_format", strtotime( $post->post_date ) ),
diff --git a/Postman/Postman-Mail/PostmanSmtpModuleTransport.php b/Postman/Postman-Mail/PostmanSmtpModuleTransport.php
index 7442972..895029b 100644
--- a/Postman/Postman-Mail/PostmanSmtpModuleTransport.php
+++ b/Postman/Postman-Mail/PostmanSmtpModuleTransport.php
@@ -543,7 +543,7 @@ class PostmanSmtpModuleTransport extends PostmanAbstractZendModuleTransport impl
printf( '<p>%s</p>', __( 'This is the Outgoing (SMTP) Mail Server, or Mail Submission Agent (MSA), which Postman delegates mail delivery to. This server is specific to your email account, and if you don\'t know what to use, ask your email service provider.', 'post-smtp' ) );
printf( '<p>%s</p>', __( 'Note that many WordPress hosts, such as GoDaddy, Bluehost and Dreamhost, require that you use their mail accounts with their mail servers, and prevent you from using others.', 'post-smtp' ) );
- printf( '<div><strong><u>%s</u></strong></div><br>', __( 'If you plan to use An API and not SMTP just type any value.', 'post-smtp' ) );
+ //printf( '<div><strong><u>%s</u></strong></div><br>', __( 'If you plan to use An API and not SMTP just type any value.', 'post-smtp' ) );
printf( '<label for="hostname">%s</label>', __( 'Outgoing Mail Server Hostname', 'post-smtp' ) );
print $this->hostname_callback();
printf( '<p class="ajax-loader" style="display:none"><img src="%s"/></p>', plugins_url( 'post-smtp/style/ajax-loader.gif' ) );
diff --git a/Postman/Postman-Send-Test-Email/PostmanSendTestEmailController.php b/Postman/Postman-Send-Test-Email/PostmanSendTestEmailController.php
index 1a207c8..03df901 100644
--- a/Postman/Postman-Send-Test-Email/PostmanSendTestEmailController.php
+++ b/Postman/Postman-Send-Test-Email/PostmanSendTestEmailController.php
@@ -117,7 +117,8 @@ class PostmanSendTestEmailController {
'not_started' => _x( 'In Outbox', 'Email Test Status', 'post-smtp' ),
'sending' => _x( 'Sending...', 'Email Test Status', 'post-smtp' ),
'success' => _x( 'Success', 'Email Test Status', 'post-smtp' ),
- 'failed' => _x( 'Failed', 'Email Test Status', 'post-smtp' ),
+ //'failed' => _x( 'Failed', 'Email Test Status', 'post-smtp' ),
+ 'failed' => sprintf( 'Failed - Check the plugin email log for more info: %s', '<a href="' . esc_url( admin_url( 'admin.php?page=postman_email_log' ) ) . '">Here</a>' ),
'ajax_error' => __( 'Ajax Error', 'post-smtp' ),
) );
}
diff --git a/Postman/Postman.php b/Postman/Postman.php
index 643431d..f47fc3b 100644
--- a/Postman/Postman.php
+++ b/Postman/Postman.php
@@ -97,8 +97,7 @@ class Postman {
}
// register the email transports
- $this->registerTransports( $rootPluginFilenameAndPath );
-
+
// store an instance of the WpMailBinder
$this->wpMailBinder = PostmanWpMailBinder::getInstance();
@@ -188,7 +187,10 @@ class Postman {
*/
public function on_plugins_loaded() {
- PostmanLicenseManager::get_instance()->init();
+ PostmanLicenseManager::get_instance()->init();
+
+ // register the email transports
+ $this->registerTransports( $this->rootPluginFilenameAndPath );
// load the text domain
$this->loadTextDomain();
@@ -370,8 +372,8 @@ class Postman {
<p style="font-size: 18px; font-weight: bold;">Please notice</p>
<p style="font-size: 14px; line-height: 1.7;">
<?php _e('Post SMTP v2 includes and new feature called: <b>Mailer Type</b>.', 'post-smtp' ); ?><br>
- <?php _e('I highly recommend to change and <strong>TEST</strong> Post SMTP with the value <code>PHPMailer</code>.', 'post-smtp' ); ?><br>
- <?php _e('if it will not work properly you can change back to the default value: <code>PostSMTP</code>.', 'post-smtp' ); ?><br>
+ <?php _e('I recommend to change it and <strong>TEST</strong> Post SMTP with the value <code>PHPMailer</code>.', 'post-smtp' ); ?><br>
+ <?php _e('<strong>ONLY</strong> if the default mailer type is not working for you.', 'post-smtp' ); ?><br>
<a target="_blank" href="<?php echo POST_SMTP_URL; ?>/style/images/mailer-type.gif">
<figure>
<img width="180" src="<?php echo POST_SMTP_URL; ?>/style/images/mailer-type.gif" alt="how to set mailer type">
diff --git a/Postman/PostmanLogFields.php b/Postman/PostmanLogFields.php
index 04d24a4..44bfee9 100644
--- a/Postman/PostmanLogFields.php
+++ b/Postman/PostmanLogFields.php
@@ -3,6 +3,7 @@ class PostmanLogFields {
private $fields = array(
'success' => 'sanitize_text_field',
+ 'solution' => [ 'PostmanLogFields', 'sanitize_message' ],
'from_header' => [ 'PostmanLogFields', 'email_header_sanitize' ],
'to_header' => [ 'PostmanLogFields', 'email_header_sanitize' ],
'cc_header' => [ 'PostmanLogFields', 'email_header_sanitize' ],
@@ -90,6 +91,17 @@ class PostmanLogFields {
return wp_kses( $message, $allowed_tags );
}
+ private function sanitize_html( $value ) {
+ $allowed_html = array(
+ 'a' => array(
+ 'href' => array(),
+ ),
+ 'br' => array(),
+ );
+
+ return wp_kses( $value, $allowed_html );
+ }
+
private function encode( $value ) {
if ( is_array( $value ) ) {
return wp_json_encode( $value );