Merged in feature/MAW-855-import-code-into-aws (pull request #2)

code import from pantheon

* code import from pantheon
This commit is contained in:
Tony Volpe
2023-12-04 23:08:14 +00:00
parent 8c9b1312bc
commit 8f4b5efda6
4766 changed files with 185592 additions and 239967 deletions

View File

@@ -95,18 +95,24 @@ class Area {
// Display notice instructing the user to complete plugin setup.
add_action( 'admin_init', [ $this, 'display_setup_notice' ] );
// Display notice explaining removal of "Email Test" tab.
add_action( 'admin_init', [ $this, 'display_email_test_tab_removal_notice' ] );
// Outputs the plugin admin header.
add_action( 'in_admin_header', [ $this, 'display_admin_header' ], 100 );
// Outputs the plugin promotional admin footer.
add_action( 'in_admin_footer', [ $this, 'display_admin_footer' ] );
// Outputs the plugin version in the admin footer.
add_filter( 'update_footer', [ $this, 'display_update_footer' ], PHP_INT_MAX );
// Hide all unrelated to the plugin notices on the plugin admin pages.
add_action( 'admin_print_scripts', [ $this, 'hide_unrelated_notices' ] );
// Process all AJAX requests.
add_action( 'wp_ajax_wp_mail_smtp_ajax', [ $this, 'process_ajax' ] );
// Maybe redirect to "Tools -> Email Test" page if old direct URL to "Settings -> Email Test" is accessed.
add_action( 'admin_init', [ $this, 'maybe_redirect_test_tab' ] );
// Init parent admin pages.
if ( WP::in_wp_admin() || WP::is_doing_self_ajax() ) {
add_action( 'init', [ $this, 'get_parent_pages' ] );
@@ -221,6 +227,36 @@ class Area {
);
}
/**
* Display notice explaining removal of "Email Test" tab.
*
* @since 3.9.0
*/
public function display_email_test_tab_removal_notice() {
// Bail if we aren't on a "Settings" page.
if ( ! $this->is_admin_page( self::SLUG ) ) {
return;
}
// Bail if the notice has been dismissed.
if ( metadata_exists( 'user', get_current_user_id(), 'wp_mail_smtp_email_test_tab_removal_notice_dismissed' ) ) {
return;
}
WP::add_admin_notice(
sprintf(
wp_kses(
/* translators: %s: Tools page URL. */
__( 'The Email Test tab was moved to <a href="%s">WP Mail SMTP > Tools</a>.', 'wp-mail-smtp' ),
[ 'a' => [ 'href' => [] ] ]
),
$this->get_admin_page_url( self::SLUG . '-tools' )
),
implode( ' ', [ WP::ADMIN_NOTICE_INFO, 'email_test_tab_removal_notice' ] )
);
}
/**
* Get menu item position.
*
@@ -526,13 +562,13 @@ class Area {
*/
wp_enqueue_style(
'wp-mail-smtp-admin-jconfirm',
wp_mail_smtp()->assets_url . '/libs/jquery-confirm.min.css',
wp_mail_smtp()->assets_url . '/css/vendor/jquery-confirm.min.css',
[ 'wp-mail-smtp-admin' ],
'3.3.4'
);
wp_enqueue_script(
'wp-mail-smtp-admin-jconfirm',
wp_mail_smtp()->assets_url . '/libs/jquery-confirm.min.js',
wp_mail_smtp()->assets_url . '/js/vendor/jquery-confirm.min.js',
[ 'wp-mail-smtp-admin' ],
'3.3.4',
false
@@ -920,7 +956,6 @@ class Area {
if ( empty( $this->pages ) ) {
$this->pages = [
'settings' => new Pages\SettingsTab(),
'test' => new Pages\TestTab( new Pages\Tools() ),
'logs' => new Pages\LogsTab(),
'alerts' => new Pages\AlertsTab(),
'connections' => new Pages\AdditionalConnectionsTab(),
@@ -1131,6 +1166,14 @@ class Area {
$data['message'] = $dismissal_response;
break;
case 'email_test_tab_removal_notice_dismiss':
if ( ! check_ajax_referer( 'wp-mail-smtp-admin', 'nonce', false ) ) {
break;
}
update_user_meta( get_current_user_id(), 'wp_mail_smtp_email_test_tab_removal_notice_dismissed', true );
break;
default:
// Allow custom tasks data processing being added here.
$data = apply_filters( 'wp_mail_smtp_admin_process_ajax_' . $task . '_data', $data );
@@ -1189,7 +1232,7 @@ class Area {
return $links;
}
$custom['pro'] = sprintf(
$custom['wp-mail-smtp-pro'] = sprintf(
'<a href="%1$s" aria-label="%2$s" target="_blank" rel="noopener noreferrer"
style="color: #00a32a; font-weight: 700;"
onmouseover="this.style.color=\'#008a20\';"
@@ -1201,14 +1244,14 @@ class Area {
esc_html__( 'Get WP Mail SMTP Pro', 'wp-mail-smtp' )
);
$custom['settings'] = sprintf(
$custom['wp-mail-smtp-settings'] = sprintf(
'<a href="%s" aria-label="%s">%s</a>',
esc_url( $this->get_admin_page_url() ),
esc_attr__( 'Go to WP Mail SMTP Settings page', 'wp-mail-smtp' ),
esc_html__( 'Settings', 'wp-mail-smtp' )
);
$custom['docs'] = sprintf(
$custom['wp-mail-smtp-docs'] = sprintf(
'<a href="%1$s" target="_blank" aria-label="%2$s" rel="noopener noreferrer">%3$s</a>',
// phpcs:ignore WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
esc_url( wp_mail_smtp()->get_utm_url( 'https://wpmailsmtp.com/docs/', [ 'medium' => 'all-plugins', 'content' => 'Documentation' ] ) ),
@@ -1300,10 +1343,14 @@ class Area {
/**
* Maybe redirect to "Tools -> Email Test" page if old direct URL to "Settings -> Email Test" is accessed.
*
* @deprecated 3.9.0
*
* @since 2.8.0
*/
public function maybe_redirect_test_tab() {
_deprecated_function( __METHOD__, '3.9.0' );
if ( $this->is_admin_page( 'general' ) && $this->get_current_tab() === 'test' ) {
wp_safe_redirect( add_query_arg( 'tab', 'test', $this->get_admin_page_url( self::SLUG . '-tools' ) ) );
}
@@ -1349,4 +1396,127 @@ class Area {
// Output inline styles.
echo '<style>a.wp-mail-smtp-sidebar-upgrade-pro { background-color: #00a32a !important; color: #fff !important; font-weight: 600 !important; }</style>';
}
/**
* Display the promotional footer in our plugin pages.
*
* @since 3.10.0
*/
public function display_admin_footer() { //phpcs:ignore Generic.Metrics.CyclomaticComplexity.TooHigh
// Bail early on non-plugin pages.
if ( ! $this->is_admin_page() ) {
return;
}
$title = esc_html__( 'Made with ♥ by the WP Mail SMTP team', 'wp-mail-smtp' );
$links = [
[
'url' => wp_mail_smtp()->is_pro() ?
wp_mail_smtp()->get_utm_url(
'https://wpmailsmtp.com/account/support/',
[
'medium' => 'Plugin Footer',
'content' => 'Contact Support',
]
) : 'https://wordpress.org/support/plugin/wp-mail-smtp/',
'text' => esc_html__( 'Support', 'wp-mail-smtp' ),
'target' => '_blank',
],
[
'url' => wp_mail_smtp()->get_utm_url(
'https://wpmailsmtp.com/docs/',
[
'medium' => 'Plugin Footer',
'content' => 'Plugin Documentation',
]
),
'text' => esc_html__( 'Docs', 'wp-mail-smtp' ),
'target' => '_blank',
],
];
if ( ! wp_mail_smtp()->is_white_labeled() ) {
$links[] = [
'url' => $this->get_admin_page_url( self::SLUG . '-about' ),
'text' => esc_html__( 'Free Plugins', 'wp-mail-smtp' ),
];
}
$links_count = count( $links );
?>
<div class="wp-mail-smtp-footer-promotion">
<p><?php echo esc_html( $title ); ?></p>
<ul class="wp-mail-smtp-footer-promotion-links">
<?php foreach ( $links as $key => $item ) : ?>
<li>
<?php
$attrs = 'href="' . esc_url( $item['url'] ) . '"';
if ( isset( $item['target'] ) ) {
$attrs .= ' target="' . esc_attr( $item['target'] ) . '"';
$attrs .= ' rel="noopener noreferrer"';
}
$text = esc_html( $item['text'] );
$divider = $links_count !== $key + 1 ? '<span>/</span>' : '';
printf(
'<a %1$s>%2$s</a>%3$s',
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
$attrs,
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
$text,
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
$divider
);
?>
</li>
<?php endforeach; ?>
</ul>
<ul class="wp-mail-smtp-footer-promotion-social">
<li>
<a href="https://www.facebook.com/wpmailsmtp" target="_blank" rel="noopener noreferrer">
<svg width="16" height="16" aria-hidden="true">
<path fill="#A7AAAD" d="M16 8.05A8.02 8.02 0 0 0 8 0C3.58 0 0 3.6 0 8.05A8 8 0 0 0 6.74 16v-5.61H4.71V8.05h2.03V6.3c0-2.02 1.2-3.15 3-3.15.9 0 1.8.16 1.8.16v1.98h-1c-1 0-1.31.62-1.31 1.27v1.49h2.22l-.35 2.34H9.23V16A8.02 8.02 0 0 0 16 8.05Z"/>
</svg>
<span class="screen-reader-text"><?php echo esc_html( 'Facebook' ); ?></span>
</a>
</li>
<li>
<a href="https://twitter.com/wpmailsmtp" target="_blank" rel="noopener noreferrer">
<svg width="17" height="16" aria-hidden="true">
<path fill="#A7AAAD" d="M15.27 4.43A7.4 7.4 0 0 0 17 2.63c-.6.27-1.3.47-2 .53a3.41 3.41 0 0 0 1.53-1.93c-.66.4-1.43.7-2.2.87a3.5 3.5 0 0 0-5.96 3.2 10.14 10.14 0 0 1-7.2-3.67C.86 2.13.7 2.73.7 3.4c0 1.2.6 2.26 1.56 2.89a3.68 3.68 0 0 1-1.6-.43v.03c0 1.7 1.2 3.1 2.8 3.43-.27.06-.6.13-.9.13a3.7 3.7 0 0 1-.66-.07 3.48 3.48 0 0 0 3.26 2.43A7.05 7.05 0 0 1 0 13.24a9.73 9.73 0 0 0 5.36 1.57c6.42 0 9.91-5.3 9.91-9.92v-.46Z"/>
</svg>
<span class="screen-reader-text"><?php echo esc_html( 'Twitter' ); ?></span>
</a>
</li>
<li>
<a href="https://youtube.com/playlist?list=PLt2XcSO7dFmCUMO0ky46Od6U2oSaiNodP" target="_blank" rel="noopener noreferrer">
<svg width="17" height="16" aria-hidden="true">
<path fill="#A7AAAD" d="M16.63 3.9a2.12 2.12 0 0 0-1.5-1.52C13.8 2 8.53 2 8.53 2s-5.32 0-6.66.38c-.71.18-1.3.78-1.49 1.53C0 5.2 0 8.03 0 8.03s0 2.78.37 4.13c.19.75.78 1.3 1.5 1.5C3.2 14 8.51 14 8.51 14s5.28 0 6.62-.34c.71-.2 1.3-.75 1.49-1.5.37-1.35.37-4.13.37-4.13s0-2.81-.37-4.12Zm-9.85 6.66V5.5l4.4 2.53-4.4 2.53Z"/>
</svg>
<span class="screen-reader-text"><?php echo esc_html( 'YouTube' ); ?></span>
</a>
</li>
</ul>
</div>
<?php
}
/**
* Display the plugin version in the footer of our plugin pages.
*
* @since 3.10.0
*
* @param string $text Text of the footer.
*/
public function display_update_footer( $text ) {
if ( $this->is_admin_page() ) {
return 'WP Mail SMTP ' . WPMS_PLUGIN_VER;
}
return $text;
}
}

View File

@@ -4,6 +4,7 @@ namespace WPMailSMTP\Admin;
use WPMailSMTP\ConnectionInterface;
use WPMailSMTP\Debug;
use WPMailSMTP\Helpers\UI;
use WPMailSMTP\Options;
use WPMailSMTP\Providers\Gmail\Auth;
@@ -64,12 +65,12 @@ class ConnectionSettings {
$mailer_supported_settings = wp_mail_smtp()->get_providers()->get_options( $mailer )->get_supports();
?>
<!-- From Email -->
<div id="wp-mail-smtp-setting-row-from_email" class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-email wp-mail-smtp-clear">
<div class="wp-mail-smtp-setting-label">
<label for="wp-mail-smtp-setting-from_email"><?php esc_html_e( 'From Email', 'wp-mail-smtp' ); ?></label>
</div>
<div class="wp-mail-smtp-setting-field">
<div class="js-wp-mail-smtp-setting-from_email" style="display: <?php echo empty( $mailer_supported_settings['from_email'] ) ? 'none' : 'block'; ?>;">
<div class="wp-mail-smtp-setting-group js-wp-mail-smtp-setting-from_email" style="display: <?php echo empty( $mailer_supported_settings['from_email'] ) ? 'none' : 'block'; ?>;">
<div id="wp-mail-smtp-setting-row-from_email" class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-email wp-mail-smtp-clear">
<div class="wp-mail-smtp-setting-label">
<label for="wp-mail-smtp-setting-from_email"><?php esc_html_e( 'From Email', 'wp-mail-smtp' ); ?></label>
</div>
<div class="wp-mail-smtp-setting-field">
<?php if ( $mailer !== 'gmail' ) : ?>
<input name="wp-mail-smtp[mail][from_email]" type="email"
value="<?php echo esc_attr( $connection_options->get( 'mail', 'from_email' ) ); ?>"
@@ -114,19 +115,23 @@ class ConnectionSettings {
</p>
<?php endif; ?>
</div>
<hr class="wp-mail-smtp-setting-mid-row-sep" style="display: <?php echo ( ! empty( $mailer_supported_settings['from_email'] ) && ! empty( $mailer_supported_settings['from_email_force'] ) ) ? 'block' : 'none'; ?>;">
<div class="js-wp-mail-smtp-setting-from_email_force" style="display: <?php echo empty( $mailer_supported_settings['from_email_force'] ) ? 'none' : 'block'; ?>;">
<input name="wp-mail-smtp[mail][from_email_force]" type="checkbox"
value="true" id="wp-mail-smtp-setting-from_email_force"
<?php checked( true, (bool) $connection_options->get( 'mail', 'from_email_force' ) ); ?>
<?php disabled( $connection_options->is_const_defined( 'mail', 'from_email_force' ) || ! empty( $disabled_email ) ); ?>
/>
<label for="wp-mail-smtp-setting-from_email_force">
<?php esc_html_e( 'Force From Email', 'wp-mail-smtp' ); ?>
</label>
</div>
<div id="wp-mail-smtp-setting-row-from_email_force" class="wp-mail-smtp-setting-row wp-mail-smtp-clear js-wp-mail-smtp-setting-from_email_force" style="display: <?php echo empty( $mailer_supported_settings['from_email_force'] ) ? 'none' : 'block'; ?>;">
<div class="wp-mail-smtp-setting-label">
<label for="wp-mail-smtp-setting-from_email_force"><?php esc_html_e( 'Force From Email', 'wp-mail-smtp' ); ?></label>
</div>
<div class="wp-mail-smtp-setting-field">
<?php
UI::toggle(
[
'name' => 'wp-mail-smtp[mail][from_email_force]',
'id' => 'wp-mail-smtp-setting-from_email_force',
'value' => 'true',
'checked' => (bool) $connection_options->get( 'mail', 'from_email_force' ),
'disabled' => $connection_options->is_const_defined( 'mail', 'from_email_force' ) || ! empty( $disabled_email ),
]
);
?>
<?php if ( ! empty( $disabled_email ) ) : ?>
<p class="desc">
@@ -142,12 +147,12 @@ class ConnectionSettings {
</div>
<!-- From Name -->
<div id="wp-mail-smtp-setting-row-from_name" class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-text wp-mail-smtp-clear">
<div class="wp-mail-smtp-setting-label">
<label for="wp-mail-smtp-setting-from_name"><?php esc_html_e( 'From Name', 'wp-mail-smtp' ); ?></label>
</div>
<div class="wp-mail-smtp-setting-field">
<div class="js-wp-mail-smtp-setting-from_name" style="display: <?php echo empty( $mailer_supported_settings['from_name'] ) ? 'none' : 'block'; ?>;">
<div class="wp-mail-smtp-setting-group js-wp-mail-smtp-setting-from_name" style="display: <?php echo empty( $mailer_supported_settings['from_name'] ) ? 'none' : 'block'; ?>;">
<div id="wp-mail-smtp-setting-row-from_name" class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-text wp-mail-smtp-clear ">
<div class="wp-mail-smtp-setting-label">
<label for="wp-mail-smtp-setting-from_name"><?php esc_html_e( 'From Name', 'wp-mail-smtp' ); ?></label>
</div>
<div class="wp-mail-smtp-setting-field">
<input name="wp-mail-smtp[mail][from_name]" type="text"
value="<?php echo esc_attr( $connection_options->get( 'mail', 'from_name' ) ); ?>"
id="wp-mail-smtp-setting-from_name" spellcheck="false"
@@ -161,19 +166,23 @@ class ConnectionSettings {
</p>
<?php endif; ?>
</div>
<hr class="wp-mail-smtp-setting-mid-row-sep" style="display: <?php echo ( ! empty( $mailer_supported_settings['from_name'] ) && ! empty( $mailer_supported_settings['from_name_force'] ) ) ? 'block' : 'none'; ?>;">
<div class="js-wp-mail-smtp-setting-from_name_force" style="display: <?php echo empty( $mailer_supported_settings['from_name_force'] ) ? 'none' : 'block'; ?>;">
<input name="wp-mail-smtp[mail][from_name_force]" type="checkbox"
value="true" id="wp-mail-smtp-setting-from_name_force"
<?php checked( true, (bool) $connection_options->get( 'mail', 'from_name_force' ) ); ?>
<?php disabled( $connection_options->is_const_defined( 'mail', 'from_name_force' ) || ! empty( $disabled_name ) ); ?>
/>
<label for="wp-mail-smtp-setting-from_name_force">
<?php esc_html_e( 'Force From Name', 'wp-mail-smtp' ); ?>
</label>
</div>
<div id="wp-mail-smtp-setting-row-from_name_force" class="wp-mail-smtp-setting-row wp-mail-smtp-clear js-wp-mail-smtp-setting-from_name_force" style="display: <?php echo empty( $mailer_supported_settings['from_name_force'] ) ? 'none' : 'block'; ?>;">
<div class="wp-mail-smtp-setting-label">
<label for="wp-mail-smtp-setting-from_name_force"><?php esc_html_e( 'Force From Name', 'wp-mail-smtp' ); ?></label>
</div>
<div class="wp-mail-smtp-setting-field">
<?php
UI::toggle(
[
'name' => 'wp-mail-smtp[mail][from_name_force]',
'id' => 'wp-mail-smtp-setting-from_name_force',
'value' => 'true',
'checked' => (bool) $connection_options->get( 'mail', 'from_name_force' ),
'disabled' => $connection_options->is_const_defined( 'mail', 'from_name_force' ) || ! empty( $disabled_name ),
]
);
?>
<?php if ( ! empty( $disabled_name ) ) : ?>
<p class="desc">
@@ -189,20 +198,22 @@ class ConnectionSettings {
</div>
<!-- Return Path -->
<div id="wp-mail-smtp-setting-row-return_path" class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-checkbox wp-mail-smtp-clear js-wp-mail-smtp-setting-return_path" style="display: <?php echo empty( $mailer_supported_settings['return_path'] ) ? 'none' : 'block'; ?>;">
<div id="wp-mail-smtp-setting-row-return_path" class="wp-mail-smtp-setting-row wp-mail-smtp-clear js-wp-mail-smtp-setting-return_path" style="display: <?php echo empty( $mailer_supported_settings['return_path'] ) ? 'none' : 'block'; ?>;">
<div class="wp-mail-smtp-setting-label">
<label for="wp-mail-smtp-setting-return_path"><?php esc_html_e( 'Return Path', 'wp-mail-smtp' ); ?></label>
</div>
<div class="wp-mail-smtp-setting-field">
<input name="wp-mail-smtp[mail][return_path]" type="checkbox"
value="true" <?php checked( true, (bool) $connection_options->get( 'mail', 'return_path' ) ); ?>
id="wp-mail-smtp-setting-return_path"
<?php disabled( $connection_options->is_const_defined( 'mail', 'return_path' ) ); ?>
/>
<label for="wp-mail-smtp-setting-return_path">
<?php esc_html_e( 'Set the return-path to match the From Email', 'wp-mail-smtp' ); ?>
</label>
<?php
UI::toggle(
[
'name' => 'wp-mail-smtp[mail][return_path]',
'id' => 'wp-mail-smtp-setting-return_path',
'value' => 'true',
'checked' => (bool) $connection_options->get( 'mail', 'return_path' ),
'disabled' => $connection_options->is_const_defined( 'mail', 'return_path' ),
]
);
?>
<p class="desc">
<?php esc_html_e( 'Return Path indicates where non-delivery receipts - or bounce messages - are to be sent.', 'wp-mail-smtp' ); ?><br/>
@@ -272,14 +283,14 @@ class ConnectionSettings {
</div>
<!-- Mailer Options -->
<div class="wp-mail-smtp-mailer-options">
<div class="wp-mail-smtp-setting-group wp-mail-smtp-mailer-options">
<?php foreach ( wp_mail_smtp()->get_providers()->get_options_all( $this->connection ) as $provider ) : ?>
<?php $provider_desc = $provider->get_description(); ?>
<div class="wp-mail-smtp-mailer-option wp-mail-smtp-mailer-option-<?php echo esc_attr( $provider->get_slug() ); ?> <?php echo $mailer === $provider->get_slug() ? 'active' : 'hidden'; ?>">
<?php if ( ! $provider->is_disabled() ) : ?>
<!-- Mailer Title/Notice/Description -->
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-content wp-mail-smtp-clear section-heading <?php echo empty( $provider_desc ) ? 'no-desc' : ''; ?>" id="wp-mail-smtp-setting-row-email-heading">
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-content wp-mail-smtp-clear section-heading <?php echo empty( $provider_desc ) ? 'no-desc' : ''; ?>">
<div class="wp-mail-smtp-setting-field">
<h2><?php echo esc_html( $provider->get_title() ); ?></h2>
<?php

View File

@@ -2,6 +2,7 @@
namespace WPMailSMTP\Admin;
use WPMailSMTP\Admin\DebugEvents\DebugEvents;
use WPMailSMTP\Helpers\Helpers;
use WPMailSMTP\Options;
use WPMailSMTP\WP;
@@ -118,18 +119,10 @@ class DashboardWidget {
WPMS_PLUGIN_VER
);
wp_enqueue_script(
'wp-mail-smtp-moment',
wp_mail_smtp()->assets_url . '/js/vendor/moment.min.js',
[],
'2.29.4',
true
);
wp_enqueue_script(
'wp-mail-smtp-chart',
wp_mail_smtp()->assets_url . '/js/vendor/chart.min.js',
[ 'wp-mail-smtp-moment' ],
[ 'moment' ],
'2.9.4.1',
true
);
@@ -175,7 +168,8 @@ class DashboardWidget {
unset( $normal_dashboard[ $widget_key ] );
$sorted_dashboard = array_merge( $widget_instance, $normal_dashboard );
$wp_meta_boxes['dashboard']['normal']['core'] = $sorted_dashboard; //phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
//phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
$wp_meta_boxes['dashboard']['normal']['core'] = $sorted_dashboard;
}
/**
@@ -258,8 +252,7 @@ class DashboardWidget {
*/
private function widget_content_html() {
$hide_graph = (bool) $this->widget_meta( 'get', 'hide_graph' );
$hide_summary_report_email_block = (bool) $this->widget_meta( 'get', 'hide_summary_report_email_block' );
$hide_graph = (bool) $this->widget_meta( 'get', 'hide_graph' );
?>
<?php if ( ! $hide_graph ) : ?>
@@ -301,37 +294,156 @@ class DashboardWidget {
<?php $this->email_stats_block(); ?>
</div>
<?php if ( SummaryReportEmail::is_disabled() && ! $hide_summary_report_email_block ) : ?>
<div id="wp-mail-smtp-dash-widget-summary-report-email-block" class="wp-mail-smtp-dash-widget-block wp-mail-smtp-dash-widget-summary-report-email-block">
<div>
<div class="wp-mail-smtp-dash-widget-summary-report-email-block-setting">
<label for="wp-mail-smtp-dash-widget-summary-report-email-enable">
<input type="checkbox" id="wp-mail-smtp-dash-widget-summary-report-email-enable">
<i class="wp-mail-smtp-dash-widget-loader"></i>
<span>
<?php
echo wp_kses(
__( '<b>NEW!</b> Enable Weekly Email Summaries', 'wp-mail-smtp' ),
[
'b' => [],
]
);
?>
</span>
</label>
<a href="<?php echo esc_url( SummaryReportEmail::get_preview_link() ); ?>" target="_blank">
<?php esc_html_e( 'View Example', 'wp-mail-smtp' ); ?>
</a>
<i class="dashicons dashicons-dismiss wp-mail-smtp-dash-widget-summary-report-email-dismiss"></i>
</div>
<div class="wp-mail-smtp-dash-widget-summary-report-email-block-applied hidden">
<i class="wp-mail-smtp-dashicons-yes-alt-green"></i>
<span><?php esc_attr_e( 'Weekly Email Summaries have been enabled', 'wp-mail-smtp' ); ?></span>
</div>
<?php
$this->display_after_email_stats_block_content();
}
/**
* Display the content after the email stats block.
*
* @since 3.9.0
*
* @return void
*/
private function display_after_email_stats_block_content() {
if ( empty( $this->widget_meta( 'get', 'hide_email_alerts_banner' ) ) ) {
// Check if we have error debug events.
$error_debug_events_count = DebugEvents::get_error_debug_events_count();
if ( ! is_wp_error( $error_debug_events_count ) && ! empty( $error_debug_events_count ) ) {
$this->show_email_alerts_banner( $error_debug_events_count );
return;
}
}
$hide_summary_report_email_block = (bool) $this->widget_meta( 'get', 'hide_summary_report_email_block' );
if ( SummaryReportEmail::is_disabled() && ! $hide_summary_report_email_block ) {
$this->show_summary_report_email_block();
}
$this->show_upgrade_footer();
}
/**
* Display the email alerts banner.
*
* @since 3.9.0
*
* @param int $error_count The number of debug events error.
*
* @return void
*/
private function show_email_alerts_banner( $error_count ) {
?>
<div id="wp-mail-smtp-dash-widget-email-alerts-education" class="wp-mail-smtp-dash-widget-block wp-mail-smtp-dash-widget-email-alerts-education">
<div class="wp-mail-smtp-dash-widget-email-alerts-education-error-icon">
<?php
printf(
'<img src="%s" alt="%s"/>',
esc_url( wp_mail_smtp()->assets_url . '/images/dash-widget/error-icon.svg' ),
esc_attr__( 'Error icon', 'wp-mail-smtp' )
);
?>
</div>
<div class="wp-mail-smtp-dash-widget-email-alerts-education-content">
<?php
$error_title = sprintf(
/* translators: %d - number of failed emails. */
_n(
'We detected %d failed email in the last 30 days.',
'We detected %d failed emails in the last 30 days.',
$error_count,
'wp-mail-smtp'
),
$error_count
);
$error_content = sprintf(
/* translators: %s - URL to WPMailSMTP.com. */
__( '<a href="%s" target="_blank" rel="noopener noreferrer">Upgrade to Pro</a> and get instant alert notifications when they fail.', 'wp-mail-smtp' ),
esc_url( wp_mail_smtp()->get_upgrade_link( [ 'medium' => 'dashboard-widget', 'content' => 'alerts-promo-upgrade-to-pro' ] ) ) // phpcs:ignore WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
);
?>
<p>
<strong><?php echo esc_html( $error_title ); ?></strong><br />
<?php
echo wp_kses(
$error_content,
[
'a' => [
'href' => [],
'target' => [],
'rel' => [],
],
]
);
?>
</p>
</div>
<button type="button" id="wp-mail-smtp-dash-widget-dismiss-email-alert-block" class="wp-mail-smtp-dash-widget-dismiss-email-alert-block" title="<?php esc_attr_e( 'Dismiss email alert block', 'wp-mail-smtp' ); ?>">
<span class="dashicons dashicons-no-alt"></span>
</button>
</div>
<?php
}
/**
* Show the summary report email block.
*
* @since 3.9.0
*
* @return void
*/
private function show_summary_report_email_block() {
?>
<div id="wp-mail-smtp-dash-widget-summary-report-email-block" class="wp-mail-smtp-dash-widget-block wp-mail-smtp-dash-widget-summary-report-email-block">
<div>
<div class="wp-mail-smtp-dash-widget-summary-report-email-block-setting">
<label for="wp-mail-smtp-dash-widget-summary-report-email-enable">
<input type="checkbox" id="wp-mail-smtp-dash-widget-summary-report-email-enable">
<i class="wp-mail-smtp-dash-widget-loader"></i>
<span>
<?php
echo wp_kses(
__( '<b>NEW!</b> Enable Weekly Email Summaries', 'wp-mail-smtp' ),
[
'b' => [],
]
);
?>
</span>
</label>
<a href="<?php echo esc_url( SummaryReportEmail::get_preview_link() ); ?>" target="_blank">
<?php esc_html_e( 'View Example', 'wp-mail-smtp' ); ?>
</a>
<i class="dashicons dashicons-dismiss wp-mail-smtp-dash-widget-summary-report-email-dismiss"></i>
</div>
<div class="wp-mail-smtp-dash-widget-summary-report-email-block-applied hidden">
<i class="wp-mail-smtp-dashicons-yes-alt-green"></i>
<span><?php esc_attr_e( 'Weekly Email Summaries have been enabled', 'wp-mail-smtp' ); ?></span>
</div>
</div>
<?php endif; ?>
</div>
<?php
}
/**
* Show the upgrade footer.
*
* @since 3.9.0
*
* @return void
*/
private function show_upgrade_footer() {
$hide_graph = (bool) $this->widget_meta( 'get', 'hide_graph' );
?>
<div id="wp-mail-smtp-dash-widget-upgrade-footer" class="wp-mail-smtp-dash-widget-block wp-mail-smtp-dash-widget-upgrade-footer wp-mail-smtp-dash-widget-upgrade-footer--<?php echo ! $hide_graph ? 'hide' : 'show'; ?>">
<p>
<?php
@@ -346,7 +458,8 @@ class DashboardWidget {
],
]
),
esc_url( wp_mail_smtp()->get_upgrade_link( [ 'medium' => 'dashboard-widget', 'content' => 'upgrade-to-pro' ] ) ) // phpcs:ignore WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
// phpcs:ignore WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
esc_url( wp_mail_smtp()->get_upgrade_link( [ 'medium' => 'dashboard-widget', 'content' => 'upgrade-to-pro' ] ) )
);
?>
</p>
@@ -420,7 +533,9 @@ class DashboardWidget {
?>
<div class="wp-mail-smtp-dash-widget-settings-container">
<button id="wp-mail-smtp-dash-widget-settings-button" class="wp-mail-smtp-dash-widget-settings-button button" type="button">
<span class="dashicons dashicons-admin-generic"></span>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 19 19">
<path d="M18,11l-2.18,0c-0.17,0.7 -0.44,1.35 -0.81,1.93l1.54,1.54l-2.1,2.1l-1.54,-1.54c-0.58,0.36 -1.23,0.63 -1.91,0.79l0,2.18l-3,0l0,-2.18c-0.68,-0.16 -1.33,-0.43 -1.91,-0.79l-1.54,1.54l-2.12,-2.12l1.54,-1.54c-0.36,-0.58 -0.63,-1.23 -0.79,-1.91l-2.18,0l0,-2.97l2.17,0c0.16,-0.7 0.44,-1.35 0.8,-1.94l-1.54,-1.54l2.1,-2.1l1.54,1.54c0.58,-0.37 1.24,-0.64 1.93,-0.81l0,-2.18l3,0l0,2.18c0.68,0.16 1.33,0.43 1.91,0.79l1.54,-1.54l2.12,2.12l-1.54,1.54c0.36,0.59 0.64,1.24 0.8,1.94l2.17,0l0,2.97Zm-8.5,1.5c1.66,0 3,-1.34 3,-3c0,-1.66 -1.34,-3 -3,-3c-1.66,0 -3,1.34 -3,3c0,1.66 1.34,3 3,3Z"></path>
</svg>
</button>
<div class="wp-mail-smtp-dash-widget-settings-menu">
<div class="wp-mail-smtp-dash-widget-settings-menu--style">
@@ -580,24 +695,12 @@ class DashboardWidget {
return false;
}
$defaults = [
'hide_graph' => 0,
'hide_summary_report_email_block' => 0,
];
if ( ! array_key_exists( $meta, $defaults ) ) {
return false;
if ( $action === 'get' ) {
return $this->get_widget_meta( $meta );
}
$meta_key = 'wp_mail_smtp_' . static::SLUG . '_' . $meta;
if ( 'get' === $action ) {
$meta_value = get_user_meta( get_current_user_id(), $meta_key, true );
return empty( $meta_value ) ? $defaults[ $meta ] : $meta_value;
}
$value = sanitize_key( $value );
$meta_key = $this->get_widget_meta_key( $meta );
$value = sanitize_key( $value );
if ( 'set' === $action && ! empty( $value ) ) {
return update_user_meta( get_current_user_id(), $meta_key, $value );
@@ -609,4 +712,48 @@ class DashboardWidget {
return false;
}
/**
* Get the widget meta value.
*
* @since 3.9.0
*
* @param string $meta Meta name.
*
* @return mixed
*/
private function get_widget_meta( $meta ) {
$defaults = [
'hide_graph' => 0,
'hide_summary_report_email_block' => 0,
'hide_email_alerts_banner' => 0,
];
$meta_value = get_user_meta( get_current_user_id(), $this->get_widget_meta_key( $meta ), true );
if ( ! empty( $meta_value ) ) {
return $meta_value;
}
if ( isset( $defaults[ $meta ] ) ) {
return $defaults[ $meta ];
}
return null;
}
/**
* Retrieve the meta key.
*
* @since 3.9.0
*
* @param string $meta Meta name.
*
* @return string
*/
private function get_widget_meta_key( $meta ) {
return 'wp_mail_smtp_' . static::SLUG . '_' . $meta;
}
}

View File

@@ -2,6 +2,7 @@
namespace WPMailSMTP\Admin\DebugEvents;
use WP_Error;
use WPMailSMTP\Admin\Area;
use WPMailSMTP\Options;
use WPMailSMTP\Tasks\DebugEventsCleanupTask;
@@ -14,6 +15,15 @@ use WPMailSMTP\WP;
*/
class DebugEvents {
/**
* Transient name for the error debug events.
*
* @since 3.9.0
*
* @var string
*/
const ERROR_DEBUG_EVENTS_TRANSIENT = 'wp_mail_smtp_error_debug_events_transient';
/**
* Register hooks.
*
@@ -248,6 +258,51 @@ class DebugEvents {
);
}
/**
* Returns the number of error debug events in a given time span.
*
* By default it returns the number of error debug events in the last 30 days.
*
* @since 3.9.0
*
* @param string $span_of_time The time span to count the events for. Default '-30 days'.
*
* @return int|WP_Error The number of error debug events or WP_Error on failure.
*/
public static function get_error_debug_events_count( $span_of_time = '-30 days' ) {
$timestamp = strtotime( $span_of_time );
if ( ! $timestamp || $timestamp > time() ) {
return new WP_Error( 'wp_mail_smtp_admin_debug_events_get_error_debug_events_count_invalid_time', 'Invalid time span.' );
}
$transient_key = self::ERROR_DEBUG_EVENTS_TRANSIENT . '_' . sanitize_title_with_dashes( $span_of_time );
$cached_error_events_count = get_transient( $transient_key );
if ( $cached_error_events_count !== false ) {
return (int) $cached_error_events_count;
}
global $wpdb;
// phpcs:disable WordPress.DB.PreparedSQLPlaceholders.UnquotedComplexPlaceholder
$sql = $wpdb->prepare(
'SELECT COUNT(*) FROM `%1$s` WHERE event_type = %2$d AND created_at >= "%3$s"',
self::get_table_name(),
Event::TYPE_ERROR,
gmdate( WP::datetime_mysql_format(), $timestamp )
);
// phpcs:enable WordPress.DB.PreparedSQLPlaceholders.UnquotedComplexPlaceholder
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared
$error_events_count = (int) $wpdb->get_var( $sql );
set_transient( $transient_key, $error_events_count, HOUR_IN_SECONDS );
return $error_events_count;
}
/**
* Register the screen options for the debug events page.
*
@@ -359,7 +414,8 @@ class DebugEvents {
$table = self::get_table_name();
$is_valid = (bool) $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s;', $table ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching
$is_valid = (bool) $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s;', $table ) );
return $is_valid;
}

View File

@@ -2,6 +2,8 @@
namespace WPMailSMTP\Admin;
use WPMailSMTP\Helpers\Helpers;
/**
* Class for interacting with the Domain Checker API.
*
@@ -53,7 +55,12 @@ class DomainChecker {
'domain' => $sending_domain,
];
$response = wp_remote_get( add_query_arg( $params, self::ENDPOINT ) );
$response = wp_remote_get(
add_query_arg( $params, self::ENDPOINT ),
[
'user-agent' => Helpers::get_default_user_agent(),
]
);
if ( is_wp_error( $response ) ) {
$this->results = [

View File

@@ -2,6 +2,7 @@
namespace WPMailSMTP\Admin;
use WPMailSMTP\Helpers\Helpers;
use WPMailSMTP\Options;
use WPMailSMTP\Tasks\Tasks;
use WPMailSMTP\WP;
@@ -120,7 +121,12 @@ class Notifications {
*/
protected function fetch_feed() {
$response = wp_remote_get( self::SOURCE_URL );
$response = wp_remote_get(
self::SOURCE_URL,
[
'user-agent' => Helpers::get_default_user_agent(),
]
);
if ( is_wp_error( $response ) ) {
return [];
@@ -226,6 +232,7 @@ class Notifications {
* Get notification data.
*
* @since 2.3.0
* @since 3.9.0 Make the AS a recurring task.
*
* @return array
*/
@@ -237,16 +244,17 @@ class Notifications {
$option = $this->get_option();
// Update notifications using async task.
if ( empty( $option['update'] ) || time() > $option['update'] + DAY_IN_SECONDS ) {
if ( empty( Tasks::is_scheduled( 'wp_mail_smtp_admin_notifications_update' ) ) ) {
// Update notifications a recurring task.
if ( Tasks::is_scheduled( 'wp_mail_smtp_admin_notifications_update' ) === false ) {
wp_mail_smtp()->get_tasks()
->create( 'wp_mail_smtp_admin_notifications_update' )
->async()
->params()
->register();
}
wp_mail_smtp()->get_tasks()
->create( 'wp_mail_smtp_admin_notifications_update' )
->recurring(
strtotime( '+1 minute' ),
$this->get_notification_update_task_interval()
)
->params()
->register();
}
$events = ! empty( $option['events'] ) ? $this->verify_active( $option['events'] ) : [];
@@ -255,6 +263,25 @@ class Notifications {
return array_merge( $events, $feed );
}
/**
* Get the update notifications interval.
*
* @since 3.9.0
*
* @return int
*/
private function get_notification_update_task_interval() {
/**
* Filters the interval for the notifications update task.
*
* @since 3.9.0
*
* @param int $interval The interval in seconds. Default to a day (in seconds).
*/
return (int) apply_filters( 'wp_mail_smtp_admin_notifications_get_notification_update_task_interval', DAY_IN_SECONDS );
}
/**
* Get notification count.
*

View File

@@ -68,13 +68,13 @@ class AdditionalConnectionsTab extends PageAbstract {
wp_enqueue_style(
'wp-mail-smtp-admin-lity',
wp_mail_smtp()->assets_url . '/libs/lity/lity.min.css',
wp_mail_smtp()->assets_url . '/css/vendor/lity.min.css',
[],
'2.4.1'
);
wp_enqueue_script(
'wp-mail-smtp-admin-lity',
wp_mail_smtp()->assets_url . '/libs/lity/lity.min.js',
wp_mail_smtp()->assets_url . '/js/vendor/lity.min.js',
[],
'2.4.1'
);
@@ -87,14 +87,13 @@ class AdditionalConnectionsTab extends PageAbstract {
*/
public function display() {
$upgrade_link_url = wp_mail_smtp()->get_upgrade_link(
$top_upgrade_button_url = wp_mail_smtp()->get_upgrade_link(
[
'medium' => 'Additional Connections Settings',
'content' => 'Upgrade to WP Mail SMTP Pro Link',
'content' => 'Upgrade to WP Mail SMTP Pro Button Top',
]
);
$upgrade_button_url = wp_mail_smtp()->get_upgrade_link(
$bottom_upgrade_button_url = wp_mail_smtp()->get_upgrade_link(
[
'medium' => 'Additional Connections Settings',
'content' => 'Upgrade to WP Mail SMTP Pro Button',
@@ -108,21 +107,13 @@ class AdditionalConnectionsTab extends PageAbstract {
</h4>
<p class="wp-mail-smtp-product-education__description">
<?php
echo wp_kses(
sprintf( /* translators: %s - WPMailSMTP.com Upgrade page URL. */
__( 'Create additional connections to set a backup for your Primary Connection or to configure Smart Routing. <a href="%s" target="_blank" rel="noopener noreferrer">Upgrade to WP Mail SMTP Pro!</a>', 'wp-mail-smtp' ),
esc_url( $upgrade_link_url )
),
[
'a' => [
'href' => [],
'rel' => [],
'target' => [],
],
]
);
esc_html_e( 'Create additional connections to set a backup for your Primary Connection or to configure Smart Routing.', 'wp-mail-smtp' );
?>
</p>
<a href="<?php echo esc_url( $top_upgrade_button_url ); ?>" target="_blank" rel="noopener noreferrer" class="wp-mail-smtp-product-education__upgrade-btn wp-mail-smtp-product-education__upgrade-btn--top wp-mail-smtp-btn wp-mail-smtp-btn-upgrade wp-mail-smtp-btn-orange">
<?php esc_html_e( 'Upgrade to WP Mail SMTP Pro', 'wp-mail-smtp' ); ?>
</a>
</div>
<?php
@@ -130,7 +121,7 @@ class AdditionalConnectionsTab extends PageAbstract {
$this->display_education_features_list();
?>
<a href="<?php echo esc_url( $upgrade_button_url ); ?>" target="_blank" rel="noopener noreferrer" class="wp-mail-smtp-btn wp-mail-smtp-btn-upgrade wp-mail-smtp-btn-orange">
<a href="<?php echo esc_url( $bottom_upgrade_button_url ); ?>" target="_blank" rel="noopener noreferrer" class="wp-mail-smtp-product-education__upgrade-btn wp-mail-smtp-product-education__upgrade-btn--bottom wp-mail-smtp-btn wp-mail-smtp-btn-upgrade wp-mail-smtp-btn-orange">
<?php esc_html_e( 'Upgrade to WP Mail SMTP Pro', 'wp-mail-smtp' ); ?>
</a>
</div>

View File

@@ -3,6 +3,7 @@
namespace WPMailSMTP\Admin\Pages;
use WPMailSMTP\Admin\PageAbstract;
use WPMailSMTP\Helpers\UI;
/**
* Class AlertsTab is a placeholder for Pro alerts feature.
@@ -61,20 +62,18 @@ class AlertsTab extends PageAbstract {
*/
public function display() {
$upgrade_link_url = wp_mail_smtp()->get_upgrade_link(
$top_upgrade_button_url = wp_mail_smtp()->get_upgrade_link(
[
'medium' => 'Alerts Settings',
'content' => 'Upgrade to WP Mail SMTP Pro Link',
'content' => 'Upgrade to WP Mail SMTP Pro Button Top',
]
);
$upgrade_button_url = wp_mail_smtp()->get_upgrade_link(
$bottom_upgrade_button_url = wp_mail_smtp()->get_upgrade_link(
[
'medium' => 'Alerts Settings',
'content' => 'Upgrade to WP Mail SMTP Pro Button',
]
);
?>
<div class="wp-mail-smtp-product-education">
<div class="wp-mail-smtp-product-education__row">
@@ -83,21 +82,50 @@ class AlertsTab extends PageAbstract {
</h4>
<p class="wp-mail-smtp-product-education__description">
<?php
echo wp_kses(
sprintf( /* translators: %s - WPMailSMTP.com Upgrade page URL. */
__( 'Configure at least one of these integrations to receive notifications when email fails to send from your site. Alert notifications will contain the following important data: email subject, email Send To address, the error message, and helpful links to help you fix the issue. <a href="%s" target="_blank" rel="noopener noreferrer">Upgrade to WP Mail SMTP Pro!</a>', 'wp-mail-smtp' ),
esc_url( $upgrade_link_url )
),
[
'a' => [
'href' => [],
'rel' => [],
'target' => [],
],
]
);
esc_html_e( 'Configure at least one of these integrations to receive notifications when email fails to send from your site. Alert notifications will contain the following important data: email subject, email Send To address, the error message, and helpful links to help you fix the issue.', 'wp-mail-smtp' );
?>
</p>
<a href="<?php echo esc_url( $top_upgrade_button_url ); ?>" target="_blank" rel="noopener noreferrer" class="wp-mail-smtp-product-education__upgrade-btn wp-mail-smtp-product-education__upgrade-btn--top wp-mail-smtp-btn wp-mail-smtp-btn-upgrade wp-mail-smtp-btn-orange">
<?php esc_html_e( 'Upgrade to WP Mail SMTP Pro', 'wp-mail-smtp' ); ?>
</a>
</div>
<div class="wp-mail-smtp-product-education__row wp-mail-smtp-product-education__row--inactive">
<div id="wp-mail-smtp-setting-row-alert_event_types" class="wp-mail-smtp-setting-row wp-mail-smtp-clear">
<div class="wp-mail-smtp-setting-label">
<label for="wp-mail-smtp-setting-debug_event_types">
<?php esc_html_e( 'Notify when', 'wp-mail-smtp' ); ?>
</label>
</div>
<div class="wp-mail-smtp-setting-field">
<?php
UI::toggle(
[
'label' => esc_html__( 'The initial email sending request fails', 'wp-mail-smtp' ),
'checked' => true,
'disabled' => true,
]
);
?>
<p class="desc">
<?php esc_html_e( 'This option is always enabled and will notify you about instant email sending failures.', 'wp-mail-smtp' ); ?>
</p>
<hr class="wp-mail-smtp-setting-mid-row-sep">
<?php
UI::toggle(
[
'label' => esc_html__( 'The deliverability verification process detects a hard bounce', 'wp-mail-smtp' ),
'disabled' => true,
]
);
?>
<p class="desc">
<?php esc_html_e( 'Get notified about emails that were successfully sent, but have hard bounced on delivery attempt. A hard bounce is an email that has failed to deliver for permanent reasons, such as the recipient\'s email address being invalid.', 'wp-mail-smtp' ); ?>
</p>
</div>
</div>
</div>
<div class="wp-mail-smtp-product-education__row wp-mail-smtp-product-education__row--inactive">
@@ -113,11 +141,9 @@ class AlertsTab extends PageAbstract {
<label><?php esc_html_e( 'Email Alerts', 'wp-mail-smtp' ); ?></label>
</div>
<div class="wp-mail-smtp-setting-field">
<label>
<span class="wp-mail-smtp-setting-toggle-switch"></span>
<span class="wp-mail-smtp-setting-toggle-checked-label"><?php esc_html_e( 'On', 'wp-mail-smtp' ); ?></span>
<span class="wp-mail-smtp-setting-toggle-unchecked-label"><?php esc_html_e( 'Off', 'wp-mail-smtp' ); ?></span>
</label>
<?php
UI::toggle();
?>
</div>
</div>
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-alert-options">
@@ -144,11 +170,9 @@ class AlertsTab extends PageAbstract {
<label><?php esc_html_e( 'Slack Alerts', 'wp-mail-smtp' ); ?></label>
</div>
<div class="wp-mail-smtp-setting-field">
<label>
<span class="wp-mail-smtp-setting-toggle-switch"></span>
<span class="wp-mail-smtp-setting-toggle-checked-label"><?php esc_html_e( 'On', 'wp-mail-smtp' ); ?></span>
<span class="wp-mail-smtp-setting-toggle-unchecked-label"><?php esc_html_e( 'Off', 'wp-mail-smtp' ); ?></span>
</label>
<?php
UI::toggle();
?>
</div>
</div>
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-alert-options">
@@ -175,11 +199,9 @@ class AlertsTab extends PageAbstract {
<label><?php esc_html_e( 'SMS via Twilio Alerts', 'wp-mail-smtp' ); ?></label>
</div>
<div class="wp-mail-smtp-setting-field">
<label>
<span class="wp-mail-smtp-setting-toggle-switch"></span>
<span class="wp-mail-smtp-setting-toggle-checked-label"><?php esc_html_e( 'On', 'wp-mail-smtp' ); ?></span>
<span class="wp-mail-smtp-setting-toggle-unchecked-label"><?php esc_html_e( 'Off', 'wp-mail-smtp' ); ?></span>
</label>
<?php
UI::toggle();
?>
</div>
</div>
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-alert-options">
@@ -224,11 +246,9 @@ class AlertsTab extends PageAbstract {
<label><?php esc_html_e( 'Webhook Alerts', 'wp-mail-smtp' ); ?></label>
</div>
<div class="wp-mail-smtp-setting-field">
<label>
<span class="wp-mail-smtp-setting-toggle-switch"></span>
<span class="wp-mail-smtp-setting-toggle-checked-label"><?php esc_html_e( 'On', 'wp-mail-smtp' ); ?></span>
<span class="wp-mail-smtp-setting-toggle-unchecked-label"><?php esc_html_e( 'Off', 'wp-mail-smtp' ); ?></span>
</label>
<?php
UI::toggle();
?>
</div>
</div>
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-alert-options">
@@ -244,7 +264,7 @@ class AlertsTab extends PageAbstract {
</div>
</div>
<a href="<?php echo esc_url( $upgrade_button_url ); ?>" target="_blank" rel="noopener noreferrer" class="wp-mail-smtp-btn wp-mail-smtp-btn-upgrade wp-mail-smtp-btn-orange">
<a href="<?php echo esc_url( $bottom_upgrade_button_url ); ?>" target="_blank" rel="noopener noreferrer" class="wp-mail-smtp-product-education__upgrade-btn wp-mail-smtp-product-education__upgrade-btn--bottom wp-mail-smtp-btn wp-mail-smtp-btn-upgrade wp-mail-smtp-btn-orange">
<?php esc_html_e( 'Upgrade to WP Mail SMTP Pro', 'wp-mail-smtp' ); ?>
</a>
</div>

View File

@@ -3,6 +3,7 @@
namespace WPMailSMTP\Admin\Pages;
use WPMailSMTP\Admin\PageAbstract;
use WPMailSMTP\Helpers\UI;
use WPMailSMTP\WP;
/**
@@ -210,16 +211,16 @@ class ControlTab extends PageAbstract {
*/
public function display() { // phpcs:ignore Generic.Metrics.CyclomaticComplexity.TooHigh
$link_upgrade_link = add_query_arg(
$top_upgrade_button_url = add_query_arg(
[ 'discount' => 'LITEUPGRADE' ],
wp_mail_smtp()->get_upgrade_link(
[
'medium' => 'Email Controls',
'content' => 'Upgrade to WP Mail SMTP Pro',
'content' => 'Upgrade to WP Mail SMTP Pro Button Top',
]
)
);
$button_upgrade_link = add_query_arg(
$bottom_upgrade_button_url = add_query_arg(
[ 'discount' => 'LITEUPGRADE' ],
wp_mail_smtp()->get_upgrade_link(
[
@@ -237,21 +238,13 @@ class ControlTab extends PageAbstract {
</h4>
<p class="wp-mail-smtp-product-education__description">
<?php
echo wp_kses(
sprintf( /* translators: %s - WPMailSMTP.com Upgrade page URL. */
__( 'Email controls allow you to manage the automatic notifications you receive from your WordPress website. With the flick of a switch, you can reduce inbox clutter and focus on the alerts that matter the most. It\'s easy to disable emails about comments, email or password changes, WordPress updates, user registrations, and personal data requests. <a href="%s" target="_blank" rel="noopener noreferrer">Upgrade to WP Mail SMTP Pro!</a>', 'wp-mail-smtp' ),
esc_url( $link_upgrade_link )
),
[
'a' => [
'href' => [],
'rel' => [],
'target' => [],
],
]
);
esc_html_e( 'Email controls allow you to manage the automatic notifications you receive from your WordPress website. With the flick of a switch, you can reduce inbox clutter and focus on the alerts that matter the most. It\'s easy to disable emails about comments, email or password changes, WordPress updates, user registrations, and personal data requests.', 'wp-mail-smtp' );
?>
</p>
<a href="<?php echo esc_url( $top_upgrade_button_url ); ?>" target="_blank" rel="noopener noreferrer" class="wp-mail-smtp-product-education__upgrade-btn wp-mail-smtp-product-education__upgrade-btn--top wp-mail-smtp-btn wp-mail-smtp-btn-upgrade wp-mail-smtp-btn-orange">
<?php esc_html_e( 'Upgrade to WP Mail SMTP Pro', 'wp-mail-smtp' ); ?>
</a>
</div>
<div class="wp-mail-smtp-product-education__row wp-mail-smtp-product-education__row--inactive">
@@ -288,16 +281,9 @@ class ControlTab extends PageAbstract {
<label><?php echo esc_html( $email['label'] ); ?></label>
</div>
<div class="wp-mail-smtp-setting-field">
<label>
<input type="checkbox" checked/>
<span class="wp-mail-smtp-setting-toggle-switch"></span>
<span class="wp-mail-smtp-setting-toggle-checked-label">
<?php esc_html_e( 'On', 'wp-mail-smtp' ); ?>
</span>
<span class="wp-mail-smtp-setting-toggle-unchecked-label">
<?php esc_html_e( 'Off', 'wp-mail-smtp' ); ?>
</span>
</label>
<?php
UI::toggle( [ 'checked' => true ] );
?>
<?php if ( ! empty( $email['desc'] ) ) : ?>
<p class="desc">
<?php echo $email['desc']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
@@ -309,7 +295,7 @@ class ControlTab extends PageAbstract {
<?php endforeach; ?>
</div>
<a href="<?php echo esc_url( $button_upgrade_link ); ?>" target="_blank" rel="noopener noreferrer" class="wp-mail-smtp-btn wp-mail-smtp-btn-upgrade wp-mail-smtp-btn-orange">
<a href="<?php echo esc_url( $bottom_upgrade_button_url ); ?>" target="_blank" rel="noopener noreferrer" class="wp-mail-smtp-product-education__upgrade-btn wp-mail-smtp-product-education__upgrade-btn--bottom wp-mail-smtp-btn wp-mail-smtp-btn-upgrade wp-mail-smtp-btn-orange">
<?php esc_html_e( 'Upgrade to WP Mail SMTP Pro', 'wp-mail-smtp' ); ?>
</a>
</div>

View File

@@ -8,6 +8,7 @@ use WPMailSMTP\Admin\DebugEvents\Migration;
use WPMailSMTP\Admin\DebugEvents\Table;
use WPMailSMTP\Admin\PageAbstract;
use WPMailSMTP\Admin\ParentPageAbstract;
use WPMailSMTP\Helpers\UI;
use WPMailSMTP\Options;
use WPMailSMTP\WP;
@@ -195,7 +196,7 @@ class DebugEventsTab extends PageAbstract {
<?php $this->wp_nonce_field(); ?>
<!-- Debug Events Section Title -->
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-content wp-mail-smtp-clear section-heading" id="wp-mail-smtp-setting-row-email-heading">
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-content wp-mail-smtp-clear section-heading wp-mail-smtp-section-heading--has-divider">
<div class="wp-mail-smtp-setting-field">
<h2><?php esc_html_e( 'Debug Events', 'wp-mail-smtp' ); ?></h2>
</div>
@@ -205,38 +206,47 @@ class DebugEventsTab extends PageAbstract {
</div>
<!-- Debug Events -->
<div id="wp-mail-smtp-setting-row-debug_event_types" class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-checkbox wp-mail-smtp-clear">
<div id="wp-mail-smtp-setting-row-debug_event_types" class="wp-mail-smtp-setting-row wp-mail-smtp-clear">
<div class="wp-mail-smtp-setting-label">
<label for="wp-mail-smtp-setting-debug_event_types">
<?php esc_html_e( 'Event Types', 'wp-mail-smtp' ); ?>
</label>
</div>
<div class="wp-mail-smtp-setting-field">
<div>
<input name="wp-mail-smtp[debug_events][email_errors]" type="checkbox"
value="true"
checked
disabled
id="wp-mail-smtp-setting-debug_events_email_errors">
<label for="wp-mail-smtp-setting-debug_events_email_errors">
<?php esc_html_e( 'Email Sending Errors', 'wp-mail-smtp' ); ?>
</label>
<p class="desc">
<?php esc_html_e( 'This debug event is always enabled and will record any email sending errors in the table below.', 'wp-mail-smtp' ); ?>
</p>
</div>
<?php
UI::toggle(
[
'name' => 'wp-mail-smtp[debug_events][email_errors]',
'id' => 'wp-mail-smtp-setting-debug_events_email_errors',
'value' => 'true',
'checked' => true,
'disabled' => true,
]
);
?>
<p class="desc">
<?php esc_html_e( 'Email Sending Errors', 'wp-mail-smtp' ); ?>
</p>
<p class="desc">
<?php esc_html_e( 'This debug event is always enabled and will record any email sending errors in the table below.', 'wp-mail-smtp' ); ?>
</p>
<hr class="wp-mail-smtp-setting-mid-row-sep">
<div>
<input name="wp-mail-smtp[debug_events][email_debug]" type="checkbox"
value="true" <?php checked( true, $this->options->get( 'debug_events', 'email_debug' ) ); ?>
id="wp-mail-smtp-setting-debug_events_email_debug">
<label for="wp-mail-smtp-setting-debug_events_email_debug">
<?php esc_html_e( 'Debug Email Sending', 'wp-mail-smtp' ); ?>
</label>
<p class="desc">
<?php esc_html_e( 'Check this if you would like to debug the email sending process. Once enabled, all debug events will be logged in the table below. This setting should only be enabled for shorter debugging periods and disabled afterwards.', 'wp-mail-smtp' ); ?>
</p>
</div>
<?php
UI::toggle(
[
'name' => 'wp-mail-smtp[debug_events][email_debug]',
'id' => 'wp-mail-smtp-setting-debug_events_email_debug',
'value' => 'true',
'checked' => (bool) $this->options->get( 'debug_events', 'email_debug' ),
]
);
?>
<p class="desc">
<?php esc_html_e( 'Debug Email Sending', 'wp-mail-smtp' ); ?>
</p>
<p class="desc">
<?php esc_html_e( 'Check this if you would like to debug the email sending process. Once enabled, all debug events will be logged in the table below. This setting should only be enabled for shorter debugging periods and disabled afterwards.', 'wp-mail-smtp' ); ?>
</p>
</div>
</div>

View File

@@ -73,13 +73,13 @@ class EmailReportsTab extends PageAbstract {
wp_enqueue_style(
'wp-mail-smtp-admin-lity',
wp_mail_smtp()->assets_url . '/libs/lity/lity.min.css',
wp_mail_smtp()->assets_url . '/css/vendor/lity.min.css',
[],
'2.4.1'
);
wp_enqueue_script(
'wp-mail-smtp-admin-lity',
wp_mail_smtp()->assets_url . '/libs/lity/lity.min.js',
wp_mail_smtp()->assets_url . '/js/vendor/lity.min.js',
[],
'2.4.1',
false
@@ -93,7 +93,13 @@ class EmailReportsTab extends PageAbstract {
*/
public function display() {
$button_upgrade_link = wp_mail_smtp()->get_upgrade_link(
$top_upgrade_button_url = wp_mail_smtp()->get_upgrade_link(
[
'medium' => 'email-reports',
'content' => 'upgrade-to-wp-mail-smtp-pro-button-link-top',
]
);
$bottom_upgrade_button_url = wp_mail_smtp()->get_upgrade_link(
[
'medium' => 'email-reports',
'content' => 'upgrade-to-wp-mail-smtp-pro-button-link',
@@ -123,28 +129,13 @@ class EmailReportsTab extends PageAbstract {
<div class="wp-mail-smtp-product-education__row">
<p class="wp-mail-smtp-product-education__description">
<?php
echo wp_kses(
sprintf( /* translators: %s - WPMailSMTP.com page URL. */
__( 'Email reports make it easy to track deliverability and engagement at-a-glance. Your open and click-through rates are grouped by subject line, making it easy to review the performance of campaigns or notifications. The report also displays Sent and Failed emails each week so you spot any issues quickly. When you upgrade, we\'ll also add an email report chart right in your WordPress dashboard. <a href="%s" target="_blank" rel="noopener noreferrer">Upgrade to WP Mail SMTP Pro!</a>', 'wp-mail-smtp' ),
esc_url(
wp_mail_smtp()->get_upgrade_link(
[
'medium' => 'email-reports',
'content' => 'upgrade-to-wp-mail-smtp-pro-text-link',
]
)
)
),
[
'a' => [
'href' => [],
'rel' => [],
'target' => [],
],
]
);
esc_html_e( 'Email reports make it easy to track deliverability and engagement at-a-glance. Your open and click-through rates are grouped by subject line, making it easy to review the performance of campaigns or notifications. The report also displays Sent and Failed emails each week so you spot any issues quickly. When you upgrade, we\'ll also add an email report chart right in your WordPress dashboard.', 'wp-mail-smtp' );
?>
</p>
<a href="<?php echo esc_url( $top_upgrade_button_url ); ?>" target="_blank" rel="noopener noreferrer" class="wp-mail-smtp-product-education__upgrade-btn wp-mail-smtp-product-education__upgrade-btn--top wp-mail-smtp-btn wp-mail-smtp-btn-upgrade wp-mail-smtp-btn-orange">
<?php esc_html_e( 'Upgrade to WP Mail SMTP Pro', 'wp-mail-smtp' ); ?>
</a>
</div>
<div class="wp-mail-smtp-product-education__row">
@@ -180,7 +171,7 @@ class EmailReportsTab extends PageAbstract {
</div>
</div>
<a href="<?php echo esc_url( $button_upgrade_link ); ?>" target="_blank" rel="noopener noreferrer" class="wp-mail-smtp-btn wp-mail-smtp-btn-upgrade wp-mail-smtp-btn-orange">
<a href="<?php echo esc_url( $bottom_upgrade_button_url ); ?>" target="_blank" rel="noopener noreferrer" class="wp-mail-smtp-product-education__upgrade-btn wp-mail-smtp-product-education__upgrade-btn--bottom wp-mail-smtp-btn wp-mail-smtp-btn-upgrade wp-mail-smtp-btn-orange">
<?php esc_html_e( 'Upgrade to WP Mail SMTP Pro', 'wp-mail-smtp' ); ?>
</a>
</div>

View File

@@ -61,13 +61,18 @@ class ExportTab extends PageAbstract {
*/
public function display() {
$button_upgrade_link = wp_mail_smtp()->get_upgrade_link(
$top_upgrade_button_url = wp_mail_smtp()->get_upgrade_link(
[
'medium' => 'tools-export',
'content' => 'upgrade-to-wp-mail-smtp-pro-button-top',
]
);
$bottom_upgrade_button_url = wp_mail_smtp()->get_upgrade_link(
[
'medium' => 'tools-export',
'content' => 'upgrade-to-wp-mail-smtp-pro-button',
]
);
?>
<div id="wp-mail-smtp-tools-export-email-logs-product-education" class="wp-mail-smtp-product-education">
<div class="wp-mail-smtp-product-education__row">
@@ -76,28 +81,13 @@ class ExportTab extends PageAbstract {
</h4>
<p class="wp-mail-smtp-product-education__description">
<?php
echo wp_kses(
sprintf( /* translators: %s - WPMailSMTP.com Upgrade page URL. */
__( 'Easily export your logs to CSV or Excel. Filter the logs before you export and only download the data you need. This feature lets you easily create your own deliverability reports. You can also use the data in 3rd party dashboards to track deliverability along with your other website statistics. <a href="%s" target="_blank" rel="noopener noreferrer">Upgrade to WP Mail SMTP Pro!</a>', 'wp-mail-smtp' ),
esc_url(
wp_mail_smtp()->get_upgrade_link(
[
'medium' => 'tools-export',
'content' => 'upgrade-to-wp-mail-smtp-pro-text-link',
]
)
)
),
[
'a' => [
'href' => [],
'rel' => [],
'target' => [],
],
]
);
esc_html_e( 'Easily export your logs to CSV or Excel. Filter the logs before you export and only download the data you need. This feature lets you easily create your own deliverability reports. You can also use the data in 3rd party dashboards to track deliverability along with your other website statistics.', 'wp-mail-smtp' );
?>
</p>
<a href="<?php echo esc_url( $top_upgrade_button_url ); ?>" target="_blank" rel="noopener noreferrer" class="wp-mail-smtp-product-education__upgrade-btn wp-mail-smtp-product-education__upgrade-btn--top wp-mail-smtp-btn wp-mail-smtp-btn-upgrade wp-mail-smtp-btn-orange">
<?php esc_html_e( 'Upgrade to WP Mail SMTP Pro', 'wp-mail-smtp' ); ?>
</a>
</div>
<div class="wp-mail-smtp-product-education__row wp-mail-smtp-product-education__row--inactive">
@@ -152,7 +142,7 @@ class ExportTab extends PageAbstract {
</section>
</div>
<a href="<?php echo esc_url( $button_upgrade_link ); ?>" target="_blank" rel="noopener noreferrer" class="wp-mail-smtp-btn wp-mail-smtp-btn-upgrade wp-mail-smtp-btn-orange">
<a href="<?php echo esc_url( $bottom_upgrade_button_url ); ?>" target="_blank" rel="noopener noreferrer" class="wp-mail-smtp-product-education__upgrade-btn wp-mail-smtp-product-education__upgrade-btn--bottom wp-mail-smtp-btn wp-mail-smtp-btn-upgrade wp-mail-smtp-btn-orange">
<?php esc_html_e( 'Upgrade to WP Mail SMTP Pro', 'wp-mail-smtp' ); ?>
</a>
</div>

View File

@@ -82,13 +82,13 @@ class LogsTab extends PageAbstract {
wp_enqueue_style(
'wp-mail-smtp-admin-lity',
wp_mail_smtp()->assets_url . '/libs/lity/lity.min.css',
wp_mail_smtp()->assets_url . '/css/vendor/lity.min.css',
[],
'2.4.1'
);
wp_enqueue_script(
'wp-mail-smtp-admin-lity',
wp_mail_smtp()->assets_url . '/libs/lity/lity.min.js',
wp_mail_smtp()->assets_url . '/js/vendor/lity.min.js',
[],
'2.4.1',
false
@@ -103,7 +103,16 @@ class LogsTab extends PageAbstract {
*/
public function display() {
$button_upgrade_link = add_query_arg(
$top_upgrade_button_url = add_query_arg(
[ 'discount' => 'LITEUPGRADE' ],
wp_mail_smtp()->get_upgrade_link(
[
'medium' => 'logs',
'content' => 'Upgrade to Pro Button Top',
]
)
);
$bottom_upgrade_button_url = add_query_arg(
[ 'discount' => 'LITEUPGRADE' ],
wp_mail_smtp()->get_upgrade_link(
[
@@ -112,15 +121,6 @@ class LogsTab extends PageAbstract {
]
)
);
$link_upgrade_link = add_query_arg(
[ 'discount' => 'LITEUPGRADE' ],
wp_mail_smtp()->get_upgrade_link(
[
'medium' => 'logs',
'content' => 'upgrade-to-wp-mail-smtp-pro-text-link',
]
)
);
$assets_url = wp_mail_smtp()->assets_url . '/images/logs/';
$screenshots = [
@@ -144,21 +144,13 @@ class LogsTab extends PageAbstract {
</h4>
<p class="wp-mail-smtp-product-education__description">
<?php
echo wp_kses(
sprintf( /* translators: %s - WPMailSMTP.com page URL. */
__( 'Email logging makes it easy to save details about all of the emails sent from your WordPress site. You can search and filter the email log to find specific messages and check the color-coded delivery status. Email logging also allows you to resend emails, save attachments, and export your logs in different formats. <a href="%s" target="_blank" rel="noopener noreferrer">Upgrade to WP Mail SMTP Pro!</a>', 'wp-mail-smtp' ),
esc_url( $link_upgrade_link )
),
[
'a' => [
'href' => [],
'rel' => [],
'target' => [],
],
]
);
esc_html_e( 'Email logging makes it easy to save details about all of the emails sent from your WordPress site. You can search and filter the email log to find specific messages and check the color-coded delivery status. Email logging also allows you to resend emails, save attachments, and export your logs in different formats.', 'wp-mail-smtp' );
?>
</p>
<a href="<?php echo esc_url( $top_upgrade_button_url ); ?>" target="_blank" rel="noopener noreferrer" class="wp-mail-smtp-product-education__upgrade-btn wp-mail-smtp-product-education__upgrade-btn--top wp-mail-smtp-btn wp-mail-smtp-btn-upgrade wp-mail-smtp-btn-orange">
<?php esc_html_e( 'Upgrade to WP Mail SMTP Pro', 'wp-mail-smtp' ); ?>
</a>
</div>
<div class="wp-mail-smtp-product-education__row">
@@ -194,7 +186,7 @@ class LogsTab extends PageAbstract {
</div>
</div>
<a href="<?php echo esc_url( $button_upgrade_link ); ?>" target="_blank" rel="noopener noreferrer" class="wp-mail-smtp-btn wp-mail-smtp-btn-upgrade wp-mail-smtp-btn-orange">
<a href="<?php echo esc_url( $bottom_upgrade_button_url ); ?>" target="_blank" rel="noopener noreferrer" class="wp-mail-smtp-product-education__upgrade-btn wp-mail-smtp-product-education__upgrade-btn--bottom wp-mail-smtp-btn wp-mail-smtp-btn-upgrade wp-mail-smtp-btn-orange">
<?php esc_html_e( 'Upgrade to WP Mail SMTP Pro', 'wp-mail-smtp' ); ?>
</a>
</div>

View File

@@ -4,6 +4,7 @@ namespace WPMailSMTP\Admin\Pages;
use WPMailSMTP\Admin\Area;
use WPMailSMTP\Admin\PageAbstract;
use WPMailSMTP\Helpers\UI;
use WPMailSMTP\Options;
use WPMailSMTP\UsageTracking\UsageTracking;
use WPMailSMTP\Reports\Emails\Summary as SummaryReportEmail;
@@ -45,7 +46,8 @@ class MiscTab extends PageAbstract {
* @return string
*/
public function get_title() {
return $this->get_label();
return esc_html__( 'Miscellaneous', 'wp-mail-smtp' );
}
/**
@@ -62,27 +64,34 @@ class MiscTab extends PageAbstract {
<?php $this->wp_nonce_field(); ?>
<!-- Section Title -->
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-content wp-mail-smtp-clear section-heading no-desc" id="wp-mail-smtp-setting-row-email-heading">
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-content wp-mail-smtp-clear section-heading wp-mail-smtp-section-heading--has-divider no-desc">
<div class="wp-mail-smtp-setting-field">
<h2><?php echo $this->get_title(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></h2>
</div>
</div>
<!-- Do not send -->
<div id="wp-mail-smtp-setting-row-do_not_send" class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-checkbox wp-mail-smtp-clear">
<div id="wp-mail-smtp-setting-row-do_not_send" class="wp-mail-smtp-setting-row wp-mail-smtp-clear">
<div class="wp-mail-smtp-setting-label">
<label for="wp-mail-smtp-setting-do_not_send">
<?php esc_html_e( 'Do Not Send', 'wp-mail-smtp' ); ?>
</label>
</div>
<div class="wp-mail-smtp-setting-field">
<input name="wp-mail-smtp[general][do_not_send]" type="checkbox" value="true" id="wp-mail-smtp-setting-do_not_send"
<?php echo $options->is_const_defined( 'general', 'do_not_send' ) ? 'disabled' : ''; ?>
<?php checked( true, $options->get( 'general', 'do_not_send' ) ); ?>
>
<label for="wp-mail-smtp-setting-do_not_send">
<?php esc_html_e( 'Stop sending all emails.', 'wp-mail-smtp' ); ?>
</label>
<?php
UI::toggle(
[
'name' => 'wp-mail-smtp[general][do_not_send]',
'id' => 'wp-mail-smtp-setting-do_not_send',
'value' => 'true',
'checked' => (bool) $options->get( 'general', 'do_not_send' ),
'disabled' => $options->is_const_defined( 'general', 'do_not_send' ),
]
);
?>
<p class="desc">
<?php esc_html_e( 'Stop sending all emails', 'wp-mail-smtp' ); ?>
</p>
<p class="desc">
<?php
printf(
@@ -124,26 +133,32 @@ class MiscTab extends PageAbstract {
</div>
<!-- Hide Announcements -->
<div id="wp-mail-smtp-setting-row-am_notifications_hidden" class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-checkbox wp-mail-smtp-clear">
<div id="wp-mail-smtp-setting-row-am_notifications_hidden" class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-checkbox-toggle wp-mail-smtp-clear">
<div class="wp-mail-smtp-setting-label">
<label for="wp-mail-smtp-setting-am_notifications_hidden">
<?php esc_html_e( 'Hide Announcements', 'wp-mail-smtp' ); ?>
</label>
</div>
<div class="wp-mail-smtp-setting-field">
<input name="wp-mail-smtp[general][am_notifications_hidden]" type="checkbox"
value="true" <?php checked( true, $options->get( 'general', 'am_notifications_hidden' ) ); ?>
id="wp-mail-smtp-setting-am_notifications_hidden"
>
<label for="wp-mail-smtp-setting-am_notifications_hidden">
<?php
UI::toggle(
[
'name' => 'wp-mail-smtp[general][am_notifications_hidden]',
'id' => 'wp-mail-smtp-setting-am_notifications_hidden',
'value' => 'true',
'checked' => (bool) $options->get( 'general', 'am_notifications_hidden' ),
]
);
?>
<p class="desc">
<?php esc_html_e( 'Hide plugin announcements and update details.', 'wp-mail-smtp' ); ?>
</label>
</p>
</div>
</div>
<!-- Hide Email Delivery Errors -->
<div id="wp-mail-smtp-setting-row-email_delivery_errors_hidden"
class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-checkbox wp-mail-smtp-clear">
class="wp-mail-smtp-setting-row wp-mail-smtp-clear">
<div class="wp-mail-smtp-setting-label">
<label for="wp-mail-smtp-setting-email_delivery_errors_hidden">
<?php esc_html_e( 'Hide Email Delivery Errors', 'wp-mail-smtp' ); ?>
@@ -153,18 +168,20 @@ class MiscTab extends PageAbstract {
<?php
$is_hard_disabled = has_filter( 'wp_mail_smtp_admin_is_error_delivery_notice_enabled' ) && ! wp_mail_smtp()->get_admin()->is_error_delivery_notice_enabled();
?>
<?php if ( $is_hard_disabled ) : ?>
<input type="checkbox" disabled checked id="wp-mail-smtp-setting-email_delivery_errors_hidden">
<?php else : ?>
<input name="wp-mail-smtp[general][email_delivery_errors_hidden]" type="checkbox" value="true"
<?php checked( true, $options->get( 'general', 'email_delivery_errors_hidden' ) ); ?>
id="wp-mail-smtp-setting-email_delivery_errors_hidden">
<?php endif; ?>
<label for="wp-mail-smtp-setting-email_delivery_errors_hidden">
<?php
UI::toggle(
[
'name' => 'wp-mail-smtp[general][email_delivery_errors_hidden]',
'id' => 'wp-mail-smtp-setting-email_delivery_errors_hidden',
'value' => 'true',
'checked' => $is_hard_disabled || (bool) $options->get( 'general', 'email_delivery_errors_hidden' ),
'disabled' => $is_hard_disabled,
]
);
?>
<p class="desc">
<?php esc_html_e( 'Hide warnings alerting of email delivery errors.', 'wp-mail-smtp' ); ?>
</label>
</p>
<?php if ( $is_hard_disabled ) : ?>
<p class="desc">
<?php
@@ -190,74 +207,79 @@ class MiscTab extends PageAbstract {
</div>
<!-- Hide Dashboard Widget -->
<div id="wp-mail-smtp-setting-row-dashboard_widget_hidden" class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-checkbox wp-mail-smtp-clear">
<div id="wp-mail-smtp-setting-row-dashboard_widget_hidden" class="wp-mail-smtp-setting-row wp-mail-smtp-clear">
<div class="wp-mail-smtp-setting-label">
<label for="wp-mail-smtp-setting-dashboard_widget_hidden">
<?php esc_html_e( 'Hide Dashboard Widget', 'wp-mail-smtp' ); ?>
</label>
</div>
<div class="wp-mail-smtp-setting-field">
<input name="wp-mail-smtp[general][dashboard_widget_hidden]" type="checkbox"
value="true" <?php checked( true, $options->get( 'general', 'dashboard_widget_hidden' ) ); ?>
id="wp-mail-smtp-setting-dashboard_widget_hidden"
>
<label for="wp-mail-smtp-setting-dashboard_widget_hidden">
<?php
UI::toggle(
[
'name' => 'wp-mail-smtp[general][dashboard_widget_hidden]',
'id' => 'wp-mail-smtp-setting-dashboard_widget_hidden',
'value' => 'true',
'checked' => (bool) $options->get( 'general', 'dashboard_widget_hidden' ),
]
);
?>
<p class="desc">
<?php esc_html_e( 'Hide the WP Mail SMTP Dashboard Widget.', 'wp-mail-smtp' ); ?>
</label>
</div>
</div>
<!-- Uninstall -->
<div id="wp-mail-smtp-setting-row-uninstall" class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-checkbox wp-mail-smtp-clear">
<div class="wp-mail-smtp-setting-label">
<label for="wp-mail-smtp-setting-uninstall">
<?php esc_html_e( 'Uninstall WP Mail SMTP', 'wp-mail-smtp' ); ?>
</label>
</div>
<div class="wp-mail-smtp-setting-field">
<input name="wp-mail-smtp[general][uninstall]" type="checkbox"
value="true" <?php checked( true, $options->get( 'general', 'uninstall' ) ); ?>
id="wp-mail-smtp-setting-uninstall">
<label for="wp-mail-smtp-setting-uninstall">
<?php esc_html_e( 'Remove ALL WP Mail SMTP data upon plugin deletion. All settings will be unrecoverable.', 'wp-mail-smtp' ); ?>
</label>
</p>
</div>
</div>
<?php if ( apply_filters( 'wp_mail_smtp_admin_pages_misc_tab_show_usage_tracking_setting', true ) ) : ?>
<!-- Usage Tracking -->
<div id="wp-mail-smtp-setting-row-usage-tracking" class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-checkbox wp-mail-smtp-clear">
<div id="wp-mail-smtp-setting-row-usage-tracking" class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-checkbox-toggle wp-mail-smtp-clear">
<div class="wp-mail-smtp-setting-label">
<label for="wp-mail-smtp-setting-usage-tracking">
<?php esc_html_e( 'Allow Usage Tracking', 'wp-mail-smtp' ); ?>
</label>
</div>
<div class="wp-mail-smtp-setting-field">
<input name="wp-mail-smtp[general][<?php echo esc_attr( UsageTracking::SETTINGS_SLUG ); ?>]" type="checkbox"
value="true" <?php checked( true, $options->get( 'general', UsageTracking::SETTINGS_SLUG ) ); ?>
id="wp-mail-smtp-setting-usage-tracking">
<label for="wp-mail-smtp-setting-usage-tracking">
<?php
UI::toggle(
[
'name' => 'wp-mail-smtp[general][' . UsageTracking::SETTINGS_SLUG . ']',
'id' => 'wp-mail-smtp-setting-usage-tracking',
'value' => 'true',
'checked' => (bool) $options->get( 'general', UsageTracking::SETTINGS_SLUG ),
]
);
?>
<p class="desc">
<?php esc_html_e( 'By allowing us to track usage data we can better help you because we know with which WordPress configurations, themes and plugins we should test.', 'wp-mail-smtp' ); ?>
</label>
</p>
</div>
</div>
<?php endif; ?>
<!-- Summary Report Email -->
<div id="wp-mail-smtp-setting-row-summary-report-email" class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-checkbox wp-mail-smtp-clear">
<div id="wp-mail-smtp-setting-row-summary-report-email" class="wp-mail-smtp-setting-row wp-mail-smtp-clear">
<div class="wp-mail-smtp-setting-label">
<label for="wp-mail-smtp-setting-summary-report-email">
<?php esc_html_e( 'Disable Email Summaries', 'wp-mail-smtp' ); ?>
</label>
</div>
<div class="wp-mail-smtp-setting-field">
<input name="wp-mail-smtp[general][<?php echo esc_attr( SummaryReportEmail::SETTINGS_SLUG ); ?>]" type="checkbox" id="wp-mail-smtp-setting-summary-report-email"
value="true" <?php checked( true, SummaryReportEmail::is_disabled() ); ?>
<?php disabled( $options->is_const_defined( 'general', SummaryReportEmail::SETTINGS_SLUG ) || ( wp_mail_smtp()->is_pro() && empty( Options::init()->get( 'logs', 'enabled' ) ) ) ); ?>>
<label for="wp-mail-smtp-setting-summary-report-email">
<?php esc_html_e( 'Disable Email Summaries weekly delivery.', 'wp-mail-smtp' ); ?>
</label>
<?php
UI::toggle(
[
'name' => 'wp-mail-smtp[general][' . SummaryReportEmail::SETTINGS_SLUG . ']',
'id' => 'wp-mail-smtp-setting-summary-report-email',
'value' => 'true',
'checked' => (bool) SummaryReportEmail::is_disabled(),
'disabled' => (
$options->is_const_defined( 'general', SummaryReportEmail::SETTINGS_SLUG ) ||
( wp_mail_smtp()->is_pro() && empty( Options::init()->get( 'logs', 'enabled' ) ) )
),
]
);
?>
<p class="desc">
<?php esc_html_e( 'Disable Email Summaries weekly delivery.', 'wp-mail-smtp' ); ?>
<?php
if ( wp_mail_smtp()->is_pro() && empty( Options::init()->get( 'logs', 'enabled' ) ) ) {
echo wp_kses(
@@ -287,6 +309,33 @@ class MiscTab extends PageAbstract {
</div>
</div>
<!-- Uninstall -->
<div id="wp-mail-smtp-setting-row-uninstall" class="wp-mail-smtp-setting-row wp-mail-smtp-clear">
<div class="wp-mail-smtp-setting-label">
<label for="wp-mail-smtp-setting-uninstall">
<?php esc_html_e( 'Uninstall WP Mail SMTP', 'wp-mail-smtp' ); ?>
</label>
</div>
<div class="wp-mail-smtp-setting-field">
<?php
UI::toggle(
[
'name' => 'wp-mail-smtp[general][uninstall]',
'id' => 'wp-mail-smtp-setting-uninstall',
'value' => 'true',
'checked' => (bool) $options->get( 'general', 'uninstall' ),
]
);
?>
<p class="desc">
<?php esc_html_e( 'Remove ALL WP Mail SMTP data upon plugin deletion.', 'wp-mail-smtp' ); ?>
</p>
<p class="desc wp-mail-smtp-danger">
<?php esc_html_e( 'All settings will be unrecoverable.', 'wp-mail-smtp' ); ?>
</p>
</div>
</div>
<?php $this->display_save_btn(); ?>
</form>

View File

@@ -81,7 +81,7 @@ class SettingsTab extends PageAbstract {
</div>
<!-- Mail Section Title -->
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-content wp-mail-smtp-clear section-heading no-desc" id="wp-mail-smtp-setting-row-email-heading">
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-content wp-mail-smtp-clear section-heading no-desc">
<div class="wp-mail-smtp-setting-field">
<h2><?php esc_html_e( 'Primary Connection', 'wp-mail-smtp' ); ?></h2>
</div>
@@ -256,21 +256,22 @@ class SettingsTab extends PageAbstract {
<div class="benefits">
<ul>
<li><?php esc_html_e( 'Manage Notifications - control which emails your site sends', 'wp-mail-smtp' ); ?></li>
<li><?php esc_html_e( 'Email Logging - keep track of every email sent from your site', 'wp-mail-smtp' ); ?></li>
<li><?php esc_html_e( 'Multisite Support - Network settings for easy management', 'wp-mail-smtp' ); ?></li>
<li><?php esc_html_e( 'Office 365 - send emails using your Office 365 account', 'wp-mail-smtp' ); ?></li>
<li><?php esc_html_e( 'Alerts - get notified when your emails fail (via email, slack or SMS)', 'wp-mail-smtp' ); ?></li>
<li><?php esc_html_e( 'Backup Connection - send emails even if your primary connection fails', 'wp-mail-smtp' ); ?></li>
<li><?php esc_html_e( 'Smart Routing - define conditions for your email sending', 'wp-mail-smtp' ); ?></li>
<li><?php esc_html_e( 'Amazon SES - harness the power of AWS', 'wp-mail-smtp' ); ?></li>
<li><?php esc_html_e( 'Outlook.com - send emails using your Outlook.com account', 'wp-mail-smtp' ); ?></li>
<li><?php esc_html_e( 'Zoho Mail - use your Zoho Mail account', 'wp-mail-smtp' ); ?></li>
<li><?php esc_html_e( 'Outlook - send emails using your Outlook or Microsoft 365 account', 'wp-mail-smtp' ); ?></li>
<li><?php esc_html_e( 'Zoho Mail - use your Zoho Mail account to send emails', 'wp-mail-smtp' ); ?></li>
<li><?php esc_html_e( 'Multisite Support - network settings for easy management', 'wp-mail-smtp' ); ?></li>
<li><?php esc_html_e( 'Manage Notifications - control which emails your site sends', 'wp-mail-smtp' ); ?></li>
<li><?php esc_html_e( 'Access to our world class support team', 'wp-mail-smtp' ); ?></li>
</ul>
<ul>
<li><?php esc_html_e( 'White Glove Setup - sit back and relax while we handle everything for you', 'wp-mail-smtp' ); ?></li>
<li class="arrow-right"><?php esc_html_e( 'Install WP Mail SMTP Pro plugin', 'wp-mail-smtp' ); ?></li>
<li class="arrow-right"><?php esc_html_e( 'Install & Setup WP Mail SMTP Pro plugin', 'wp-mail-smtp' ); ?></li>
<li class="arrow-right"><?php esc_html_e( 'Configure SendLayer, SMTP.com or Brevo service', 'wp-mail-smtp' ); ?></li>
<li class="arrow-right"><?php esc_html_e( 'Set up domain name verification (DNS)', 'wp-mail-smtp' ); ?></li>
<li class="arrow-right"><?php esc_html_e( 'Configure SMTP.com or Mailgun service', 'wp-mail-smtp' ); ?></li>
<li class="arrow-right"><?php esc_html_e( 'Set up WP Mail SMTP Pro plugin', 'wp-mail-smtp' ); ?></li>
<li class="arrow-right"><?php esc_html_e( 'Test and verify email delivery', 'wp-mail-smtp' ); ?></li>
</ul>
</div>

View File

@@ -3,6 +3,7 @@
namespace WPMailSMTP\Admin\Pages;
use WPMailSMTP\Admin\PageAbstract;
use WPMailSMTP\Helpers\UI;
use WPMailSMTP\WP;
/**
@@ -82,20 +83,18 @@ class SmartRoutingTab extends PageAbstract {
*/
public function display() {
$upgrade_link_url = wp_mail_smtp()->get_upgrade_link(
$top_upgrade_button_url = wp_mail_smtp()->get_upgrade_link(
[
'medium' => 'Smart Routing Settings',
'content' => 'Upgrade to WP Mail SMTP Pro Link',
'content' => 'Upgrade to WP Mail SMTP Pro Button Top',
]
);
$upgrade_button_url = wp_mail_smtp()->get_upgrade_link(
$bottom_upgrade_button_url = wp_mail_smtp()->get_upgrade_link(
[
'medium' => 'Smart Routing Settings',
'content' => 'Upgrade to WP Mail SMTP Pro Button',
]
);
?>
<div id="wp-mail-smtp-smart-routing-product-education" class="wp-mail-smtp-product-education">
<div class="wp-mail-smtp-product-education__row wp-mail-smtp-product-education__row--no-border">
@@ -104,33 +103,25 @@ class SmartRoutingTab extends PageAbstract {
</h4>
<p class="wp-mail-smtp-product-education__description">
<?php
echo wp_kses(
sprintf( /* translators: %s - WPMailSMTP.com Upgrade page URL. */
__( 'Send emails from different additional connections based on your configured conditions. Emails that do not match any of the conditions below will be sent via your Primary Connection. <a href="%s" target="_blank" rel="noopener noreferrer">Upgrade to WP Mail SMTP Pro!</a>', 'wp-mail-smtp' ),
esc_url( $upgrade_link_url )
),
[
'a' => [
'href' => [],
'rel' => [],
'target' => [],
],
]
);
esc_html_e( 'Send emails from different additional connections based on your configured conditions. Emails that do not match any of the conditions below will be sent via your Primary Connection.', 'wp-mail-smtp' );
?>
</p>
<a href="<?php echo esc_url( $top_upgrade_button_url ); ?>" target="_blank" rel="noopener noreferrer" class="wp-mail-smtp-product-education__upgrade-btn wp-mail-smtp-product-education__upgrade-btn--top wp-mail-smtp-btn wp-mail-smtp-btn-upgrade wp-mail-smtp-btn-orange">
<?php esc_html_e( 'Upgrade to WP Mail SMTP Pro', 'wp-mail-smtp' ); ?>
</a>
</div>
<div class="wp-mail-smtp-product-education__row wp-mail-smtp-product-education__row--inactive wp-mail-smtp-product-education__row--no-border wp-mail-smtp-product-education__row--no-padding wp-mail-smtp-product-education__row--full-width">
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-no-border">
<div class="wp-mail-smtp-smart-routing-enable-toggle">
<label class="wp-mail-smtp-setting-toggle">
<input type="checkbox" class="wp-mail-smtp-smart-routing-enabled" checked/>
<span class="wp-mail-smtp-setting-toggle__switch"></span>
</label>
<label class="wp-mail-smtp-smart-routing-enable-toggle__label">
<?php esc_html_e( 'Enable Smart Routing', 'wp-mail-smtp' ); ?>
</label>
</div>
<?php
UI::toggle(
[
'label' => esc_html__( 'Enable Smart Routing', 'wp-mail-smtp' ),
'class' => 'wp-mail-smtp-smart-routing-toggle',
'checked' => true,
]
);
?>
</div>
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-no-border wp-mail-smtp-setting-row-no-padding">
<div class="wp-mail-smtp-smart-routing-routes">
@@ -313,7 +304,7 @@ class SmartRoutingTab extends PageAbstract {
</div>
</div>
<a href="<?php echo esc_url( $upgrade_button_url ); ?>" target="_blank" rel="noopener noreferrer" class="wp-mail-smtp-btn wp-mail-smtp-btn-upgrade wp-mail-smtp-btn-orange">
<a href="<?php echo esc_url( $bottom_upgrade_button_url ); ?>" target="_blank" rel="noopener noreferrer" class="wp-mail-smtp-product-education__upgrade-btn wp-mail-smtp-product-education__upgrade-btn--bottom wp-mail-smtp-btn wp-mail-smtp-btn-upgrade wp-mail-smtp-btn-orange">
<?php esc_html_e( 'Upgrade to WP Mail SMTP Pro', 'wp-mail-smtp' ); ?>
</a>
</div>

View File

@@ -10,6 +10,7 @@ use WPMailSMTP\MailCatcherInterface;
use WPMailSMTP\Options;
use WPMailSMTP\WP;
use WPMailSMTP\Admin\PageAbstract;
use WPMailSMTP\Helpers\UI;
/**
* Class TestTab is part of Area, displays email testing page of the plugin.
@@ -180,12 +181,15 @@ class TestTab extends PageAbstract {
<label for="wp-mail-smtp-setting-test_email_html"><?php esc_html_e( 'HTML', 'wp-mail-smtp' ); ?></label>
</div>
<div class="wp-mail-smtp-setting-field">
<label for="wp-mail-smtp-setting-test_email_html">
<input type="checkbox" id="wp-mail-smtp-setting-test_email_html" name="wp-mail-smtp[test][html]" value="yes" checked/>
<span class="wp-mail-smtp-setting-toggle-switch"></span>
<span class="wp-mail-smtp-setting-toggle-checked-label"><?php esc_html_e( 'On', 'wp-mail-smtp' ); ?></span>
<span class="wp-mail-smtp-setting-toggle-unchecked-label"><?php esc_html_e( 'Off', 'wp-mail-smtp' ); ?></span>
</label>
<?php
UI::toggle(
[
'name' => 'wp-mail-smtp[test][html]',
'id' => 'wp-mail-smtp-setting-test_email_html',
'checked' => true,
]
);
?>
<p class="desc">
<?php esc_html_e( 'Send this email in HTML or in plain text format.', 'wp-mail-smtp' ); ?>
</p>
@@ -244,7 +248,7 @@ class TestTab extends PageAbstract {
?>
<!-- Test Email Section Title -->
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-content wp-mail-smtp-clear section-heading no-desc" id="wp-mail-smtp-setting-row-email-heading">
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-content wp-mail-smtp-clear section-heading no-desc wp-mail-smtp-section-heading--has-divider">
<div class="wp-mail-smtp-setting-field">
<h2><?php esc_html_e( 'Send a Test Email', 'wp-mail-smtp' ); ?></h2>
</div>
@@ -422,6 +426,14 @@ class TestTab extends PageAbstract {
<meta name="viewport" content="width=device-width">
<title>WP Mail SMTP Test Email</title>
<style type="text/css">@media only screen and (max-width: 599px) {table.body .container {width: 95% !important;}.header {padding: 15px 15px 12px 15px !important;}.header img {width: 200px !important;height: auto !important;}.content, .aside {padding: 30px 40px 20px 40px !important;}}</style>
<?php
/**
* Fires in the HTML test email head.
*
* @since 3.10.0
*/
do_action( 'wp_mail_smtp_admin_pages_test_tab_get_email_message_html_head' );
?>
</head>
<body style="height: 100% !important; width: 100% !important; min-width: 100%; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -webkit-font-smoothing: antialiased !important; -moz-osx-font-smoothing: grayscale !important; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; margin: 0; Margin: 0; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; background-color: #f1f1f1; text-align: center;">
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%" class="body" style="border-collapse: collapse; border-spacing: 0; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; height: 100% !important; width: 100% !important; min-width: 100%; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -webkit-font-smoothing: antialiased !important; -moz-osx-font-smoothing: grayscale !important; background-color: #f1f1f1; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; margin: 0; Margin: 0; text-align: left; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%;">
@@ -437,69 +449,83 @@ class TestTab extends PageAbstract {
</tr>
<!-- Content -->
<tr style="padding: 0; vertical-align: top; text-align: left;">
<td align="left" valign="top" class="content" style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; margin: 0; Margin: 0; text-align: left; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; background-color: #ffffff; padding: 60px 75px 45px 75px; border-right: 1px solid #ddd; border-bottom: 1px solid #ddd; border-left: 1px solid #ddd; border-top: 3px solid #809eb0;">
<div class="success" style="text-align: center;">
<p class="check" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; margin: 0 auto 16px auto; Margin: 0 auto 16px auto; text-align: center;">
<img src="<?php echo esc_url( wp_mail_smtp()->plugin_url . '/assets/images/email/icon-check.png' ); ?>" width="70" alt="Success" style="outline: none; text-decoration: none; max-width: 100%; clear: both; -ms-interpolation-mode: bicubic; display: block; margin: 0 auto 0 auto; Margin: 0 auto 0 auto; width: 50px;">
</p>
<p class="text-extra-large text-center congrats" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; mso-line-height-rule: exactly; line-height: 140%; font-size: 20px; text-align: center; margin: 0 0 20px 0; Margin: 0 0 20px 0;">
Congrats, test email was sent successfully!
</p>
<p class="text-large" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; text-align: left; mso-line-height-rule: exactly; line-height: 140%; margin: 0 0 15px 0; Margin: 0 0 15px 0; font-size: 16px;">
Thank you for trying out WP Mail SMTP. We're on a mission to make sure that your emails actually get delivered.
</p>
<td align="left" valign="top" style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; margin: 0; Margin: 0; text-align: left; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; background-color: #ffffff; padding: 0; border-right: 1px solid #ddd; border-bottom: 1px solid #ddd; border-left: 1px solid #ddd; border-top: 3px solid #809eb0;">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-spacing: 0; padding: 0; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; margin: 0; Margin: 0; text-align: inherit;">
<tr style="padding: 0; vertical-align: top; text-align: left;">
<td class="content" style="padding: 60px 75px 45px 75px;">
<div class="success" style="text-align: center;">
<p class="check" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; margin: 0 auto 16px auto; Margin: 0 auto 16px auto; text-align: center;">
<img src="<?php echo esc_url( wp_mail_smtp()->plugin_url . '/assets/images/email/icon-check.png' ); ?>" width="70" alt="Success" style="outline: none; text-decoration: none; max-width: 100%; clear: both; -ms-interpolation-mode: bicubic; display: block; margin: 0 auto 0 auto; Margin: 0 auto 0 auto; width: 50px;">
</p>
<p class="text-extra-large text-center congrats" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; mso-line-height-rule: exactly; line-height: 140%; font-size: 20px; text-align: center; margin: 0 0 20px 0; Margin: 0 0 20px 0;">
Congrats, test email was sent successfully!
</p>
<p class="text-large" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; text-align: left; mso-line-height-rule: exactly; line-height: 140%; margin: 0 0 15px 0; Margin: 0 0 15px 0; font-size: 16px;">
Thank you for trying out WP Mail SMTP. We're on a mission to make sure that your emails actually get delivered.
</p>
<?php if ( ! wp_mail_smtp()->is_pro() ) : ?>
<p class="text-large" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; text-align: left; mso-line-height-rule: exactly; line-height: 140%; margin: 0 0 15px 0; Margin: 0 0 15px 0; font-size: 16px;">
If you find this free plugin useful, please consider giving WP Mail SMTP Pro a try!
</p>
<?php endif; ?>
<p class="signature" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; text-align: left; margin: 20px 0 0 0; Margin: 20px 0 0 0;">
<img src="<?php echo esc_url( wp_mail_smtp()->plugin_url . '/assets/images/email/signature.png' ); ?>" width="180" alt="Signature" style="outline: none; text-decoration: none; max-width: 100%; clear: both; -ms-interpolation-mode: bicubic; width: 180px; display: block; margin: 0 0 0 0; Margin: 0 0 0 0;">
</p>
<p style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; text-align: left; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; margin: 0 0 15px 0; Margin: 0 0 15px 0;">
Jared Atchison<br>Co-Founder, WP Mail SMTP
</p>
</div>
</td>
</tr>
<!-- Aside -->
<?php if ( ! wp_mail_smtp()->is_pro() ) : ?>
<p class="text-large" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; text-align: left; mso-line-height-rule: exactly; line-height: 140%; margin: 0 0 15px 0; Margin: 0 0 15px 0; font-size: 16px;">
If you find this free plugin useful, please consider giving WP Mail SMTP Pro a try!
</p>
<?php endif; ?>
<p class="signature" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; text-align: left; margin: 20px 0 0 0; Margin: 20px 0 0 0;">
<img src="<?php echo esc_url( wp_mail_smtp()->plugin_url . '/assets/images/email/signature.png' ); ?>" width="180" alt="Signature" style="outline: none; text-decoration: none; max-width: 100%; clear: both; -ms-interpolation-mode: bicubic; width: 180px; display: block; margin: 0 0 0 0; Margin: 0 0 0 0;">
</p>
<p style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; text-align: left; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; margin: 0 0 15px 0; Margin: 0 0 15px 0;">
Jared Atchison<br>Co-Founder, WP Mail SMTP
</p>
</div>
</td>
</tr>
<!-- Aside -->
<?php if ( ! wp_mail_smtp()->is_pro() ) : ?>
<tr style="padding: 0; vertical-align: top; text-align: left;">
<td align="left" valign="top" class="aside upsell-mi" style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; margin: 0; Margin: 0; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; background-color: #f8f8f8; border-top: 1px solid #dddddd; border-right: 1px solid #dddddd; border-bottom: 1px solid #dddddd; border-left: 1px solid #dddddd; text-align: center !important; padding: 30px 75px 25px 75px;">
<h6 style="padding: 0; color: #444444; word-wrap: normal; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: bold; mso-line-height-rule: exactly; line-height: 130%; font-size: 18px; text-align: center; margin: 0 0 15px 0; Margin: 0 0 15px 0;">
Unlock Powerful Features with WP Mail SMTP Pro
</h6>
<p class="text-large" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; mso-line-height-rule: exactly; line-height: 140%; margin: 0 0 15px 0; Margin: 0 0 15px 0; font-size: 16px; text-align: center;">
Email Logging and Exporting<br>
Amazon SES / Microsoft 365 / Zoho Mail<br>
Open and Click Tracking<br>
Email Resending<br>
Email Reports<br>
World-Class Support
</p>
<p class="text-large last" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; mso-line-height-rule: exactly; line-height: 140%; font-size: 13px; text-align: center; margin: 0 0 0 0; Margin: 0 0 0 0;">
WP Mail SMTP users get <span style="font-weight:700;color:#218900;">$50 off</span>, automatically applied at checkout
</p>
<center style="width: 100%;">
<table class="button large expanded orange" style="border-collapse: collapse; border-spacing: 0; padding: 0; vertical-align: top; text-align: left; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #e27730; width: 100% !important;">
<tr style="padding: 0; vertical-align: top; text-align: left;">
<td class="button-inner" style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; margin: 0; Margin: 0; text-align: left; font-size: 14px; mso-line-height-rule: exactly; line-height: 100%; padding: 20px 0 20px 0;">
<table style="border-collapse: collapse; border-spacing: 0; padding: 0; vertical-align: top; text-align: left; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; width: 100% !important;">
<tr style="padding: 0; vertical-align: top; text-align: left;">
<td align="left" valign="top" class="aside upsell-mi" style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; margin: 0; Margin: 0; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; background-color: #f8f8f8; border-top: 1px solid #dddddd; text-align: center !important; padding: 30px 75px 25px 75px;">
<h6 style="padding: 0; color: #444444; word-wrap: normal; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: bold; mso-line-height-rule: exactly; line-height: 130%; font-size: 18px; text-align: center; margin: 0 0 15px 0; Margin: 0 0 15px 0;">
Unlock Powerful Features with WP Mail SMTP Pro
</h6>
<p class="text-large" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; mso-line-height-rule: exactly; line-height: 140%; margin: 0 0 15px 0; Margin: 0 0 15px 0; font-size: 16px; text-align: center;">
Email Logging with Email Resending<br>
Open & Click Tracking<br>
Email Reports with Weekly Summary<br>
Backup Mailer<br>
Failed Email Alerts via Email, Slack, and SMS<br>
World-Class Support
</p>
<p class="text-large last" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; mso-line-height-rule: exactly; line-height: 140%; font-size: 13px; text-align: center; margin: 0 0 0 0; Margin: 0 0 0 0;">
WP Mail SMTP users get <span style="font-weight:700;color:#218900;">$50 off</span>, automatically applied at checkout
</p>
<center style="width: 100%;">
<table class="button large expanded orange" style="border-collapse: collapse; border-spacing: 0; padding: 0; vertical-align: top; text-align: left; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #e27730; width: 100% !important;">
<tr style="padding: 0; vertical-align: top; text-align: left;">
<td style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; margin: 0; Margin: 0; font-size: 14px; text-align: center; color: #ffffff; background: #e27730; border: 1px solid #c45e1b; border-bottom: 3px solid #c45e1b; mso-line-height-rule: exactly; line-height: 100%;">
<a href="<?php echo esc_url( wp_mail_smtp()->get_upgrade_link( 'email-test' ) ); ?>" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; margin: 0; Margin: 0; font-family: Helvetica, Arial, sans-serif; font-weight: bold; color: #ffffff; text-decoration: none; display: inline-block; border: 0 solid #c45e1b; mso-line-height-rule: exactly; line-height: 100%; padding: 14px 20px 12px 20px; font-size: 20px; text-align: center; width: 100%; padding-left: 0; padding-right: 0;">
Upgrade to Pro Today
</a>
<td class="button-inner" style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; margin: 0; Margin: 0; text-align: left; font-size: 14px; mso-line-height-rule: exactly; line-height: 100%; padding: 20px 0 20px 0;">
<table style="border-collapse: collapse; border-spacing: 0; padding: 0; vertical-align: top; text-align: left; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; width: 100% !important;">
<tr style="padding: 0; vertical-align: top; text-align: left;">
<td style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; margin: 0; Margin: 0; font-size: 14px; text-align: center; color: #ffffff; background: #e27730; border: 1px solid #c45e1b; border-bottom: 3px solid #c45e1b; mso-line-height-rule: exactly; line-height: 100%;">
<a href="<?php echo esc_url( wp_mail_smtp()->get_upgrade_link( 'email-test' ) ); ?>" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; margin: 0; Margin: 0; font-family: Helvetica, Arial, sans-serif; font-weight: bold; color: #ffffff; text-decoration: none; display: inline-block; border: 0 solid #c45e1b; mso-line-height-rule: exactly; line-height: 100%; padding: 14px 20px 12px 20px; font-size: 20px; text-align: center; width: 100%; padding-left: 0; padding-right: 0;">
Upgrade to Pro Today
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</td>
</tr>
<?php endif; ?>
</center>
</td>
</tr>
<?php endif; ?>
<?php
/**
* Fires in the HTML test email footer.
*
* @since 3.10.0
*/
do_action( 'wp_mail_smtp_admin_pages_test_tab_get_email_message_html_footer' );
?>
</table>
</td>
</tr>
</table>
</td>
</tr>
@@ -547,11 +573,11 @@ https://wpmailsmtp.com/lite-upgrade/
Unlock These Powerful Features with WP Mail SMTP Pro:
+ Log all emails and export your email logs in different formats
+ Send emails with Amazon SES / Microsoft 365 / Zoho Mail
+ Track opens and clicks to measure engagement
+ Resend failed emails from your email log
+ Create email reports and graphs
+ Log all emails and resend failed emails from your email log
+ Track opens and clicks to measure the engagement
+ Get email reports with a weekly summary of your email activity
+ Use a backup mailer if your mail service goes down
+ Get notified of failed emails via email, Slack, or SMS
+ Get help from our world-class support team
- Jared Atchison
@@ -814,7 +840,7 @@ Co-Founder, WP Mail SMTP';
esc_html__( 'Typically this error is returned when you are sending too many e-mails or e-mails that have been identified as spam.', 'wp-mail-smtp' ),
],
'steps' => [
esc_html__( 'Check the emails that are sending are sending individually. Example: email is not sending to 30 recipients. You can install any WordPress e-mail logging plugin to do that.', 'wp-mail-smtp' ),
esc_html__( 'Make sure you are not sending emails with too many recipients. Example: single email should not have 10+ recipients. You can install any WordPress e-mail logging plugin to check your recipients (TO, CC and BCC).', 'wp-mail-smtp' ),
esc_html__( 'Contact your SMTP host to ask about sending/rate limits.', 'wp-mail-smtp' ),
esc_html__( 'Verify with them your SMTP account is in good standing and your account has not been flagged.', 'wp-mail-smtp' ),
],
@@ -938,12 +964,12 @@ Co-Founder, WP Mail SMTP';
],
'title' => esc_html__( 'Mailgun failed.', 'wp-mail-smtp' ),
'description' => [
esc_html__( 'Typically this error occurs because there is an issue with your Mailgun settings, in many cases Private API Key, Domain Name, or Region is incorrect.', 'wp-mail-smtp' ),
esc_html__( 'Typically this error occurs because there is an issue with your Mailgun settings, in many cases Mailgun API Key, Domain Name, or Region is incorrect.', 'wp-mail-smtp' ),
],
'steps' => [
sprintf(
wp_kses( /* translators: %1$s - Mailgun API Key area URL. */
__( 'Go to your Mailgun account and verify that your <a href="%1$s" target="_blank" rel="noopener noreferrer">Private API Key</a> is correct.', 'wp-mail-smtp' ),
__( 'Go to your Mailgun account and verify that your <a href="%1$s" target="_blank" rel="noopener noreferrer">Mailgun API Key</a> is correct.', 'wp-mail-smtp' ),
[
'a' => [
'href' => [],
@@ -952,7 +978,7 @@ Co-Founder, WP Mail SMTP';
],
]
),
'https://app.mailgun.com/app/account/security/api_keys'
'https://app.mailgun.com/settings/api_security'
),
sprintf(
wp_kses( /* translators: %1$s - Mailgun domains area URL. */
@@ -1033,7 +1059,7 @@ Co-Founder, WP Mail SMTP';
. '<li>' .
sprintf(
wp_kses( /* translators: %s - Google support article URL. */
__( 'if you are using G Suite, please <a href="%s" target="_blank" rel="noopener noreferrer">read this article</a> to proceed.', 'wp-mail-smtp' ),
__( 'if you are using Google Workspace, please <a href="%s" target="_blank" rel="noopener noreferrer">read this article</a> to proceed.', 'wp-mail-smtp' ),
[
'a' => [
'href' => [],
@@ -1124,8 +1150,8 @@ Co-Founder, WP Mail SMTP';
],
'steps' => [
sprintf(
wp_kses( /* translators: %s - Google G Suite Admin area URL. */
__( 'Make sure that your G Suite trial period has not expired. You can check the status <a href="%s" target="_blank" rel="noopener noreferrer">here</a>.', 'wp-mail-smtp' ),
wp_kses( /* translators: %s - Google Workspace Admin area URL. */
__( 'Make sure that your Google Workspace trial period has not expired. You can check the status <a href="%s" target="_blank" rel="noopener noreferrer">here</a>.', 'wp-mail-smtp' ),
[
'a' => [
'href' => [],
@@ -1137,8 +1163,8 @@ Co-Founder, WP Mail SMTP';
'https://admin.google.com'
),
sprintf(
wp_kses( /* translators: %s - Google G Suite Admin area URL. */
__( 'Make sure that Gmail app in your G Suite is actually enabled. You can check that in Apps list in <a href="%s" target="_blank" rel="noopener noreferrer">G Suite Admin</a> area.', 'wp-mail-smtp' ),
wp_kses( /* translators: %s - Google Workspace Admin area URL. */
__( 'Make sure that Gmail app in your Google Workspace is actually enabled. You can check that in Apps list in <a href="%s" target="_blank" rel="noopener noreferrer">Google Workspace Admin</a> area.', 'wp-mail-smtp' ),
[
'a' => [
'href' => [],
@@ -1357,7 +1383,7 @@ Co-Founder, WP Mail SMTP';
. '</ul>',
],
'steps' => [
esc_html__( 'Triple check the plugin settings, consider reconfiguring to make sure everything is correct (eg bad copy and paste).', 'wp-mail-smtp' ),
esc_html__( 'Triple-check the plugin settings and consider reconfiguring to make sure everything is correct. Maybe there was an issue with copy&pasting.', 'wp-mail-smtp' ),
wp_kses(
__( 'Contact your web hosting provider and ask them to verify your server can make outside connections. Additionally, ask them if a firewall or security policy may be preventing the connection - many shared hosts block certain ports.<br><strong>Note: this is the most common cause of this issue.</strong>', 'wp-mail-smtp' ),
[

View File

@@ -4,6 +4,7 @@ namespace WPMailSMTP\Admin;
use WPMailSMTP\Admin\Pages\TestTab;
use WPMailSMTP\Connect;
use WPMailSMTP\Helpers\Helpers;
use WPMailSMTP\Helpers\PluginImportDataRetriever;
use WPMailSMTP\Options;
use WPMailSMTP\UsageTracking\UsageTracking;
@@ -688,6 +689,7 @@ class SetupWizard {
* Prepare mailer options for all mailers.
*
* @since 2.6.0
* @since 3.10.0 Supply WPMS_AMAZONSES_DISPLAY_IDENTITIES constant value to control display of Amazon SES identity list.
*
* @return array
*/
@@ -708,6 +710,10 @@ class SetupWizard {
if ( $provider->get_slug() === 'gmail' ) {
$data['gmail']['redirect_uri'] = \WPMailSMTP\Providers\Gmail\Auth::get_oauth_redirect_url();
}
if ( $provider->get_slug() === 'amazonses' ) {
$data['amazonses']['display_identities'] = ! defined( 'WPMS_AMAZONSES_DISPLAY_IDENTITIES' ) || WPMS_AMAZONSES_DISPLAY_IDENTITIES === true;
}
}
return apply_filters( 'wp_mail_smtp_admin_setup_wizard_prepare_mailer_options', $data );
@@ -974,6 +980,7 @@ class SetupWizard {
* AJAX callback for getting all partner's plugin information.
*
* @since 2.6.0
* @since 3.9.0 Check if a SEO toolkit plugin is installed.
*/
public function get_partner_plugins_info() {
@@ -982,6 +989,7 @@ class SetupWizard {
$plugins = $this->get_partner_plugins();
$contact_form_plugin_already_installed = false;
$seo_toolkit_plugin_already_installed = false;
$contact_form_basenames = [
'wpforms-lite/wpforms.php',
@@ -992,12 +1000,24 @@ class SetupWizard {
'ninja-forms/ninja-forms.php',
];
$seo_toolkit_basenames = [
'all-in-one-seo-pack/all_in_one_seo_pack.php',
'all-in-one-seo-pack-pro/all_in_one_seo_pack.php',
'seo-by-rank-math/rank-math.php',
'seo-by-rank-math-pro/rank-math-pro.php',
'wordpress-seo/wp-seo.php',
'wordpress-seo-premium/wp-seo-premium.php',
'wp-seopress/seopress.php',
'wp-seopress-pro/seopress-pro.php',
];
$installed_plugins = get_plugins();
foreach ( $installed_plugins as $basename => $plugin_info ) {
if ( in_array( $basename, $contact_form_basenames, true ) ) {
$contact_form_plugin_already_installed = true;
break;
} elseif ( in_array( $basename, $seo_toolkit_basenames, true ) ) {
$seo_toolkit_plugin_already_installed = true;
}
}
@@ -1009,6 +1029,7 @@ class SetupWizard {
$data = [
'plugins' => $plugins,
'contact_form_plugin_already_installed' => $contact_form_plugin_already_installed,
'seo_toolkit_plugin_already_installed' => $seo_toolkit_plugin_already_installed,
];
wp_send_json_success( $data );
@@ -1032,6 +1053,12 @@ class SetupWizard {
'is_activated' => function_exists( 'wpforms' ),
'is_installed' => array_key_exists( 'wpforms-lite/wpforms.php', $installed_plugins ),
],
[
'slug' => 'all-in-one-seo-pack',
'name' => esc_html__( 'All in One SEO', 'wp-mail-smtp' ),
'is_activated' => class_exists( 'AIOSEOP_Core' ),
'is_installed' => array_key_exists( 'all-in-one-seo-pack/all_in_one_seo_pack.php', $installed_plugins ),
],
[
'slug' => 'google-analytics-for-wordpress',
'name' => esc_html__( 'Google Analytics by MonsterInsights', 'wp-mail-smtp' ),
@@ -1039,10 +1066,10 @@ class SetupWizard {
'is_installed' => array_key_exists( 'google-analytics-for-wordpress/googleanalytics.php', $installed_plugins ),
],
[
'slug' => 'all-in-one-seo-pack',
'name' => esc_html__( 'All in One SEO', 'wp-mail-smtp' ),
'is_activated' => class_exists( 'AIOSEOP_Core' ),
'is_installed' => array_key_exists( 'all-in-one-seo-pack/all_in_one_seo_pack.php', $installed_plugins ),
'slug' => 'insert-headers-and-footers',
'name' => esc_html__( 'Code Snippets by WPCode', 'wp-mail-smtp' ),
'is_activated' => class_exists( 'InsertHeadersAndFooters' ),
'is_installed' => array_key_exists( 'insert-headers-and-footers/ihaf.php', $installed_plugins ),
],
[
'slug' => 'rafflepress',
@@ -1099,6 +1126,7 @@ class SetupWizard {
wp_remote_post(
'https://connect.wpmailsmtp.com/subscribe/drip/',
[
'user-agent' => Helpers::get_default_user_agent(),
'body' => $body,
]
);
@@ -1109,7 +1137,7 @@ class SetupWizard {
/**
* Get the WPForms version type if it's installed.
*
* @since {VERSION}
* @since 3.9.0
*
* @return false|string Return `false` if WPForms is not installed, otherwise return either `lite` or `pro`.
*/
@@ -1237,6 +1265,7 @@ class SetupWizard {
wp_remote_post(
'https://wpmailsmtp.com/wizard-feedback/',
[
'user-agent' => Helpers::get_default_user_agent(),
'body' => [
'wpforms' => [
'id' => 87892,