first commit
This commit is contained in:
92
wp/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/About.php
Normal file
92
wp/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/About.php
Normal file
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
namespace WPMailSMTP\Admin\Pages;
|
||||
|
||||
use WPMailSMTP\Admin\ParentPageAbstract;
|
||||
|
||||
/**
|
||||
* About parent page.
|
||||
*
|
||||
* @since 1.5.0
|
||||
* @since 2.9.0 changed parent class from PageAbstract to ParentPageAbstract.
|
||||
*/
|
||||
class About extends ParentPageAbstract {
|
||||
|
||||
/**
|
||||
* Slug of a page.
|
||||
*
|
||||
* @since 1.5.0
|
||||
*
|
||||
* @var string Slug of a page.
|
||||
*/
|
||||
protected $slug = 'about';
|
||||
|
||||
/**
|
||||
* Page default tab slug.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $default_tab = 'about';
|
||||
|
||||
/**
|
||||
* Get label for a tab.
|
||||
* Process only those that exists.
|
||||
* Defaults to "About Us".
|
||||
*
|
||||
* @since 1.5.0
|
||||
*
|
||||
* @param string $tab Tab to get label for.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_label( $tab = '' ) {
|
||||
|
||||
if ( ! empty( $tab ) ) {
|
||||
return $this->get_tab_label( $tab );
|
||||
}
|
||||
|
||||
return esc_html__( 'About Us', 'wp-mail-smtp' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Title of a page.
|
||||
*
|
||||
* @since 1.5.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return $this->get_label();
|
||||
}
|
||||
|
||||
/**
|
||||
* Active the given plugin.
|
||||
*
|
||||
* @deprecated 2.9.0
|
||||
*
|
||||
* @since 1.5.0
|
||||
*/
|
||||
public static function ajax_plugin_activate() {
|
||||
|
||||
_deprecated_function( __METHOD__, '2.9.0', '\WPMailSMTP\Admin\Pages\AboutTab::ajax_plugin_activate' );
|
||||
|
||||
AboutTab::ajax_plugin_activate();
|
||||
}
|
||||
|
||||
/**
|
||||
* Install & activate the given plugin.
|
||||
*
|
||||
* @deprecated 2.9.0
|
||||
*
|
||||
* @since 1.5.0
|
||||
*/
|
||||
public static function ajax_plugin_install() {
|
||||
|
||||
_deprecated_function( __METHOD__, '2.9.0', '\WPMailSMTP\Admin\Pages\AboutTab::ajax_plugin_install' );
|
||||
|
||||
AboutTab::ajax_plugin_install();
|
||||
}
|
||||
}
|
||||
661
wp/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/AboutTab.php
Normal file
661
wp/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/AboutTab.php
Normal file
@@ -0,0 +1,661 @@
|
||||
<?php
|
||||
|
||||
namespace WPMailSMTP\Admin\Pages;
|
||||
|
||||
use WPMailSMTP\Admin\PageAbstract;
|
||||
use WPMailSMTP\Admin\PluginsInstallSkin;
|
||||
use WPMailSMTP\Admin\PluginsInstallUpgrader;
|
||||
|
||||
/**
|
||||
* About tab.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*/
|
||||
class AboutTab extends PageAbstract {
|
||||
|
||||
/**
|
||||
* Part of the slug of a tab.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $slug = 'about';
|
||||
|
||||
/**
|
||||
* Tab priority.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $priority = 20;
|
||||
|
||||
/**
|
||||
* Link label of a tab.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_label() {
|
||||
|
||||
return esc_html__( 'About Us', 'wp-mail-smtp' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Title of a tab.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return $this->get_label();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tab content.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*/
|
||||
public function display() {
|
||||
|
||||
?>
|
||||
<div class="wp-mail-smtp-admin-about-section wp-mail-smtp-admin-columns">
|
||||
|
||||
<div class="wp-mail-smtp-admin-column-60">
|
||||
<h3>
|
||||
<?php esc_html_e( 'Hello and welcome to WP Mail SMTP, the easiest and most popular WordPress SMTP plugin. We build software that helps your site reliably deliver emails every time.', 'wp-mail-smtp' ); ?>
|
||||
</h3>
|
||||
|
||||
<p>
|
||||
<?php esc_html_e( 'Email deliverability has been a well-documented problem for all WordPress websites. However as WPForms grew, we became more aware of this painful issue that affects our users and the larger WordPress community. So we decided to solve this problem and make a solution that\'s beginner friendly.', 'wp-mail-smtp' ); ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php esc_html_e( 'Our goal is to make reliable email deliverability easy for WordPress.', 'wp-mail-smtp' ); ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
wp_kses(
|
||||
/* translators: %1$s - WPForms URL, %2$s - WPBeginner URL, %3$s - OptinMonster URL, %4$s - MonsterInsights URL, %5$s - Awesome Motive URL */
|
||||
__( 'WP Mail SMTP is brought to you by the same team that\'s behind the most user friendly WordPress forms, <a href="%1$s" target="_blank" rel="noopener noreferrer">WPForms</a>, the largest WordPress resource site, <a href="%2$s" target="_blank" rel="noopener noreferrer">WPBeginner</a>, the most popular lead-generation software, <a href="%3$s" target="_blank" rel="noopener noreferrer">OptinMonster</a>, the best WordPress analytics plugin, <a href="%4$s" target="_blank" rel="noopener noreferrer">MonsterInsights</a>, and <a href="%5$s" target="_blank" rel="noopener noreferrer">more</a>.', 'wp-mail-smtp' ),
|
||||
[
|
||||
'a' => [
|
||||
'href' => [],
|
||||
'rel' => [],
|
||||
'target' => [],
|
||||
],
|
||||
]
|
||||
),
|
||||
'https://wpforms.com/?utm_source=wpmailsmtpplugin&utm_medium=pluginaboutpage&utm_campaign=aboutwpmailsmtp',
|
||||
'https://www.wpbeginner.com/?utm_source=wpmailsmtpplugin&utm_medium=pluginaboutpage&utm_campaign=aboutwpmailsmtp',
|
||||
'https://optinmonster.com/?utm_source=wpmailsmtpplugin&utm_medium=pluginaboutpage&utm_campaign=aboutwpmailsmtp',
|
||||
'https://www.monsterinsights.com/?utm_source=wpmailsmtpplugin&utm_medium=pluginaboutpage&utm_campaign=aboutwpmailsmtp',
|
||||
// phpcs:ignore WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
|
||||
esc_url( wp_mail_smtp()->get_utm_url( 'https://awesomemotive.com/', [ 'medium' => 'pluginaboutpage', 'content' => 'aboutwpmailsmtp' ] ) )
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php esc_html_e( 'Yup, we know a thing or two about building awesome products that customers love.', 'wp-mail-smtp' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="wp-mail-smtp-admin-column-40 wp-mail-smtp-admin-column-last">
|
||||
<figure>
|
||||
<img src="<?php echo esc_url( wp_mail_smtp()->assets_url . '/images/about/team.jpg' ); ?>" alt="<?php esc_attr_e( 'The WPForms Team photo', 'wp-mail-smtp' ); ?>">
|
||||
<figcaption>
|
||||
<?php esc_html_e( 'The WPForms Team', 'wp-mail-smtp' ); ?>
|
||||
</figcaption>
|
||||
</figure>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
// Do not display the plugin section if the user can't install or activate them.
|
||||
if ( ! current_user_can( 'install_plugins' ) && ! current_user_can( 'activate_plugins' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->display_plugins();
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the plugins section.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*/
|
||||
protected function display_plugins() {
|
||||
|
||||
?>
|
||||
<div class="wp-mail-smtp-admin-about-plugins">
|
||||
<div class="plugins-container">
|
||||
<?php
|
||||
foreach ( self::get_am_plugins() as $key => $plugin ) :
|
||||
$is_url_external = false;
|
||||
|
||||
$data = $this->get_about_plugins_data( $plugin );
|
||||
|
||||
if ( isset( $plugin['pro'] ) && array_key_exists( $plugin['pro']['path'], get_plugins() ) ) {
|
||||
$is_url_external = true;
|
||||
$plugin = $plugin['pro'];
|
||||
|
||||
$data = array_merge( $data, $this->get_about_plugins_data( $plugin, true ) );
|
||||
}
|
||||
|
||||
// Do not display a plugin which has to be installed and the user can't install it.
|
||||
if ( ! current_user_can( 'install_plugins' ) && $data['status_class'] === 'status-download' ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="plugin-container">
|
||||
<div class="plugin-item">
|
||||
<div class="details wp-mail-smtp-clear">
|
||||
<img src="<?php echo esc_url( $plugin['icon'] ); ?>" alt="<?php esc_attr_e( 'Plugin icon', 'wp-mail-smtp' ); ?>">
|
||||
<h5 class="plugin-name">
|
||||
<?php echo esc_html( $plugin['name'] ); ?>
|
||||
</h5>
|
||||
<p class="plugin-desc">
|
||||
<?php echo esc_html( $plugin['desc'] ); ?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="actions wp-mail-smtp-clear">
|
||||
<div class="status">
|
||||
<strong>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s - status HTML text. */
|
||||
esc_html__( 'Status: %s', 'wp-mail-smtp' ),
|
||||
'<span class="status-label ' . esc_attr( $data['status_class'] ) . '">' . esc_html( $data['status_text'] ) . '</span>'
|
||||
);
|
||||
?>
|
||||
</strong>
|
||||
</div>
|
||||
<div class="action-button">
|
||||
<?php
|
||||
$go_to_class = '';
|
||||
if ( $is_url_external && $data['status_class'] === 'status-download' ) {
|
||||
$go_to_class = ' go_to';
|
||||
}
|
||||
?>
|
||||
<a href="<?php echo esc_url( $plugin['url'] ); ?>"
|
||||
class="<?php echo esc_attr( $data['action_class'] . $go_to_class ); ?>"
|
||||
data-plugin="<?php echo esc_attr( $data['plugin_src'] ); ?>">
|
||||
<?php echo esc_html( $data['action_text'] ); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate all the required CSS classed and labels to be used in rendering.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @param array $plugin Plugin slug.
|
||||
* @param bool $is_pro License type.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
protected function get_about_plugins_data( $plugin, $is_pro = false ) {
|
||||
|
||||
$data = [];
|
||||
|
||||
if ( array_key_exists( $plugin['path'], get_plugins() ) ) {
|
||||
if ( is_plugin_active( $plugin['path'] ) ) {
|
||||
// Status text/status.
|
||||
$data['status_class'] = 'status-active';
|
||||
$data['status_text'] = esc_html__( 'Active', 'wp-mail-smtp' );
|
||||
// Button text/status.
|
||||
$data['action_class'] = $data['status_class'] . ' button button-secondary disabled';
|
||||
$data['action_text'] = esc_html__( 'Activated', 'wp-mail-smtp' );
|
||||
$data['plugin_src'] = esc_attr( $plugin['path'] );
|
||||
} else {
|
||||
// Status text/status.
|
||||
$data['status_class'] = 'status-inactive';
|
||||
$data['status_text'] = esc_html__( 'Inactive', 'wp-mail-smtp' );
|
||||
// Button text/status.
|
||||
$data['action_class'] = $data['status_class'] . ' button button-secondary';
|
||||
$data['action_text'] = esc_html__( 'Activate', 'wp-mail-smtp' );
|
||||
$data['plugin_src'] = esc_attr( $plugin['path'] );
|
||||
}
|
||||
} else {
|
||||
if ( ! $is_pro ) {
|
||||
// Doesn't exist, install.
|
||||
// Status text/status.
|
||||
$data['status_class'] = 'status-download';
|
||||
$data['status_text'] = esc_html__( 'Not Installed', 'wp-mail-smtp' );
|
||||
// Button text/status.
|
||||
$data['action_class'] = $data['status_class'] . ' button button-primary';
|
||||
$data['action_text'] = esc_html__( 'Install Plugin', 'wp-mail-smtp' );
|
||||
$data['plugin_src'] = esc_url( $plugin['url'] );
|
||||
|
||||
// If plugin URL is not a zip file, open a new tab with site URL.
|
||||
if ( preg_match( '/.*\.zip$/', $plugin['url'] ) === 0 ) {
|
||||
$data['status_class'] = 'status-open';
|
||||
$data['action_class'] = $data['status_class'] . ' button button-primary';
|
||||
$data['action_text'] = esc_html__( 'Visit Site', 'wp-mail-smtp' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of AM plugins that we propose to install.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private static function get_am_plugins() {
|
||||
|
||||
$data = [
|
||||
'om' => [
|
||||
'path' => 'optinmonster/optin-monster-wp-api.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/plugin-om.png',
|
||||
'name' => esc_html__( 'OptinMonster', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Instantly get more subscribers, leads, and sales with the #1 conversion optimization toolkit. Create high converting popups, announcement bars, spin a wheel, and more with smart targeting and personalization.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://downloads.wordpress.org/plugin/optinmonster.zip',
|
||||
],
|
||||
'wpforms' => [
|
||||
'path' => 'wpforms-lite/wpforms.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/plugin-wpf.png',
|
||||
'name' => esc_html__( 'WPForms', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'The best drag & drop WordPress form builder. Easily create beautiful contact forms, surveys, payment forms, and more with our 600+ form templates. Trusted by over 5 million websites as the best forms plugin.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://downloads.wordpress.org/plugin/wpforms-lite.zip',
|
||||
'pro' => [
|
||||
'path' => 'wpforms/wpforms.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/plugin-wpf.png',
|
||||
'name' => esc_html__( 'WPForms Pro', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'The best drag & drop WordPress form builder. Easily create beautiful contact forms, surveys, payment forms, and more with our 600+ form templates. Trusted by over 5 million websites as the best forms plugin.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://wpforms.com/?utm_source=WordPress&utm_medium=about&utm_campaign=smtp',
|
||||
],
|
||||
],
|
||||
'mi' => [
|
||||
'path' => 'google-analytics-for-wordpress/googleanalytics.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/plugin-mi.png',
|
||||
'name' => esc_html__( 'MonsterInsights', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'The leading WordPress analytics plugin that shows you how people find and use your website, so you can make data driven decisions to grow your business. Properly set up Google Analytics without writing code.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://downloads.wordpress.org/plugin/google-analytics-for-wordpress.zip',
|
||||
'pro' => [
|
||||
'path' => 'google-analytics-premium/googleanalytics-premium.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/plugin-mi.png',
|
||||
'name' => esc_html__( 'MonsterInsights Pro', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'The leading WordPress analytics plugin that shows you how people find and use your website, so you can make data driven decisions to grow your business. Properly set up Google Analytics without writing code.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://www.monsterinsights.com/?utm_source=WordPress&utm_medium=about&utm_campaign=smtp',
|
||||
],
|
||||
],
|
||||
'aioseo' => [
|
||||
'path' => 'all-in-one-seo-pack/all_in_one_seo_pack.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/plugin-aioseo.png',
|
||||
'name' => esc_html__( 'AIOSEO', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'The original WordPress SEO plugin and toolkit that improves your website’s search rankings. Comes with all the SEO features like Local SEO, WooCommerce SEO, sitemaps, SEO optimizer, schema, and more.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://downloads.wordpress.org/plugin/all-in-one-seo-pack.zip',
|
||||
'pro' => [
|
||||
'path' => 'all-in-one-seo-pack-pro/all_in_one_seo_pack.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/plugin-aioseo.png',
|
||||
'name' => esc_html__( 'AIOSEO', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'The original WordPress SEO plugin and toolkit that improves your website’s search rankings. Comes with all the SEO features like Local SEO, WooCommerce SEO, sitemaps, SEO optimizer, schema, and more.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://aioseo.com/?utm_source=WordPress&utm_medium=about&utm_campaign=smtp',
|
||||
],
|
||||
],
|
||||
'seedprod' => [
|
||||
'path' => 'coming-soon/coming-soon.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/plugin-seedprod.png',
|
||||
'name' => esc_html__( 'SeedProd', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'The fastest drag & drop landing page builder for WordPress. Create custom landing pages without writing code, connect them with your CRM, collect subscribers, and grow your audience. Trusted by 1 million sites.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://downloads.wordpress.org/plugin/coming-soon.zip',
|
||||
'pro' => [
|
||||
'path' => 'seedprod-coming-soon-pro-5/seedprod-coming-soon-pro-5.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/plugin-seedprod.png',
|
||||
'name' => esc_html__( 'SeedProd', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'The fastest drag & drop landing page builder for WordPress. Create custom landing pages without writing code, connect them with your CRM, collect subscribers, and grow your audience. Trusted by 1 million sites.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://www.seedprod.com/?utm_source=WordPress&utm_medium=about&utm_campaign=smtp',
|
||||
],
|
||||
],
|
||||
'rafflepress' => [
|
||||
'path' => 'rafflepress/rafflepress.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/plugin-rp.png',
|
||||
'name' => esc_html__( 'RafflePress', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Turn your website visitors into brand ambassadors! Easily grow your email list, website traffic, and social media followers with the most powerful giveaways & contests plugin for WordPress.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://downloads.wordpress.org/plugin/rafflepress.zip',
|
||||
'pro' => [
|
||||
'path' => 'rafflepress-pro/rafflepress-pro.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/plugin-rp.png',
|
||||
'name' => esc_html__( 'RafflePress Pro', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Turn your website visitors into brand ambassadors! Easily grow your email list, website traffic, and social media followers with the most powerful giveaways & contests plugin for WordPress.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://rafflepress.com/pricing/?utm_source=WordPress&utm_medium=about&utm_campaign=smtp',
|
||||
],
|
||||
],
|
||||
'pushengage' => [
|
||||
'path' => 'pushengage/main.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/plugin-pushengage.png',
|
||||
'name' => esc_html__( 'PushEngage', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Connect with your visitors after they leave your website with the leading web push notification software. Over 10,000+ businesses worldwide use PushEngage to send 15 billion notifications each month.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://downloads.wordpress.org/plugin/pushengage.zip',
|
||||
],
|
||||
'smash-balloon-instagram-feeds' => [
|
||||
'path' => 'instagram-feed/instagram-feed.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/plugin-smash-balloon-instagram-feeds.png',
|
||||
'name' => esc_html__( 'Smash Balloon Instagram Feeds', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Easily display Instagram content on your WordPress site without writing any code. Comes with multiple templates, ability to show content from multiple accounts, hashtags, and more. Trusted by 1 million websites.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://downloads.wordpress.org/plugin/instagram-feed.zip',
|
||||
'pro' => [
|
||||
'path' => 'instagram-feed-pro/instagram-feed.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/plugin-smash-balloon-instagram-feeds.png',
|
||||
'name' => esc_html__( 'Smash Balloon Instagram Feeds', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Easily display Instagram content on your WordPress site without writing any code. Comes with multiple templates, ability to show content from multiple accounts, hashtags, and more. Trusted by 1 million websites.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://smashballoon.com/instagram-feed/?utm_source=WordPress&utm_medium=about&utm_campaign=smtp',
|
||||
],
|
||||
],
|
||||
'smash-balloon-facebook-feeds' => [
|
||||
'path' => 'custom-facebook-feed/custom-facebook-feed.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/plugin-smash-balloon-facebook-feeds.png',
|
||||
'name' => esc_html__( 'Smash Balloon Facebook Feeds', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Easily display Facebook content on your WordPress site without writing any code. Comes with multiple templates, ability to embed albums, group content, reviews, live videos, comments, and reactions.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://downloads.wordpress.org/plugin/custom-facebook-feed.zip',
|
||||
'pro' => [
|
||||
'path' => 'custom-facebook-feed-pro/custom-facebook-feed.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/plugin-smash-balloon-facebook-feeds.png',
|
||||
'name' => esc_html__( 'Smash Balloon Facebook Feeds', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Easily display Facebook content on your WordPress site without writing any code. Comes with multiple templates, ability to embed albums, group content, reviews, live videos, comments, and reactions.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://smashballoon.com/custom-facebook-feed/?utm_source=WordPress&utm_medium=about&utm_campaign=smtp',
|
||||
],
|
||||
],
|
||||
'smash-balloon-youtube-feeds' => [
|
||||
'path' => 'feeds-for-youtube/youtube-feed.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/plugin-smash-balloon-youtube-feeds.png',
|
||||
'name' => esc_html__( 'Smash Balloon YouTube Feeds', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Easily display YouTube videos on your WordPress site without writing any code. Comes with multiple layouts, ability to embed live streams, video filtering, ability to combine multiple channel videos, and more.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://downloads.wordpress.org/plugin/feeds-for-youtube.zip',
|
||||
'pro' => [
|
||||
'path' => 'youtube-feed-pro/youtube-feed.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/plugin-smash-balloon-youtube-feeds.png',
|
||||
'name' => esc_html__( 'Smash Balloon YouTube Feeds', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Easily display YouTube videos on your WordPress site without writing any code. Comes with multiple layouts, ability to embed live streams, video filtering, ability to combine multiple channel videos, and more.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://smashballoon.com/youtube-feed/?utm_source=WordPress&utm_medium=about&utm_campaign=smtp',
|
||||
],
|
||||
],
|
||||
'smash-balloon-twitter-feeds' => [
|
||||
'path' => 'custom-twitter-feeds/custom-twitter-feed.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/plugin-smash-balloon-twitter-feeds.png',
|
||||
'name' => esc_html__( 'Smash Balloon Twitter Feeds', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Easily display Twitter content in WordPress without writing any code. Comes with multiple layouts, ability to combine multiple Twitter feeds, Twitter card support, tweet moderation, and more.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://downloads.wordpress.org/plugin/custom-twitter-feeds.zip',
|
||||
'pro' => [
|
||||
'path' => 'custom-twitter-feeds-pro/custom-twitter-feed.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/plugin-smash-balloon-twitter-feeds.png',
|
||||
'name' => esc_html__( 'Smash Balloon Twitter Feeds', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Easily display Twitter content in WordPress without writing any code. Comes with multiple layouts, ability to combine multiple Twitter feeds, Twitter card support, tweet moderation, and more.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://smashballoon.com/custom-twitter-feeds/?utm_source=WordPress&utm_medium=about&utm_campaign=smtp',
|
||||
],
|
||||
],
|
||||
'trustpulse' => [
|
||||
'path' => 'trustpulse-api/trustpulse.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/plugin-trustpulse.png',
|
||||
'name' => esc_html__( 'TrustPulse', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Boost your sales and conversions by up to 15% with real-time social proof notifications. TrustPulse helps you show live user activity and purchases to help convince other users to purchase.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://downloads.wordpress.org/plugin/trustpulse-api.zip',
|
||||
],
|
||||
'searchwp' => [
|
||||
'path' => '',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/searchwp.png',
|
||||
'name' => esc_html__( 'SearchWP', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'The most advanced WordPress search plugin. Customize your WordPress search algorithm, reorder search results, track search metrics, and everything you need to leverage search to grow your business.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://searchwp.com/?utm_source=WordPress&utm_medium=about&utm_campaign=smtp',
|
||||
'pro' => [
|
||||
'path' => 'searchwp/index.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/searchwp.png',
|
||||
'name' => esc_html__( 'SearchWP', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'The most advanced WordPress search plugin. Customize your WordPress search algorithm, reorder search results, track search metrics, and everything you need to leverage search to grow your business.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://searchwp.com/?utm_source=WordPress&utm_medium=about&utm_campaign=smtp',
|
||||
],
|
||||
],
|
||||
'affiliatewp' => [
|
||||
'path' => '',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/affiliatewp.png',
|
||||
'name' => esc_html__( 'AffiliateWP', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'The #1 affiliate management plugin for WordPress. Easily create an affiliate program for your eCommerce store or membership site within minutes and start growing your sales with the power of referral marketing.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://affiliatewp.com/?utm_source=WordPress&utm_medium=about&utm_campaign=smtp',
|
||||
'pro' => [
|
||||
'path' => 'affiliate-wp/affiliate-wp.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/affiliatewp.png',
|
||||
'name' => esc_html__( 'AffiliateWP', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'The #1 affiliate management plugin for WordPress. Easily create an affiliate program for your eCommerce store or membership site within minutes and start growing your sales with the power of referral marketing.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://affiliatewp.com/?utm_source=WordPress&utm_medium=about&utm_campaign=smtp',
|
||||
],
|
||||
],
|
||||
'wp-simple-pay' => [
|
||||
'path' => 'stripe/stripe-checkout.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/wp-simple-pay.png',
|
||||
'name' => esc_html__( 'WP Simple Pay', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'The #1 Stripe payments plugin for WordPress. Start accepting one-time and recurring payments on your WordPress site without setting up a shopping cart. No code required.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://downloads.wordpress.org/plugin/stripe.zip',
|
||||
'pro' => [
|
||||
'path' => 'wp-simple-pay-pro-3/simple-pay.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/wp-simple-pay.png',
|
||||
'name' => esc_html__( 'WP Simple Pay Pro', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'The #1 Stripe payments plugin for WordPress. Start accepting one-time and recurring payments on your WordPress site without setting up a shopping cart. No code required.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://wpsimplepay.com/?utm_source=WordPress&utm_medium=about&utm_campaign=smtp',
|
||||
],
|
||||
],
|
||||
'easy-digital-downloads' => [
|
||||
'path' => 'easy-digital-downloads/easy-digital-downloads.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/edd.png',
|
||||
'name' => esc_html__( 'Easy Digital Downloads', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'The best WordPress eCommerce plugin for selling digital downloads. Start selling eBooks, software, music, digital art, and more within minutes. Accept payments, manage subscriptions, advanced access control, and more.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://downloads.wordpress.org/plugin/easy-digital-downloads.zip',
|
||||
],
|
||||
'sugar-calendar' => [
|
||||
'path' => 'sugar-calendar-lite/sugar-calendar-lite.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/sugar-calendar.png',
|
||||
'name' => esc_html__( 'Sugar Calendar Lite', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'A simple & powerful event calendar plugin for WordPress that comes with all the event management features including payments, scheduling, timezones, ticketing, recurring events, and more.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://downloads.wordpress.org/plugin/sugar-calendar-lite.zip',
|
||||
'pro' => [
|
||||
'path' => 'sugar-calendar/sugar-calendar.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/sugar-calendar.png',
|
||||
'name' => esc_html__( 'Sugar Calendar', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'A simple & powerful event calendar plugin for WordPress that comes with all the event management features including payments, scheduling, timezones, ticketing, recurring events, and more.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://sugarcalendar.com/?utm_source=WordPress&utm_medium=about&utm_campaign=smtp',
|
||||
],
|
||||
],
|
||||
'wp-charitable' => [
|
||||
'path' => 'charitable/charitable.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/plugin-charitable.png',
|
||||
'name' => esc_html__( 'WP Charitable', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Top-rated WordPress donation and fundraising plugin. Over 10,000+ non-profit organizations and website owners use Charitable to create fundraising campaigns and raise more money online.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://downloads.wordpress.org/plugin/charitable.zip',
|
||||
],
|
||||
'wpcode' => [
|
||||
'path' => 'insert-headers-and-footers/ihaf.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/plugin-wpcode.png',
|
||||
'name' => esc_html__( 'WPCode Lite', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Future proof your WordPress customizations with the most popular code snippet management plugin for WordPress. Trusted by over 1,500,000+ websites for easily adding code to WordPress right from the admin area.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://downloads.wordpress.org/plugin/insert-headers-and-footers.zip',
|
||||
'pro' => [
|
||||
'path' => 'wpcode-premium/wpcode.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/plugin-wpcode.png',
|
||||
'name' => esc_html__( 'WPCode Pro', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Future proof your WordPress customizations with the most popular code snippet management plugin for WordPress. Trusted by over 1,500,000+ websites for easily adding code to WordPress right from the admin area.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://wpcode.com/?utm_source=WordPress&utm_medium=about&utm_campaign=smtp',
|
||||
],
|
||||
],
|
||||
'duplicator' => [
|
||||
'path' => 'duplicator/duplicator.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/duplicator-icon-large.png',
|
||||
'name' => esc_html__( 'Duplicator', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Leading WordPress backup & site migration plugin. Over 1,500,000+ smart website owners use Duplicator to make reliable and secure WordPress backups to protect their websites. It also makes website migration really easy.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://downloads.wordpress.org/plugin/duplicator.zip',
|
||||
'pro' => [
|
||||
'path' => 'duplicator-pro/duplicator-pro.php',
|
||||
'icon' => wp_mail_smtp()->assets_url . '/images/about/duplicator-icon-large.png',
|
||||
'name' => esc_html__( 'Duplicator Pro', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Leading WordPress backup & site migration plugin. Over 1,500,000+ smart website owners use Duplicator to make reliable and secure WordPress backups to protect their websites. It also makes website migration really easy.', 'wp-mail-smtp' ),
|
||||
'url' => 'https://duplicator.com/?utm_source=WordPress&utm_medium=about&utm_campaign=smtp',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Active the given plugin.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*/
|
||||
public static function ajax_plugin_activate() {
|
||||
|
||||
// Run a security check.
|
||||
check_ajax_referer( 'wp-mail-smtp-about', 'nonce' );
|
||||
|
||||
$error = esc_html__( 'Could not activate the plugin. Please activate it from the Plugins page.', 'wp-mail-smtp' );
|
||||
|
||||
// Check for permissions.
|
||||
if ( ! current_user_can( 'activate_plugins' ) ) {
|
||||
wp_send_json_error( $error );
|
||||
}
|
||||
|
||||
if ( empty( $_POST['plugin'] ) ) {
|
||||
wp_send_json_error( $error );
|
||||
}
|
||||
|
||||
$plugin_slug = sanitize_text_field( wp_unslash( $_POST['plugin'] ) );
|
||||
|
||||
$whitelisted_plugins = [];
|
||||
|
||||
foreach ( self::get_am_plugins() as $item ) {
|
||||
if ( ! empty( $item['path'] ) ) {
|
||||
$whitelisted_plugins[] = $item['path'];
|
||||
}
|
||||
|
||||
if ( ! empty( $item['pro']['path'] ) ) {
|
||||
$whitelisted_plugins[] = $item['pro']['path'];
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! in_array( $plugin_slug, $whitelisted_plugins, true ) ) {
|
||||
wp_send_json_error( esc_html__( 'Could not activate the plugin. Plugin is not whitelisted.', 'wp-mail-smtp' ) );
|
||||
}
|
||||
|
||||
$activate = activate_plugins( $plugin_slug );
|
||||
|
||||
if ( ! is_wp_error( $activate ) ) {
|
||||
wp_send_json_success( esc_html__( 'Plugin activated.', 'wp-mail-smtp' ) );
|
||||
}
|
||||
|
||||
wp_send_json_error( $error );
|
||||
}
|
||||
|
||||
/**
|
||||
* Install & activate the given plugin.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*/
|
||||
public static function ajax_plugin_install() { // phpcs:ignore:Generic.Metrics.CyclomaticComplexity.TooHigh
|
||||
|
||||
// Run a security check.
|
||||
check_ajax_referer( 'wp-mail-smtp-about', 'nonce' );
|
||||
|
||||
$error = esc_html__( 'Could not install the plugin.', 'wp-mail-smtp' );
|
||||
|
||||
// Check for permissions.
|
||||
if ( ! current_user_can( 'install_plugins' ) ) {
|
||||
wp_send_json_error( $error );
|
||||
}
|
||||
|
||||
if ( empty( $_POST['plugin'] ) ) {
|
||||
wp_send_json_error();
|
||||
}
|
||||
|
||||
$plugin_url = esc_url_raw( wp_unslash( $_POST['plugin'] ) );
|
||||
|
||||
if ( ! in_array( $plugin_url, wp_list_pluck( array_values( self::get_am_plugins() ), 'url' ) , true ) ) {
|
||||
wp_send_json_error( esc_html__( 'Could not install the plugin. Plugin is not whitelisted.', 'wp-mail-smtp' ) );
|
||||
}
|
||||
|
||||
// Set the current screen to avoid undefined notices.
|
||||
set_current_screen( 'wp-mail-smtp_page_wp-mail-smtp-about' );
|
||||
|
||||
// Prepare variables.
|
||||
$url = esc_url_raw(
|
||||
add_query_arg(
|
||||
[
|
||||
'page' => 'wp-mail-smtp-about',
|
||||
],
|
||||
admin_url( 'admin.php' )
|
||||
)
|
||||
);
|
||||
|
||||
$creds = request_filesystem_credentials( $url, '', false, false, null );
|
||||
|
||||
// Check for file system permissions.
|
||||
if ( false === $creds ) {
|
||||
wp_send_json_error( $error );
|
||||
}
|
||||
|
||||
if ( ! WP_Filesystem( $creds ) ) {
|
||||
wp_send_json_error( $error );
|
||||
}
|
||||
|
||||
// Do not allow WordPress to search/download translations, as this will break JS output.
|
||||
remove_action( 'upgrader_process_complete', [ 'Language_Pack_Upgrader', 'async_upgrade' ], 20 );
|
||||
|
||||
// Create the plugin upgrader with our custom skin.
|
||||
$installer = new PluginsInstallUpgrader( new PluginsInstallSkin() );
|
||||
|
||||
// Error check.
|
||||
if ( ! method_exists( $installer, 'install' ) ) {
|
||||
wp_send_json_error( $error );
|
||||
}
|
||||
|
||||
$installer->install( $plugin_url );
|
||||
|
||||
// Flush the cache and return the newly installed plugin basename.
|
||||
wp_cache_flush();
|
||||
|
||||
if ( $installer->plugin_info() ) {
|
||||
|
||||
$plugin_basename = $installer->plugin_info();
|
||||
|
||||
// Activate the plugin silently.
|
||||
$activated = activate_plugin( $plugin_basename );
|
||||
|
||||
if ( ! is_wp_error( $activated ) ) {
|
||||
wp_send_json_success(
|
||||
[
|
||||
'msg' => esc_html__( 'Plugin installed & activated.', 'wp-mail-smtp' ),
|
||||
'is_activated' => true,
|
||||
'basename' => $plugin_basename,
|
||||
]
|
||||
);
|
||||
} else {
|
||||
wp_send_json_success(
|
||||
[
|
||||
'msg' => esc_html__( 'Plugin installed.', 'wp-mail-smtp' ),
|
||||
'is_activated' => false,
|
||||
'basename' => $plugin_basename,
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
wp_send_json_error( $error );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
<?php
|
||||
|
||||
namespace WPMailSMTP\Admin\Pages;
|
||||
|
||||
use WPMailSMTP\Admin\PageAbstract;
|
||||
|
||||
/**
|
||||
* Class ActionScheduler.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*/
|
||||
class ActionSchedulerTab extends PageAbstract {
|
||||
|
||||
/**
|
||||
* Part of the slug of a tab.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $slug = 'action-scheduler';
|
||||
|
||||
/**
|
||||
* Tab priority.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $priority = 30;
|
||||
|
||||
/**
|
||||
* Link label of a tab.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_label() {
|
||||
|
||||
return esc_html__( 'Scheduled Actions', 'wp-mail-smtp' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Title of a tab.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return $this->get_label();
|
||||
}
|
||||
|
||||
/**
|
||||
* URL to a tab.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_link() {
|
||||
|
||||
return add_query_arg( [ 's' => 'wp_mail_smtp' ], parent::get_link() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Register hooks.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*/
|
||||
public function hooks() {
|
||||
|
||||
add_action( 'current_screen', [ $this, 'init' ], 20 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Init.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*/
|
||||
public function init() {
|
||||
|
||||
if ( $this->is_applicable() ) {
|
||||
\ActionScheduler_AdminView::instance()->process_admin_ui();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display scheduled actions table.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*/
|
||||
public function display() {
|
||||
|
||||
if ( ! $this->is_applicable() ) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<h1><?php echo esc_html__( 'Scheduled Actions', 'wp-mail-smtp' ); ?></h1>
|
||||
|
||||
<p>
|
||||
<?php
|
||||
echo sprintf(
|
||||
wp_kses( /* translators: %s - Action Scheduler website URL. */
|
||||
__( 'WP Mail SMTP is using the <a href="%s" target="_blank" rel="noopener noreferrer">Action Scheduler</a> library, which allows it to queue and process bigger tasks in the background without making your site slower for your visitors. Below you can see the list of all tasks and their status. This table can be very useful when debugging certain issues.', 'wp-mail-smtp' ),
|
||||
[
|
||||
'a' => [
|
||||
'href' => [],
|
||||
'rel' => [],
|
||||
'target' => [],
|
||||
],
|
||||
]
|
||||
),
|
||||
'https://actionscheduler.org/'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<?php echo esc_html__( 'Action Scheduler library is also used by other plugins, like WPForms and WooCommerce, so you might see tasks that are not related to our plugin in the table below.', 'wp-mail-smtp' ); ?>
|
||||
</p>
|
||||
|
||||
<?php if ( isset( $_GET['s'] ) ) : // phpcs:ignore WordPress.Security.NonceVerification.Recommended ?>
|
||||
<div id="wp-mail-smtp-reset-filter">
|
||||
<?php
|
||||
echo wp_kses(
|
||||
sprintf( /* translators: %s - search term. */
|
||||
__( 'Search results for <strong>%s</strong>', 'wp-mail-smtp' ),
|
||||
sanitize_text_field( wp_unslash( $_GET['s'] ) ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
||||
),
|
||||
[ 'strong' => [] ]
|
||||
);
|
||||
?>
|
||||
<a href="<?php echo esc_url( remove_query_arg( 's' ) ); ?>">
|
||||
<i class="reset dashicons dashicons-dismiss"></i>
|
||||
</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
\ActionScheduler_AdminView::instance()->render_admin_ui();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if ActionScheduler_AdminView class exists.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function is_applicable() {
|
||||
|
||||
return class_exists( 'ActionScheduler_AdminView' );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
<?php
|
||||
|
||||
namespace WPMailSMTP\Admin\Pages;
|
||||
|
||||
use WPMailSMTP\Admin\PageAbstract;
|
||||
|
||||
/**
|
||||
* Class AdditionalConnectionsTab is a placeholder for Pro additional connections feature.
|
||||
* Displays product education.
|
||||
*
|
||||
* @since 3.7.0
|
||||
*/
|
||||
class AdditionalConnectionsTab extends PageAbstract {
|
||||
|
||||
/**
|
||||
* Part of the slug of a tab.
|
||||
*
|
||||
* @since 3.7.0
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $slug = 'connections';
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @since 3.7.0
|
||||
*
|
||||
* @param PageAbstract $parent_page Parent page object.
|
||||
*/
|
||||
public function __construct( $parent_page = null ) {
|
||||
|
||||
parent::__construct( $parent_page );
|
||||
|
||||
if ( wp_mail_smtp()->get_admin()->get_current_tab() === $this->slug && ! wp_mail_smtp()->is_pro() ) {
|
||||
$this->hooks();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Link label of a tab.
|
||||
*
|
||||
* @since 3.7.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_label() {
|
||||
|
||||
return esc_html__( 'Additional Connections', 'wp-mail-smtp' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Register hooks.
|
||||
*
|
||||
* @since 3.7.0
|
||||
*/
|
||||
public function hooks() {
|
||||
|
||||
add_action( 'wp_mail_smtp_admin_area_enqueue_assets', [ $this, 'enqueue_assets' ] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue required JS and CSS.
|
||||
*
|
||||
* @since 3.7.0
|
||||
*/
|
||||
public function enqueue_assets() {
|
||||
|
||||
wp_enqueue_style(
|
||||
'wp-mail-smtp-admin-lity',
|
||||
wp_mail_smtp()->assets_url . '/libs/lity/lity.min.css',
|
||||
[],
|
||||
'2.4.1'
|
||||
);
|
||||
wp_enqueue_script(
|
||||
'wp-mail-smtp-admin-lity',
|
||||
wp_mail_smtp()->assets_url . '/libs/lity/lity.min.js',
|
||||
[],
|
||||
'2.4.1'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Output HTML of additional connections' education.
|
||||
*
|
||||
* @since 3.7.0
|
||||
*/
|
||||
public function display() {
|
||||
|
||||
$upgrade_link_url = wp_mail_smtp()->get_upgrade_link(
|
||||
[
|
||||
'medium' => 'Additional Connections Settings',
|
||||
'content' => 'Upgrade to WP Mail SMTP Pro Link',
|
||||
]
|
||||
);
|
||||
|
||||
$upgrade_button_url = wp_mail_smtp()->get_upgrade_link(
|
||||
[
|
||||
'medium' => 'Additional Connections Settings',
|
||||
'content' => 'Upgrade to WP Mail SMTP Pro Button',
|
||||
]
|
||||
);
|
||||
?>
|
||||
<div id="wp-mail-additional-connections-product-education" class="wp-mail-smtp-product-education">
|
||||
<div class="wp-mail-smtp-product-education__row">
|
||||
<h4 class="wp-mail-smtp-product-education__heading">
|
||||
<?php esc_html_e( 'Additional Connections', 'wp-mail-smtp' ); ?>
|
||||
</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' => [],
|
||||
],
|
||||
]
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$this->display_education_screenshots();
|
||||
$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">
|
||||
<?php esc_html_e( 'Upgrade to WP Mail SMTP Pro', 'wp-mail-smtp' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Output HTML of additional connections' education screenshots.
|
||||
*
|
||||
* @since 3.7.0
|
||||
*/
|
||||
protected function display_education_screenshots() {
|
||||
|
||||
$assets_url = wp_mail_smtp()->assets_url . '/images/additional-connections/';
|
||||
$screenshots = [
|
||||
[
|
||||
'url' => $assets_url . 'screenshot-01.png',
|
||||
'url_thumbnail' => $assets_url . 'thumbnail-01.png',
|
||||
'title' => __( 'Backup Connection', 'wp-mail-smtp' ),
|
||||
],
|
||||
[
|
||||
'url' => $assets_url . 'screenshot-02.png',
|
||||
'url_thumbnail' => $assets_url . 'thumbnail-02.png',
|
||||
'title' => __( 'Smart Routing', 'wp-mail-smtp' ),
|
||||
],
|
||||
];
|
||||
?>
|
||||
<div class="wp-mail-smtp-product-education__row wp-mail-smtp-product-education__row--full-width">
|
||||
<div class="wp-mail-smtp-product-education__screenshots wp-mail-smtp-product-education__screenshots--two">
|
||||
<?php foreach ( $screenshots as $screenshot ) : ?>
|
||||
<div>
|
||||
<a href="<?php echo esc_url( $screenshot['url'] ); ?>" data-lity data-lity-desc="<?php echo esc_attr( $screenshot['title'] ); ?>">
|
||||
<img src="<?php echo esc_url( $screenshot['url_thumbnail'] ); ?>" alt="<?php esc_attr( $screenshot['title'] ); ?>">
|
||||
</a>
|
||||
<span><?php echo esc_html( $screenshot['title'] ); ?></span>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Output HTML of additional connections' education features list.
|
||||
*
|
||||
* @since 3.7.0
|
||||
*/
|
||||
protected function display_education_features_list() {
|
||||
|
||||
?>
|
||||
<div class="wp-mail-smtp-product-education__row wp-mail-smtp-product-education__row--full-width">
|
||||
<div class="wp-mail-smtp-product-education__list">
|
||||
<h4><?php esc_html_e( 'With additional connections you can...', 'wp-mail-smtp' ); ?></h4>
|
||||
<div>
|
||||
<ul>
|
||||
<li><?php esc_html_e( 'Set a Backup Connection', 'wp-mail-smtp' ); ?></li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><?php esc_html_e( 'Use mailers for different purposes', 'wp-mail-smtp' ); ?></li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><?php esc_html_e( 'Create advanced routing rules', 'wp-mail-smtp' ); ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
253
wp/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/AlertsTab.php
Normal file
253
wp/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/AlertsTab.php
Normal file
@@ -0,0 +1,253 @@
|
||||
<?php
|
||||
|
||||
namespace WPMailSMTP\Admin\Pages;
|
||||
|
||||
use WPMailSMTP\Admin\PageAbstract;
|
||||
|
||||
/**
|
||||
* Class AlertsTab is a placeholder for Pro alerts feature.
|
||||
* Displays product education.
|
||||
*
|
||||
* @since 3.5.0
|
||||
*/
|
||||
class AlertsTab extends PageAbstract {
|
||||
|
||||
/**
|
||||
* Part of the slug of a tab.
|
||||
*
|
||||
* @since 3.5.0
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $slug = 'alerts';
|
||||
|
||||
/**
|
||||
* Tab priority.
|
||||
*
|
||||
* @since 3.5.0
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $priority = 20;
|
||||
|
||||
/**
|
||||
* Link label of a tab.
|
||||
*
|
||||
* @since 3.5.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_label() {
|
||||
|
||||
return esc_html__( 'Alerts', 'wp-mail-smtp' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Title of a tab.
|
||||
*
|
||||
* @since 3.5.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return $this->get_label();
|
||||
}
|
||||
|
||||
/**
|
||||
* Output HTML of the alerts settings preview.
|
||||
*
|
||||
* @since 3.5.0
|
||||
*/
|
||||
public function display() {
|
||||
|
||||
$upgrade_link_url = wp_mail_smtp()->get_upgrade_link(
|
||||
[
|
||||
'medium' => 'Alerts Settings',
|
||||
'content' => 'Upgrade to WP Mail SMTP Pro Link',
|
||||
]
|
||||
);
|
||||
|
||||
$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">
|
||||
<h4 class="wp-mail-smtp-product-education__heading">
|
||||
<?php esc_html_e( 'Alerts', 'wp-mail-smtp' ); ?>
|
||||
</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' => [],
|
||||
],
|
||||
]
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="wp-mail-smtp-product-education__row wp-mail-smtp-product-education__row--inactive">
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-alert">
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-content section-heading">
|
||||
<div class="wp-mail-smtp-setting-field">
|
||||
<h3><?php esc_html_e( 'Email', 'wp-mail-smtp' ); ?></h3>
|
||||
<p class="desc"><?php esc_html_e( 'Enter the email addresses (3 max) you’d like to use to receive alerts when email sending fails. Read our documentation on setting up email alerts.', 'wp-mail-smtp' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-checkbox-toggle">
|
||||
<div class="wp-mail-smtp-setting-label">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-alert-options">
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-alert-connection-options">
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-text">
|
||||
<div class="wp-mail-smtp-setting-label">
|
||||
<label><?php esc_html_e( 'Send To', 'wp-mail-smtp' ); ?></label>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-setting-field"><input type="text"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-alert">
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-content section-heading">
|
||||
<div class="wp-mail-smtp-setting-field">
|
||||
<h3><?php esc_html_e( 'Slack', 'wp-mail-smtp' ); ?></h3>
|
||||
<p class="desc"><?php esc_html_e( 'Paste in the Slack webhook URL you’d like to use to receive alerts when email sending fails. Read our documentation on setting up Slack alerts.', 'wp-mail-smtp' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-checkbox-toggle">
|
||||
<div class="wp-mail-smtp-setting-label">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-alert-options">
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-alert-connection-options">
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-text">
|
||||
<div class="wp-mail-smtp-setting-label">
|
||||
<label><?php esc_html_e( 'Webhook URL', 'wp-mail-smtp' ); ?></label>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-setting-field"><input type="text"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-alert">
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-content section-heading">
|
||||
<div class="wp-mail-smtp-setting-field">
|
||||
<h3><?php esc_html_e( 'SMS via Twilio', 'wp-mail-smtp' ); ?></h3>
|
||||
<p class="desc"><?php esc_html_e( 'To receive SMS alerts, you’ll need a Twilio account. Read our documentation to learn how to set up Twilio SMS, then enter your connection details below.', 'wp-mail-smtp' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-checkbox-toggle">
|
||||
<div class="wp-mail-smtp-setting-label">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-alert-options">
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-alert-connection-options">
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-text">
|
||||
<div class="wp-mail-smtp-setting-label">
|
||||
<label><?php esc_html_e( 'Twilio Account ID', 'wp-mail-smtp' ); ?></label>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-setting-field"><input type="text"></div>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-text">
|
||||
<div class="wp-mail-smtp-setting-label">
|
||||
<label><?php esc_html_e( 'Twilio Auth Token', 'wp-mail-smtp' ); ?></label>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-setting-field"><input type="text"></div>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-text">
|
||||
<div class="wp-mail-smtp-setting-label">
|
||||
<label><?php esc_html_e( 'From Phone Number', 'wp-mail-smtp' ); ?></label>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-setting-field"><input type="text"></div>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-text">
|
||||
<div class="wp-mail-smtp-setting-label">
|
||||
<label><?php esc_html_e( 'To Phone Number', 'wp-mail-smtp' ); ?></label>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-setting-field"><input type="text"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-alert">
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-content section-heading">
|
||||
<div class="wp-mail-smtp-setting-field">
|
||||
<h3><?php esc_html_e( 'Webhook', 'wp-mail-smtp' ); ?></h3>
|
||||
<p class="desc"><?php esc_html_e( 'Paste in the webhook URL you’d like to use to receive alerts when email sending fails. Read our documentation on setting up webhook alerts.', 'wp-mail-smtp' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-checkbox-toggle">
|
||||
<div class="wp-mail-smtp-setting-label">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-alert-options">
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-alert-connection-options">
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-text">
|
||||
<div class="wp-mail-smtp-setting-label">
|
||||
<label><?php esc_html_e( 'Webhook URL', 'wp-mail-smtp' ); ?></label>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-setting-field"><input type="text"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</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">
|
||||
<?php esc_html_e( 'Upgrade to WP Mail SMTP Pro', 'wp-mail-smtp' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace WPMailSMTP\Admin\Pages;
|
||||
|
||||
use WPMailSMTP\ConnectionInterface;
|
||||
use WPMailSMTP\Providers\AuthAbstract;
|
||||
|
||||
/**
|
||||
* Class AuthTab.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class AuthTab {
|
||||
|
||||
/**
|
||||
* @var string Slug of a tab.
|
||||
*/
|
||||
protected $slug = 'auth';
|
||||
|
||||
/**
|
||||
* Launch mailer specific Auth logic.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function process_auth() {
|
||||
|
||||
$connection = wp_mail_smtp()->get_connections_manager()->get_primary_connection();
|
||||
|
||||
/**
|
||||
* Filters auth connection object.
|
||||
*
|
||||
* @since 3.7.0
|
||||
*
|
||||
* @param ConnectionInterface $connection The Connection object.
|
||||
*/
|
||||
$connection = apply_filters( 'wp_mail_smtp_admin_pages_auth_tab_process_auth_connection', $connection );
|
||||
|
||||
$auth = wp_mail_smtp()->get_providers()->get_auth( $connection->get_mailer_slug(), $connection );
|
||||
|
||||
if (
|
||||
$auth &&
|
||||
$auth instanceof AuthAbstract &&
|
||||
method_exists( $auth, 'process' )
|
||||
) {
|
||||
$auth->process();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return nothing, as we don't need this functionality.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function get_label() {
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return nothing, as we don't need this functionality.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function get_title() {
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Do nothing, as we don't need this functionality.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function display() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,341 @@
|
||||
<?php
|
||||
|
||||
namespace WPMailSMTP\Admin\Pages;
|
||||
|
||||
use WPMailSMTP\Admin\PageAbstract;
|
||||
use WPMailSMTP\WP;
|
||||
|
||||
/**
|
||||
* Class ControlTab is a placeholder for Pro Email Control tab settings.
|
||||
* Displays an upsell.
|
||||
*
|
||||
* @since 1.6.0
|
||||
*/
|
||||
class ControlTab extends PageAbstract {
|
||||
|
||||
/**
|
||||
* Slug of a tab.
|
||||
*
|
||||
* @since 1.6.0
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $slug = 'control';
|
||||
|
||||
/**
|
||||
* Link label of a tab.
|
||||
*
|
||||
* @since 1.6.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_label() {
|
||||
|
||||
return esc_html__( 'Email Controls', 'wp-mail-smtp' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Title of a tab.
|
||||
*
|
||||
* @since 1.6.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return $this->get_label();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of all available emails that we can manage.
|
||||
*
|
||||
* @see https://github.com/johnbillion/wp_mail Apr 12th 2019.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function get_controls() {
|
||||
|
||||
return [
|
||||
'comments' => [
|
||||
'title' => esc_html__( 'Comments', 'wp-mail-smtp' ),
|
||||
'emails' => [
|
||||
'dis_comments_awaiting_moderation' => [
|
||||
'label' => esc_html__( 'Awaiting Moderation', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Comment is awaiting moderation. Sent to the site admin and post author if they can edit comments.', 'wp-mail-smtp' ),
|
||||
],
|
||||
'dis_comments_published' => [
|
||||
'label' => esc_html__( 'Published', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Comment has been published. Sent to the post author.', 'wp-mail-smtp' ),
|
||||
],
|
||||
],
|
||||
],
|
||||
'admin_email' => [
|
||||
'title' => esc_html__( 'Change of Admin Email', 'wp-mail-smtp' ),
|
||||
'emails' => [
|
||||
'dis_admin_email_attempt' => [
|
||||
'label' => esc_html__( 'Site Admin Email Change Attempt', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Change of site admin email address was attempted. Sent to the proposed new email address.', 'wp-mail-smtp' ),
|
||||
],
|
||||
'dis_admin_email_changed' => [
|
||||
'label' => esc_html__( 'Site Admin Email Changed', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Site admin email address was changed. Sent to the old site admin email address.', 'wp-mail-smtp' ),
|
||||
],
|
||||
'dis_admin_email_network_attempt' => [
|
||||
'label' => esc_html__( 'Network Admin Email Change Attempt', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Change of network admin email address was attempted. Sent to the proposed new email address.', 'wp-mail-smtp' ),
|
||||
],
|
||||
'dis_admin_email_network_changed' => [
|
||||
'label' => esc_html__( 'Network Admin Email Changed', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Network admin email address was changed. Sent to the old network admin email address.', 'wp-mail-smtp' ),
|
||||
],
|
||||
],
|
||||
],
|
||||
'user_details' => [
|
||||
'title' => esc_html__( 'Change of User Email or Password', 'wp-mail-smtp' ),
|
||||
'emails' => [
|
||||
'dis_user_details_password_reset_request' => [
|
||||
'label' => esc_html__( 'Reset Password Request', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'User requested a password reset via "Lost your password?". Sent to the user.', 'wp-mail-smtp' ),
|
||||
],
|
||||
'dis_user_details_password_reset' => [
|
||||
'label' => esc_html__( 'Password Reset Successfully', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'User reset their password from the password reset link. Sent to the site admin.', 'wp-mail-smtp' ),
|
||||
],
|
||||
'dis_user_details_password_changed' => [
|
||||
'label' => esc_html__( 'Password Changed', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'User changed their password. Sent to the user.', 'wp-mail-smtp' ),
|
||||
],
|
||||
'dis_user_details_email_change_attempt' => [
|
||||
'label' => esc_html__( 'Email Change Attempt', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'User attempted to change their email address. Sent to the proposed new email address.', 'wp-mail-smtp' ),
|
||||
],
|
||||
'dis_user_details_email_changed' => [
|
||||
'label' => esc_html__( 'Email Changed', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'User changed their email address. Sent to the user.', 'wp-mail-smtp' ),
|
||||
],
|
||||
],
|
||||
],
|
||||
'personal_data' => [
|
||||
'title' => esc_html__( 'Personal Data Requests', 'wp-mail-smtp' ),
|
||||
'emails' => [
|
||||
'dis_personal_data_user_confirmed' => [
|
||||
'label' => esc_html__( 'User Confirmed Export / Erasure Request', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'User clicked a confirmation link in personal data export or erasure request email. Sent to the site or network admin.', 'wp-mail-smtp' ),
|
||||
],
|
||||
'dis_personal_data_erased_data' => [
|
||||
'label' => esc_html__( 'Admin Erased Data', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Site admin clicked "Erase Personal Data" button next to a confirmed data erasure request. Sent to the requester email address.', 'wp-mail-smtp' ),
|
||||
],
|
||||
'dis_personal_data_sent_export_link' => [
|
||||
'label' => esc_html__( 'Admin Sent Link to Export Data', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Site admin clicked "Email Data" button next to a confirmed data export request. Sent to the requester email address.', 'wp-mail-smtp' ) . '<br>' .
|
||||
'<strong>' . esc_html__( 'Disabling this option will block users from being able to export their personal data, as they will not receive an email with a link.', 'wp-mail-smtp' ) . '</strong>',
|
||||
],
|
||||
],
|
||||
],
|
||||
'auto_updates' => [
|
||||
'title' => esc_html__( 'Automatic Updates', 'wp-mail-smtp' ),
|
||||
'emails' => [
|
||||
'dis_auto_updates_plugin_status' => [
|
||||
'label' => esc_html__( 'Plugin Status', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Completion or failure of a background automatic plugin update. Sent to the site or network admin.', 'wp-mail-smtp' ),
|
||||
],
|
||||
'dis_auto_updates_theme_status' => [
|
||||
'label' => esc_html__( 'Theme Status', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Completion or failure of a background automatic theme update. Sent to the site or network admin.', 'wp-mail-smtp' ),
|
||||
],
|
||||
'dis_auto_updates_status' => [
|
||||
'label' => esc_html__( 'WP Core Status', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Completion or failure of a background automatic core update. Sent to the site or network admin.', 'wp-mail-smtp' ),
|
||||
],
|
||||
'dis_auto_updates_full_log' => [
|
||||
'label' => esc_html__( 'Full Log', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'Full log of background update results which includes information about WordPress core, plugins, themes, and translations updates. Only sent when you are using a development version of WordPress. Sent to the site or network admin.', 'wp-mail-smtp' ),
|
||||
],
|
||||
],
|
||||
],
|
||||
'new_user' => [
|
||||
'title' => esc_html__( 'New User', 'wp-mail-smtp' ),
|
||||
'emails' => [
|
||||
'dis_new_user_created_to_admin' => [
|
||||
'label' => esc_html__( 'Created (Admin)', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'A new user was created. Sent to the site admin.', 'wp-mail-smtp' ),
|
||||
],
|
||||
'dis_new_user_created_to_user' => [
|
||||
'label' => esc_html__( 'Created (User)', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'A new user was created. Sent to the new user.', 'wp-mail-smtp' ),
|
||||
],
|
||||
'dis_new_user_invited_to_site_network' => [
|
||||
'label' => esc_html__( 'Invited To Site', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'A new user was invited to a site from Users -> Add New -> Add New User. Sent to the invited user.', 'wp-mail-smtp' ),
|
||||
],
|
||||
'dis_new_user_created_network' => [
|
||||
'label' => esc_html__( 'Created On Site', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'A new user account was created. Sent to Network Admin.', 'wp-mail-smtp' ),
|
||||
],
|
||||
'dis_new_user_added_activated_network' => [
|
||||
'label' => esc_html__( 'Added / Activated on Site', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'A user has been added, or their account activation has been successful. Sent to the user, that has been added/activated.', 'wp-mail-smtp' ),
|
||||
],
|
||||
],
|
||||
],
|
||||
'network_new_site' => [
|
||||
'title' => esc_html__( 'New Site', 'wp-mail-smtp' ),
|
||||
'emails' => [
|
||||
'dis_new_site_user_registered_site_network' => [
|
||||
'label' => esc_html__( 'User Created Site', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'User registered for a new site. Sent to the site admin.', 'wp-mail-smtp' ),
|
||||
],
|
||||
'dis_new_site_user_added_activated_site_in_network_to_admin' => [
|
||||
'label' => esc_html__( 'Network Admin: User Activated / Added Site', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'User activated their new site, or site was added from Network Admin -> Sites -> Add New. Sent to Network Admin.', 'wp-mail-smtp' ),
|
||||
],
|
||||
'dis_new_site_user_added_activated_site_in_network_to_site' => [
|
||||
'label' => esc_html__( 'Site Admin: Activated / Added Site', 'wp-mail-smtp' ),
|
||||
'desc' => esc_html__( 'User activated their new site, or site was added from Network Admin -> Sites -> Add New. Sent to Site Admin.', 'wp-mail-smtp' ),
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Output HTML of the email controls settings preview.
|
||||
*
|
||||
* @since 1.6.0
|
||||
* @since 2.1.0 Replaced images with SVGs.
|
||||
* @since 3.1.0 Updated layout to inactive settings preview.
|
||||
*/
|
||||
public function display() { // phpcs:ignore Generic.Metrics.CyclomaticComplexity.TooHigh
|
||||
|
||||
$link_upgrade_link = add_query_arg(
|
||||
[ 'discount' => 'LITEUPGRADE' ],
|
||||
wp_mail_smtp()->get_upgrade_link(
|
||||
[
|
||||
'medium' => 'Email Controls',
|
||||
'content' => 'Upgrade to WP Mail SMTP Pro',
|
||||
]
|
||||
)
|
||||
);
|
||||
$button_upgrade_link = add_query_arg(
|
||||
[ 'discount' => 'LITEUPGRADE' ],
|
||||
wp_mail_smtp()->get_upgrade_link(
|
||||
[
|
||||
'medium' => 'Email Controls',
|
||||
'content' => 'Upgrade to WP Mail SMTP Pro Button',
|
||||
]
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
<div id="wp-mail-smtp-email-controls-product-education" class="wp-mail-smtp-product-education">
|
||||
<div class="wp-mail-smtp-product-education__row">
|
||||
<h4 class="wp-mail-smtp-product-education__heading">
|
||||
<?php esc_html_e( 'Email Controls', 'wp-mail-smtp' ); ?>
|
||||
</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' => [],
|
||||
],
|
||||
]
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="wp-mail-smtp-product-education__row wp-mail-smtp-product-education__row--inactive">
|
||||
<?php
|
||||
foreach ( static::get_controls() as $section_id => $section ) :
|
||||
if ( empty( $section['emails'] ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( $this->is_it_for_multisite( sanitize_key( $section_id ) ) && ! WP::use_global_plugin_settings() ) {
|
||||
continue;
|
||||
}
|
||||
?>
|
||||
<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">
|
||||
<h5><?php echo esc_html( $section['title'] ); ?></h5>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
foreach ( $section['emails'] as $email_id => $email ) :
|
||||
$email_id = sanitize_key( $email_id );
|
||||
|
||||
if ( empty( $email_id ) || empty( $email['label'] ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( $this->is_it_for_multisite( sanitize_key( $email_id ) ) && ! WP::use_global_plugin_settings() ) {
|
||||
continue;
|
||||
}
|
||||
?>
|
||||
<div 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><?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 if ( ! empty( $email['desc'] ) ) : ?>
|
||||
<p class="desc">
|
||||
<?php echo $email['desc']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?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">
|
||||
<?php esc_html_e( 'Upgrade to WP Mail SMTP Pro', 'wp-mail-smtp' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this key dedicated to MultiSite environment.
|
||||
*
|
||||
* @since 1.5.0
|
||||
*
|
||||
* @param string $key Email unique key.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function is_it_for_multisite( $key ) {
|
||||
|
||||
return strpos( $key, 'network' ) !== false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Not used as we display an upsell.
|
||||
*
|
||||
* @since 1.6.0
|
||||
*
|
||||
* @param array $data Post data specific for the plugin.
|
||||
*/
|
||||
public function process_post( $data ) { }
|
||||
}
|
||||
@@ -0,0 +1,551 @@
|
||||
<?php
|
||||
|
||||
namespace WPMailSMTP\Admin\Pages;
|
||||
|
||||
use WPMailSMTP\Admin\Area;
|
||||
use WPMailSMTP\Admin\DebugEvents\DebugEvents;
|
||||
use WPMailSMTP\Admin\DebugEvents\Migration;
|
||||
use WPMailSMTP\Admin\DebugEvents\Table;
|
||||
use WPMailSMTP\Admin\PageAbstract;
|
||||
use WPMailSMTP\Admin\ParentPageAbstract;
|
||||
use WPMailSMTP\Options;
|
||||
use WPMailSMTP\WP;
|
||||
|
||||
/**
|
||||
* Debug Events settings page.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class DebugEventsTab extends PageAbstract {
|
||||
|
||||
/**
|
||||
* Part of the slug of a tab.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $slug = 'debug-events';
|
||||
|
||||
/**
|
||||
* Tab priority.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $priority = 40;
|
||||
|
||||
/**
|
||||
* Debug events list table.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @var Table
|
||||
*/
|
||||
protected $table = null;
|
||||
|
||||
/**
|
||||
* Plugin options.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @var Options
|
||||
*/
|
||||
protected $options;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param ParentPageAbstract $parent_page Tab parent page.
|
||||
*/
|
||||
public function __construct( $parent_page = null ) {
|
||||
|
||||
$this->options = Options::init();
|
||||
|
||||
parent::__construct( $parent_page );
|
||||
|
||||
// Remove unnecessary $_GET parameters and prevent url duplications in _wp_http_referer input.
|
||||
$this->remove_get_parameters();
|
||||
}
|
||||
|
||||
/**
|
||||
* Link label of a tab.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_label() {
|
||||
|
||||
return esc_html__( 'Debug Events', 'wp-mail-smtp' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Title of a tab.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return $this->get_label();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register hooks.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public function hooks() {
|
||||
|
||||
add_action( 'wp_mail_smtp_admin_area_enqueue_assets', [ $this, 'enqueue_assets' ] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue required JS and CSS.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public function enqueue_assets() {
|
||||
|
||||
$min = WP::asset_min();
|
||||
|
||||
wp_enqueue_style(
|
||||
'wp-mail-smtp-flatpickr',
|
||||
wp_mail_smtp()->assets_url . '/css/vendor/flatpickr.min.css',
|
||||
[],
|
||||
'4.6.9'
|
||||
);
|
||||
wp_enqueue_script(
|
||||
'wp-mail-smtp-flatpickr',
|
||||
wp_mail_smtp()->assets_url . '/js/vendor/flatpickr.min.js',
|
||||
[ 'jquery' ],
|
||||
'4.6.9',
|
||||
true
|
||||
);
|
||||
|
||||
wp_enqueue_script(
|
||||
'wp-mail-smtp-tools-debug-events',
|
||||
wp_mail_smtp()->assets_url . "/js/smtp-tools-debug-events{$min}.js",
|
||||
[ 'jquery', 'wp-mail-smtp-flatpickr' ],
|
||||
WPMS_PLUGIN_VER,
|
||||
true
|
||||
);
|
||||
|
||||
wp_localize_script(
|
||||
'wp-mail-smtp-tools-debug-events',
|
||||
'wp_mail_smtp_tools_debug_events',
|
||||
[
|
||||
'lang_code' => sanitize_key( WP::get_language_code() ),
|
||||
'plugin_url' => wp_mail_smtp()->plugin_url,
|
||||
'loader' => wp_mail_smtp()->prepare_loader( 'blue' ),
|
||||
'texts' => [
|
||||
'delete_all_notice' => esc_html__( 'Are you sure you want to permanently delete all debug events?', 'wp-mail-smtp' ),
|
||||
'cancel' => esc_html__( 'Cancel', 'wp-mail-smtp' ),
|
||||
'close' => esc_html__( 'Close', 'wp-mail-smtp' ),
|
||||
'yes' => esc_html__( 'Yes', 'wp-mail-smtp' ),
|
||||
'ok' => esc_html__( 'OK', 'wp-mail-smtp' ),
|
||||
'notice_title' => esc_html__( 'Heads up!', 'wp-mail-smtp' ),
|
||||
'error_occurred' => esc_html__( 'An error occurred!', 'wp-mail-smtp' ),
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get email logs list table.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return Table
|
||||
*/
|
||||
public function get_table() {
|
||||
|
||||
if ( $this->table === null ) {
|
||||
$this->table = new Table();
|
||||
}
|
||||
|
||||
return $this->table;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display scheduled actions table.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public function display() {
|
||||
|
||||
?>
|
||||
<?php if( WP::use_global_plugin_settings() && ! current_user_can( 'manage_network_options' ) ) : ?>
|
||||
<!-- 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-field">
|
||||
<h2><?php esc_html_e( 'Debug Events', 'wp-mail-smtp' ); ?></h2>
|
||||
</div>
|
||||
<p>
|
||||
<?php esc_html_e( 'On this page, you can view different plugin debugging events and email sending errors.', 'wp-mail-smtp' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<form method="POST" action="<?php echo esc_url( $this->get_link() ); ?>">
|
||||
<?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-field">
|
||||
<h2><?php esc_html_e( 'Debug Events', 'wp-mail-smtp' ); ?></h2>
|
||||
</div>
|
||||
<p>
|
||||
<?php esc_html_e( 'On this page, you can view and configure different plugin debugging events. View email sending errors and enable debugging events, allowing you to detect email sending issues.', 'wp-mail-smtp' ); ?>
|
||||
</p>
|
||||
</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 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>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="wp-mail-smtp-setting-row-debug_events_retention_period" class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-select wp-mail-smtp-clear">
|
||||
<div class="wp-mail-smtp-setting-label">
|
||||
<label for="wp-mail-smtp-setting-debug_events_retention_period">
|
||||
<?php esc_html_e( 'Events Retention Period', 'wp-mail-smtp' ); ?>
|
||||
</label>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-setting-field">
|
||||
<select name="wp-mail-smtp[debug_events][retention_period]" id="wp-mail-smtp-setting-debug_events_retention_period"
|
||||
<?php disabled( $this->options->is_const_defined( 'debug_events', 'retention_period' ) ); ?>>
|
||||
<option value=""><?php esc_html_e( 'Forever', 'wp-mail-smtp' ); ?></option>
|
||||
<?php foreach ( $this->get_debug_events_retention_period_options() as $value => $label ) : ?>
|
||||
<option value="<?php echo esc_attr( $value ); ?>" <?php selected( $this->options->get( 'debug_events', 'retention_period' ), $value ); ?>>
|
||||
<?php echo esc_html( $label ); ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<p class="desc">
|
||||
<?php
|
||||
esc_html_e( 'Debug events older than the selected period will be permanently deleted from the database.', 'wp-mail-smtp' );
|
||||
|
||||
if ( $this->options->is_const_defined( 'debug_events', 'retention_period' ) ) {
|
||||
//phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
echo '<br>' . $this->options->get_const_set_message( 'WPMS_DEBUG_EVENTS_RETENTION_PERIOD' );
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php $this->display_save_btn(); ?>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
|
||||
if ( ! DebugEvents::is_valid_db() ) {
|
||||
$this->display_debug_events_not_installed();
|
||||
} else {
|
||||
$table = $this->get_table();
|
||||
$table->prepare_items();
|
||||
|
||||
?>
|
||||
<form action="<?php echo esc_url( $this->get_link() ); ?>" method="get">
|
||||
<input type="hidden" name="page" value="<?php echo esc_attr( Area::SLUG . '-tools' ); ?>" />
|
||||
<input type="hidden" name="tab" value="<?php echo esc_attr( $this->get_slug() ); ?>" />
|
||||
<?php
|
||||
|
||||
// State of status filter for submission with other filters.
|
||||
if ( $table->get_filtered_types() !== false ) {
|
||||
printf( '<input type="hidden" name="type" value="%s">', esc_attr( $table->get_filtered_types() ) );
|
||||
}
|
||||
|
||||
if ( $this->get_filters_html() ) {
|
||||
?>
|
||||
<div id="wp-mail-smtp-reset-filter">
|
||||
<?php
|
||||
$type = $table->get_filtered_types();
|
||||
|
||||
echo wp_kses(
|
||||
sprintf( /* translators: %1$s - number of debug events found; %2$s - filtered type. */
|
||||
_n(
|
||||
'Found <strong>%1$s %2$s event</strong>',
|
||||
'Found <strong>%1$s %2$s events</strong>',
|
||||
absint( $table->get_pagination_arg( 'total_items' ) ),
|
||||
'wp-mail-smtp'
|
||||
),
|
||||
absint( $table->get_pagination_arg( 'total_items' ) ),
|
||||
$type !== false && isset( $table->get_types()[ $type ] ) ? $table->get_types()[ $type ] : ''
|
||||
),
|
||||
[
|
||||
'strong' => [],
|
||||
]
|
||||
);
|
||||
?>
|
||||
|
||||
<?php foreach ( $this->get_filters_html() as $id => $html ) : ?>
|
||||
<?php
|
||||
echo wp_kses(
|
||||
$html,
|
||||
[ 'em' => [] ]
|
||||
);
|
||||
?>
|
||||
<i class="reset dashicons dashicons-dismiss" data-scope="<?php echo esc_attr( $id ); ?>"></i>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
$table->search_box(
|
||||
esc_html__( 'Search Events', 'wp-mail-smtp' ),
|
||||
Area::SLUG . '-debug-events-search-input'
|
||||
);
|
||||
|
||||
$table->views();
|
||||
$table->display();
|
||||
?>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Process tab form submission ($_POST ).
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param array $data Post data specific for the plugin.
|
||||
*/
|
||||
public function process_post( $data ) {
|
||||
|
||||
$this->check_admin_referer();
|
||||
|
||||
if ( WP::use_global_plugin_settings() && ! current_user_can( 'manage_network_options' ) ) {
|
||||
wp_die( esc_html__( 'You don\'t have the capability to perform this action.', 'wp-mail-smtp' ) );
|
||||
}
|
||||
|
||||
// Unchecked checkboxes doesn't exist in $_POST, so we need to ensure we actually have them in data to save.
|
||||
if ( empty( $data['debug_events']['email_debug'] ) ) {
|
||||
$data['debug_events']['email_debug'] = false;
|
||||
}
|
||||
|
||||
// All the sanitization is done there.
|
||||
$this->options->set( $data, false, false );
|
||||
|
||||
WP::add_admin_notice(
|
||||
esc_html__( 'Settings were successfully saved.', 'wp-mail-smtp' ),
|
||||
WP::ADMIN_NOTICE_SUCCESS
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array with information (HTML and id) for each filter for this current view.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function get_filters_html() {
|
||||
|
||||
$filters = [
|
||||
'.search-box' => $this->get_filter_search_html(),
|
||||
'.wp-mail-smtp-filter-date' => $this->get_filter_date_html(),
|
||||
];
|
||||
|
||||
return array_filter( $filters );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return HTML with information about the search filter.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function get_filter_search_html() {
|
||||
|
||||
$table = $this->get_table();
|
||||
$term = $table->get_filtered_search();
|
||||
|
||||
if ( $term === false ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return sprintf( /* translators: %s The searched term. */
|
||||
__( 'where event contains "%s"', 'wp-mail-smtp' ),
|
||||
'<em>' . esc_html( $term ) . '</em>'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return HTML with information about the date filter.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function get_filter_date_html() {
|
||||
|
||||
$table = $this->get_table();
|
||||
$dates = $table->get_filtered_dates();
|
||||
|
||||
if ( $dates === false ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$dates = array_map(
|
||||
function ( $date ) {
|
||||
return date_i18n( 'M j, Y', strtotime( $date ) );
|
||||
},
|
||||
$dates
|
||||
);
|
||||
|
||||
$html = '';
|
||||
|
||||
switch ( count( $dates ) ) {
|
||||
case 1:
|
||||
$html = sprintf( /* translators: %s - Date. */
|
||||
esc_html__( 'on %s', 'wp-mail-smtp' ),
|
||||
'<em>' . $dates[0] . '</em>'
|
||||
);
|
||||
break;
|
||||
case 2:
|
||||
$html = sprintf( /* translators: %1$s - Date. %2$s - Date. */
|
||||
esc_html__( 'between %1$s and %2$s', 'wp-mail-smtp' ),
|
||||
'<em>' . $dates[0] . '</em>',
|
||||
'<em>' . $dates[1] . '</em>'
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a message when debug events DB table is missing.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
private function display_debug_events_not_installed() {
|
||||
|
||||
$error_message = get_option( Migration::ERROR_OPTION_NAME );
|
||||
?>
|
||||
|
||||
<div class="notice-inline notice-error">
|
||||
<h3><?php esc_html_e( 'Debug Events are Not Installed Correctly', 'wp-mail-smtp' ); ?></h3>
|
||||
|
||||
<p>
|
||||
<?php
|
||||
if ( ! empty( $error_message ) ) {
|
||||
esc_html_e( 'The database table was not installed correctly. Please contact plugin support to diagnose and fix the issue. Provide them the error message below:', 'wp-mail-smtp' );
|
||||
echo '<br><br>';
|
||||
echo '<code>' . esc_html( $error_message ) . '</code>';
|
||||
} else {
|
||||
esc_html_e( 'For some reason the database table was not installed correctly. Please contact plugin support team to diagnose and fix the issue.', 'wp-mail-smtp' );
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove unnecessary $_GET parameters for shorter URL.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
protected function remove_get_parameters() {
|
||||
|
||||
if ( isset( $_SERVER['REQUEST_URI'] ) ) {
|
||||
$_SERVER['REQUEST_URI'] = remove_query_arg(
|
||||
[
|
||||
'_wp_http_referer',
|
||||
'_wpnonce',
|
||||
'wp-mail-smtp-debug-events-nonce',
|
||||
],
|
||||
$_SERVER['REQUEST_URI'] // phpcs:ignore WordPress.Security.ValidatedSanitizedInput
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get debug events retention period options.
|
||||
*
|
||||
* @since 3.6.0
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_debug_events_retention_period_options() {
|
||||
|
||||
$options = [
|
||||
604800 => esc_html__( '1 Week', 'wp-mail-smtp' ),
|
||||
2628000 => esc_html__( '1 Month', 'wp-mail-smtp' ),
|
||||
7885000 => esc_html__( '3 Months', 'wp-mail-smtp' ),
|
||||
15770000 => esc_html__( '6 Months', 'wp-mail-smtp' ),
|
||||
31540000 => esc_html__( '1 Year', 'wp-mail-smtp' ),
|
||||
];
|
||||
|
||||
$debug_event_retention_period = $this->options->get( 'debug_events', 'retention_period' );
|
||||
|
||||
// Check if defined value already in list and add it if not.
|
||||
if (
|
||||
! empty( $debug_event_retention_period ) &&
|
||||
! isset( $options[ $debug_event_retention_period ] )
|
||||
) {
|
||||
$debug_event_retention_period_days = floor( $debug_event_retention_period / DAY_IN_SECONDS );
|
||||
|
||||
$options[ $debug_event_retention_period ] = sprintf(
|
||||
/* translators: %d - days count. */
|
||||
_n( '%d Day', '%d Days', $debug_event_retention_period_days, 'wp-mail-smtp' ),
|
||||
$debug_event_retention_period_days
|
||||
);
|
||||
|
||||
ksort( $options );
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter debug events retention period options.
|
||||
*
|
||||
* @since 3.6.0
|
||||
*
|
||||
* @param array $options Debug Events retention period options.
|
||||
* Option key in seconds.
|
||||
*/
|
||||
return apply_filters(
|
||||
'wp_mail_smtp_admin_pages_debug_events_tab_get_debug_events_retention_period_options',
|
||||
$options
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace WPMailSMTP\Admin\Pages;
|
||||
|
||||
use WPMailSMTP\Admin\ParentPageAbstract;
|
||||
|
||||
/**
|
||||
* Class EmailReports.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class EmailReports extends ParentPageAbstract {
|
||||
|
||||
/**
|
||||
* Page default tab slug.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $default_tab = 'reports';
|
||||
|
||||
/**
|
||||
* Slug of a page.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $slug = 'reports';
|
||||
|
||||
/**
|
||||
* Link label of a page.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_label() {
|
||||
|
||||
return esc_html__( 'Email Reports', 'wp-mail-smtp' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Title of a page.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return $this->get_label();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
<?php
|
||||
|
||||
namespace WPMailSMTP\Admin\Pages;
|
||||
|
||||
use WPMailSMTP\Admin\PageAbstract;
|
||||
|
||||
/**
|
||||
* Class EmailTrackingReportsTab is a placeholder for Pro email tracking reports.
|
||||
* Displays product education.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class EmailReportsTab extends PageAbstract {
|
||||
|
||||
/**
|
||||
* Part of the slug of a tab.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $slug = 'reports';
|
||||
|
||||
/**
|
||||
* Tab priority.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $priority = 10;
|
||||
|
||||
/**
|
||||
* Link label of a tab.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_label() {
|
||||
|
||||
return esc_html__( 'Email Reports', 'wp-mail-smtp' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Title of a tab.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return $this->get_label();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register hooks.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public function hooks() {
|
||||
|
||||
add_action( 'wp_mail_smtp_admin_area_enqueue_assets', [ $this, 'enqueue_assets' ] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue required JS and CSS.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public function enqueue_assets() {
|
||||
|
||||
wp_enqueue_style(
|
||||
'wp-mail-smtp-admin-lity',
|
||||
wp_mail_smtp()->assets_url . '/libs/lity/lity.min.css',
|
||||
[],
|
||||
'2.4.1'
|
||||
);
|
||||
wp_enqueue_script(
|
||||
'wp-mail-smtp-admin-lity',
|
||||
wp_mail_smtp()->assets_url . '/libs/lity/lity.min.js',
|
||||
[],
|
||||
'2.4.1',
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Output HTML of the email reports education.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public function display() {
|
||||
|
||||
$button_upgrade_link = wp_mail_smtp()->get_upgrade_link(
|
||||
[
|
||||
'medium' => 'email-reports',
|
||||
'content' => 'upgrade-to-wp-mail-smtp-pro-button-link',
|
||||
]
|
||||
);
|
||||
|
||||
$assets_url = wp_mail_smtp()->assets_url . '/images/email-reports/';
|
||||
$screenshots = [
|
||||
[
|
||||
'url' => $assets_url . 'screenshot-01.png',
|
||||
'url_thumbnail' => $assets_url . 'thumbnail-01.png',
|
||||
'title' => __( 'Stats at a Glance', 'wp-mail-smtp' ),
|
||||
],
|
||||
[
|
||||
'url' => $assets_url . 'screenshot-02.png',
|
||||
'url_thumbnail' => $assets_url . 'thumbnail-02.png',
|
||||
'title' => __( 'Detailed Stats by Subject Line', 'wp-mail-smtp' ),
|
||||
],
|
||||
[
|
||||
'url' => $assets_url . 'screenshot-03.png',
|
||||
'url_thumbnail' => $assets_url . 'thumbnail-03.png',
|
||||
'title' => __( 'Weekly Email Report', 'wp-mail-smtp' ),
|
||||
],
|
||||
];
|
||||
?>
|
||||
<div id="wp-mail-smtp-email-reports-product-education" class="wp-mail-smtp-product-education">
|
||||
<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' => [],
|
||||
],
|
||||
]
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="wp-mail-smtp-product-education__row">
|
||||
<div class="wp-mail-smtp-product-education__screenshots wp-mail-smtp-product-education__screenshots--three">
|
||||
<?php foreach ( $screenshots as $screenshot ) : ?>
|
||||
<div>
|
||||
<a href="<?php echo esc_url( $screenshot['url'] ); ?>" data-lity data-lity-desc="<?php echo esc_attr( $screenshot['title'] ); ?>">
|
||||
<img src="<?php echo esc_url( $screenshot['url_thumbnail'] ); ?>" alt="<?php esc_attr( $screenshot['title'] ); ?>">
|
||||
</a>
|
||||
<span><?php echo esc_html( $screenshot['title'] ); ?></span>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wp-mail-smtp-product-education__row">
|
||||
<div class="wp-mail-smtp-product-education__list">
|
||||
<h4><?php esc_html_e( 'Unlock these awesome reporting features:', 'wp-mail-smtp' ); ?></h4>
|
||||
<div>
|
||||
<ul>
|
||||
<li><?php esc_html_e( 'Get weekly deliverability reports', 'wp-mail-smtp' ); ?></li>
|
||||
<li><?php esc_html_e( 'View stats grouped by subject line', 'wp-mail-smtp' ); ?></li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><?php esc_html_e( 'Track total emails sent each week', 'wp-mail-smtp' ); ?></li>
|
||||
<li><?php esc_html_e( 'Measure open rate and click through rates', 'wp-mail-smtp' ); ?></li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><?php esc_html_e( 'Spot failed emails quickly', 'wp-mail-smtp' ); ?></li>
|
||||
<li><?php esc_html_e( 'See email report graphs in WordPress', 'wp-mail-smtp' ); ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
</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">
|
||||
<?php esc_html_e( 'Upgrade to WP Mail SMTP Pro', 'wp-mail-smtp' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
161
wp/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/ExportTab.php
Normal file
161
wp/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/ExportTab.php
Normal file
@@ -0,0 +1,161 @@
|
||||
<?php
|
||||
|
||||
namespace WPMailSMTP\Admin\Pages;
|
||||
|
||||
use WPMailSMTP\Admin\PageAbstract;
|
||||
|
||||
/**
|
||||
* Class ExportTab is a placeholder for Pro email logs export.
|
||||
* Displays product education.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*/
|
||||
class ExportTab extends PageAbstract {
|
||||
|
||||
/**
|
||||
* Part of the slug of a tab.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $slug = 'export';
|
||||
|
||||
/**
|
||||
* Tab priority.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $priority = 20;
|
||||
|
||||
/**
|
||||
* Link label of a tab.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_label() {
|
||||
|
||||
return esc_html__( 'Export', 'wp-mail-smtp' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Title of a tab.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return $this->get_label();
|
||||
}
|
||||
|
||||
/**
|
||||
* Output HTML of the email logs export form preview.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*/
|
||||
public function display() {
|
||||
|
||||
$button_upgrade_link = 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">
|
||||
<h4 class="wp-mail-smtp-product-education__heading">
|
||||
<?php esc_html_e( 'Export Email Logs', 'wp-mail-smtp' ); ?>
|
||||
</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' => [],
|
||||
],
|
||||
]
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="wp-mail-smtp-product-education__row wp-mail-smtp-product-education__row--inactive">
|
||||
<section class="wp-clearfix">
|
||||
<h5><?php esc_html_e( 'Export Type', 'wp-mail-smtp' ); ?></h5>
|
||||
<label>
|
||||
<input type="radio" checked><?php esc_html_e( 'Export in CSV (.csv)', 'wp-mail-smtp' ); ?>
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio"><?php esc_html_e( 'Export in Microsoft Excel (.xlsx)', 'wp-mail-smtp' ); ?>
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio"><?php esc_html_e( 'Export in EML (.eml)', 'wp-mail-smtp' ); ?>
|
||||
</label>
|
||||
</section>
|
||||
|
||||
<section class="wp-clearfix">
|
||||
<h5><?php esc_html_e( 'Common Information', 'wp-mail-smtp' ); ?></h5>
|
||||
<label><input type="checkbox" checked><?php esc_html_e( 'To Address', 'wp-mail-smtp' ); ?></label>
|
||||
<label><input type="checkbox" checked><?php esc_html_e( 'From Address', 'wp-mail-smtp' ); ?></label>
|
||||
<label><input type="checkbox" checked><?php esc_html_e( 'From Name', 'wp-mail-smtp' ); ?></label>
|
||||
<label><input type="checkbox" checked><?php esc_html_e( 'Subject', 'wp-mail-smtp' ); ?></label>
|
||||
<label><input type="checkbox" checked><?php esc_html_e( 'Body', 'wp-mail-smtp' ); ?></label>
|
||||
<label><input type="checkbox" checked><?php esc_html_e( 'Created Date', 'wp-mail-smtp' ); ?></label>
|
||||
<label><input type="checkbox" checked><?php esc_html_e( 'Number of Attachments', 'wp-mail-smtp' ); ?></label>
|
||||
<label><input type="checkbox" checked><?php esc_html_e( 'Attachments', 'wp-mail-smtp' ); ?></label>
|
||||
</section>
|
||||
|
||||
<section class="wp-clearfix">
|
||||
<h5><?php esc_html_e( 'Additional Information', 'wp-mail-smtp' ); ?></h5>
|
||||
<label><input type="checkbox"><?php esc_html_e( 'Status', 'wp-mail-smtp' ); ?></label>
|
||||
<label><input type="checkbox"><?php esc_html_e( 'Carbon Copy (CC)', 'wp-mail-smtp' ); ?></label>
|
||||
<label><input type="checkbox"><?php esc_html_e( 'Blind Carbon Copy (BCC)', 'wp-mail-smtp' ); ?></label>
|
||||
<label><input type="checkbox"><?php esc_html_e( 'Headers', 'wp-mail-smtp' ); ?></label>
|
||||
<label><input type="checkbox"><?php esc_html_e( 'Mailer', 'wp-mail-smtp' ); ?></label>
|
||||
<label><input type="checkbox"><?php esc_html_e( 'Error Details', 'wp-mail-smtp' ); ?></label>
|
||||
<label><input type="checkbox"><?php esc_html_e( 'Email log ID', 'wp-mail-smtp' ); ?></label>
|
||||
<label><input type="checkbox"><?php esc_html_e( 'Source', 'wp-mail-smtp' ); ?></label>
|
||||
</section>
|
||||
|
||||
<section class="wp-clearfix">
|
||||
<h5><?php esc_html_e( 'Custom Date Range', 'wp-mail-smtp' ); ?></h5>
|
||||
<input type="text" class="wp-mail-smtp-date-selector" placeholder="<?php esc_html_e( 'Select a date range', 'wp-mail-smtp' ); ?>">
|
||||
</section>
|
||||
|
||||
<section class="wp-clearfix">
|
||||
<h5><?php esc_html_e( 'Search', 'wp-mail-smtp' ); ?></h5>
|
||||
<select class="wp-mail-smtp-search-box-field">
|
||||
<option><?php esc_html_e( 'Email Addresses', 'wp-mail-smtp' ); ?></option>
|
||||
</select>
|
||||
<input type="text" class="wp-mail-smtp-search-box-term">
|
||||
</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">
|
||||
<?php esc_html_e( 'Upgrade to WP Mail SMTP Pro', 'wp-mail-smtp' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
68
wp/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/Logs.php
Normal file
68
wp/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/Logs.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace WPMailSMTP\Admin\Pages;
|
||||
|
||||
use WPMailSMTP\Admin\Area;
|
||||
use WPMailSMTP\Admin\PageAbstract;
|
||||
use WPMailSMTP\WP;
|
||||
|
||||
/**
|
||||
* Class Logs
|
||||
*/
|
||||
class Logs extends PageAbstract {
|
||||
|
||||
/**
|
||||
* Slug of a page.
|
||||
*
|
||||
* @since 1.5.0
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $slug = 'logs';
|
||||
|
||||
/**
|
||||
* Get the page/tab link.
|
||||
*
|
||||
* @since 1.5.0
|
||||
* @since 2.1.0 Changed the URL to point to the email log settings tab.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_link() {
|
||||
|
||||
return add_query_arg(
|
||||
'tab',
|
||||
$this->slug,
|
||||
WP::admin_url( 'admin.php?page=' . Area::SLUG )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Link label of a tab.
|
||||
*
|
||||
* @since 1.5.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_label() {
|
||||
return esc_html__( 'Email Log', 'wp-mail-smtp' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Title of a tab.
|
||||
*
|
||||
* @since 1.5.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
return $this->get_label();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tab content.
|
||||
*
|
||||
* @since 2.1.0 Moved the display content to the email log settings tab.
|
||||
*/
|
||||
public function display() {}
|
||||
}
|
||||
212
wp/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/LogsTab.php
Normal file
212
wp/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/LogsTab.php
Normal file
@@ -0,0 +1,212 @@
|
||||
<?php
|
||||
|
||||
namespace WPMailSMTP\Admin\Pages;
|
||||
|
||||
use WPMailSMTP\Admin\PageAbstract;
|
||||
use WPMailSMTP\Admin\ParentPageAbstract;
|
||||
|
||||
/**
|
||||
* Class LogsTab is a placeholder for Lite users and redirects them to Email Log page.
|
||||
*
|
||||
* @since 1.6.0
|
||||
*/
|
||||
class LogsTab extends PageAbstract {
|
||||
|
||||
/**
|
||||
* Part of the slug of a tab.
|
||||
*
|
||||
* @since 1.6.0
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $slug = 'logs';
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param ParentPageAbstract $parent_page Tab parent page.
|
||||
*/
|
||||
public function __construct( $parent_page = null ) {
|
||||
|
||||
parent::__construct( $parent_page );
|
||||
|
||||
$current_tab = isset( $_GET['tab'] ) ? sanitize_key( $_GET['tab'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
||||
|
||||
if ( wp_mail_smtp()->get_admin()->is_admin_page() && $current_tab === 'logs' ) {
|
||||
$this->hooks();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Link label of a tab.
|
||||
*
|
||||
* @since 1.6.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_label() {
|
||||
|
||||
return esc_html__( 'Email Log', 'wp-mail-smtp' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Title of a tab.
|
||||
*
|
||||
* @since 1.6.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return $this->get_label();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register hooks.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public function hooks() {
|
||||
|
||||
add_action( 'wp_mail_smtp_admin_area_enqueue_assets', [ $this, 'enqueue_assets' ] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue required JS and CSS.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public function enqueue_assets() {
|
||||
|
||||
wp_enqueue_style(
|
||||
'wp-mail-smtp-admin-lity',
|
||||
wp_mail_smtp()->assets_url . '/libs/lity/lity.min.css',
|
||||
[],
|
||||
'2.4.1'
|
||||
);
|
||||
wp_enqueue_script(
|
||||
'wp-mail-smtp-admin-lity',
|
||||
wp_mail_smtp()->assets_url . '/libs/lity/lity.min.js',
|
||||
[],
|
||||
'2.4.1',
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the upsell content for the Email Log feature.
|
||||
*
|
||||
* @since 1.6.0
|
||||
* @since 2.1.0 Moved the display content from the email log page (WP admin menu "Email Log" page).
|
||||
*/
|
||||
public function display() {
|
||||
|
||||
$button_upgrade_link = add_query_arg(
|
||||
[ 'discount' => 'LITEUPGRADE' ],
|
||||
wp_mail_smtp()->get_upgrade_link(
|
||||
[
|
||||
'medium' => 'logs',
|
||||
'content' => 'Upgrade to Pro Button',
|
||||
]
|
||||
)
|
||||
);
|
||||
$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 = [
|
||||
[
|
||||
'url' => $assets_url . 'archive.png',
|
||||
'url_thumbnail' => $assets_url . 'archive-thumbnail.png',
|
||||
'title' => __( 'Email Log Index', 'wp-mail-smtp' ),
|
||||
],
|
||||
[
|
||||
'url' => $assets_url . 'single.png',
|
||||
'url_thumbnail' => $assets_url . 'single-thumbnail.png',
|
||||
'title' => __( 'Individual Email Log', 'wp-mail-smtp' ),
|
||||
],
|
||||
];
|
||||
?>
|
||||
|
||||
<div id="wp-mail-smtp-email-logs-product-education" class="wp-mail-smtp-product-education">
|
||||
<div class="wp-mail-smtp-product-education__row">
|
||||
<h4 class="wp-mail-smtp-product-education__heading">
|
||||
<?php esc_html_e( 'Email Log', 'wp-mail-smtp' ); ?>
|
||||
</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' => [],
|
||||
],
|
||||
]
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="wp-mail-smtp-product-education__row">
|
||||
<div class="wp-mail-smtp-product-education__screenshots wp-mail-smtp-product-education__screenshots--two">
|
||||
<?php foreach ( $screenshots as $screenshot ) : ?>
|
||||
<div>
|
||||
<a href="<?php echo esc_url( $screenshot['url'] ); ?>" data-lity data-lity-desc="<?php echo esc_attr( $screenshot['title'] ); ?>">
|
||||
<img src="<?php echo esc_url( $screenshot['url_thumbnail'] ); ?>" alt="<?php esc_attr( $screenshot['title'] ); ?>">
|
||||
</a>
|
||||
<span><?php echo esc_html( $screenshot['title'] ); ?></span>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wp-mail-smtp-product-education__row">
|
||||
<div class="wp-mail-smtp-product-education__list">
|
||||
<h4><?php esc_html_e( 'Unlock these awesome logging features:', 'wp-mail-smtp' ); ?></h4>
|
||||
<div>
|
||||
<ul>
|
||||
<li><?php esc_html_e( 'Save detailed email headers', 'wp-mail-smtp' ); ?></li>
|
||||
<li><?php esc_html_e( 'See sent and failed emails', 'wp-mail-smtp' ); ?></li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><?php esc_html_e( 'Resend emails and attachments', 'wp-mail-smtp' ); ?></li>
|
||||
<li><?php esc_html_e( 'Track email opens and clicks', 'wp-mail-smtp' ); ?></li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><?php esc_html_e( 'Print email logs or save as PDF', 'wp-mail-smtp' ); ?></li>
|
||||
<li><?php esc_html_e( 'Export logs to CSV, XLSX, or EML', 'wp-mail-smtp' ); ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
</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">
|
||||
<?php esc_html_e( 'Upgrade to WP Mail SMTP Pro', 'wp-mail-smtp' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Not used as we are simply redirecting users.
|
||||
*
|
||||
* @since 1.6.0
|
||||
*
|
||||
* @param array $data Post data specific for the plugin.
|
||||
*/
|
||||
public function process_post( $data ) { }
|
||||
}
|
||||
353
wp/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/MiscTab.php
Normal file
353
wp/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/MiscTab.php
Normal file
@@ -0,0 +1,353 @@
|
||||
<?php
|
||||
|
||||
namespace WPMailSMTP\Admin\Pages;
|
||||
|
||||
use WPMailSMTP\Admin\Area;
|
||||
use WPMailSMTP\Admin\PageAbstract;
|
||||
use WPMailSMTP\Options;
|
||||
use WPMailSMTP\UsageTracking\UsageTracking;
|
||||
use WPMailSMTP\Reports\Emails\Summary as SummaryReportEmail;
|
||||
use WPMailSMTP\Tasks\Reports\SummaryEmailTask as SummaryReportEmailTask;
|
||||
use WPMailSMTP\WP;
|
||||
|
||||
/**
|
||||
* Class MiscTab is part of Area, displays different plugin-related settings of the plugin (not related to emails).
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class MiscTab extends PageAbstract {
|
||||
|
||||
/**
|
||||
* Slug of a tab.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $slug = 'misc';
|
||||
|
||||
/**
|
||||
* Link label of a tab.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_label() {
|
||||
return esc_html__( 'Misc', 'wp-mail-smtp' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Title of a tab.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
return $this->get_label();
|
||||
}
|
||||
|
||||
/**
|
||||
* Output HTML of the misc settings.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function display() {
|
||||
|
||||
$options = Options::init();
|
||||
?>
|
||||
|
||||
<form method="POST" action="">
|
||||
<?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-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 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>
|
||||
<p class="desc">
|
||||
<?php
|
||||
printf(
|
||||
wp_kses(
|
||||
__( 'Some plugins, like BuddyPress and Events Manager, are using their own email delivery solutions. By default, this option does not block their emails, as those plugins do not use default <code>wp_mail()</code> function to send emails.', 'wp-mail-smtp' ),
|
||||
[
|
||||
'code' => [],
|
||||
]
|
||||
)
|
||||
);
|
||||
?>
|
||||
<br>
|
||||
<?php esc_html_e( 'You will need to consult with their documentation to switch them to use default WordPress email delivery.', 'wp-mail-smtp' ); ?>
|
||||
<br>
|
||||
<?php esc_html_e( 'Test emails are allowed to be sent, regardless of this option.', 'wp-mail-smtp' ); ?>
|
||||
<br>
|
||||
<?php
|
||||
if ( $options->is_const_defined( 'general', 'do_not_send' ) ) {
|
||||
echo $options->get_const_set_message( 'WPMS_DO_NOT_SEND' ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
} else {
|
||||
printf(
|
||||
wp_kses( /* translators: %s - The URL to the constants support article. */
|
||||
__( 'Please read this <a href="%s" target="_blank" rel="noopener noreferrer">support article</a> if you want to enable this option using constants.', 'wp-mail-smtp' ),
|
||||
[
|
||||
'a' => [
|
||||
'href' => [],
|
||||
'target' => [],
|
||||
'rel' => [],
|
||||
],
|
||||
]
|
||||
),
|
||||
// phpcs:ignore WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
|
||||
esc_url( wp_mail_smtp()->get_utm_url( 'https://wpmailsmtp.com/docs/how-to-secure-smtp-settings-by-using-constants/', [ 'medium' => 'misc-settings', 'content' => 'Do not send setting description - support article' ] ) )
|
||||
);
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</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 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 esc_html_e( 'Hide plugin announcements and update details.', 'wp-mail-smtp' ); ?>
|
||||
</label>
|
||||
</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">
|
||||
<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' ); ?>
|
||||
</label>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-setting-field">
|
||||
<?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 esc_html_e( 'Hide warnings alerting of email delivery errors.', 'wp-mail-smtp' ); ?>
|
||||
</label>
|
||||
|
||||
<?php if ( $is_hard_disabled ) : ?>
|
||||
<p class="desc">
|
||||
<?php
|
||||
printf( /* translators: %s - filter that was used to disabled. */
|
||||
esc_html__( 'Email Delivery Errors were disabled using a %s filter.', 'wp-mail-smtp' ),
|
||||
'<code>wp_mail_smtp_admin_is_error_delivery_notice_enabled</code>'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<?php else : ?>
|
||||
<p class="desc">
|
||||
<?php
|
||||
echo wp_kses(
|
||||
__( '<strong>This is not recommended</strong> and should only be done for staging or development sites.', 'wp-mail-smtp' ),
|
||||
[
|
||||
'strong' => [],
|
||||
]
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</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 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 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>
|
||||
</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 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 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>
|
||||
</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 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>
|
||||
<p class="desc">
|
||||
<?php
|
||||
if ( wp_mail_smtp()->is_pro() && empty( Options::init()->get( 'logs', 'enabled' ) ) ) {
|
||||
echo wp_kses(
|
||||
sprintf( /* translators: %s - Email Log settings url. */
|
||||
__( 'Please enable <a href="%s">Email Logging</a> first, before this setting can be configured.', 'wp-mail-smtp' ),
|
||||
esc_url( wp_mail_smtp()->get_admin()->get_admin_page_url( Area::SLUG . '&tab=logs' ) )
|
||||
),
|
||||
[
|
||||
'a' => [
|
||||
'href' => [],
|
||||
],
|
||||
]
|
||||
);
|
||||
} else {
|
||||
printf(
|
||||
'<a href="%1$s" target="_blank">%2$s</a>',
|
||||
esc_url( SummaryReportEmail::get_preview_link() ),
|
||||
esc_html__( 'View Email Summary Example', 'wp-mail-smtp' )
|
||||
);
|
||||
}
|
||||
|
||||
if ( $options->is_const_defined( 'general', SummaryReportEmail::SETTINGS_SLUG ) ) {
|
||||
echo '<br>' . $options->get_const_set_message( 'WPMS_SUMMARY_REPORT_EMAIL_DISABLED' ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php $this->display_save_btn(); ?>
|
||||
|
||||
</form>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Process tab form submission ($_POST).
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @since 2.2.0 Fixed checkbox saving and use the correct merge to prevent breaking other 'general' checkboxes.
|
||||
*
|
||||
* @param array $data Tab data specific for the plugin ($_POST).
|
||||
*/
|
||||
public function process_post( $data ) { // phpcs:ignore Generic.Metrics.CyclomaticComplexity.TooHigh
|
||||
|
||||
$this->check_admin_referer();
|
||||
|
||||
$options = Options::init();
|
||||
|
||||
// Unchecked checkboxes doesn't exist in $_POST, so we need to ensure we actually have them in data to save.
|
||||
if ( empty( $data['general']['do_not_send'] ) ) {
|
||||
$data['general']['do_not_send'] = false;
|
||||
}
|
||||
if ( empty( $data['general']['am_notifications_hidden'] ) ) {
|
||||
$data['general']['am_notifications_hidden'] = false;
|
||||
}
|
||||
if ( empty( $data['general']['email_delivery_errors_hidden'] ) ) {
|
||||
$data['general']['email_delivery_errors_hidden'] = false;
|
||||
}
|
||||
if ( empty( $data['general']['dashboard_widget_hidden'] ) ) {
|
||||
$data['general']['dashboard_widget_hidden'] = false;
|
||||
}
|
||||
if ( empty( $data['general']['uninstall'] ) ) {
|
||||
$data['general']['uninstall'] = false;
|
||||
}
|
||||
if ( empty( $data['general'][ UsageTracking::SETTINGS_SLUG ] ) ) {
|
||||
$data['general'][ UsageTracking::SETTINGS_SLUG ] = false;
|
||||
}
|
||||
if ( empty( $data['general'][ SummaryReportEmail::SETTINGS_SLUG ] ) ) {
|
||||
$data['general'][ SummaryReportEmail::SETTINGS_SLUG ] = false;
|
||||
}
|
||||
|
||||
$is_summary_report_email_opt_changed = $options->is_option_changed(
|
||||
$options->parse_boolean( $data['general'][ SummaryReportEmail::SETTINGS_SLUG ] ),
|
||||
'general',
|
||||
SummaryReportEmail::SETTINGS_SLUG
|
||||
);
|
||||
|
||||
// If this option was changed, cancel summary report email task.
|
||||
if ( $is_summary_report_email_opt_changed ) {
|
||||
( new SummaryReportEmailTask() )->cancel();
|
||||
}
|
||||
|
||||
// All the sanitization is done there.
|
||||
$options->set( $data, false, false );
|
||||
|
||||
WP::add_admin_notice(
|
||||
esc_html__( 'Settings were successfully saved.', 'wp-mail-smtp' ),
|
||||
WP::ADMIN_NOTICE_SUCCESS
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,444 @@
|
||||
<?php
|
||||
|
||||
namespace WPMailSMTP\Admin\Pages;
|
||||
|
||||
use WPMailSMTP\Admin\ConnectionSettings;
|
||||
use WPMailSMTP\Admin\PageAbstract;
|
||||
use WPMailSMTP\Admin\SetupWizard;
|
||||
use WPMailSMTP\Options;
|
||||
use WPMailSMTP\Providers\Gmail\Auth;
|
||||
use WPMailSMTP\WP;
|
||||
|
||||
/**
|
||||
* Class SettingsTab is part of Area, displays general settings of the plugin.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class SettingsTab extends PageAbstract {
|
||||
|
||||
/**
|
||||
* Settings constructor.
|
||||
*
|
||||
* @since 1.5.0
|
||||
*/
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
|
||||
add_action( 'wp_mail_smtp_admin_pages_settings_license_key', array( __CLASS__, 'display_license_key_field_content' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @var string Slug of a tab.
|
||||
*/
|
||||
protected $slug = 'settings';
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function get_label() {
|
||||
return esc_html__( 'General', 'wp-mail-smtp' );
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function get_title() {
|
||||
return $this->get_label();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function display() {
|
||||
|
||||
$options = Options::init();
|
||||
?>
|
||||
|
||||
<form method="POST" action="" autocomplete="off" class="wp-mail-smtp-connection-settings-form">
|
||||
<?php $this->wp_nonce_field(); ?>
|
||||
|
||||
<?php ob_start(); ?>
|
||||
|
||||
<!-- License 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-license-heading">
|
||||
<div class="wp-mail-smtp-setting-field">
|
||||
<h2><?php esc_html_e( 'License', 'wp-mail-smtp' ); ?></h2>
|
||||
|
||||
<p class="desc">
|
||||
<?php esc_html_e( 'Your license key provides access to updates and support.', 'wp-mail-smtp' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- License Key -->
|
||||
<div id="wp-mail-smtp-setting-row-license_key" class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-license_key wp-mail-smtp-clear">
|
||||
<div class="wp-mail-smtp-setting-label">
|
||||
<label for="wp-mail-smtp-setting-license_key"><?php esc_html_e( 'License Key', 'wp-mail-smtp' ); ?></label>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-setting-field">
|
||||
<?php do_action( 'wp_mail_smtp_admin_pages_settings_license_key', $options ); ?>
|
||||
</div>
|
||||
</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-field">
|
||||
<h2><?php esc_html_e( 'Primary Connection', 'wp-mail-smtp' ); ?></h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ( ! is_network_admin() ) : ?>
|
||||
<!-- Setup Wizard button -->
|
||||
<div id="wp-mail-smtp-setting-row-setup-wizard-button" 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( 'Setup Wizard', 'wp-mail-smtp' ); ?></label>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-setting-field">
|
||||
<a href="<?php echo esc_url( SetupWizard::get_site_url() ); ?>" class="wp-mail-smtp-btn wp-mail-smtp-btn-md wp-mail-smtp-btn-blueish">
|
||||
<?php esc_html_e( 'Launch Setup Wizard', 'wp-mail-smtp' ); ?>
|
||||
</a>
|
||||
|
||||
<p class="desc">
|
||||
<?php esc_html_e( 'We\'ll guide you through each step needed to get WP Mail SMTP fully set up on your site.', 'wp-mail-smtp' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
$connection = wp_mail_smtp()->get_connections_manager()->get_primary_connection();
|
||||
$connection_settings = new ConnectionSettings( $connection );
|
||||
|
||||
// Display connection settings.
|
||||
$connection_settings->display();
|
||||
?>
|
||||
|
||||
<?php $this->display_backup_connection_education(); ?>
|
||||
|
||||
<?php
|
||||
$settings_content = apply_filters( 'wp_mail_smtp_admin_settings_tab_display', ob_get_clean() );
|
||||
echo $settings_content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
?>
|
||||
|
||||
<?php $this->display_save_btn(); ?>
|
||||
|
||||
</form>
|
||||
|
||||
<?php
|
||||
$this->display_wpforms();
|
||||
$this->display_pro_banner();
|
||||
}
|
||||
|
||||
/**
|
||||
* License key text for a Lite version of the plugin.
|
||||
*
|
||||
* @since 1.5.0
|
||||
*
|
||||
* @param Options $options
|
||||
*/
|
||||
public static function display_license_key_field_content( $options ) {
|
||||
?>
|
||||
|
||||
<p><?php esc_html_e( 'You\'re using WP Mail SMTP Lite - no license needed. Enjoy!', 'wp-mail-smtp' ); ?> 🙂</p>
|
||||
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
wp_kses( /* translators: %s - WPMailSMTP.com upgrade URL. */
|
||||
__( 'To unlock more features, consider <strong><a href="%s" target="_blank" rel="noopener noreferrer" class="wp-mail-smtp-upgrade-modal">upgrading to PRO</a></strong>.', 'wp-mail-smtp' ),
|
||||
array(
|
||||
'a' => array(
|
||||
'href' => array(),
|
||||
'class' => array(),
|
||||
'target' => array(),
|
||||
'rel' => array(),
|
||||
),
|
||||
'strong' => array(),
|
||||
)
|
||||
),
|
||||
esc_url( wp_mail_smtp()->get_upgrade_link( 'general-license-key' ) )
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
|
||||
<p class="desc">
|
||||
<?php
|
||||
printf(
|
||||
wp_kses( /* Translators: %s - discount value $50 */
|
||||
__( 'As a valued WP Mail SMTP Lite user you receive <strong>%s off</strong>, automatically applied at checkout!', 'wp-mail-smtp' ),
|
||||
array(
|
||||
'strong' => array(),
|
||||
'br' => array(),
|
||||
)
|
||||
),
|
||||
'$50'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<p>
|
||||
<?php esc_html_e( 'Already purchased? Simply enter your license key below to connect with WP Mail SMTP Pro!', 'wp-mail-smtp' ); ?>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<input type="password" id="wp-mail-smtp-setting-upgrade-license-key" class="wp-mail-smtp-not-form-input" placeholder="<?php esc_attr_e( 'Paste license key here', 'wp-mail-smtp' ); ?>" value="" />
|
||||
<button type="button" class="wp-mail-smtp-btn wp-mail-smtp-btn-md wp-mail-smtp-btn-orange" id="wp-mail-smtp-setting-upgrade-license-button">
|
||||
<?php esc_attr_e( 'Connect', 'wp-mail-smtp' ); ?>
|
||||
</button>
|
||||
</p>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a WPForms related message.
|
||||
*
|
||||
* @since 1.3.0
|
||||
* @since 1.4.0 Display only to site admins.
|
||||
* @since 1.5.0 Do nothing.
|
||||
*/
|
||||
protected function display_wpforms() {
|
||||
/*
|
||||
* Used to have this check:
|
||||
*
|
||||
* $is_dismissed = get_user_meta( get_current_user_id(), 'wp_mail_smtp_wpforms_dismissed', true );
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Display WP Mail SMTP Pro upgrade banner.
|
||||
*
|
||||
* @since 1.5.0
|
||||
*/
|
||||
protected function display_pro_banner() {
|
||||
|
||||
// Display only to site admins. Only site admins can install plugins.
|
||||
if ( ! is_super_admin() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Do not display if WP Mail SMTP Pro already installed.
|
||||
if ( wp_mail_smtp()->is_pro() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$is_dismissed = get_user_meta( get_current_user_id(), 'wp_mail_smtp_pro_banner_dismissed', true );
|
||||
|
||||
// Do not display if user dismissed.
|
||||
if ( (bool) $is_dismissed === true ) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="wp-mail-smtp-pro-banner">
|
||||
|
||||
<span class="wp-mail-smtp-pro-banner-dismiss">
|
||||
<button id="wp-mail-smtp-pro-banner-dismiss">
|
||||
<span class="dashicons dashicons-dismiss"></span>
|
||||
</button>
|
||||
</span>
|
||||
|
||||
<h2>
|
||||
<?php esc_html_e( 'Get WP Mail SMTP Pro and Unlock all the Powerful Features', 'wp-mail-smtp' ); ?>
|
||||
</h2>
|
||||
|
||||
<p>
|
||||
<?php esc_html_e( 'Thanks for being a loyal WP Mail SMTP user. Upgrade to WP Mail SMTP Pro to unlock more awesome features and experience why WP Mail SMTP is the most popular SMTP plugin.', 'wp-mail-smtp' ); ?>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<?php esc_html_e( 'We know that you will truly love WP Mail SMTP. It\'s used by over 3,000,000 websites.', 'wp-mail-smtp' ); ?>
|
||||
</p>
|
||||
|
||||
<p><strong><?php esc_html_e( 'Pro Features:', 'wp-mail-smtp' ); ?></strong></p>
|
||||
|
||||
<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( '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( '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( '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>
|
||||
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
wp_kses( /* translators: %s - WPMailSMTP.com URL. */
|
||||
__( '<a href="%s" target="_blank" rel="noopener noreferrer">Get WP Mail SMTP Pro Today and Unlock all the Powerful Features »</a>', 'wp-mail-smtp' ),
|
||||
array(
|
||||
'a' => array(
|
||||
'href' => array(),
|
||||
'target' => array(),
|
||||
'rel' => array(),
|
||||
),
|
||||
'strong' => array(),
|
||||
)
|
||||
),
|
||||
esc_url( wp_mail_smtp()->get_upgrade_link( 'general-cta' ) )
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
wp_kses( /* Translators: %s - discount value $50. */
|
||||
__( '<strong>Bonus:</strong> WP Mail SMTP users get <span class="price-off">%s off regular price</span>, automatically applied at checkout.', 'wp-mail-smtp' ),
|
||||
array(
|
||||
'strong' => array(),
|
||||
'span' => array(
|
||||
'class' => array(),
|
||||
),
|
||||
)
|
||||
),
|
||||
'$50'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Display backup connection education section.
|
||||
*
|
||||
* @since 3.7.0
|
||||
*/
|
||||
private function display_backup_connection_education() {
|
||||
|
||||
if ( wp_mail_smtp()->is_pro() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$upgrade_link_url = wp_mail_smtp()->get_upgrade_link(
|
||||
[
|
||||
'medium' => 'Backup Connection Settings',
|
||||
'content' => 'Upgrade to WP Mail SMTP Pro Link',
|
||||
]
|
||||
);
|
||||
?>
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-setting-row-content wp-mail-smtp-clear section-heading">
|
||||
<div class="wp-mail-smtp-setting-field">
|
||||
<h4 class="wp-mail-smtp-product-education__heading">
|
||||
<?php esc_html_e( 'Backup Connection', 'wp-mail-smtp' ); ?>
|
||||
</h4>
|
||||
<p class="wp-mail-smtp-product-education__description">
|
||||
<?php
|
||||
echo wp_kses(
|
||||
sprintf( /* translators: %s - WPMailSMTP.com Upgrade page URL. */
|
||||
__( 'Don’t worry about losing emails. Add an additional connection, then set it as your Backup Connection. Emails that fail to send with the Primary Connection will be sent via the selected Backup 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' => [],
|
||||
],
|
||||
]
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-setting-row wp-mail-smtp-clear">
|
||||
<div class="wp-mail-smtp-setting-label">
|
||||
<label>
|
||||
<?php esc_html_e( 'Backup Connection', 'wp-mail-smtp' ); ?>
|
||||
</label>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-setting-field">
|
||||
<div class="wp-mail-smtp-connection-selector">
|
||||
<label>
|
||||
<input type="radio" checked/>
|
||||
<span><?php esc_attr_e( 'None', 'wp-mail-smtp' ); ?></span>
|
||||
</label>
|
||||
</div>
|
||||
<p class="desc">
|
||||
<?php
|
||||
echo wp_kses(
|
||||
sprintf( /* translators: %s - Smart routing settings page url. */
|
||||
__( 'Once you add an <a href="%s">additional connection</a>, you can select it here.', 'wp-mail-smtp' ),
|
||||
add_query_arg(
|
||||
[
|
||||
'tab' => 'connections',
|
||||
],
|
||||
wp_mail_smtp()->get_admin()->get_admin_page_url()
|
||||
)
|
||||
),
|
||||
[
|
||||
'a' => [
|
||||
'href' => [],
|
||||
'target' => [],
|
||||
'rel' => [],
|
||||
],
|
||||
]
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Process tab form submission ($_POST ).
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @param array $data Post data specific for the plugin.
|
||||
*/
|
||||
public function process_post( $data ) {
|
||||
|
||||
$this->check_admin_referer();
|
||||
|
||||
$connection = wp_mail_smtp()->get_connections_manager()->get_primary_connection();
|
||||
$connection_settings = new ConnectionSettings( $connection );
|
||||
|
||||
$old_data = $connection->get_options()->get_all();
|
||||
|
||||
$data = $connection_settings->process( $data, $old_data );
|
||||
|
||||
/**
|
||||
* Filters mail settings before save.
|
||||
*
|
||||
* @since 2.2.1
|
||||
*
|
||||
* @param array $data Settings data.
|
||||
*/
|
||||
$data = apply_filters( 'wp_mail_smtp_settings_tab_process_post', $data );
|
||||
|
||||
// All the sanitization is done in Options class.
|
||||
Options::init()->set( $data, false, false );
|
||||
|
||||
$connection_settings->post_process( $data, $old_data );
|
||||
|
||||
if ( $connection_settings->get_scroll_to() !== false ) {
|
||||
// phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotValidated
|
||||
wp_safe_redirect( sanitize_text_field( wp_unslash( $_POST['_wp_http_referer'] ) ) . $connection_settings->get_scroll_to() );
|
||||
exit;
|
||||
}
|
||||
|
||||
WP::add_admin_notice(
|
||||
esc_html__( 'Settings were successfully saved.', 'wp-mail-smtp' ),
|
||||
WP::ADMIN_NOTICE_SUCCESS
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,324 @@
|
||||
<?php
|
||||
|
||||
namespace WPMailSMTP\Admin\Pages;
|
||||
|
||||
use WPMailSMTP\Admin\PageAbstract;
|
||||
use WPMailSMTP\WP;
|
||||
|
||||
/**
|
||||
* Class SmartRoutingTab is a placeholder for Pro smart routing feature.
|
||||
* Displays product education.
|
||||
*
|
||||
* @since 3.7.0
|
||||
*/
|
||||
class SmartRoutingTab extends PageAbstract {
|
||||
|
||||
/**
|
||||
* Part of the slug of a tab.
|
||||
*
|
||||
* @since 3.7.0
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $slug = 'routing';
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @since 3.7.0
|
||||
*
|
||||
* @param PageAbstract $parent_page Parent page object.
|
||||
*/
|
||||
public function __construct( $parent_page = null ) {
|
||||
|
||||
parent::__construct( $parent_page );
|
||||
|
||||
if ( wp_mail_smtp()->get_admin()->get_current_tab() === $this->slug && ! wp_mail_smtp()->is_pro() ) {
|
||||
$this->hooks();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Link label of a tab.
|
||||
*
|
||||
* @since 3.7.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_label() {
|
||||
|
||||
return esc_html__( 'Smart Routing', 'wp-mail-smtp' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Register hooks.
|
||||
*
|
||||
* @since 3.7.0
|
||||
*/
|
||||
public function hooks() {
|
||||
|
||||
add_action( 'wp_mail_smtp_admin_area_enqueue_assets', [ $this, 'enqueue_assets' ] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue required JS and CSS.
|
||||
*
|
||||
* @since 3.7.0
|
||||
*/
|
||||
public function enqueue_assets() {
|
||||
|
||||
$min = WP::asset_min();
|
||||
|
||||
wp_enqueue_style(
|
||||
'wp-mail-smtp-smart-routing',
|
||||
wp_mail_smtp()->plugin_url . "/assets/css/smtp-smart-routing{$min}.css",
|
||||
[],
|
||||
WPMS_PLUGIN_VER
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Output HTML of smart routing education.
|
||||
*
|
||||
* @since 3.7.0
|
||||
*/
|
||||
public function display() {
|
||||
|
||||
$upgrade_link_url = wp_mail_smtp()->get_upgrade_link(
|
||||
[
|
||||
'medium' => 'Smart Routing Settings',
|
||||
'content' => 'Upgrade to WP Mail SMTP Pro Link',
|
||||
]
|
||||
);
|
||||
|
||||
$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">
|
||||
<h4 class="wp-mail-smtp-product-education__heading">
|
||||
<?php esc_html_e( 'Smart Routing', 'wp-mail-smtp' ); ?>
|
||||
</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' => [],
|
||||
],
|
||||
]
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</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>
|
||||
</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">
|
||||
<div class="wp-mail-smtp-smart-routing-route">
|
||||
<div class="wp-mail-smtp-smart-routing-route__header">
|
||||
<span><?php esc_html_e( 'Send with', 'wp-mail-smtp' ); ?></span>
|
||||
<select class="wp-mail-smtp-smart-routing-route__connection">
|
||||
<option><?php esc_html_e( 'WooCommerce Emails (SendLayer)', 'wp-mail-smtp' ); ?></option>
|
||||
</select>
|
||||
<span><?php esc_html_e( 'if the following conditions are met...', 'wp-mail-smtp' ); ?></span>
|
||||
<div class="wp-mail-smtp-smart-routing-route__actions">
|
||||
<div class="wp-mail-smtp-smart-routing-route__order">
|
||||
<button class="wp-mail-smtp-smart-routing-route__order-btn wp-mail-smtp-smart-routing-route__order-btn--up">
|
||||
<img src="<?php echo esc_url( wp_mail_smtp()->assets_url . '/images/icons/arrow-up.svg' ); ?>" alt="<?php esc_attr_e( 'Arrow Up', 'wp-mail-smtp' ); ?>">
|
||||
</button>
|
||||
<button class="wp-mail-smtp-smart-routing-route__order-btn wp-mail-smtp-smart-routing-route__order-btn--down">
|
||||
<img src="<?php echo esc_url( wp_mail_smtp()->assets_url . '/images/icons/arrow-up.svg' ); ?>" alt="<?php esc_attr_e( 'Arrow Down', 'wp-mail-smtp' ); ?>">
|
||||
</button>
|
||||
</div>
|
||||
<button class="wp-mail-smtp-smart-routing-route__delete">
|
||||
<i class="dashicons dashicons-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-smart-routing-route__main">
|
||||
<div class="wp-mail-smtp-conditional">
|
||||
<div class="wp-mail-smtp-conditional__group">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr class="wp-mail-smtp-conditional__row">
|
||||
<td class="wp-mail-smtp-conditional__property-col">
|
||||
<select>
|
||||
<option><?php esc_html_e( 'Subject', 'wp-mail-smtp' ); ?></option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="wp-mail-smtp-conditional__operator-col">
|
||||
<select class="wp-mail-smtp-conditional__operator">
|
||||
<option><?php esc_html_e( 'Contains', 'wp-mail-smtp' ); ?></option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="wp-mail-smtp-conditional__value-col">
|
||||
<input type="text" value="<?php esc_html_e( 'Order', 'wp-mail-smtp' ); ?>" class="wp-mail-smtp-conditional__value">
|
||||
</td>
|
||||
<td class="wp-mail-smtp-conditional__actions">
|
||||
<button class="wp-mail-smtp-conditional__add-rule wp-mail-smtp-btn wp-mail-smtp-btn-md wp-mail-smtp-btn-grey">
|
||||
<?php esc_html_e( 'And', 'wp-mail-smtp' ); ?>
|
||||
</button>
|
||||
<button class="wp-mail-smtp-conditional__delete-rule">
|
||||
<i class="dashicons dashicons-trash" aria-hidden="true"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="wp-mail-smtp-conditional__row">
|
||||
<td class="wp-mail-smtp-conditional__property-col">
|
||||
<select class="wp-mail-smtp-conditional__property">
|
||||
<option><?php esc_html_e( 'From Email', 'wp-mail-smtp' ); ?></option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="wp-mail-smtp-conditional__operator-col">
|
||||
<select class="wp-mail-smtp-conditional__operator">
|
||||
<option><?php esc_html_e( 'Is', 'wp-mail-smtp' ); ?></option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="wp-mail-smtp-conditional__value-col">
|
||||
<input type="text" value="shop@wpmailsmtp.com" class="wp-mail-smtp-conditional__value">
|
||||
</td>
|
||||
<td class="wp-mail-smtp-conditional__actions">
|
||||
<button class="wp-mail-smtp-conditional__add-rule wp-mail-smtp-btn wp-mail-smtp-btn-md wp-mail-smtp-btn-grey">
|
||||
<?php esc_html_e( 'And', 'wp-mail-smtp' ); ?>
|
||||
</button>
|
||||
<button class="wp-mail-smtp-conditional__delete-rule">
|
||||
<i class="dashicons dashicons-trash" aria-hidden="true"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="wp-mail-smtp-conditional__group-delimiter"><?php esc_html_e( 'or', 'wp-mail-smtp' ); ?></div>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-conditional__group">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr class="wp-mail-smtp-conditional__row">
|
||||
<td class="wp-mail-smtp-conditional__property-col">
|
||||
<select class="wp-mail-smtp-conditional__property">
|
||||
<option><?php esc_html_e( 'From Email', 'wp-mail-smtp' ); ?></option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="wp-mail-smtp-conditional__operator-col">
|
||||
<select class="wp-mail-smtp-conditional__operator">
|
||||
<option><?php esc_html_e( 'Is', 'wp-mail-smtp' ); ?></option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="wp-mail-smtp-conditional__value-col">
|
||||
<input type="text" value="returns@wpmailsmtp.com" class="wp-mail-smtp-conditional__value">
|
||||
</td>
|
||||
<td class="wp-mail-smtp-conditional__actions">
|
||||
<button class="wp-mail-smtp-conditional__add-rule wp-mail-smtp-btn wp-mail-smtp-btn-md wp-mail-smtp-btn-grey">
|
||||
<?php esc_html_e( 'And', 'wp-mail-smtp' ); ?>
|
||||
</button>
|
||||
<button class="wp-mail-smtp-conditional__delete-rule">
|
||||
<i class="dashicons dashicons-trash" aria-hidden="true"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="wp-mail-smtp-conditional__group-delimiter"><?php esc_html_e( 'or', 'wp-mail-smtp' ); ?></div>
|
||||
</div>
|
||||
<button class="wp-mail-smtp-conditional__add-group wp-mail-smtp-btn wp-mail-smtp-btn-md wp-mail-smtp-btn-grey">
|
||||
<?php esc_html_e( 'Add New Group', 'wp-mail-smtp' ); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-smart-routing-route">
|
||||
<div class="wp-mail-smtp-smart-routing-route__header">
|
||||
<span><?php esc_html_e( 'Send with', 'wp-mail-smtp' ); ?></span>
|
||||
<select class="wp-mail-smtp-smart-routing-route__connection">
|
||||
<option><?php esc_html_e( 'Contact Emails (SMTP.com)', 'wp-mail-smtp' ); ?></option>
|
||||
</select>
|
||||
<span><?php esc_html_e( 'if the following conditions are met...', 'wp-mail-smtp' ); ?></span>
|
||||
<div class="wp-mail-smtp-smart-routing-route__actions">
|
||||
<div class="wp-mail-smtp-smart-routing-route__order">
|
||||
<button class="wp-mail-smtp-smart-routing-route__order-btn wp-mail-smtp-smart-routing-route__order-btn--up">
|
||||
<img src="<?php echo esc_url( wp_mail_smtp()->assets_url . '/images/icons/arrow-up.svg' ); ?>" alt="<?php esc_attr_e( 'Arrow Up', 'wp-mail-smtp' ); ?>">
|
||||
</button>
|
||||
<button class="wp-mail-smtp-smart-routing-route__order-btn wp-mail-smtp-smart-routing-route__order-btn--down">
|
||||
<img src="<?php echo esc_url( wp_mail_smtp()->assets_url . '/images/icons/arrow-up.svg' ); ?>" alt="<?php esc_attr_e( 'Arrow Down', 'wp-mail-smtp' ); ?>">
|
||||
</button>
|
||||
</div>
|
||||
<button class="wp-mail-smtp-smart-routing-route__delete">
|
||||
<i class="dashicons dashicons-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-smart-routing-route__main">
|
||||
<div class="wp-mail-smtp-conditional">
|
||||
<div class="wp-mail-smtp-conditional__group">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr class="wp-mail-smtp-conditional__row">
|
||||
<td class="wp-mail-smtp-conditional__property-col">
|
||||
<select>
|
||||
<option><?php esc_html_e( 'Initiator', 'wp-mail-smtp' ); ?></option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="wp-mail-smtp-conditional__operator-col">
|
||||
<select class="wp-mail-smtp-conditional__operator">
|
||||
<option><?php esc_html_e( 'Is', 'wp-mail-smtp' ); ?></option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="wp-mail-smtp-conditional__value-col">
|
||||
<input type="text" value="<?php esc_html_e( 'WPForms', 'wp-mail-smtp' ); ?>" class="wp-mail-smtp-conditional__value">
|
||||
</td>
|
||||
<td class="wp-mail-smtp-conditional__actions">
|
||||
<button class="wp-mail-smtp-conditional__add-rule wp-mail-smtp-btn wp-mail-smtp-btn-md wp-mail-smtp-btn-grey">
|
||||
<?php esc_html_e( 'And', 'wp-mail-smtp' ); ?>
|
||||
</button>
|
||||
<button class="wp-mail-smtp-conditional__delete-rule">
|
||||
<i class="dashicons dashicons-trash" aria-hidden="true"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="wp-mail-smtp-conditional__group-delimiter"><?php esc_html_e( 'or', 'wp-mail-smtp' ); ?></div>
|
||||
</div>
|
||||
<button class="wp-mail-smtp-conditional__add-group wp-mail-smtp-btn wp-mail-smtp-btn-md wp-mail-smtp-btn-grey">
|
||||
<?php esc_html_e( 'Add New Group', 'wp-mail-smtp' ); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-smart-routing-routes-note">
|
||||
<img src="<?php echo esc_url( wp_mail_smtp()->assets_url . '/images/icons/lightbulb.svg' ); ?>" alt="<?php esc_attr_e( 'Light bulb icon', 'wp-mail-smtp' ); ?>">
|
||||
<?php esc_html_e( 'Friendly reminder, your Primary Connection will be used for all emails that do not match the conditions above.', 'wp-mail-smtp' ); ?>
|
||||
</div>
|
||||
</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">
|
||||
<?php esc_html_e( 'Upgrade to WP Mail SMTP Pro', 'wp-mail-smtp' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
1580
wp/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/TestTab.php
Normal file
1580
wp/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/TestTab.php
Normal file
File diff suppressed because it is too large
Load Diff
55
wp/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/Tools.php
Normal file
55
wp/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/Tools.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace WPMailSMTP\Admin\Pages;
|
||||
|
||||
use WPMailSMTP\Admin\ParentPageAbstract;
|
||||
|
||||
/**
|
||||
* Class Tools.
|
||||
*
|
||||
* @since 2.8.0
|
||||
*/
|
||||
class Tools extends ParentPageAbstract {
|
||||
|
||||
/**
|
||||
* Slug of a page.
|
||||
*
|
||||
* @since 2.8.0
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $slug = 'tools';
|
||||
|
||||
/**
|
||||
* Page default tab slug.
|
||||
*
|
||||
* @since 2.8.0
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $default_tab = 'test';
|
||||
|
||||
/**
|
||||
* Link label of a page.
|
||||
*
|
||||
* @since 2.8.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_label() {
|
||||
|
||||
return esc_html__( 'Tools', 'wp-mail-smtp' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Title of a page.
|
||||
*
|
||||
* @since 2.8.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return $this->get_label();
|
||||
}
|
||||
}
|
||||
281
wp/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/VersusTab.php
Normal file
281
wp/wp-content/plugins/wp-mail-smtp/src/Admin/Pages/VersusTab.php
Normal file
@@ -0,0 +1,281 @@
|
||||
<?php
|
||||
|
||||
namespace WPMailSMTP\Admin\Pages;
|
||||
|
||||
use WPMailSMTP\Admin\PageAbstract;
|
||||
|
||||
/**
|
||||
* Versus tab.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*/
|
||||
class VersusTab extends PageAbstract {
|
||||
|
||||
/**
|
||||
* Part of the slug of a tab.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $slug = 'versus';
|
||||
|
||||
/**
|
||||
* Tab priority.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $priority = 40;
|
||||
|
||||
/**
|
||||
* Link label of a tab.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_label() {
|
||||
|
||||
return esc_html__( 'Lite vs Pro', 'wp-mail-smtp' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Title of a tab.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return $this->get_label();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tab content.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*/
|
||||
public function display() {
|
||||
|
||||
$license = wp_mail_smtp()->get_license_type();
|
||||
?>
|
||||
|
||||
<div class="wp-mail-smtp-admin-about-section wp-mail-smtp-admin-about-section-squashed">
|
||||
<h1 class="centered">
|
||||
<strong>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s - plugin current license type. */
|
||||
esc_html__( '%s vs Pro', 'wp-mail-smtp' ),
|
||||
esc_html( ucfirst( $license ) )
|
||||
);
|
||||
?>
|
||||
</strong>
|
||||
</h1>
|
||||
|
||||
<p class="centered <?php echo( $license === 'pro' ? 'hidden' : '' ); ?>">
|
||||
<?php esc_html_e( 'Get the most out of WP Mail SMTP by upgrading to Pro and unlocking all of the powerful features.', 'wp-mail-smtp' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="wp-mail-smtp-admin-about-section wp-mail-smtp-admin-about-section-squashed wp-mail-smtp-admin-about-section-hero wp-mail-smtp-admin-about-section-table">
|
||||
|
||||
<div class="wp-mail-smtp-admin-about-section-hero-main wp-mail-smtp-admin-columns">
|
||||
<div class="wp-mail-smtp-admin-column-33">
|
||||
<h3 class="no-margin">
|
||||
<?php esc_html_e( 'Feature', 'wp-mail-smtp' ); ?>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-admin-column-33">
|
||||
<h3 class="no-margin">
|
||||
<?php echo esc_html( ucfirst( $license ) ); ?>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-admin-column-33">
|
||||
<h3 class="no-margin">
|
||||
<?php esc_html_e( 'Pro', 'wp-mail-smtp' ); ?>
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wp-mail-smtp-admin-about-section-hero-extra no-padding wp-mail-smtp-admin-columns">
|
||||
|
||||
<table>
|
||||
<?php
|
||||
foreach ( $this->get_license_features() as $slug => $name ) {
|
||||
$current = $this->get_license_data( $slug, $license );
|
||||
$pro = $this->get_license_data( $slug, 'pro' );
|
||||
?>
|
||||
<tr class="wp-mail-smtp-admin-columns">
|
||||
<td class="wp-mail-smtp-admin-column-33">
|
||||
<p><?php echo esc_html( $name ); ?></p>
|
||||
</td>
|
||||
<td class="wp-mail-smtp-admin-column-33">
|
||||
<p class="features-<?php echo esc_attr( $current['status'] ); ?>">
|
||||
<?php echo implode( '<br>', $current['text'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</p>
|
||||
</td>
|
||||
<td class="wp-mail-smtp-admin-column-33">
|
||||
<p class="features-full">
|
||||
<?php echo implode( '<br>', $pro['text'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if ( 'lite' === $license ) : ?>
|
||||
<div class="wp-mail-smtp-admin-about-section wp-mail-smtp-admin-about-section-hero">
|
||||
<div class="wp-mail-smtp-admin-about-section-hero-main no-border">
|
||||
<h3 class="call-to-action centered">
|
||||
<a href="<?php echo esc_url( wp_mail_smtp()->get_upgrade_link( 'lite-vs-pro' ) ); ?>" target="_blank" rel="noopener noreferrer">
|
||||
<?php esc_html_e( 'Get WP Mail SMTP Pro Today and Unlock all of these Powerful Features', 'wp-mail-smtp' ); ?>
|
||||
</a>
|
||||
</h3>
|
||||
|
||||
<p class="centered">
|
||||
<?php
|
||||
printf(
|
||||
wp_kses( /* Translators: %s - discount value $50. */
|
||||
__( 'Bonus: WP Mail SMTP Lite users get <span class="price-off">%s off regular price</span>, automatically applied at checkout.', 'wp-mail-smtp' ),
|
||||
[
|
||||
'span' => [
|
||||
'class' => [],
|
||||
],
|
||||
]
|
||||
),
|
||||
'$50'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of features for all licenses.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function get_license_features() {
|
||||
|
||||
return [
|
||||
'log' => esc_html__( 'Email Log', 'wp-mail-smtp' ),
|
||||
'control' => esc_html__( 'Email Controls', 'wp-mail-smtp' ),
|
||||
'mailers' => esc_html__( 'Mailer Options', 'wp-mail-smtp' ),
|
||||
'multisite' => esc_html__( 'WordPress Multisite', 'wp-mail-smtp' ),
|
||||
'support' => esc_html__( 'Customer Support', 'wp-mail-smtp' ),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the array of data that compared the license data.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @param string $feature Feature name.
|
||||
* @param string $license License type to get data for.
|
||||
*
|
||||
* @return array|false
|
||||
*/
|
||||
private function get_license_data( $feature, $license ) {
|
||||
|
||||
$data = [
|
||||
'log' => [
|
||||
'lite' => [
|
||||
'status' => 'none',
|
||||
'text' => [
|
||||
'<strong>' . esc_html__( 'Emails are not logged', 'wp-mail-smtp' ) . '</strong>',
|
||||
],
|
||||
],
|
||||
'pro' => [
|
||||
'status' => 'full',
|
||||
'text' => [
|
||||
'<strong>' . esc_html__( 'Access to all Email Logging options right inside WordPress', 'wp-mail-smtp' ) . '</strong>',
|
||||
],
|
||||
],
|
||||
],
|
||||
'control' => [
|
||||
'lite' => [
|
||||
'status' => 'none',
|
||||
'text' => [
|
||||
'<strong>' . esc_html__( 'No controls over whether default WordPress emails are sent', 'wp-mail-smtp' ) . '</strong>',
|
||||
],
|
||||
],
|
||||
'pro' => [
|
||||
'status' => 'full',
|
||||
'text' => [
|
||||
'<strong>' . esc_html__( 'Complete Email Controls management for most default WordPress emails', 'wp-mail-smtp' ) . '</strong>',
|
||||
],
|
||||
],
|
||||
],
|
||||
'mailers' => [
|
||||
'lite' => [
|
||||
'status' => 'none',
|
||||
'text' => [
|
||||
'<strong>' . esc_html__( 'Limited Mailers', 'wp-mail-smtp' ) . '</strong><br>' . esc_html__( 'Access is limited to standard mailer options only', 'wp-mail-smtp' ),
|
||||
],
|
||||
],
|
||||
'pro' => [
|
||||
'status' => 'full',
|
||||
'text' => [
|
||||
'<strong>' . esc_html__( 'Additional Mailer Options', 'wp-mail-smtp' ) . '</strong><br>' . esc_html__( 'Microsoft Outlook (with Office365 support), Amazon SES and Zoho Mail', 'wp-mail-smtp' ),
|
||||
],
|
||||
],
|
||||
],
|
||||
'multisite' => [
|
||||
'lite' => [
|
||||
'status' => 'none',
|
||||
'text' => [
|
||||
'<strong>' . esc_html__( 'No Global Network Settings', 'wp-mail-smtp' ) . '</strong>',
|
||||
],
|
||||
],
|
||||
'pro' => [
|
||||
'status' => 'full',
|
||||
'text' => [
|
||||
'<strong>' . esc_html__( 'All Global Network Settings', 'wp-mail-smtp' ) . '</strong><br>' . esc_html__( 'Optionally configure settings at the network level or manage separately for each subsite', 'wp-mail-smtp' ),
|
||||
],
|
||||
],
|
||||
],
|
||||
'support' => [
|
||||
'lite' => [
|
||||
'status' => 'none',
|
||||
'text' => [
|
||||
'<strong>' . esc_html__( 'Limited Support', 'wp-mail-smtp' ) . '</strong>',
|
||||
],
|
||||
],
|
||||
'pro' => [
|
||||
'status' => 'full',
|
||||
'text' => [
|
||||
'<strong>' . esc_html__( 'Priority Support', 'wp-mail-smtp' ) . '</strong>',
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
// Wrong feature?
|
||||
if ( ! isset( $data[ $feature ] ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Wrong license type?
|
||||
if ( ! isset( $data[ $feature ][ $license ] ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $data[ $feature ][ $license ];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user