Файловый менеджер - Редактировать - /home/tuudkjt/globeasy/wp-includes/ID3/Pages.zip
Назад
PK 0/]�F'��F �F DebugEventsTab.phpnu ��� <?php namespace EasyWPSMTP\Admin\Pages; use EasyWPSMTP\Admin\Area; use EasyWPSMTP\Admin\DebugEvents\DebugEvents; use EasyWPSMTP\Admin\DebugEvents\Migration; use EasyWPSMTP\Admin\DebugEvents\Table; use EasyWPSMTP\Admin\PageAbstract; use EasyWPSMTP\Admin\ParentPageAbstract; use EasyWPSMTP\Options; use EasyWPSMTP\WP; /** * Debug Events settings page. * * @since 2.0.0 */ class DebugEventsTab extends PageAbstract { /** * Part of the slug of a tab. * * @since 2.0.0 * * @var string */ protected $slug = 'debug-events'; /** * Tab priority. * * @since 2.0.0 * * @var int */ protected $priority = 40; /** * Debug events list table. * * @since 2.0.0 * * @var Table */ protected $table = null; /** * Plugin options. * * @since 2.0.0 * * @var Options */ protected $options; /** * Constructor. * * @since 2.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 2.0.0 * * @return string */ public function get_label() { return esc_html__( 'Debug Events', 'easy-wp-smtp' ); } /** * Title of a tab. * * @since 2.0.0 * * @return string */ public function get_title() { return $this->get_label(); } /** * Register hooks. * * @since 2.0.0 */ public function hooks() { add_action( 'easy_wp_smtp_admin_area_enqueue_assets', [ $this, 'enqueue_assets' ] ); } /** * Enqueue required JS and CSS. * * @since 2.0.0 */ public function enqueue_assets() { $min = WP::asset_min(); wp_enqueue_style( 'easy-wp-smtp-flatpickr', easy_wp_smtp()->assets_url . '/css/vendor/flatpickr.min.css', [], '4.6.9' ); wp_enqueue_script( 'easy-wp-smtp-flatpickr', easy_wp_smtp()->assets_url . '/js/vendor/flatpickr.min.js', [ 'jquery' ], '4.6.9', true ); wp_enqueue_script( 'easy-wp-smtp-tools-debug-events', easy_wp_smtp()->assets_url . "/js/smtp-tools-debug-events{$min}.js", [ 'jquery', 'easy-wp-smtp-flatpickr' ], EasyWPSMTP_PLUGIN_VERSION, true ); wp_localize_script( 'easy-wp-smtp-tools-debug-events', 'easy_wp_smtp_tools_debug_events', [ 'lang_code' => sanitize_key( WP::get_language_code() ), 'plugin_url' => easy_wp_smtp()->plugin_url, 'loader' => easy_wp_smtp()->prepare_loader(), 'texts' => [ 'delete_all_notice' => esc_html__( 'Are you sure you want to permanently delete all debug events?', 'easy-wp-smtp' ), 'cancel' => esc_html__( 'Cancel', 'easy-wp-smtp' ), 'close' => esc_html__( 'Close', 'easy-wp-smtp' ), 'yes' => esc_html__( 'Yes', 'easy-wp-smtp' ), 'ok' => esc_html__( 'OK', 'easy-wp-smtp' ), 'notice_title' => esc_html__( 'Heads up!', 'easy-wp-smtp' ), 'error_occurred' => esc_html__( 'An error occurred!', 'easy-wp-smtp' ), ], ] ); } /** * Get email logs list table. * * @since 2.0.0 * * @return Table */ public function get_table() { if ( $this->table === null ) { $this->table = new Table(); } return $this->table; } /** * Display scheduled actions table. * * @since 2.0.0 */ public function display() { $can_manage_settings = ( ! is_multisite() || ( ! is_network_admin() && ! WP::use_global_plugin_settings() ) || ( is_network_admin() && current_user_can( 'manage_network_options' ) && WP::use_global_plugin_settings() ) ); ?> <?php if ( $can_manage_settings ) : ?> <form method="POST" action="<?php echo esc_url( $this->get_link() ); ?>"> <?php $this->wp_nonce_field(); ?> <?php endif; ?> <div class="easy-wp-smtp-meta-box"> <div class="easy-wp-smtp-meta-box__header"> <div class="easy-wp-smtp-meta-box__heading"> <?php esc_html_e( 'Debug Events', 'easy-wp-smtp' ); ?> </div> <?php /** * Fires after export Debug Events metabox title. * * @since 2.7.0 */ do_action( 'easy_wp_smtp_admin_page_tools_debug_events_metabox_heading_after' ); ?> </div> <div class="easy-wp-smtp-meta-box__content"> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-row__desc"> <p> <?php esc_html_e( 'Here, you can view and configure plugin debugging events to find and resolve email sending issues. You’ll also see any email sending errors that occur.', 'easy-wp-smtp' ); ?> </p> <?php if ( ! $can_manage_settings && is_network_admin() && current_user_can( 'manage_network_options' ) ) : ?> <p> <?php echo wp_kses( sprintf( /* translators: %1$s - create missing tables link; %2$s - contact support link. */ __( 'To configure debugging events for the whole network, <a href="%1$s">activate network-wide Settings Control</a>.', 'easy-wp-smtp' ), esc_url( easy_wp_smtp()->get_admin()->get_admin_page_url() ) ), [ 'a' => [ 'href' => [], 'target' => [], 'rel' => [], ], ] ); ?> </p> <?php endif; ?> </div> </div> <?php if ( $can_manage_settings ) : ?> <!-- Debug Events --> <div id="easy-wp-smtp-setting-row-debug_event_types" class="easy-wp-smtp-row easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <label for="easy-wp-smtp-setting-debug_event_types"> <?php esc_html_e( 'Event Types', 'easy-wp-smtp' ); ?> </label> </div> <div class="easy-wp-smtp-setting-row__field"> <div class="easy-wp-smtp-setting-row__sub-row"> <label class="easy-wp-smtp-toggle" for="easy-wp-smtp-setting-debug_events_email_errors"> <input name="easy-wp-smtp[debug_events][email_errors]" type="checkbox" value="true" checked disabled id="easy-wp-smtp-setting-debug_events_email_errors" /> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--static"><?php esc_html_e( 'Email Sending Errors', 'easy-wp-smtp' ); ?></span> </label> <p class="desc"> <?php esc_html_e( 'The Email Sending Errors debug event is always enabled and records any email sending errors in the table below.', 'easy-wp-smtp' ); ?> </p> </div> <div class="easy-wp-smtp-setting-row__sub-row"> <label class="easy-wp-smtp-toggle" for="easy-wp-smtp-setting-debug_events_email_debug"> <input name="easy-wp-smtp[debug_events][email_debug]" type="checkbox" value="true" <?php checked( true, $this->options->get( 'debug_events', 'email_debug' ) ); ?> id="easy-wp-smtp-setting-debug_events_email_debug" /> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--static"><?php esc_html_e( 'Debug Email Sending', 'easy-wp-smtp' ); ?></span> </label> <p class="desc"> <?php esc_html_e( 'Enable this setting to debug the email sending process. All debug events will be logged in the table below. This setting is recommended only for shorter debugging periods. Please disable it once you’re done troubleshooting.', 'easy-wp-smtp' ); ?> </p> </div> </div> </div> <div id="easy-wp-smtp-setting-row-debug_events_retention_period" class="easy-wp-smtp-row easy-wp-smtp-setting-row easy-wp-smtp-setting-row--text"> <div class="easy-wp-smtp-setting-row__label"> <label for="easy-wp-smtp-setting-debug_events_retention_period"> <?php esc_html_e( 'Events Retention Period', 'easy-wp-smtp' ); ?> </label> </div> <div class="easy-wp-smtp-setting-row__field"> <select name="easy-wp-smtp[debug_events][retention_period]" id="easy-wp-smtp-setting-debug_events_retention_period" <?php disabled( $this->options->is_const_defined( 'debug_events', 'retention_period' ) ); ?>> <option value=""><?php esc_html_e( 'Forever', 'easy-wp-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 that fall outside the chosen period will be permanently deleted from the database.', 'easy-wp-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( 'EASY_WP_SMTP_DEBUG_EVENTS_RETENTION_PERIOD' ); } ?> </p> </div> </div> <?php endif; ?> </div> </div> <?php if ( $can_manage_settings ) : ?> <?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" class="easy-wp-smtp-debug-events-table easy-wp-smtp-wp-list-table"> <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="easy-wp-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' ) ), 'easy-wp-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', 'easy-wp-smtp' ), Area::SLUG . '-debug-events-search-input' ); $table->views(); $table->display(); ?> </form> <?php } } /** * Process tab form submission ($_POST ). * * @since 2.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.', 'easy-wp-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.', 'easy-wp-smtp' ), WP::ADMIN_NOTICE_SUCCESS ); } /** * Return an array with information (HTML and id) for each filter for this current view. * * @since 2.0.0 * * @return array */ private function get_filters_html() { $filters = [ '.search-box' => $this->get_filter_search_html(), '.easy-wp-smtp-filter-date' => $this->get_filter_date_html(), ]; return array_filter( $filters ); } /** * Return HTML with information about the search filter. * * @since 2.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"', 'easy-wp-smtp' ), '<em>' . esc_html( $term ) . '</em>' ); } /** * Return HTML with information about the date filter. * * @since 2.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', 'easy-wp-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', 'easy-wp-smtp' ), '<em>' . $dates[0] . '</em>', '<em>' . $dates[1] . '</em>' ); break; } return $html; } /** * Display a message when debug events DB table is missing. * * @since 2.0.0 */ private function display_debug_events_not_installed() { $error_message = get_option( Migration::ERROR_OPTION_NAME ); $create_missing_tables_url = wp_nonce_url( add_query_arg( [ 'create-missing-db-tables' => 1, ], $this->get_link() ), Area::SLUG . '-create-missing-db-tables' ); $contact_support_url = easy_wp_smtp()->get_utm_url( 'https://easywpsmtp.com/account/support/', [ 'medium' => 'debug-events', 'content' => 'Debug Events not installed correctly', ] ); ?> <div class="notice-inline notice-error" style="margin-top: 32px;"> <h3><?php esc_html_e( 'Debug Events are Not Installed Correctly', 'easy-wp-smtp' ); ?></h3> <p> <?php if ( ! empty( $error_message ) ) { echo wp_kses( sprintf( /* translators: %1$s - create missing tables link; %2$s - contact support link. */ __( 'Easy WP SMTP is using custom database tables for some of its features. In order to work properly, the custom tables should be created, and it seems they are missing. Please try to <a href="%1$s">create the missing DB tables by clicking on this link</a>. If this issue persists, please <a href="%2$s" target="_blank" rel="noopener noreferrer">contact our support</a> and provide the error message below:', 'easy-wp-smtp' ), esc_url( $create_missing_tables_url ), esc_url( $contact_support_url ) ), [ 'a' => [ 'href' => [], 'target' => [], 'rel' => [], ], ] ); echo '<br><br>'; echo '<code>' . esc_html( $error_message ) . '</code>'; } else { echo wp_kses( sprintf( /* translators: %1$s - create missing tables link; %2$s - contact support link. */ __( 'Easy WP SMTP is using custom database tables for some of its features. In order to work properly, the custom tables should be created, and it seems they are missing. Please try to <a href="%1$s">create the missing DB tables by clicking on this link</a>. If this issue persists, please <a href="%2$s" target="_blank" rel="noopener noreferrer">contact our support</a>.', 'easy-wp-smtp' ), esc_url( $create_missing_tables_url ), esc_url( $contact_support_url ) ), [ 'a' => [ 'href' => [], 'target' => [], 'rel' => [], ], ] ); } ?> </p> </div> <?php } /** * Remove unnecessary $_GET parameters for shorter URL. * * @since 2.0.0 */ protected function remove_get_parameters() { if ( isset( $_SERVER['REQUEST_URI'] ) ) { $_SERVER['REQUEST_URI'] = remove_query_arg( [ '_wp_http_referer', '_wpnonce', 'easy-wp-smtp-debug-events-nonce', ], $_SERVER['REQUEST_URI'] // phpcs:ignore WordPress.Security.ValidatedSanitizedInput ); } } /** * Get debug events retention period options. * * @since 2.0.0 * * @return array */ protected function get_debug_events_retention_period_options() { $options = [ 604800 => esc_html__( '1 Week', 'easy-wp-smtp' ), 2628000 => esc_html__( '1 Month', 'easy-wp-smtp' ), 7885000 => esc_html__( '3 Months', 'easy-wp-smtp' ), 15770000 => esc_html__( '6 Months', 'easy-wp-smtp' ), 31540000 => esc_html__( '1 Year', 'easy-wp-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, 'easy-wp-smtp' ), $debug_event_retention_period_days ); ksort( $options ); } /** * Filter debug events retention period options. * * @since 2.0.0 * * @param array $options Debug Events retention period options. * Option key in seconds. */ return apply_filters( 'easy_wp_smtp_admin_pages_debug_events_tab_get_debug_events_retention_period_options', $options ); } } PK 0/]���p �p MiscTab.phpnu ��� <?php namespace EasyWPSMTP\Admin\Pages; use EasyWPSMTP\Admin\Area; use EasyWPSMTP\Admin\PageAbstract; use EasyWPSMTP\OptimizedEmailSending; use EasyWPSMTP\Options; use EasyWPSMTP\Reports\Emails\Summary as SummaryReportEmail; use EasyWPSMTP\Tasks\Reports\SummaryEmailTask as SummaryReportEmailTask; use EasyWPSMTP\UsageTracking\UsageTracking; use EasyWPSMTP\WP; /** * Class MiscTab is part of Area, displays different plugin-related settings of the plugin (not related to emails). * * @since 2.0.0 */ class MiscTab extends PageAbstract { /** * Slug of a tab. * * @since 2.0.0 * * @var string */ protected $slug = 'misc'; /** * Link label of a tab. * * @since 2.0.0 * * @return string */ public function get_label() { return esc_html__( 'Misc', 'easy-wp-smtp' ); } /** * Title of a tab. * * @since 2.0.0 * * @return string */ public function get_title() { return esc_html__( 'Miscellaneous', 'easy-wp-smtp' ); } /** * Output HTML of the misc settings. * * @since 2.0.0 */ public function display() { $options = Options::init(); /** * Filters whether to show Debug Log settings. * * @since 2.0.0 * * @param bool $show_debug_log_setting Whether to show Debug Log settings. */ $show_debug_log_settings = apply_filters( 'easy_wp_smtp_admin_pages_misc_tab_show_debug_log_settings', false ); ?> <form method="POST" action=""> <?php $this->wp_nonce_field(); ?> <div class="easy-wp-smtp-meta-box"> <div class="easy-wp-smtp-meta-box__header"> <div class="easy-wp-smtp-meta-box__heading"> <?php echo esc_html( $this->get_title() ); ?> </div> </div> <div class="easy-wp-smtp-meta-box__content"> <!-- Domain check --> <div class="easy-wp-smtp-row easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <label for="easy-wp-smtp-setting-domain_check"> <?php esc_html_e( 'Enable Domain Check', 'easy-wp-smtp' ); ?> </label> </div> <div class="easy-wp-smtp-setting-row__field"> <div class="easy-wp-smtp-setting-row__sub-row"> <label class="easy-wp-smtp-toggle" for="easy-wp-smtp-setting-domain_check"> <input name="easy-wp-smtp[general][domain_check]" type="checkbox" value="true" id="easy-wp-smtp-setting-domain_check" <?php echo $options->is_const_defined( 'general', 'domain_check' ) ? 'disabled' : ''; ?> <?php checked( true, $options->get( 'general', 'domain_check' ) ); ?> /> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--checked"><?php esc_html_e( 'On', 'easy-wp-smtp' ); ?></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--unchecked"><?php esc_html_e( 'Off', 'easy-wp-smtp' ); ?></span> </label> <p class="desc"> <?php esc_html_e( 'Easy WP SMTP settings will be used only if the site is running on following domain(s):', 'easy-wp-smtp' ); ?> </p> </div> <div class="easy-wp-smtp-setting-row__sub-row"> <input name="easy-wp-smtp[general][domain_check_allowed_domains]" type="text" value="<?php echo esc_attr( $options->get( 'general', 'domain_check_allowed_domains' ) ); ?>" id="easy-wp-smtp-setting-domain_check_allowed_domains" spellcheck="false" <?php echo $options->is_const_defined( 'general', 'domain_check_allowed_domains' ) || ! $options->get( 'general', 'domain_check' ) ? 'disabled' : ''; ?> /> <p class="desc"> <?php esc_html_e( 'Comma separated domains list. (Example: domain1.com, domain2.com)', 'easy-wp-smtp' ); ?> </p> </div> <div class="easy-wp-smtp-setting-row__sub-row"> <label class="easy-wp-smtp-toggle" for="easy-wp-smtp-setting-domain_check_do_not_send"> <input name="easy-wp-smtp[general][domain_check_do_not_send]" type="checkbox" value="true" id="easy-wp-smtp-setting-domain_check_do_not_send" <?php echo $options->is_const_defined( 'general', 'domain_check_do_not_send' ) || ! $options->get( 'general', 'domain_check' ) ? 'disabled' : ''; ?> <?php checked( true, $options->get( 'general', 'domain_check_do_not_send' ) ); ?> /> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--static"><?php esc_html_e( 'Block all emails', 'easy-wp-smtp' ); ?></span> </label> <p class="desc"> <?php esc_html_e( 'When enabled, the plugin will attempt to block ALL emails from being sent out if a domain mismatch occurs.', 'easy-wp-smtp' ); ?> </p> </div> </div> </div> <!-- Do not send --> <div id="easy-wp-smtp-setting-row-do_not_send" class="easy-wp-smtp-row easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <label for="easy-wp-smtp-setting-do_not_send"> <?php esc_html_e( 'Do Not Send', 'easy-wp-smtp' ); ?> </label> </div> <div class="easy-wp-smtp-setting-row__field"> <div class="easy-wp-smtp-setting-row__sub-row"> <label class="easy-wp-smtp-toggle" for="easy-wp-smtp-setting-do_not_send"> <input name="easy-wp-smtp[general][do_not_send]" type="checkbox" value="true" id="easy-wp-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' ) ); ?> /> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--static"><?php esc_html_e( 'Stop sending all emails', 'easy-wp-smtp' ); ?></span> </label> <p class="desc"> <?php esc_html_e( 'Enable to stop your site from sending emails. Test emails are allowed to be sent, regardless of whether this option is enabl.', 'easy-wp-smtp' ); ?> </p> <p class="desc"> <?php esc_html_e( 'Some plugins, like BuddyPress and Events Manager, use their own email delivery solutions. By default, this option does not block their emails, as those plugins do not use the default wp_mail() function to send emails. You will need to consult the documentation of any such plugins to switch them to use default WordPress email delivery for this setting to have an effect. ', 'easy-wp-smtp' ); ?>, </p> </div> <?php $this->display_log_blocked_emails_settings(); ?> </div> </div> <!-- Allow Insecure SSL Certificates --> <div id="easy-wp-smtp-setting-row-allow_smtp_insecure_ssl" class="easy-wp-smtp-row easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <label for="easy-wp-smtp-setting-allow_smtp_insecure_ssl"> <?php esc_html_e( 'Allow Insecure SSL Certificates', 'easy-wp-smtp' ); ?> </label> </div> <div class="easy-wp-smtp-setting-row__field"> <label class="easy-wp-smtp-toggle" for="easy-wp-smtp-setting-allow_smtp_insecure_ssl"> <input name="easy-wp-smtp[general][allow_smtp_insecure_ssl]" type="checkbox" value="true" id="easy-wp-smtp-setting-allow_smtp_insecure_ssl" <?php echo $options->is_const_defined( 'general', 'allow_smtp_insecure_ssl' ) ? 'disabled' : ''; ?> <?php checked( true, $options->get( 'general', 'allow_smtp_insecure_ssl' ) ); ?> /> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--checked"><?php esc_html_e( 'On', 'easy-wp-smtp' ); ?></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--unchecked"><?php esc_html_e( 'Off', 'easy-wp-smtp' ); ?></span> </label> <p class="desc"> <?php esc_html_e( 'Allow insecure and self-signed SSL certificates on SMTP server. It\'s highly recommended to keep this option disabled.', 'easy-wp-smtp' ); ?> </p> </div> </div> <?php if ( ! empty( $options->get( 'deprecated', 'debug_log_enabled' ) ) || $show_debug_log_settings ) : ?> <!-- Debug Log --> <div id="easy-wp-smtp-setting-row-debug_log_enabled" class="easy-wp-smtp-row easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <label for="easy-wp-smtp-setting-debug_log_enabled"> <?php esc_html_e( 'Enable Debug Log', 'easy-wp-smtp' ); ?> </label> </div> <div class="easy-wp-smtp-setting-row__field"> <label class="easy-wp-smtp-toggle" for="easy-wp-smtp-setting-debug_log_enabled"> <input name="easy-wp-smtp[deprecated][debug_log_enabled]" type="checkbox" value="true" <?php checked( true, $options->get( 'deprecated', 'debug_log_enabled' ) ); ?> id="easy-wp-smtp-setting-debug_log_enabled" /> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--checked"><?php esc_html_e( 'On', 'easy-wp-smtp' ); ?></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--unchecked"><?php esc_html_e( 'Off', 'easy-wp-smtp' ); ?></span> </label> <p class="desc"> <?php echo wp_kses( __( '<b>Note:</b> The debug log is reset when the plugin is activated, deactivated, or updated.', 'easy-wp-smtp' ), [ 'b' => [], ] ); ?> </p> <p class="easy-wp-smtp-btn-group desc"> <a href="<?php echo esc_url( add_query_arg( 'swpsmtp_action', 'view_log', easy_wp_smtp()->get_admin()->get_admin_page_url() ) ); ?>" target="_blank" class="easy-wp-smtp-btn easy-wp-smtp-btn--secondary easy-wp-smtp-btn--sm"><?php esc_html_e( 'View Log', 'easy-wp-smtp' ); ?></a> <a id="easy-wp-smtp-clean-debug-log" href="#0" class="easy-wp-smtp-btn easy-wp-smtp-btn--tertiary easy-wp-smtp-btn--sm"><?php esc_html_e( 'Clear Log', 'easy-wp-smtp' ); ?></a> </p> </div> </div> <?php endif; ?> <!-- Hide Announcements --> <div id="easy-wp-smtp-setting-row-am_notifications_hidden" class="easy-wp-smtp-row easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <label for="easy-wp-smtp-setting-am_notifications_hidden"> <?php esc_html_e( 'Announcements', 'easy-wp-smtp' ); ?> </label> </div> <div class="easy-wp-smtp-setting-row__field"> <label class="easy-wp-smtp-toggle" for="easy-wp-smtp-setting-am_notifications_hidden"> <input name="easy-wp-smtp[general][am_notifications_hidden]" type="checkbox" value="true" <?php checked( true, ! $options->get( 'general', 'am_notifications_hidden' ) ); ?> id="easy-wp-smtp-setting-am_notifications_hidden" /> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--checked"><?php esc_html_e( 'On', 'easy-wp-smtp' ); ?></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--unchecked"><?php esc_html_e( 'Off', 'easy-wp-smtp' ); ?></span> </label> <div class="desc"> <?php esc_html_e( 'Show plugin announcements and update details in the WordPress dashboard.', 'easy-wp-smtp' ); ?> </div> </div> </div> <!-- Hide Email Delivery Errors --> <div id="easy-wp-smtp-setting-row-email_delivery_errors_hidden" class="easy-wp-smtp-row easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <label for="easy-wp-smtp-setting-email_delivery_errors_hidden"> <?php esc_html_e( 'Email Delivery Errors', 'easy-wp-smtp' ); ?> </label> </div> <div class="easy-wp-smtp-setting-row__field"> <?php $is_hard_disabled = has_filter( 'easy_wp_smtp_admin_is_error_delivery_notice_enabled' ) && ! easy_wp_smtp()->get_admin()->is_error_delivery_notice_enabled(); ?> <label class="easy-wp-smtp-toggle" for="easy-wp-smtp-setting-email_delivery_errors_hidden"> <?php if ( $is_hard_disabled ) : ?> <input type="checkbox" disabled id="easy-wp-smtp-setting-email_delivery_errors_hidden"> <?php else : ?> <input name="easy-wp-smtp[general][email_delivery_errors_hidden]" type="checkbox" value="true" <?php checked( true, ! $options->get( 'general', 'email_delivery_errors_hidden' ) ); ?> id="easy-wp-smtp-setting-email_delivery_errors_hidden" /> <?php endif; ?> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--checked"><?php esc_html_e( 'On', 'easy-wp-smtp' ); ?></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--unchecked"><?php esc_html_e( 'Off', 'easy-wp-smtp' ); ?></span> </label> <p class="desc"> <?php esc_html_e( 'Show email delivery errors, warnings, and alerts in the WordPress dashboard.', 'easy-wp-smtp' ); ?> </p> <?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.', 'easy-wp-smtp' ), '<code>easy_wp_smtp_admin_is_error_delivery_notice_enabled</code>' ); ?> </p> <?php else : ?> <p class="desc"> <?php esc_html_e( 'Disabling this setting is not recommended and should only be done for staging or development sites.', 'easy-wp-smtp' ); ?> </p> <?php endif; ?> </div> </div> <!-- Hide Top Level Menu --> <div id="easy-wp-smtp-setting-row-top_level_menu_hidden" class="easy-wp-smtp-row easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <label for="easy-wp-smtp-setting-top_level_menu_hidden"> <?php esc_html_e( 'Compact Mode', 'easy-wp-smtp' ); ?> </label> </div> <div class="easy-wp-smtp-setting-row__field"> <label class="easy-wp-smtp-toggle" for="easy-wp-smtp-setting-top_level_menu_hidden"> <input name="easy-wp-smtp[general][top_level_menu_hidden]" type="checkbox" value="true" <?php checked( true, $options->get( 'general', 'top_level_menu_hidden' ) ); ?> id="easy-wp-smtp-setting-top_level_menu_hidden" /> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--checked"><?php esc_html_e( 'On', 'easy-wp-smtp' ); ?></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--unchecked"><?php esc_html_e( 'Off', 'easy-wp-smtp' ); ?></span> </label> <div class="desc"> <?php esc_html_e( 'Enabling this will condense navigation and move Easy WP SMTP under the WordPress Settings menu.', 'easy-wp-smtp' ); ?> <?php if ( is_network_admin() ) : ?> <?php esc_html_e( 'This setting will be applied only to subsites.', 'easy-wp-smtp' ); ?> <?php endif; ?> </div> </div> </div> <?php if ( apply_filters( 'easy_wp_smtp_admin_pages_misc_tab_show_usage_tracking_setting', true ) ) : ?> <!-- Usage Tracking --> <div id="easy-wp-smtp-setting-row-usage-tracking" class="easy-wp-smtp-row easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <label for="easy-wp-smtp-setting-usage-tracking"> <?php esc_html_e( 'Allow Usage Tracking', 'easy-wp-smtp' ); ?> </label> </div> <div class="easy-wp-smtp-setting-row__field"> <label class="easy-wp-smtp-toggle" for="easy-wp-smtp-setting-usage-tracking"> <input name="easy-wp-smtp[general][<?php echo esc_attr( UsageTracking::SETTINGS_SLUG ); ?>]" type="checkbox" value="true" id="easy-wp-smtp-setting-usage-tracking" <?php checked( true, $options->get( 'general', UsageTracking::SETTINGS_SLUG ) ); ?> /> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--checked"><?php esc_html_e( 'On', 'easy-wp-smtp' ); ?></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--unchecked"><?php esc_html_e( 'Off', 'easy-wp-smtp' ); ?></span> </label> <p class="desc"> <?php esc_html_e( 'By allowing us to track usage data we can better help you because we know with which WordPress configurations, themes and plugins we should test.', 'easy-wp-smtp' ); ?> </p> </div> </div> <?php endif; ?> <!-- Hide Dashboard Widget --> <div id="easy-wp-smtp-setting-row-dashboard_widget_hidden" class="easy-wp-smtp-row easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <label for="easy-wp-smtp-setting-dashboard_widget_hidden"> <?php esc_html_e( 'Hide Dashboard Widget', 'easy-wp-smtp' ); ?> </label> </div> <div class="easy-wp-smtp-setting-row__field"> <label class="easy-wp-smtp-toggle" for="easy-wp-smtp-setting-dashboard_widget_hidden"> <input name="easy-wp-smtp[general][dashboard_widget_hidden]" type="checkbox" value="true" <?php checked( true, $options->get( 'general', 'dashboard_widget_hidden' ) ); ?> id="easy-wp-smtp-setting-dashboard_widget_hidden" /> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--checked"><?php esc_html_e( 'On', 'easy-wp-smtp' ); ?></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--unchecked"><?php esc_html_e( 'Off', 'easy-wp-smtp' ); ?></span> </label> <p class="desc"> <?php esc_html_e( 'Hide the Easy WP SMTP Dashboard Widget.', 'easy-wp-smtp' ); ?> </p> </div> </div> <!-- Summary Report Email --> <div id="easy-wp-smtp-setting-row-summary-report-email" class="easy-wp-smtp-row easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <label for="easy-wp-smtp-setting-summary-report-email"> <?php esc_html_e( 'Disable Email Summaries', 'easy-wp-smtp' ); ?> </label> </div> <div class="easy-wp-smtp-setting-row__field"> <label class="easy-wp-smtp-toggle" for="easy-wp-smtp-setting-summary-report-email"> <input name="easy-wp-smtp[general][<?php echo esc_attr( SummaryReportEmail::SETTINGS_SLUG ); ?>]" type="checkbox" id="easy-wp-smtp-setting-summary-report-email" value="true" <?php checked( true, SummaryReportEmail::is_disabled() ); ?> <?php disabled( $options->is_const_defined( 'general', SummaryReportEmail::SETTINGS_SLUG ) || ( easy_wp_smtp()->is_pro() && empty( Options::init()->get( 'logs', 'enabled' ) ) ) ); ?> /> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--checked"><?php esc_html_e( 'On', 'easy-wp-smtp' ); ?></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--unchecked"><?php esc_html_e( 'Off', 'easy-wp-smtp' ); ?></span> </label> <p class="desc"> <?php esc_html_e( 'Disable Email Summaries weekly delivery.', 'easy-wp-smtp' ); ?> </p> <p class="desc"> <?php if ( easy_wp_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.', 'easy-wp-smtp' ), esc_url( easy_wp_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', 'easy-wp-smtp' ) ); } if ( $options->is_const_defined( 'general', SummaryReportEmail::SETTINGS_SLUG ) ) { echo '<br>' . $options->get_const_set_message( 'EASY_WP_SMTP_SUMMARY_REPORT_EMAIL_DISABLED' ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } ?> </p> </div> </div> <!-- Optimize email sending --> <div id="easy-wp-smtp-setting-row-optimize-email-sending" class="easy-wp-smtp-row easy-wp-smtp-setting-row easy-wp-smtp-row--has-divider"> <div class="easy-wp-smtp-setting-row__label"> <label for="easy-wp-smtp-setting-optimize-email-sending"> <?php esc_html_e( 'Optimize Email Sending', 'easy-wp-smtp' ); ?> </label> </div> <div class="easy-wp-smtp-setting-row__field"> <label class="easy-wp-smtp-toggle" for="easy-wp-smtp-setting-optimize-email-sending"> <input name="easy-wp-smtp[general][<?php echo esc_attr( OptimizedEmailSending::SETTINGS_SLUG ); ?>]" type="checkbox" value="true" id="easy-wp-smtp-setting-optimize-email-sending" <?php checked( true, OptimizedEmailSending::is_enabled() ); ?> <?php disabled( $options->is_const_defined( 'general', OptimizedEmailSending::SETTINGS_SLUG ) ); ?>/> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--checked"><?php esc_html_e( 'On', 'easy-wp-smtp' ); ?></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--unchecked"><?php esc_html_e( 'Off', 'easy-wp-smtp' ); ?></span> </label> <p class="desc"> <?php printf( wp_kses( /* translators: %1$s - Documentation URL. */ __( 'Send emails asynchronously, which will make pages with email requests load faster, but may delay email delivery by a minute or two. <a href="%1$s" target="_blank" rel="noopener noreferrer">Learn More</a>', 'easy-wp-smtp' ), [ 'a' => [ 'href' => [], 'rel' => [], 'target' => [], ], ] ), esc_url( easy_wp_smtp()->get_utm_url( 'https://easywpsmtp.com/docs/a-complete-guide-to-miscellaneous-settings/#optimize-email-sending', [ 'medium' => 'misc-settings', 'content' => 'Optimize Email Sending - support article', ] ) ) ); if ( $options->is_const_defined( 'general', OptimizedEmailSending::SETTINGS_SLUG ) ) { echo '<br>' . $options->get_const_set_message( 'EASY_WP_SMTP_OPTIMIZED_EMAIL_SENDING_ENABLED' ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } ?> </p> </div> </div> <!-- Rate limit --> <?php $this->display_rate_limit_settings(); ?> <!-- Uninstall --> <div id="easy-wp-smtp-setting-row-uninstall" class="easy-wp-smtp-row easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <label for="easy-wp-smtp-setting-uninstall"> <?php esc_html_e( 'Uninstall Easy WP SMTP', 'easy-wp-smtp' ); ?> </label> </div> <div class="easy-wp-smtp-setting-row__field"> <label class="easy-wp-smtp-toggle" for="easy-wp-smtp-setting-uninstall"> <input name="easy-wp-smtp[general][uninstall]" type="checkbox" value="true" <?php checked( true, $options->get( 'general', 'uninstall' ) ); ?> id="easy-wp-smtp-setting-uninstall" /> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--checked"><?php esc_html_e( 'On', 'easy-wp-smtp' ); ?></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--unchecked"><?php esc_html_e( 'Off', 'easy-wp-smtp' ); ?></span> </label> <p class="desc"> <?php esc_html_e( 'Enabling this will REMOVE ALL Easy WP SMTP data upon plugin deletion. All settings will be unrecoverable.', 'easy-wp-smtp' ); ?> </p> </div> </div> </div> </div> <?php $this->display_save_btn(); ?> </form> <?php } /** * Display rate limit settings. * * @since 2.6.0 */ protected function display_rate_limit_settings() { $upgrade_link_url = add_query_arg( [ 'discount' => 'LITEUPGRADE' ], easy_wp_smtp()->get_upgrade_link( [ 'medium' => 'Email Rate Limit', 'content' => 'Upgrade to Pro Link', ] ) ); ?> <div id="easy-wp-smtp-setting-row-rate_limit-lite" class="easy-wp-smtp-row easy-wp-smtp-row--has-divider"> <div class="easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <label for="easy-wp-smtp-setting-rate_limit-lite"> <?php esc_html_e( 'Email Rate Limiting', 'easy-wp-smtp' ); ?> </label> </div> <div class="easy-wp-smtp-setting-row__field"> <label class="easy-wp-smtp-toggle" for="easy-wp-smtp-setting-rate_limit-lite" data-disabled-text="<?php esc_html_e( 'Pro', 'easy-wp-smtp' ); ?>"> <input type="checkbox" id="easy-wp-smtp-setting-rate_limit-lite"/> <span class=" easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--checked"><?php esc_html_e( 'On', 'easy-wp-smtp' ); ?></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--unchecked"><?php esc_html_e( 'Off', 'easy-wp-smtp' ); ?></span> </label> <p class="desc"> <?php echo wp_kses( sprintf( /* translators: %s - EasyWPSMTP.com Upgrade page URL. */ __( 'Limit the number of emails this site will send in each time interval (per minute, hour, day, week and month). Emails that will cross those set limits will be queued and sent as soon as your limits allow. <a href="%s" target="_blank" rel="noopener noreferrer">Learn More</a>.', 'easy-wp-smtp' ), esc_url( easy_wp_smtp()->get_utm_url( 'https://easywpsmtp.com/docs/a-complete-guide-to-miscellaneous-settings/#email-rate-limiting', [ 'medium' => 'misc-settings', 'content' => 'Optimize Email Sending - support article', ] ) ) ), [ 'a' => [ 'href' => [], 'rel' => [], 'target' => [], ], ] ); ?> </p> </div> </div> </div> <?php } /** * Display "Log Blocked Emails" control. * * @since 2.12.0 */ protected function display_log_blocked_emails_settings() {} /** * Process tab form submission ($_POST). * * @since 2.0.0 * * @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(); $bool_options = [ 'domain_check', 'domain_check_do_not_send', 'do_not_send', 'allow_smtp_insecure_ssl', 'top_level_menu_hidden', 'uninstall', UsageTracking::SETTINGS_SLUG, SummaryReportEmail::SETTINGS_SLUG, OptimizedEmailSending::SETTINGS_SLUG, 'dashboard_widget_hidden', ]; // Unchecked checkboxes doesn't exist in $_POST, so we need to ensure we actually have them in data to save. foreach ( $bool_options as $option_key ) { if ( empty( $data['general'][ $option_key ] ) ) { $data['general'][ $option_key ] = false; } } $data['general']['am_notifications_hidden'] = empty( $data['general']['am_notifications_hidden'] ); $data['general']['email_delivery_errors_hidden'] = empty( $data['general']['email_delivery_errors_hidden'] ); if ( empty( $data['deprecated']['debug_log_enabled'] ) ) { $data['deprecated']['debug_log_enabled'] = 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.', 'easy-wp-smtp' ), WP::ADMIN_NOTICE_SUCCESS ); } } PK 0/]�� AuthTab.phpnu ��� <?php namespace EasyWPSMTP\Admin\Pages; use EasyWPSMTP\ConnectionInterface; use EasyWPSMTP\Providers\AuthAbstract; /** * Class AuthTab. * * @since 2.1.0 */ class AuthTab { /** * @var string Slug of a tab. */ protected $slug = 'auth'; /** * Launch mailer specific Auth logic. * * @since 2.1.0 */ public function process_auth() { $connection = easy_wp_smtp()->get_connections_manager()->get_primary_connection(); /** * Filters auth connection object. * * @since 2.1.0 * * @param ConnectionInterface $connection The Connection object. */ $connection = apply_filters( 'easy_wp_smtp_admin_pages_auth_tab_process_auth_connection', $connection ); $auth = easy_wp_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 2.1.0 */ public function get_label() { return ''; } /** * Return nothing, as we don't need this functionality. * * @since 2.1.0 */ public function get_title() { return ''; } /** * Do nothing, as we don't need this functionality. * * @since 2.1.0 */ public function display() { } } PK 0/]䪉d� � TestTab.phpnu ��� <?php namespace EasyWPSMTP\Admin\Pages; use EasyWPSMTP\Admin\DomainChecker; use EasyWPSMTP\Conflicts; use EasyWPSMTP\ConnectionInterface; use EasyWPSMTP\Debug; use EasyWPSMTP\MailCatcherInterface; use EasyWPSMTP\Options; use EasyWPSMTP\WP; use EasyWPSMTP\Admin\PageAbstract; /** * Class TestTab is part of Area, displays email testing page of the plugin. * * @since 2.0.0 */ class TestTab extends PageAbstract { /** * @var string Slug of a tab. */ protected $slug = 'test'; /** * Tab priority. * * @since 2.0.0 * * @var int */ protected $priority = 10; /** * Mailer debug error data. * * @since 2.0.0 * * @var array */ private $debug = []; /** * Domain Checker API object. * * @since 2.1.0 * * @var DomainChecker|null */ private $domain_checker; /** * Test email sending failed. * * @since 2.1.0 * * @const int */ const FAILED = 0; /** * Test email sent successfully. * * @since 2.1.0 * * @const int */ const SUCCESS = 1; /** * Test email domain check failed. * * @since 2.1.0 * * @const int */ const FAILED_DOMAIN_CHECK = 2; /** * Test email result. * * @since 2.1.0 * * @var int */ private $result = null; /** * Test email POST data. * * @since 2.0.0 * * @var array */ private $post_data = []; /** * Test email connection. * * @since 2.0.0 * * @var ConnectionInterface */ private $connection; /** * @inheritdoc */ public function get_label() { return esc_html__( 'Email Test', 'easy-wp-smtp' ); } /** * @inheritdoc */ public function get_title() { return $this->get_label(); } /** * Display test email form. * * @since 2.0.0 */ public function display() { $test_email_options = array_merge( [ 'to' => '', 'subject' => '', 'message' => '', ], get_option( 'easy_wp_smtp_test_email', [] ) ); if ( empty( $test_email_options['to'] ) ) { $test_email_options['to'] = wp_get_current_user()->user_email; } ?> <form id="easy-wp-smtp-email-test-form" method="POST" action="<?php echo esc_url( $this->get_link() ); ?>"> <?php $this->wp_nonce_field(); ?> <div class="easy-wp-smtp-meta-box"> <div class="easy-wp-smtp-meta-box__header"> <div class="easy-wp-smtp-meta-box__heading"> <?php esc_html_e( 'Send a Test', 'easy-wp-smtp' ); ?> </div> </div> <div class="easy-wp-smtp-meta-box__content"> <!-- Test Email --> <div id="easy-wp-smtp-setting-row-test_email" class="easy-wp-smtp-row easy-wp-smtp-setting-row easy-wp-smtp-setting-row--text"> <div class="easy-wp-smtp-setting-row__label"> <label for="easy-wp-smtp-setting-test_email"><?php esc_html_e( 'Send To', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"> <input name="easy-wp-smtp[test][email]" value="<?php echo esc_attr( $test_email_options['to'] ); ?>" type="email" id="easy-wp-smtp-setting-test_email" spellcheck="false" placeholder="yourmail@example.com" required /> <p class="desc"> <?php esc_html_e( 'Enter the email address you want to send the test email to.', 'easy-wp-smtp' ); ?> </p> </div> </div> <?php /** * Fires after "Send To" section on the test email page. * * @since 2.0.0 */ do_action( 'easy_wp_smtp_admin_pages_test_tab_display_form_send_to_after' ); ?> <!-- HTML/Plain --> <div id="easy-wp-smtp-setting-row-test_email_html" class="easy-wp-smtp-row easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <label for="easy-wp-smtp-setting-test_email_html"><?php esc_html_e( 'HTML', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"> <label class="easy-wp-smtp-toggle" for="easy-wp-smtp-setting-test_email_html"> <input type="checkbox" id="easy-wp-smtp-setting-test_email_html" name="easy-wp-smtp[test][html]" value="yes" checked/> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--checked"><?php esc_html_e( 'On', 'easy-wp-smtp' ); ?></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--unchecked"><?php esc_html_e( 'Off', 'easy-wp-smtp' ); ?></span> </label> <p class="desc"> <?php esc_html_e( 'Enable to send this email in HTML format. Disable to send it in plain text format.', 'easy-wp-smtp' ); ?> </p> </div> </div> <!-- Custom Email --> <div id="easy-wp-smtp-setting-row-test_email_custom" class="easy-wp-smtp-row easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <label for="easy-wp-smtp-setting-test_email_custom"><?php esc_html_e( 'Custom Email', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"> <label class="easy-wp-smtp-toggle" for="easy-wp-smtp-setting-test_email_custom"> <input type="checkbox" id="easy-wp-smtp-setting-test_email_custom" name="easy-wp-smtp[test][custom]" value="yes"/> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--checked"><?php esc_html_e( 'On', 'easy-wp-smtp' ); ?></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--unchecked"><?php esc_html_e( 'Off', 'easy-wp-smtp' ); ?></span> </label> <p class="desc"> <?php esc_html_e( 'Replace the predefined email template with your own content.', 'easy-wp-smtp' ); ?> </p> </div> </div> <!-- Subject --> <div id="easy-wp-smtp-setting-row-test_email_subject" class="easy-wp-smtp-row easy-wp-smtp-setting-row easy-wp-smtp-setting-row--text" style="display: none;"> <div class="easy-wp-smtp-setting-row__label"> <label for="easy-wp-smtp-setting-test_email_subject"><?php esc_html_e( 'Subject', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"> <input name="easy-wp-smtp[test][subject]" type="text" id="easy-wp-smtp-setting-test_email_subject" value="<?php echo esc_attr( $test_email_options['subject'] ); ?>" spellcheck="false"> <p class="desc"> <?php esc_html_e( 'Enter a custom subject for your message.', 'easy-wp-smtp' ); ?> </p> </div> </div> <!-- Message --> <div id="easy-wp-smtp-setting-row-test_email_message" class="easy-wp-smtp-row easy-wp-smtp-setting-row easy-wp-smtp-setting-row--text" style="display: none;"> <div class="easy-wp-smtp-setting-row__label"> <label for="easy-wp-smtp-setting-test_email_message"><?php esc_html_e( 'Message', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"> <textarea name="easy-wp-smtp[test][message]" id="easy-wp-smtp-setting-test_email_message" spellcheck="false" rows="9"><?php echo esc_textarea( stripslashes( $test_email_options['message'] ) ); ?></textarea> <p class="desc"> <?php esc_html_e( 'Write your custom email message.', 'easy-wp-smtp' ); ?> </p> </div> </div> </div> </div> <?php $btn = 'easy-wp-smtp-btn--primary'; $disabled = ''; $help_text = ''; $mailer = easy_wp_smtp()->get_providers()->get_mailer( Options::init()->get( 'mail', 'mailer' ), easy_wp_smtp()->get_processor()->get_phpmailer() ); if ( ! $mailer || ! $mailer->is_mailer_complete() ) { $btn = 'easy-wp-smtp-btn--primary easy-wp-smtp-btn--primary--disabled'; $disabled = 'disabled'; $help_text = '<div class="easy-wp-smtp-test-email-submit__text">' . esc_html__( 'You cannot send an email. Mailer is not properly configured. Please check your settings.', 'easy-wp-smtp' ) . '</div>'; } ?> <div class="easy-wp-smtp-test-email-submit"> <button type="submit" class="easy-wp-smtp-btn easy-wp-smtp-btn--lg <?php echo esc_attr( $btn ); ?>" <?php echo esc_attr( $disabled ); ?>> <?php esc_html_e( 'Send Test Email', 'easy-wp-smtp' ); ?> </button> <?php echo $help_text; ?> </div> <?php $this->post_form_hidden_field(); ?> </form> <?php if ( ! empty( $mailer ) && $mailer->is_mailer_complete() && isset( $_GET['auto-start'] ) ) : // phpcs:ignore ?> <script> (function( $ ) { var $button = $( '.easy-wp-smtp-tab-tools-test #easy-wp-smtp-email-test-form .easy-wp-smtp-btn' ); $button.addClass( 'easy-wp-smtp-btn--loading' ); $( '#easy-wp-smtp-email-test-form' ).submit(); }( jQuery )); </script> <?php endif; if ( ! is_null( $this->result ) && $this->result !== self::SUCCESS ) { echo '<div class="easy-wp-smtp-test-email-result">'; if ( $this->result === self::FAILED_DOMAIN_CHECK ) { $this->display_domain_check_details(); } elseif ( $this->result === self::FAILED ) { $this->display_debug_details(); } echo '</div>'; ?> <!-- Scroll to the error container. --> <script> jQuery( function( $ ) { $( 'html, body' ).animate( { scrollTop: $( ".easy-wp-smtp-test-email-result" ).offset().top - 50 }, 500 ); } ); </script> <?php } } /** * @inheritdoc */ public function process_post( $data ) { $this->check_admin_referer(); $this->post_data = $data; $connection = easy_wp_smtp()->get_connections_manager()->get_primary_connection(); /** * Filters test email connection object. * * @since 2.0.0 * * @param ConnectionInterface $connection The Connection object. * @param array $data Post data. */ $this->connection = apply_filters( 'easy_wp_smtp_admin_pages_test_tab_process_post_connection', $connection, $data ); if ( ! empty( $data['test']['email'] ) ) { $data['test']['email'] = wp_unslash( $data['test']['email'] ); $data['test']['email'] = filter_var( $data['test']['email'], FILTER_VALIDATE_EMAIL ); } $is_html = true; if ( empty( $data['test']['html'] ) ) { $is_html = false; } if ( empty( $data['test']['email'] ) ) { WP::add_admin_notice( esc_html__( 'Test failed. Please use a valid email address and try to resend the test email.', 'easy-wp-smtp' ), WP::ADMIN_NOTICE_WARNING ); return; } $phpmailer = easy_wp_smtp()->get_processor()->get_phpmailer(); // Set SMTPDebug level, default is 3 (commands + data + connection status). $phpmailer->SMTPDebug = apply_filters( 'easy_wp_smtp_admin_test_email_smtp_debug', 3 ); if ( $is_html ) { add_filter( 'wp_mail_content_type', array( __CLASS__, 'set_test_html_content_type' ) ); } $to = $data['test']['email']; if ( ! empty( $data['test']['custom'] ) && ! empty( $data['test']['subject'] ) ) { $subject = $data['test']['subject']; } else { if ( $is_html ) { /* translators: %s - email address a test email will be sent to. */ $subject = 'Easy WP SMTP: HTML ' . sprintf( esc_html__( 'Test email to %s', 'easy-wp-smtp' ), $data['test']['email'] ); } else { /* translators: %s - email address a test email will be sent to. */ $subject = 'Easy WP SMTP: ' . sprintf( esc_html__( 'Test email to %s', 'easy-wp-smtp' ), $data['test']['email'] ); } } $headers = [ 'X-Mailer-Type:EasyWPSMTP/Admin/Test' ]; if ( $is_html ) { $headers[] = 'Content-Type: text/html'; } // Clear debug before send test email. Debug::clear(); // Force processing for test email even if email sending is blocked. easy_wp_smtp()->get_processor()->set_force_processing( true ); // Start output buffering to grab smtp debugging output. ob_start(); // Send the test mail. $result = wp_mail( $to, $subject, $this->get_email_message( $is_html ), $headers ); $smtp_debug = ob_get_clean(); easy_wp_smtp()->get_processor()->set_force_processing( false ); if ( $is_html ) { remove_filter( 'wp_mail_content_type', array( __NAMESPACE__, 'set_test_html_content_type' ) ); } /* * Notify a user about the results. */ if ( $result ) { $connection_options = $this->connection->get_options(); $mailer = $connection_options->get( 'mail', 'mailer' ); $email = $connection_options->get( 'mail', 'from_email' ); $domain = ''; // Add the optional sending domain parameter. if ( in_array( $mailer, [ 'mailgun', 'sendinblue', 'sendgrid' ], true ) ) { $domain = $connection_options->get( $mailer, 'domain' ); } $this->domain_checker = new DomainChecker( $mailer, $email, $domain ); $this->result = $this->domain_checker->no_issues() ? self::SUCCESS : self::FAILED_DOMAIN_CHECK; if ( $this->result === self::SUCCESS ) { $result_message = esc_html__( 'Test plain text email was sent successfully!', 'easy-wp-smtp' ); if ( $is_html ) { $result_message = sprintf( /* translators: %s - "HTML" in bold. */ esc_html__( 'Test %s email was sent successfully! Please check your inbox to make sure it is delivered.', 'easy-wp-smtp' ), '<strong>HTML</strong>' ); } WP::add_admin_notice( $result_message, WP::ADMIN_NOTICE_SUCCESS ); } } else { // Grab the smtp debugging output. $this->debug['smtp_debug'] = $smtp_debug; $this->debug['smtp_error'] = wp_strip_all_tags( $phpmailer->ErrorInfo ); $this->debug['error_log'] = $this->get_debug_messages( $phpmailer, $smtp_debug ); $this->result = self::FAILED; } // Update test email data. $test_email_options = get_option( 'easy_wp_smtp_test_email', [] ); $test_email_options['to'] = filter_var( $to, FILTER_SANITIZE_EMAIL ); if ( ! empty( $data['test']['custom'] ) ) { $test_email_options['subject'] = sanitize_text_field( $subject ); if ( ! empty( $data['test']['message'] ) ) { $test_email_options['message'] = sanitize_textarea_field( $data['test']['message'] ); } } update_option( 'easy_wp_smtp_test_email', $test_email_options, false ); } /** * Get the email message that should be sent. * * @since 2.0.0 * * @param bool $is_html Whether to send an HTML email or plain text. * * @return string */ private function get_email_message( $is_html = true ) { if ( ! empty( $this->post_data['test']['custom'] ) && ! empty( $this->post_data['test']['message'] ) ) { return $this->post_data['test']['message']; } // Default plain text version of the email. $message = self::get_email_message_text(); if ( $is_html ) { $message = $this->get_email_message_html(); } return $message; } /** * Get the HTML prepared message for test email. * * @since 2.0.0 * * @return string */ private function get_email_message_html() { ob_start(); ?> <!doctype html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width"> <title>Easy WP SMTP Test Email</title> <style type="text/css">@media only screen and (max-width: 599px) {table.body .container {width: 95% !important;}.header {padding: 30px 15px 30px 15px !important;}.content, .education-main {padding: 40px 30px !important;} .education-footer {padding: 20px 30px !important;}.guaranty-badge {display: none !important;}.education-footer p {text-align: left !important;}}</style> </head> <body style="height: 100% !important; width: 100% !important; min-width: 100%; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -webkit-font-smoothing: antialiased !important; -moz-osx-font-smoothing: grayscale !important; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #3A3A56; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; margin: 0; Margin: 0; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; background-color: #F2F2F4; text-align: center;"> <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%" class="body" style="border-collapse: collapse; border-spacing: 0; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; height: 100% !important; width: 100% !important; min-width: 100%; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -webkit-font-smoothing: antialiased !important; -moz-osx-font-smoothing: grayscale !important; background-color: #F2F2F4; color: #3A3A56; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; margin: 0; Margin: 0; text-align: left; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%;"> <tr style="padding: 0; vertical-align: top; text-align: left;"> <td align="center" valign="top" class="body-inner easy-wp-smtp" style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #3A3A56; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; margin: 0; Margin: 0; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; text-align: center;"> <!-- Container --> <table border="0" cellpadding="0" cellspacing="0" class="container" style="border-collapse: collapse; border-spacing: 0; padding: 0; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; width: 600px; margin: 0 auto 30px auto; Margin: 0 auto 30px auto; text-align: inherit;"> <!-- Header --> <tr style="padding: 0; vertical-align: top; text-align: left;"> <td align="center" valign="middle" class="header" style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #3A3A56; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; margin: 0; Margin: 0; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; text-align: center; padding: 30px 30px 30px 30px;"> <img src="<?php echo esc_url( easy_wp_smtp()->plugin_url . '/assets/images/email/easy-wp-smtp.png' ); ?>" width="308" alt="Easy WP SMTP Logo" style="outline: none; text-decoration: none; max-width: 100%; clear: both; -ms-interpolation-mode: bicubic; display: inline-block !important; width: 308px;"> </td> </tr> <!-- Content --> <tr style="padding: 0; vertical-align: top; text-align: left;"> <td align="left" valign="top" class="content" style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #3A3A56; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; margin: 0; Margin: 0; text-align: left; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; background-color: #ffffff; padding-top: 60px;padding-bottom: 60px;padding-left: 60px;padding-right: 60px;"> <div class="success" style="text-align: center;"> <p class="check" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #3A3A56; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; margin: 0 auto 40px auto; Margin: 0 auto 40px auto; text-align: center;"> <img src="<?php echo esc_url( easy_wp_smtp()->plugin_url . '/assets/images/email/icon-check.png' ); ?>" width="64" alt="Success" style="outline: none; text-decoration: none; max-width: 100%; clear: both; -ms-interpolation-mode: bicubic; display: block; margin: 0 auto 0 auto; Margin: 0 auto 0 auto; width: 64px;"> </p> <p class="text-extra-large text-center congrats" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #09092C; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; padding: 0; mso-line-height-rule: exactly; line-height: 140%; font-size: 20px; text-align: center; margin: 0 0 40px 0; Margin: 0 0 40px 0;"> Congrats, test email was sent successfully! </p> <p class="text-large" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #3A3A56; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; text-align: left; mso-line-height-rule: exactly; line-height: 140%; margin: 0 0 40px 0; Margin: 0 0 40px 0; font-size: 16px;"> Thank you for using Easy WP SMTP. We're on a mission to make sure your emails actually get delivered. </p> <p class="signature" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #3A3A56; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; text-align: left; margin: 0 0 10px 0; Margin: 0 0 10px 0;"> <img src="<?php echo esc_url( easy_wp_smtp()->plugin_url . '/assets/images/email/signature.png' ); ?>" width="180" alt="Signature" style="outline: none; text-decoration: none; max-width: 100%; clear: both; -ms-interpolation-mode: bicubic; width: 180px; display: block; margin: 0 0 0 0; Margin: 0 0 0 0;"> </p> <p style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #6F6F84; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; text-align: left; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; margin: 0 0 0px 0; Margin: 0 0 0px 0;"> <strong>Jared Atchison</strong><br> CEO, SendLayer </p> </div> </td> </tr> <?php if ( ! easy_wp_smtp()->is_pro() ) : ?> <tr style="padding: 0; vertical-align: top; text-align: left;"> <td align="left" valign="top" class="education-main" style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; margin: 0; Margin: 0; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; background-color: #DBEDE6; text-align: left !important; padding-top: 60px;padding-bottom: 60px;padding-left: 60px;padding-right: 60px;"> <h6 style="padding: 0; color: #02150D; word-wrap: normal; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: bold; mso-line-height-rule: exactly; line-height: 130%; font-size: 17px; text-align: left; margin: 0 0 20px 0; Margin: 0 0 20px 0;"> Unlock Powerful Features with Easy WP SMTP Pro </h6> <table style="border-collapse: collapse; border-spacing: 0; padding: 0; vertical-align: top; text-align: left; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; width: 100% !important;"> <tr style="padding: 0; vertical-align: top; text-align: left;"> <td style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; margin: 0; Margin: 0; mso-line-height-rule: exactly; text-align: left; padding: 0 0 0 0; line-height: 100%;width: 67%;"> <table style="border-collapse: collapse; border-spacing: 0; padding: 0; vertical-align: top; text-align: left; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; width: 100% !important; margin-bottom: 5px;"> <tr style="padding: 0; vertical-align: top; text-align: left;"> <td style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; margin: 0; Margin: 0; mso-line-height-rule: exactly; text-align: left; line-height: 140%; padding-bottom: 15px; padding-top: 0; padding-right: 10px;padding-left: 0; width: 16px;"> <img src="<?php echo esc_url( easy_wp_smtp()->plugin_url . '/assets/images/email/check.png' ); ?>" width="16" alt="Check" style="outline: none; text-decoration: none; max-width: 100%; clear: both; -ms-interpolation-mode: bicubic; width: 16px; vertical-align: middle;"> </td> <td style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; margin: 0; Margin: 0; mso-line-height-rule: exactly; text-align: left; line-height: 140%; padding-bottom: 15px; padding-top: 0; padding-right: 0;padding-left: 0;font-size: 15px;"> Detailed Email Logs </td> </tr> <tr style="padding: 0; vertical-align: top; text-align: left;"> <td style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; margin: 0; Margin: 0; mso-line-height-rule: exactly; text-align: left; line-height: 140%; padding-bottom: 15px; padding-top: 0; padding-right: 10px;padding-left: 0;width: 16px;"> <img src="<?php echo esc_url( easy_wp_smtp()->plugin_url . '/assets/images/email/check.png' ); ?>" width="16" alt="Check" style="outline: none; text-decoration: none; max-width: 100%; clear: both; -ms-interpolation-mode: bicubic; width: 16px;vertical-align: middle;"> </td> <td style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; margin: 0; Margin: 0; mso-line-height-rule: exactly; text-align: left; line-height: 140%; padding-bottom: 15px; padding-top: 0; padding-right: 0;padding-left: 0;font-size: 15px;"> Complete Email Reports </td> </tr> <tr style="padding: 0; vertical-align: top; text-align: left;"> <td style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; margin: 0; Margin: 0; mso-line-height-rule: exactly; text-align: left; line-height: 140%; padding-bottom: 15px; padding-top: 0; padding-right: 10px;padding-left: 0;width: 16px;"> <img src="<?php echo esc_url( easy_wp_smtp()->plugin_url . '/assets/images/email/check.png' ); ?>" width="16" alt="Check" style="outline: none; text-decoration: none; max-width: 100%; clear: both; -ms-interpolation-mode: bicubic; width: 16px;vertical-align: middle;"> </td> <td style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; margin: 0; Margin: 0; mso-line-height-rule: exactly; text-align: left; line-height: 140%; padding-bottom: 15px; padding-top: 0; padding-right: 0;padding-left: 0;font-size: 15px;"> Enhanced Weekly Email Summary </td> </tr> </table> <table class="button" style="border-collapse: collapse; border-spacing: 0; padding: 0; vertical-align: top; text-align: left; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; width: 100%; max-width: 202px;"> <tr style="padding: 0; vertical-align: top; text-align: left;"> <td class="button-inner" style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; margin: 0; Margin: 0; text-align: left; font-size: 14px; mso-line-height-rule: exactly; line-height: 100%; padding: 0 0 0 0;"> <table style="border-collapse: collapse; border-spacing: 0; padding: 0; vertical-align: top; text-align: left; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; width: 100% !important;"> <tr style="padding: 0; vertical-align: top; text-align: left;"> <td style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; margin: 0; Margin: 0; font-size: 16px; text-align: center; color: #ffffff; background: #0F8A56; border-radius: 4px; mso-line-height-rule: exactly; line-height: 100%;"> <a href="<?php echo esc_url( easy_wp_smtp()->get_upgrade_link( 'email-test' ) ); ?>" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; margin: 0; Margin: 0; font-family: Helvetica, Arial, sans-serif; font-weight: bold; color: #ffffff; text-decoration: none; display: inline-block; border: 0 solid #0F8A56; mso-line-height-rule: exactly; line-height: 100%; padding: 12px 20px 12px 20px; font-size: 16px; text-align: center; width: 100%; padding-left: 0; padding-right: 0;"> Upgrade to Pro Today </a> </td> </tr> </table> </td> </tr> </table> </td> <td class="guaranty-badge" align="right" style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; margin: 0; Margin: 0; mso-line-height-rule: exactly; text-align: right; padding: 0 0 0 0; line-height: 140%; width: 33%;"> <img src="<?php echo esc_url( easy_wp_smtp()->plugin_url . '/assets/images/email/14days-badge.png' ); ?>" width="155" alt="Check" style="outline: none; text-decoration: none; max-width: 100%; clear: both; -ms-interpolation-mode: bicubic; width: 155px;"> </td> </tr> </table> </td> </tr> <tr style="padding: 0; vertical-align: top; text-align: left;"> <td align="left" valign="top" class="education-footer" style="word-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: top; mso-table-lspace: 0pt; mso-table-rspace: 0pt; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #444; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; margin: 0; Margin: 0; font-size: 14px; mso-line-height-rule: exactly; line-height: 140%; background-color: #B7DCCC; text-align: left !important; padding-top: 20px;padding-bottom: 20px;padding-left: 55px;padding-right: 55px;"> <p class="text-large last" style="-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; color: #042315; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight: normal; padding: 0; mso-line-height-rule: exactly; line-height: 140%; font-size: 14px; text-align: center; margin: 0 0 0 0; Margin: 0 0 0 0;"> Upgrade to the Pro and <span style="font-weight:bold;color:#0B613C;text-transform: uppercase;">save 50% today</span>, automatically applied at checkout. </p> </td> </tr> <?php endif; ?> </table> </td> </tr> </table> </body> </html> <?php $message = ob_get_clean(); return $message; } /** * Get the plain text prepared message for test email. * * @since 2.0.0 * * @return string */ public static function get_email_message_text() { // phpcs:disable if ( easy_wp_smtp()->is_pro() ) { // Easy WP SMTP Pro paid installed. $message = 'Congrats, test email was sent successfully! Thank you for using Easy WP SMTP. We\'re on a mission to make sure your emails actually get delivered. - Jared Atchison CEO, SendLayer'; } else { // Free Easy WP SMTP is installed. $message = 'Congrats, test email was sent successfully! Thank you for trying out Easy WP SMTP. We are on a mission to make sure your emails actually get delivered. If you find this free plugin useful, please consider giving Easy WP SMTP Pro a try! https://easywpsmtp.com/lite-upgrade/ Unlock These Powerful Features with Easy WP SMTP Pro: + Log all emails and export your email logs in different formats + Send emails with Amazon SES / Microsoft 365/ Zoho Mail + Track opens and clicks to measure engagement + Resend failed emails from your email log + Create email reports and graphs + Get help from our world-class support team - Jared Atchison CEO, SendLayer'; } // phpcs:enable return $message; } /** * Set the HTML content type for a test email. * * @since 2.0.0 * * @return string */ public static function set_test_html_content_type() { return 'text/html'; } /** * Prepare debug information, that will help users to identify the error. * * @since 2.0.0 * * @param MailCatcherInterface $phpmailer The MailCatcher object. * @param string $smtp_debug The SMTP debug message. * * @return string */ protected function get_debug_messages( $phpmailer, $smtp_debug ) { $connection_options = $this->connection->get_options(); $conflicts = new Conflicts(); $this->debug['mailer'] = $connection_options->get( 'mail', 'mailer' ); /* * Versions Debug. */ $versions_text = '<strong>Versions:</strong><br>'; $versions_text .= '<strong>WordPress:</strong> ' . get_bloginfo( 'version' ) . '<br>'; $versions_text .= '<strong>WordPress MS:</strong> ' . ( is_multisite() ? 'Yes' : 'No' ) . '<br>'; $versions_text .= '<strong>PHP:</strong> ' . PHP_VERSION . '<br>'; $versions_text .= '<strong>Easy WP SMTP:</strong> ' . EasyWPSMTP_PLUGIN_VERSION . '<br>'; /* * Mailer Debug. */ $mailer_text = '<strong>Params:</strong><br>'; $mailer_text .= '<strong>Mailer:</strong> ' . $this->debug['mailer'] . '<br>'; $mailer_text .= '<strong>Constants:</strong> ' . ( $connection_options->is_const_enabled() ? 'Yes' : 'No' ) . '<br>'; if ( $conflicts->is_detected() ) { $conflict_plugin_names = implode( ', ', $conflicts->get_all_conflict_names() ); $mailer_text .= '<strong>Conflicts:</strong> ' . esc_html( $conflict_plugin_names ) . '<br>'; } // Display different debug info based on the mailer. $mailer = easy_wp_smtp()->get_providers()->get_mailer( $this->debug['mailer'], $phpmailer, $this->connection ); if ( $mailer ) { $mailer_text .= $mailer->get_debug_info(); } $phpmailer_error = $phpmailer->ErrorInfo; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase // Append any PHPMailer errors to the mailer debug (except SMTP mailer, which has the full error output below). if ( ! empty( $phpmailer_error ) && ! $connection_options->is_mailer_smtp() ) { $mailer_text .= '<br><br><strong>PHPMailer Debug:</strong><br>' . wp_strip_all_tags( $phpmailer_error ) . '<br>'; } /* * General Debug. */ $debug_text = implode( '<br>', Debug::get() ); Debug::clear(); if ( ! empty( $debug_text ) ) { $debug_text = '<br><strong>Debug:</strong><br>' . $debug_text . '<br>'; } /* * SMTP Debug. */ $smtp_text = ''; if ( $connection_options->is_mailer_smtp() ) { $smtp_text = '<strong>SMTP Debug:</strong><br>'; if ( ! empty( $smtp_debug ) ) { $smtp_text .= $smtp_debug; } else { $smtp_text .= '[empty]'; } } $errors = apply_filters( 'easy_wp_smtp_admin_test_get_debug_messages', array( $versions_text, $mailer_text, $debug_text, $smtp_text, ) ); return '<pre>' . implode( '<br>', array_filter( $errors ) ) . '</pre>'; } /** * Returns debug information for detection, processing, and display. * * @since 2.0.0 * * @return array */ protected function get_debug_details() { $connection_options = $this->connection->get_options(); $smtp_host = $connection_options->get( 'smtp', 'host' ); $smtp_port = $connection_options->get( 'smtp', 'port' ); $smtp_encryption = $connection_options->get( 'smtp', 'encryption' ); $details = [ // [any] - cURL error 60/77. [ 'mailer' => 'any', 'errors' => [ [ 'cURL error 60' ], [ 'cURL error 77' ], ], 'title' => esc_html__( 'SSL certificate issue.', 'easy-wp-smtp' ), 'description' => [ esc_html__( 'This means your web server cannot reliably make secure connections (make requests to HTTPS sites).', 'easy-wp-smtp' ), esc_html__( 'Typically this error is returned when web server is not configured properly.', 'easy-wp-smtp' ), ], 'steps' => [ esc_html__( 'Contact your web hosting provider and inform them your site has an issue with SSL certificates.', 'easy-wp-smtp' ), esc_html__( 'The exact error you can provide them is in the Error log, available at the bottom of this page.', 'easy-wp-smtp' ), esc_html__( 'Ask them to resolve the issue then try again.', 'easy-wp-smtp' ), ], ], // [any] - cURL error 6/7. [ 'mailer' => 'any', 'errors' => [ [ 'cURL error 6' ], [ 'cURL error 7' ], ], 'title' => esc_html__( 'Could not connect to host.', 'easy-wp-smtp' ), 'description' => [ ! empty( $smtp_host ) ? sprintf( /* translators: %s - SMTP host address. */ esc_html__( 'This means your web server was unable to connect to %s.', 'easy-wp-smtp' ), $smtp_host ) : esc_html__( 'This means your web server was unable to connect to the host server.', 'easy-wp-smtp' ), esc_html__( 'Typically this error is returned your web server is blocking the connections or the SMTP host denying the request.', 'easy-wp-smtp' ), ], 'steps' => [ sprintf( /* translators: %s - SMTP host address. */ esc_html__( 'Contact your web hosting provider and ask them to verify your server can connect to %s. Additionally, ask them if a firewall or security policy may be preventing the connection.', 'easy-wp-smtp' ), $smtp_host ), esc_html__( 'If using "Other SMTP" Mailer, triple check your SMTP settings including host address, email, and password.', 'easy-wp-smtp' ), esc_html__( 'If using "Other SMTP" Mailer, contact your SMTP host to confirm they are accepting outside connections with the settings you have configured (address, username, port, security, etc).', 'easy-wp-smtp' ), ], ], // [sendgrid] - cURL error 18 - potential incorrect API key. [ 'mailer' => 'sendgrid', 'errors' => [ [ 'cURL error 18' ], ], 'title' => esc_html__( 'Invalid SendGrid API key', 'easy-wp-smtp' ), 'description' => [ esc_html__( 'It looks like your SendGrid API Key is invalid.', 'easy-wp-smtp' ), ], 'steps' => [ esc_html__( 'Go to Easy WP SMTP plugin Settings page.', 'easy-wp-smtp' ), esc_html__( 'Make sure your API Key in the SendGrid mailer settings is correct and valid.', 'easy-wp-smtp' ), esc_html__( 'Save the plugin settings.', 'easy-wp-smtp' ), esc_html__( 'If updating the API Key doesn\'t resolve this issue, please contact our support.', 'easy-wp-smtp' ), ], ], // [any] - cURL error XX (other). [ 'mailer' => 'any', 'errors' => [ [ 'cURL error' ], ], 'title' => esc_html__( 'Could not connect to your host.', 'easy-wp-smtp' ), 'description' => [ ! empty( $smtp_host ) ? sprintf( /* translators: %s - SMTP host address. */ esc_html__( 'This means your web server was unable to connect to %s.', 'easy-wp-smtp' ), $smtp_host ) : esc_html__( 'This means your web server was unable to connect to the host server.', 'easy-wp-smtp' ), esc_html__( 'Typically this error is returned when web server is not configured properly.', 'easy-wp-smtp' ), ], 'steps' => [ esc_html__( 'Contact your web hosting provider and inform them you are having issues making outbound connections.', 'easy-wp-smtp' ), esc_html__( 'The exact error you can provide them is in the Error log, available at the bottom of this page.', 'easy-wp-smtp' ), esc_html__( 'Ask them to resolve the issue then try again.', 'easy-wp-smtp' ), ], ], // [smtp] - SMTP Error: Count not authenticate. [ 'mailer' => 'smtp', 'errors' => [ [ 'SMTP Error: Could not authenticate.' ], ], 'title' => esc_html__( 'Could not authenticate your SMTP account.', 'easy-wp-smtp' ), 'description' => [ esc_html__( 'This means we were able to connect to your SMTP host, but were not able to proceed using the email/password in the settings.', 'easy-wp-smtp' ), esc_html__( 'Typically this error is returned when the email or password is not correct or is not what the SMTP host is expecting.', 'easy-wp-smtp' ), ], 'steps' => [ esc_html__( 'Triple check your SMTP settings including host address, email, and password. If you have recently reset your password you will need to update the settings.', 'easy-wp-smtp' ), esc_html__( 'Contact your SMTP host to confirm you are using the correct username and password.', 'easy-wp-smtp' ), esc_html__( 'Verify with your SMTP host that your account has permissions to send emails using outside connections.', 'easy-wp-smtp' ), sprintf( wp_kses( /* translators: %s - URL to the easywpsmtp.com doc page. */ __( 'Visit <a href="%s" target="_blank" rel="noopener noreferrer">our documentation</a> for additional tips on how to resolve this error.', 'easy-wp-smtp' ), [ 'a' => [ 'href' => [], 'target' => [], 'rel' => [], ], ] ), // phpcs:ignore WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound esc_url( easy_wp_smtp()->get_utm_url( 'https://easywpsmtp.com/docs/setting-up-the-other-smtp-mailer/#auth-type', [ 'medium' => 'email-test', 'content' => 'Other SMTP auth debug - our documentation' ] ) ) ), ], ], // [smtp] - Sending bulk email, hitting rate limit. [ 'mailer' => 'smtp', 'errors' => [ [ 'We do not authorize the use of this system to transport unsolicited' ], ], 'title' => esc_html__( 'Error due to unsolicited and/or bulk e-mail.', 'easy-wp-smtp' ), 'description' => [ esc_html__( 'This means the connection to your SMTP host was made successfully, but the host rejected the email.', 'easy-wp-smtp' ), esc_html__( 'Typically this error is returned when you are sending too many e-mails or e-mails that have been identified as spam.', 'easy-wp-smtp' ), ], 'steps' => [ esc_html__( 'Make sure you are not sending emails with too many recipients. Example: single email should not have 10+ recipients. You can install any WordPress e-mail logging plugin to check your recipients (TO, CC and BCC).', 'easy-wp-smtp' ), esc_html__( 'Contact your SMTP host to ask about sending/rate limits.', 'easy-wp-smtp' ), esc_html__( 'Verify with them your SMTP account is in good standing and your account has not been flagged.', 'easy-wp-smtp' ), ], ], // [smtp] - Unauthenticated senders not allowed. [ 'mailer' => 'smtp', 'errors' => [ [ 'Unauthenticated senders not allowed' ], ], 'title' => esc_html__( 'Unauthenticated senders are not allowed.', 'easy-wp-smtp' ), 'description' => [ esc_html__( 'This means the connection to your SMTP host was made successfully, but you should enable Authentication and provide correct Username and Password.', 'easy-wp-smtp' ), ], 'steps' => [ esc_html__( 'Go to Easy WP SMTP plugin Settings page.', 'easy-wp-smtp' ), esc_html__( 'Enable Authentication', 'easy-wp-smtp' ), esc_html__( 'Enter correct SMTP Username (usually this is an email address) and Password in the appropriate fields.', 'easy-wp-smtp' ), ], ], // [smtp] - certificate verify failed. // Has to be defined before "SMTP connect() failed" error, since this is a more specific error, // which contains the "SMTP connect() failed" error message as well. [ 'mailer' => 'smtp', 'errors' => [ [ 'certificate verify failed' ], ], 'title' => esc_html__( 'Misconfigured server certificate.', 'easy-wp-smtp' ), 'description' => [ esc_html__( 'This means OpenSSL on your server isn\'t able to verify the host certificate.', 'easy-wp-smtp' ), esc_html__( 'There are a few reasons why this is happening. It could be that the host certificate is misconfigured, or this server\'s OpenSSL is using an outdated CA bundle.', 'easy-wp-smtp' ), ], 'steps' => [ esc_html__( 'Verify that the host\'s SSL certificate is valid.', 'easy-wp-smtp' ), sprintf( wp_kses( /* translators: %s - URL to the PHP openssl manual */ __( 'Contact your hosting support, show them the "full Error Log for debugging" below and share this <a href="%s" target="_blank" rel="noopener noreferrer">link</a> with them.', 'easy-wp-smtp' ), [ 'a' => [ 'href' => [], 'target' => [], 'rel' => [], ], ] ), 'https://www.php.net/manual/en/migration56.openssl.php' ), ], ], // [smtp] - SMTP connect() failed. [ 'mailer' => 'smtp', 'errors' => [ [ 'SMTP connect() failed' ], ], 'title' => esc_html__( 'Could not connect to the SMTP host.', 'easy-wp-smtp' ), 'description' => [ ! empty( $smtp_host ) ? sprintf( /* translators: %s - SMTP host address. */ esc_html__( 'This means your web server was unable to connect to %s.', 'easy-wp-smtp' ), $smtp_host ) : esc_html__( 'This means your web server was unable to connect to the host server.', 'easy-wp-smtp' ), esc_html__( 'Typically this error is returned for one of the following reasons:', 'easy-wp-smtp' ), '<ul>' . '<li>' . esc_html__( 'SMTP settings are incorrect (wrong port, security setting, incorrect host).', 'easy-wp-smtp' ) . '</li>' . '<li>' . esc_html__( 'Your web server is blocking the connection.', 'easy-wp-smtp' ) . '</li>' . '<li>' . esc_html__( 'Your SMTP host is rejecting the connection.', 'easy-wp-smtp' ) . '</li>' . '</ul>', ], 'steps' => [ esc_html__( 'Triple check your SMTP settings including host address, email, and password, port, and security.', 'easy-wp-smtp' ), sprintf( wp_kses( /* translators: %1$s - SMTP host address, %2$s - SMTP port, %3$s - SMTP encryption. */ __( 'Contact your web hosting provider and ask them to verify your server can connect to %1$s on port %2$s using %3$s encryption. Additionally, ask them if a firewall or security policy may be preventing the connection - many shared hosts block certain ports.<br><strong>Note: this is the most common cause of this issue.</strong>', 'easy-wp-smtp' ), [ 'a' => [ 'href' => [], 'rel' => [], 'target' => [], ], 'strong' => [], 'br' => [], ] ), $smtp_host, $smtp_port, 'none' === $smtp_encryption ? esc_html__( 'no', 'easy-wp-smtp' ) : $smtp_encryption ), esc_html__( 'Contact your SMTP host to confirm you are using the correct username and password.', 'easy-wp-smtp' ), esc_html__( 'Verify with your SMTP host that your account has permissions to send emails using outside connections.', 'easy-wp-smtp' ), ], ], // [mailgun] - Please activate your Mailgun account. [ 'mailer' => 'mailgun', 'errors' => [ [ 'Please activate your Mailgun account' ], ], 'title' => esc_html__( 'Mailgun failed.', 'easy-wp-smtp' ), 'description' => [ esc_html__( 'It seems that you forgot to activate your Mailgun account.', 'easy-wp-smtp' ), ], 'steps' => [ esc_html__( 'Check your inbox you used to create a Mailgun account. Click the activation link in an email from Mailgun.', 'easy-wp-smtp' ), esc_html__( 'If you do not see activation email, go to your Mailgun control panel and resend the activation email.', 'easy-wp-smtp' ), ], ], // [mailgun] - Forbidden. [ 'mailer' => 'mailgun', 'errors' => [ [ 'Forbidden' ], ], 'title' => esc_html__( 'Mailgun failed.', 'easy-wp-smtp' ), 'description' => [ esc_html__( 'Typically this error occurs because there is an issue with your Mailgun settings, in many cases Mailgun API Key, Domain Name, or Region is incorrect.', 'easy-wp-smtp' ), ], 'steps' => [ sprintf( wp_kses( /* translators: %1$s - Mailgun API Key area URL. */ __( 'Go to your Mailgun account and verify that your <a href="%1$s" target="_blank" rel="noopener noreferrer">Mailgun API Key</a> is correct.', 'easy-wp-smtp' ), [ 'a' => [ 'href' => [], 'rel' => [], 'target' => [], ], ] ), 'https://app.mailgun.com/settings/api_security' ), sprintf( wp_kses( /* translators: %1$s - Mailgun domains area URL. */ __( 'Verify your <a href="%1$s" target="_blank" rel="noopener noreferrer">Domain Name</a> is correct.', 'easy-wp-smtp' ), [ 'a' => [ 'href' => [], 'rel' => [], 'target' => [], ], ] ), 'https://app.mailgun.com/mg/sending/domains' ), esc_html__( 'Verify your domain Region is correct.', 'easy-wp-smtp' ), ], ], // [mailgun] - Free accounts are for test purposes only. [ 'mailer' => 'mailgun', 'errors' => [ [ 'Free accounts are for test purposes only' ], ], 'title' => esc_html__( 'Mailgun failed.', 'easy-wp-smtp' ), 'description' => [ esc_html__( 'Your Mailgun account does not have access to send emails.', 'easy-wp-smtp' ), esc_html__( 'Typically this error occurs because you have not set up and/or complete domain name verification for your Mailgun account.', 'easy-wp-smtp' ), ], 'steps' => [ sprintf( wp_kses( /* translators: %s - Mailgun documentation URL. */ __( 'Go to our how-to guide for setting up <a href="%s" target="_blank" rel="noopener noreferrer">Mailgun with Easy WP SMTP</a>.', 'easy-wp-smtp' ), [ 'a' => [ 'href' => [], 'rel' => [], 'target' => [], ], ] ), // phpcs:ignore WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound esc_url( easy_wp_smtp()->get_utm_url( 'https://easywpsmtp.com/docs/setting-up-the-mailgun-mailer/', [ 'medium' => 'email-test', 'content' => 'Mailgun with Easy WP SMTP' ] ) ) ), esc_html__( 'Complete the steps in section "2. Verify Your Domain".', 'easy-wp-smtp' ), ], ], // [gmail] - 401: Login Required. [ 'mailer' => 'gmail', 'errors' => [ [ '401', 'Login Required' ], ], 'title' => esc_html__( 'Google API Error.', 'easy-wp-smtp' ), 'description' => [ esc_html__( 'You have not properly configured Gmail mailer.', 'easy-wp-smtp' ), esc_html__( 'Make sure that you have clicked the "Allow plugin to send emails using your Google account" button under Gmail settings.', 'easy-wp-smtp' ), ], 'steps' => [ esc_html__( 'Go to plugin Settings page and click the "Allow plugin to send emails using your Google account" button.', 'easy-wp-smtp' ), esc_html__( 'After the click you should be redirected to a Gmail authorization screen, where you will be asked a permission to send emails on your behalf.', 'easy-wp-smtp' ), esc_html__( 'Please click "Agree", if you see that button. If not - you will need to enable less secure apps first:', 'easy-wp-smtp' ) . '<ul>' . '<li>' . sprintf( wp_kses( /* translators: %s - Google support article URL. */ __( 'if you are using regular Gmail account, please <a href="%s" target="_blank" rel="noopener noreferrer">read this article</a> to proceed.', 'easy-wp-smtp' ), [ 'a' => [ 'href' => [], 'target' => [], 'rel' => [], ], ] ), 'https://support.google.com/accounts/answer/6010255?hl=en' ) . '</li>' . '<li>' . sprintf( wp_kses( /* translators: %s - Google support article URL. */ __( 'if you are using Google Workspace, please <a href="%s" target="_blank" rel="noopener noreferrer">read this article</a> to proceed.', 'easy-wp-smtp' ), [ 'a' => [ 'href' => [], 'target' => [], 'rel' => [], ], ] ), 'https://support.google.com/cloudidentity/answer/6260879?hl=en' ) . '</li>' . '</ul>', ], ], // [gmail] - 400: Recipient address required. [ 'mailer' => 'gmail', 'errors' => [ [ '400', 'Recipient address required' ], ], 'title' => esc_html__( 'Google API Error.', 'easy-wp-smtp' ), 'description' => [ esc_html__( 'Typically this error occurs because the address to which the email was sent to is invalid or was empty.', 'easy-wp-smtp' ), ], 'steps' => [ esc_html__( 'Check the "Send To" email address used and confirm it is a valid email and was not empty.', 'easy-wp-smtp' ), sprintf( /* translators: 1 - correct email address example. 2 - incorrect email address example. */ esc_html__( 'It should be something like this: %1$s. These are incorrect values: %2$s.', 'easy-wp-smtp' ), '<code>info@example.com</code>', '<code>info@localhost</code>, <code>info@192.168.1.1</code>' ), esc_html__( 'Make sure that the generated email has a TO header, useful when you are responsible for email creation.', 'easy-wp-smtp' ), ], ], // [gmail] - Token has been expired or revoked. [ 'mailer' => 'gmail', 'errors' => [ [ 'invalid_grant', 'Token has been expired or revoked' ], ], 'title' => esc_html__( 'Google API Error.', 'easy-wp-smtp' ), 'description' => [ esc_html__( 'Unfortunately, this error can be due to many different reasons.', 'easy-wp-smtp' ), sprintf( wp_kses( /* translators: %s - Blog article URL. */ __( 'Please <a href="%s" target="_blank" rel="noopener noreferrer">read this article</a> to learn more about what can cause this error and follow the steps below.', 'easy-wp-smtp' ), [ 'a' => [ 'href' => [], 'target' => [], 'rel' => [], ], ] ), 'https://blog.timekit.io/google-oauth-invalid-grant-nightmare-and-how-to-fix-it-9f4efaf1da35' ), ], 'steps' => [ esc_html__( 'Go to Easy WP SMTP plugin settings page. Click the “Remove OAuth Connection” button.', 'easy-wp-smtp' ), esc_html__( 'Then click the “Allow plugin to send emails using your Google account” button and re-enable access.', 'easy-wp-smtp' ), ], ], // [gmail] - Code was already redeemed. [ 'mailer' => 'gmail', 'errors' => [ [ 'invalid_grant', 'Code was already redeemed' ], ], 'title' => esc_html__( 'Google API Error.', 'easy-wp-smtp' ), 'description' => [ esc_html__( 'Authentication code that Google returned to you has already been used on your previous auth attempt.', 'easy-wp-smtp' ), ], 'steps' => [ esc_html__( 'Make sure that you are not trying to manually clean up the plugin options to retry the "Allow..." step.', 'easy-wp-smtp' ), esc_html__( 'Reinstall the plugin with clean plugin data turned on on Misc page. This will remove all the plugin options and you will be safe to retry.', 'easy-wp-smtp' ), esc_html__( 'Make sure there is no aggressive caching on site admin area pages or try to clean cache between attempts.', 'easy-wp-smtp' ), ], ], // [gmail] - 400: Mail service not enabled. [ 'mailer' => 'gmail', 'errors' => [ [ '400', 'Mail service not enabled' ], ], 'title' => esc_html__( 'Google API Error.', 'easy-wp-smtp' ), 'description' => [ esc_html__( 'There are various reasons for that, please review the steps below.', 'easy-wp-smtp' ), ], 'steps' => [ sprintf( wp_kses( /* translators: %s - Google Google Workspace Admin area URL. */ __( 'Make sure that your Google Workspace trial period has not expired. You can check the status <a href="%s" target="_blank" rel="noopener noreferrer">here</a>.', 'easy-wp-smtp' ), [ 'a' => [ 'href' => [], 'rel' => [], 'target' => [], ], ] ), 'https://admin.google.com' ), sprintf( wp_kses( /* translators: %s - Google Google Workspace Admin area URL. */ __( 'Make sure that Gmail app in your Google Workspace is actually enabled. You can check that in Apps list in <a href="%s" target="_blank" rel="noopener noreferrer">Google Workspace Admin</a> area.', 'easy-wp-smtp' ), [ 'a' => [ 'href' => [], 'rel' => [], 'target' => [], ], ] ), 'https://admin.google.com' ), sprintf( wp_kses( /* translators: %s - Google Developers Console URL. */ __( 'Make sure that you have Gmail API enabled, and you can do that <a href="%s" target="_blank" rel="noopener noreferrer">here</a>.', 'easy-wp-smtp' ), [ 'a' => [ 'href' => [], 'rel' => [], 'target' => [], ], ] ), 'https://console.developers.google.com/' ), ], ], // [gmail] - 403: Project X is not found and cannot be used for API calls. [ 'mailer' => 'gmail', 'errors' => [ [ '403', 'is not found and cannot be used for API calls' ], ], 'title' => esc_html__( 'Google API Error.', 'easy-wp-smtp' ), 'description' => [], 'steps' => [ esc_html__( 'Make sure that the used Client ID/Secret correspond to a proper project that has Gmail API enabled.', 'easy-wp-smtp' ), sprintf( wp_kses( /* translators: %s - Gmail documentation URL. */ esc_html__( 'Please follow our <a href="%s" target="_blank" rel="noopener noreferrer">Gmail tutorial</a> to be sure that all the correct project and data is applied.', 'easy-wp-smtp' ), [ 'a' => [ 'href' => [], 'rel' => [], 'target' => [], ], ] ), // phpcs:ignore WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound esc_url( easy_wp_smtp()->get_utm_url( 'https://easywpsmtp.com/docs/setting-up-the-gmail-mailer/', [ 'medium' => 'email-test', 'content' => 'Gmail tutorial' ] ) ) ), ], ], // [gmail] - The OAuth client was disabled. [ 'mailer' => 'gmail', 'errors' => [ [ 'disabled_client', 'The OAuth client was disabled' ], ], 'title' => esc_html__( 'Google API Error.', 'easy-wp-smtp' ), 'description' => [ esc_html__( 'You may have added a new API to a project', 'easy-wp-smtp' ), ], 'steps' => [ esc_html__( 'Make sure that the used Client ID/Secret correspond to a proper project that has Gmail API enabled.', 'easy-wp-smtp' ), esc_html__( 'Try to use a separate project for your emails, so the project has only 1 Gmail API in it enabled. You will need to remove the old project and create a new one from scratch.', 'easy-wp-smtp' ), ], ], // [SMTP.com] - The "channel - not found" issue. [ 'mailer' => 'smtpcom', 'errors' => [ [ 'channel - not found' ], ], 'title' => esc_html__( 'SMTP.com API Error.', 'easy-wp-smtp' ), 'description' => [ esc_html__( 'Your Sender Name option is incorrect.', 'easy-wp-smtp' ), ], 'steps' => [ esc_html__( 'Please make sure you entered an accurate Sender Name in Easy WP SMTP plugin settings.', 'easy-wp-smtp' ), ], ], // [sparkpost] - Forbidden. [ 'mailer' => 'sparkpost', 'errors' => [ [ 'Forbidden' ], ], 'title' => esc_html__( 'SparkPost API failed.', 'easy-wp-smtp' ), 'description' => [ esc_html__( 'Typically this error occurs because there is an issue with your SparkPost settings, in many cases an incorrect API key.', 'easy-wp-smtp' ), ], 'steps' => [ sprintf( wp_kses( /* translators: %1$s - SparkPost API Keys area URL, %1$s - SparkPost EU API Keys area URL. */ __( 'Go to your <a href="%1$s" target="_blank" rel="noopener noreferrer">SparkPost account</a> or <a href="%2$s" target="_blank" rel="noopener noreferrer">SparkPost EU account</a> and verify that your API key is correct.', 'easy-wp-smtp' ), [ 'a' => [ 'href' => [], 'rel' => [], 'target' => [], ], 'b' => [], ] ), 'https://app.sparkpost.com/account/api-keys', 'https://app.eu.sparkpost.com/account/api-keys' ), esc_html__( 'Verify that your API key has "Transmissions: Read/Write" permission.', 'easy-wp-smtp' ), ], ], // [sparkpost] - Unauthorized. [ 'mailer' => 'sparkpost', 'errors' => [ [ 'Unauthorized' ], ], 'title' => esc_html__( 'SparkPost API failed.', 'easy-wp-smtp' ), 'description' => [ esc_html__( 'Typically this error occurs because there is an issue with your SparkPost settings, in many cases an incorrect region.', 'easy-wp-smtp' ), ], 'steps' => [ esc_html__( 'Verify that your SparkPost account region is selected in Easy WP SMTP settings.', 'easy-wp-smtp' ), ], ], ]; /** * [any] - PHP 7.4.x and PCRE library issues. */ if ( version_compare( phpversion(), '7.4', '>=' ) && defined( 'PCRE_VERSION' ) && version_compare( PCRE_VERSION, '10.0', '>' ) && version_compare( PCRE_VERSION, '10.32', '<=' ) ) { $details[] = [ 'mailer' => 'any', 'errors' => [ [ 'Invalid address: (setFrom)' ], ], 'title' => esc_html__( 'PCRE library issue', 'easy-wp-smtp' ), 'description' => [ esc_html__( 'It looks like your server is running PHP version 7.4.x with an outdated PCRE library (libpcre2) that has a known issue with email address validation.', 'easy-wp-smtp' ), esc_html__( 'There is a known issue with PHP version 7.4.x, when using libpcre2 library version lower than 10.33.', 'easy-wp-smtp' ), ], 'steps' => [ esc_html__( 'Contact your web hosting provider and inform them you are having issues with libpcre2 library on PHP 7.4.', 'easy-wp-smtp' ), esc_html__( 'They should be able to resolve this issue for you.', 'easy-wp-smtp' ), esc_html__( 'For a quick fix, until your web hosting resolves this, you can downgrade to PHP version 7.3 on your server.', 'easy-wp-smtp' ), ], ]; } // Error detection logic. foreach ( $details as $data ) { // Check for appropriate mailer. if ( 'any' !== $data['mailer'] && $this->debug['mailer'] !== $data['mailer'] ) { continue; } $match = false; // Attempt to detect errors. foreach ( $data['errors'] as $error_group ) { foreach ( $error_group as $error_message ) { $match = false !== strpos( $this->debug['error_log'], $error_message ); if ( ! $match ) { break; } } if ( $match ) { break; } } if ( $match ) { return $data; } } // Return defaults. return [ 'title' => esc_html__( 'An issue was detected.', 'easy-wp-smtp' ), 'description' => [ esc_html__( 'This means your test email was unable to be sent.', 'easy-wp-smtp' ), esc_html__( 'Typically this error is returned for one of the following reasons:', 'easy-wp-smtp' ), '<ul>' . '<li>' . esc_html__( 'Plugin settings are incorrect (wrong SMTP settings, invalid Mailer configuration, etc).', 'easy-wp-smtp' ) . '</li>' . '<li>' . esc_html__( 'Your web server is blocking the connection.', 'easy-wp-smtp' ) . '</li>' . '<li>' . esc_html__( 'Your host is rejecting the connection.', 'easy-wp-smtp' ) . '</li>' . '</ul>', ], 'steps' => [ esc_html__( 'Triple-check the plugin settings and consider reconfiguring to make sure everything is correct. Maybe there was an issue with copy&pasting.', 'easy-wp-smtp' ), wp_kses( __( 'Contact your web hosting provider and ask them to verify your server can make outside connections. Additionally, ask them if a firewall or security policy may be preventing the connection - many shared hosts block certain ports.<br><strong>Note: this is the most common cause of this issue.</strong>', 'easy-wp-smtp' ), [ 'strong' => [], 'br' => [], ] ), esc_html__( 'Try using a different mailer.', 'easy-wp-smtp' ), ], ]; } /** * Displays all the various error and debug details. * * @since 2.0.0 */ protected function display_debug_details() { if ( empty( $this->debug ) ) { return; } $debug = $this->get_debug_details(); $allowed_tags = [ 'a' => [ 'href' => [], 'rel' => [], 'target' => [], ], 'p' => [], 'strong' => [], 'b' => [], 'i' => [], 'br' => [], 'code' => [], 'ul' => [], 'ol' => [], 'li' => [], 'pre' => [], ]; ?> <div id="message" class="notice-error notice-inline"> <p><?php esc_html_e( 'There was a problem while sending the test email.', 'easy-wp-smtp' ); ?></p> </div> <div class="easy-wp-smtp-test-email-debug"> <h2><?php echo esc_html( $debug['title'] ); ?></h2> <?php foreach ( $debug['description'] as $description ) { $description = wp_kses( $description, $allowed_tags ); if ( substr( $description, 0, 1 ) !== '<' ) { echo '<p>' . $description . '</p>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } else { echo $description; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } ?> <h2><?php esc_html_e( 'Recommended next steps:', 'easy-wp-smtp' ); ?></h2> <ol> <?php foreach ( $debug['steps'] as $step ) : ?> <li><?php echo wp_kses( $step, $allowed_tags ); ?></li> <?php endforeach; ?> </ol> <h2><?php esc_html_e( 'Need support?', 'easy-wp-smtp' ); ?></h2> <?php if ( easy_wp_smtp()->is_pro() ) : ?> <p> <?php printf( wp_kses( /* translators: %s - EasyWPSMTP.com account area link. */ __( 'As a Easy WP SMTP Pro user you have access to Easy WP SMTP priority support. Please log in to your EasyWPSMTP.com account and <a href="%s" target="_blank" rel="noopener noreferrer">submit a support ticket</a>.', 'easy-wp-smtp' ), array( 'a' => array( 'href' => array(), 'rel' => array(), 'target' => array(), ), ) ), // phpcs:ignore WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound esc_url( easy_wp_smtp()->get_utm_url( 'https://easywpsmtp.com/account/support/', [ 'medium' => 'email-test', 'content' => 'submit a support ticket' ] ) ) ); ?> </p> <?php else : ?> <p> <?php esc_html_e( 'Easy WP SMTP is a free plugin, and the team behind SendLayer maintains it to give back to the WordPress community.', 'easy-wp-smtp' ); ?> </p> <p> <?php printf( wp_kses( /* translators: %s - EasyWPSMTP.com URL. */ __( 'To access our world class support, please <a href="%s" target="_blank" rel="noopener noreferrer">upgrade to Easy WP SMTP Pro</a>. Along with getting expert support, you will also get Notification controls, Email Logging, and integrations for Amazon SES, Office 365, and Outlook.com.', 'easy-wp-smtp' ), array( 'a' => array( 'href' => array(), 'target' => array(), 'rel' => array(), ), ) ), esc_url( easy_wp_smtp()->get_upgrade_link( 'email-test-fail' ) ) ) ?> </p> <p> <?php printf( wp_kses( /* Translators: %s - discount value 50% */ __( 'As a valued Easy WP SMTP user, you will get <span class="price-off">%s off regular pricing</span>, automatically applied at checkout!', 'easy-wp-smtp' ), array( 'span' => array( 'class' => array(), ), ) ), '50%' ); ?> </p> <p> <?php printf( wp_kses( /* translators: %1$s - Easy WP SMTP support forum URL, %2$s - EasyWPSMTP.com URL. */ __( 'Alternatively, we also offer limited support on the WordPress.org support forums. You can <a href="%1$s" target="_blank" rel="noopener noreferrer">create a support thread</a> there, but please understand that free support is not guaranteed and is limited to simple issues. If you have an urgent or complex issue, then please consider <a href="%2$s" target="_blank" rel="noopener noreferrer">upgrading to Easy WP SMTP Pro</a> to access our priority support ticket system.', 'easy-wp-smtp' ), array( 'a' => array( 'href' => array(), 'rel' => array(), 'target' => array(), ), ) ), 'https://wordpress.org/support/plugin/easy-wp-smtp/', esc_url( easy_wp_smtp()->get_upgrade_link( 'email-test-fail' ) ) ); ?> </p> <?php endif; ?> <p> <em><?php esc_html_e( 'Please copy the error log message below into the support ticket.', 'easy-wp-smtp' ); ?></em> </p> <p class="easy-wp-smtp-btn-group"> <button type="button" class="easy-wp-smtp-error-log-toggle easy-wp-smtp-btn easy-wp-smtp-btn--secondary"> <?php esc_html_e( 'View Full Error Log', 'easy-wp-smtp' ); ?> </button> <button type="button" class="easy-wp-smtp-error-log-copy easy-wp-smtp-btn easy-wp-smtp-btn--tertiary"> <span class="easy-wp-smtp-error-log-copy-front"> <?php esc_html_e( 'Copy Error Log', 'easy-wp-smtp' ); ?> </span> <span class="easy-wp-smtp-error-log-copy-back"> <?php esc_html_e( 'Copied', 'easy-wp-smtp' ); ?> </span> </button> </p> <div class="easy-wp-smtp-error-log notice-error notice-inline"> <blockquote> <?php echo wp_kses( $this->debug['error_log'], $allowed_tags ); ?> </blockquote> </div> </div> <?php } /** * Display the domain check details. * * @since 2.1.0 */ protected function display_domain_check_details() { if ( empty( $this->domain_checker ) || $this->domain_checker->no_issues() ) { return; } ?> <?php if ( $this->domain_checker->is_supported_mailer() ) : ?> <div class="notice-warning notice-inline easy-wp-smtp-notice"> <p><?php esc_html_e( 'The test email might have sent, but its deliverability should be improved.', 'easy-wp-smtp' ); ?></p> </div> <?php endif; ?> <?php echo $this->domain_checker->get_results_html(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> <?php } } PK 0/]\�Kf� � AdditionalConnectionsTab.phpnu ��� <?php namespace EasyWPSMTP\Admin\Pages; use EasyWPSMTP\Admin\PageAbstract; /** * Class AdditionalConnectionsTab is a placeholder for Pro additional connections feature. * Displays product education. * * @since 2.5.0 */ class AdditionalConnectionsTab extends PageAbstract { /** * Part of the slug of a tab. * * @since 2.5.0 * * @var string */ protected $slug = 'connections'; /** * Constructor. * * @since 2.5.0 * * @param PageAbstract $parent_page Parent page object. */ public function __construct( $parent_page = null ) { parent::__construct( $parent_page ); if ( easy_wp_smtp()->get_admin()->get_current_tab() === $this->slug && ! easy_wp_smtp()->is_pro() ) { $this->hooks(); } } /** * Link label of a tab. * * @since 2.5.0 * * @return string */ public function get_label() { return esc_html__( 'Additional Connections', 'easy-wp-smtp' ); } /** * Register hooks. * * @since 2.5.0 */ public function hooks() { add_action( 'easy_wp_smtp_admin_area_enqueue_assets', [ $this, 'enqueue_assets' ] ); } /** * Enqueue required JS and CSS. * * @since 2.5.0 */ public function enqueue_assets() { wp_enqueue_style( 'easy-wp-smtp-admin-lity', easy_wp_smtp()->assets_url . '/css/vendor/lity.min.css', [], '2.4.1' ); wp_enqueue_script( 'easy-wp-smtp-admin-lity', easy_wp_smtp()->assets_url . '/js/vendor/lity.min.js', [], '2.4.1' ); } /** * Output HTML of additional connections' education. * * @since 2.5.0 */ public function display() { $button_upgrade_link = add_query_arg( [ 'discount' => 'LITEUPGRADE' ], easy_wp_smtp()->get_upgrade_link( [ 'medium' => 'additional-connections', 'content' => 'Upgrade to Pro Button', ] ) ); $link_upgrade_link = add_query_arg( [ 'discount' => 'LITEUPGRADE' ], easy_wp_smtp()->get_upgrade_link( [ 'medium' => 'additional-connections', 'content' => 'upgrade-to-easy-wp-smtp-pro-text-link', ] ) ); ?> <div class="easy-wp-smtp-meta-box"> <div class="easy-wp-smtp-meta-box__header"> <div class="easy-wp-smtp-meta-box__heading"> <?php echo esc_html( $this->get_title() ); ?> </div> <a href="<?php echo esc_url( $button_upgrade_link ); ?>" target="_blank" rel="noopener noreferrer" class="easy-wp-smtp-btn easy-wp-smtp-btn--sm easy-wp-smtp-btn--green"> <?php esc_html_e( 'Upgrade to Pro', 'easy-wp-smtp' ); ?> </a> </div> <div class="easy-wp-smtp-meta-box__content"> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-row__desc"> <?php echo wp_kses( sprintf( /* translators: %s - EasyWPSMTP.com page URL. */ __( 'Set up additional connections to ensure a backup for your Primary Connection or to enable Smart Routing. <a href="%s" target="_blank" rel="noopener noreferrer">Upgrade to Easy WP SMTP Pro</a> to start taking advantage of additional connections.', 'easy-wp-smtp' ), esc_url( $link_upgrade_link ) ), [ 'a' => [ 'href' => [], 'rel' => [], 'target' => [], ], ] ); ?> </div> </div> <?php $this->display_education_screenshots(); $this->display_education_features_list(); ?> </div> </div> <?php } /** * Output HTML of additional connections' education screenshots. * * @since 2.5.0 */ protected function display_education_screenshots() { $assets_url = easy_wp_smtp()->assets_url . '/images/additional-connections/'; $screenshots = [ [ 'url' => $assets_url . 'screenshot-01.png', 'url_thumbnail' => $assets_url . 'thumbnail-01.png', 'title' => __( 'Backup Connection', 'easy-wp-smtp' ), ], [ 'url' => $assets_url . 'screenshot-02.png', 'url_thumbnail' => $assets_url . 'thumbnail-02.png', 'title' => __( 'Smart Routing', 'easy-wp-smtp' ), ], ]; ?> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-product-education-screenshots easy-wp-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 2.5.0 */ protected function display_education_features_list() { ?> <div class="easy-wp-smtp-row easy-wp-smtp-row--has-bg-color easy-wp-smtp-product-education-cta-row"> <div class="easy-wp-smtp-row__heading easy-wp-smtp-settings-heading"> <?php esc_html_e( 'Using additional connections, you are able to:', 'easy-wp-smtp' ); ?> </div> <div class="easy-wp-smtp-product-education-list"> <ul> <li><?php esc_html_e( 'Configure a Backup Connection', 'easy-wp-smtp' ); ?></li> </ul> <ul> <li><?php esc_html_e( 'Utilize different mailers for specific tasks', 'easy-wp-smtp' ); ?></li> </ul> <ul> <li><?php esc_html_e( 'Implement advanced routing rules', 'easy-wp-smtp' ); ?></li> </ul> </div> <?php $this->display_action_button(); ?> </div> <?php } /** * Output the action button. * * @since 2.6.0 */ protected function display_action_button() { $button_upgrade_link = add_query_arg( [ 'discount' => 'LITEUPGRADE' ], easy_wp_smtp()->get_upgrade_link( [ 'medium' => 'additional-connections', 'content' => 'Upgrade to Pro Button', ] ) ); ?> <a href="<?php echo esc_url( $button_upgrade_link ); ?>" target="_blank" rel="noopener noreferrer" class="easy-wp-smtp-btn easy-wp-smtp-btn--lg easy-wp-smtp-btn--green"> <?php esc_html_e( 'Upgrade to Easy WP SMTP Pro', 'easy-wp-smtp' ); ?> </a> <?php } } PK 0/]�~E¯ � Tools.phpnu ��� <?php namespace EasyWPSMTP\Admin\Pages; use EasyWPSMTP\Admin\ParentPageAbstract; /** * Class Tools. * * @since 2.0.0 */ class Tools extends ParentPageAbstract { /** * Slug of a page. * * @since 2.0.0 * * @var string */ protected $slug = 'tools'; /** * Page default tab slug. * * @since 2.0.0 * * @var string */ protected $default_tab = 'test'; /** * Link label of a page. * * @since 2.0.0 * * @return string */ public function get_label() { return esc_html__( 'Tools', 'easy-wp-smtp' ); } /** * Title of a page. * * @since 2.0.0 * * @return string */ public function get_title() { return $this->get_label(); } } PK 0/]k��;& & EmailReportsTab.phpnu ��� <?php namespace EasyWPSMTP\Admin\Pages; use EasyWPSMTP\Admin\PageAbstract; /** * Class EmailTrackingReportsTab is a placeholder for Pro email tracking reports. * Displays product education. * * @since 2.1.0 */ class EmailReportsTab extends PageAbstract { /** * Part of the slug of a tab. * * @since 2.1.0 * * @var string */ protected $slug = 'reports'; /** * Tab priority. * * @since 2.1.0 * * @var int */ protected $priority = 10; /** * Link label of a tab. * * @since 2.1.0 * * @return string */ public function get_label() { return esc_html__( 'Email Reports', 'easy-wp-smtp' ); } /** * Title of a tab. * * @since 2.1.0 * * @return string */ public function get_title() { return $this->get_label(); } /** * Register hooks. * * @since 2.1.0 */ public function hooks() { add_action( 'easy_wp_smtp_admin_area_enqueue_assets', [ $this, 'enqueue_assets' ] ); } /** * Enqueue required JS and CSS. * * @since 2.1.0 */ public function enqueue_assets() { wp_enqueue_style( 'easy-wp-smtp-admin-lity', easy_wp_smtp()->assets_url . '/css/vendor/lity.min.css', [], '2.4.1' ); wp_enqueue_script( 'easy-wp-smtp-admin-lity', easy_wp_smtp()->assets_url . '/js/vendor/lity.min.js', [], '2.4.1', false ); } /** * Output HTML of the email reports education. * * @since 2.1.0 */ public function display() { $button_upgrade_link = easy_wp_smtp()->get_upgrade_link( [ 'medium' => 'email-reports', 'content' => 'upgrade-to-easy-wp-smtp-pro-button-link', ] ); $assets_url = easy_wp_smtp()->assets_url . '/images/education/reports/'; $screenshots = [ [ 'url' => $assets_url . 'screenshot-01.png', 'url_thumbnail' => $assets_url . 'thumbnail-01.png', 'title' => __( 'Stats at a Glance', 'easy-wp-smtp' ), ], [ 'url' => $assets_url . 'screenshot-02.png', 'url_thumbnail' => $assets_url . 'thumbnail-02.png', 'title' => __( 'Detailed Stats by Subject Line', 'easy-wp-smtp' ), ], [ 'url' => $assets_url . 'screenshot-03.png', 'url_thumbnail' => $assets_url . 'thumbnail-03.png', 'title' => __( 'Weekly Email Report', 'easy-wp-smtp' ), ], ]; ?> <div class="easy-wp-smtp-meta-box"> <div class="easy-wp-smtp-meta-box__content"> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-row__desc"> <?php echo wp_kses( sprintf( /* translators: %s - EasyWPSMTP.com page URL. */ __( 'With Email Reports, you can track email deliverability and engagement from your WordPress dashboard. Open and click-through rates are grouped by subject line for quick and simple campaign performance analysis. The report will also show how many emails you successfully sent and how many emails failed to send each week so you can find and resolve problems with ease. <a href="%s" target="_blank" rel="noopener noreferrer">Upgrade to Easy WP SMTP Pro</a> now and we’ll add your email report to your WordPress dashboard.', 'easy-wp-smtp' ), esc_url( easy_wp_smtp()->get_upgrade_link( [ 'medium' => 'email-reports', 'content' => 'upgrade-to-easy-wp-smtp-pro-text-link', ] ) ) ), [ 'a' => [ 'href' => [], 'rel' => [], 'target' => [], ], ] ); ?> </div> </div> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-product-education-screenshots easy-wp-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="easy-wp-smtp-row easy-wp-smtp-row--has-bg-color easy-wp-smtp-product-education-cta-row"> <div class="easy-wp-smtp-row__heading easy-wp-smtp-settings-heading"> <?php esc_html_e( 'Unlock these awesome reporting features:', 'easy-wp-smtp' ); ?> </div> <div class="easy-wp-smtp-product-education-list"> <ul> <li><?php esc_html_e( 'Receive weekly deliverability reports', 'easy-wp-smtp' ); ?></li> <li><?php esc_html_e( 'See stats grouped by subject line', 'easy-wp-smtp' ); ?></li> </ul> <ul> <li><?php esc_html_e( 'Track total sent emails each week', 'easy-wp-smtp' ); ?></li> <li><?php esc_html_e( 'Monitor open and click-through rates', 'easy-wp-smtp' ); ?></li> </ul> <ul> <li><?php esc_html_e( 'Identify failed emails quickly', 'easy-wp-smtp' ); ?></li> <li><?php esc_html_e( 'View email report charts in WordPress', 'easy-wp-smtp' ); ?></li> </ul> </div> <a href="<?php echo esc_url( $button_upgrade_link ); ?>" target="_blank" rel="noopener noreferrer" class="easy-wp-smtp-btn easy-wp-smtp-btn--lg easy-wp-smtp-btn--green"> <?php esc_html_e( 'Upgrade to Easy WP SMTP Pro', 'easy-wp-smtp' ); ?> </a> </div> </div> </div> <?php } } PK 0/]�{, {, ExportTab.phpnu ��� <?php namespace EasyWPSMTP\Admin\Pages; use EasyWPSMTP\Admin\PageAbstract; /** * Class ExportTab is a placeholder for Pro email logs export. * Displays product education. * * @since 2.1.0 */ class ExportTab extends PageAbstract { /** * Part of the slug of a tab. * * @since 2.1.0 * * @var string */ protected $slug = 'export'; /** * Tab priority. * * @since 2.1.0 * * @var int */ protected $priority = 20; /** * Link label of a tab. * * @since 2.1.0 * * @return string */ public function get_label() { return esc_html__( 'Export', 'easy-wp-smtp' ); } /** * Title of a tab. * * @since 2.1.0 * * @return string */ public function get_title() { return $this->get_label(); } /** * Output HTML of the email logs export form preview. * * @since 2.1.0 */ public function display() { $button_upgrade_link = easy_wp_smtp()->get_upgrade_link( [ 'medium' => 'tools-export', 'content' => 'upgrade-to-easy-wp-smtp-pro-button', ] ); ?> <div class="easy-wp-smtp-meta-box"> <div class="easy-wp-smtp-meta-box__header"> <div class="easy-wp-smtp-meta-box__heading"> <?php esc_html_e( 'Export Email Logs', 'easy-wp-smtp' ); ?> </div> <a href="<?php echo esc_url( $button_upgrade_link ); ?>" target="_blank" rel="noopener noreferrer" class="easy-wp-smtp-btn easy-wp-smtp-btn--sm easy-wp-smtp-btn--green"> <?php esc_html_e( 'Upgrade to Pro', 'easy-wp-smtp' ); ?> </a> </div> <div class="easy-wp-smtp-meta-box__content"> <div class="easy-wp-smtp-row easy-wp-smtp-row--has-divider"> <div class="easy-wp-smtp-row__desc"> <?php echo wp_kses( sprintf( /* translators: %s - EasyWPSMTP.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 Easy WP SMTP Pro!</a>', 'easy-wp-smtp' ), esc_url( easy_wp_smtp()->get_upgrade_link( [ 'medium' => 'tools-export', 'content' => 'upgrade-to-easy-wp-smtp-pro-text-link', ] ) ) ), [ 'a' => [ 'href' => [], 'rel' => [], 'target' => [], ], ] ); ?> </div> </div> <div class="easy-wp-smtp-row easy-wp-smtp-setting-row--inactive easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <?php esc_html_e( 'Export Type', 'easy-wp-smtp' ); ?> </div> <div class="easy-wp-smtp-setting-row__field"> <div class="easy-wp-smtp-radio-group"> <label class="easy-wp-smtp-radio"> <input type="radio" checked> <span class="easy-wp-smtp-radio__checkmark"></span> <span class="easy-wp-smtp-radio__label"> <?php esc_html_e( 'Export in CSV (.csv)', 'easy-wp-smtp' ); ?> </span> </label> <label class="easy-wp-smtp-radio"> <span class="easy-wp-smtp-radio__checkmark"></span> <span class="easy-wp-smtp-radio__label"> <?php esc_html_e( 'Export in Microsoft Excel (.xlsx)', 'easy-wp-smtp' ); ?> </span> </label> <label class="easy-wp-smtp-radio"> <span class="easy-wp-smtp-radio__checkmark"></span> <span class="easy-wp-smtp-radio__label"> <?php esc_html_e( 'Export in EML (.eml)', 'easy-wp-smtp' ); ?> </span> </label> </div> </div> </div> <div class="easy-wp-smtp-row easy-wp-smtp-setting-row--inactive easy-wp-smtp-setting-row easy-wp-smtp-setting-row--text"> <div class="easy-wp-smtp-setting-row__label"> <?php esc_html_e( 'Custom Date Range', 'easy-wp-smtp' ); ?> </div> <div class="easy-wp-smtp-setting-row__field"> <input class="easy-wp-smtp-date-selector form-control input" placeholder="Select a date range" tabindex="0" type="text"> </div> </div> <div class="easy-wp-smtp-row easy-wp-smtp-setting-row--inactive easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <?php esc_html_e( 'Search', 'easy-wp-smtp' ); ?> </div> <div class="easy-wp-smtp-setting-row__field"> <div class="easy-wp-smtp-setting-row__sub-row easy-wp-smtp-radio-group"> <label class="easy-wp-smtp-radio"> <input type="radio" checked> <span class="easy-wp-smtp-radio__checkmark"></span> <span class="easy-wp-smtp-radio__label"> <?php esc_html_e( 'Email Addresses', 'easy-wp-smtp' ); ?> </span> </label> <label class="easy-wp-smtp-radio"> <span class="easy-wp-smtp-radio__checkmark"></span> <span class="easy-wp-smtp-radio__label"> <?php esc_html_e( 'Subject & Headers', 'easy-wp-smtp' ); ?> </span> </label> <label class="easy-wp-smtp-radio"> <span class="easy-wp-smtp-radio__checkmark"></span> <span class="easy-wp-smtp-radio__label"> <?php esc_html_e( 'Content', 'easy-wp-smtp' ); ?> </span> </label> </div> <div class="easy-wp-smtp-setting-row__sub-row"> <input type="text" class="easy-wp-smtp-search-box-term"> </div> </div> </div> <div class="easy-wp-smtp-row easy-wp-smtp-setting-row--inactive easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <?php esc_html_e( 'Common Information', 'easy-wp-smtp' ); ?> </div> <div class="easy-wp-smtp-setting-row__field"> <div class="easy-wp-smtp-checkbox-group"> <label class="easy-wp-smtp-checkbox"> <input type="checkbox" checked> <span class="easy-wp-smtp-checkbox__checkmark"></span> <span class="easy-wp-smtp-checkbox__label"> <?php esc_html_e( 'To Address', 'easy-wp-smtp' ); ?> </span> </label> <label class="easy-wp-smtp-checkbox"> <input type="checkbox" checked> <span class="easy-wp-smtp-checkbox__checkmark"></span> <span class="easy-wp-smtp-checkbox__label"> <?php esc_html_e( 'From Address', 'easy-wp-smtp' ); ?> </span> </label> <label class="easy-wp-smtp-checkbox"> <input type="checkbox" checked> <span class="easy-wp-smtp-checkbox__checkmark"></span> <span class="easy-wp-smtp-checkbox__label"> <?php esc_html_e( 'From Name', 'easy-wp-smtp' ); ?> </span> </label> <label class="easy-wp-smtp-checkbox"> <input type="checkbox" checked> <span class="easy-wp-smtp-checkbox__checkmark"></span> <span class="easy-wp-smtp-checkbox__label"> <?php esc_html_e( 'Subject', 'easy-wp-smtp' ); ?> </span> </label> <label class="easy-wp-smtp-checkbox"> <input type="checkbox" checked> <span class="easy-wp-smtp-checkbox__checkmark"></span> <span class="easy-wp-smtp-checkbox__label"> <?php esc_html_e( 'Body', 'easy-wp-smtp' ); ?> </span> </label> <label class="easy-wp-smtp-checkbox"> <input type="checkbox" checked> <span class="easy-wp-smtp-checkbox__checkmark"></span> <span class="easy-wp-smtp-checkbox__label"> <?php esc_html_e( 'Created Date', 'easy-wp-smtp' ); ?> </span> </label> <label class="easy-wp-smtp-checkbox"> <input type="checkbox" checked> <span class="easy-wp-smtp-checkbox__checkmark"></span> <span class="easy-wp-smtp-checkbox__label"> <?php esc_html_e( 'Number of Attachments', 'easy-wp-smtp' ); ?> </span> </label> <label class="easy-wp-smtp-checkbox"> <input type="checkbox" checked> <span class="easy-wp-smtp-checkbox__checkmark"></span> <span class="easy-wp-smtp-checkbox__label"> <?php esc_html_e( 'Attachments', 'easy-wp-smtp' ); ?> </span> </label> </div> </div> </div> <div class="easy-wp-smtp-row easy-wp-smtp-setting-row--inactive easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <?php esc_html_e( 'Additional Information', 'easy-wp-smtp' ); ?> </div> <div class="easy-wp-smtp-setting-row__field"> <div class="easy-wp-smtp-checkbox-group"> <label class="easy-wp-smtp-checkbox"> <span class="easy-wp-smtp-checkbox__checkmark"></span> <span class="easy-wp-smtp-checkbox__label"> <?php esc_html_e( 'Status', 'easy-wp-smtp' ); ?> </span> </label> <label class="easy-wp-smtp-checkbox"> <span class="easy-wp-smtp-checkbox__checkmark"></span> <span class="easy-wp-smtp-checkbox__label"> <?php esc_html_e( 'Carbon Copy (CC)', 'easy-wp-smtp' ); ?> </span> </label> <label class="easy-wp-smtp-checkbox"> <span class="easy-wp-smtp-checkbox__checkmark"></span> <span class="easy-wp-smtp-checkbox__label"> <?php esc_html_e( 'Blind Carbon Copy (BCC)', 'easy-wp-smtp' ); ?> </span> </label> <label class="easy-wp-smtp-checkbox"> <span class="easy-wp-smtp-checkbox__checkmark"></span> <span class="easy-wp-smtp-checkbox__label"> <?php esc_html_e( 'Headers', 'easy-wp-smtp' ); ?> </span> </label> <label class="easy-wp-smtp-checkbox"> <span class="easy-wp-smtp-checkbox__checkmark"></span> <span class="easy-wp-smtp-checkbox__label"> <?php esc_html_e( 'Mailer', 'easy-wp-smtp' ); ?> </span> </label> <label class="easy-wp-smtp-checkbox"> <span class="easy-wp-smtp-checkbox__checkmark"></span> <span class="easy-wp-smtp-checkbox__label"> <?php esc_html_e( 'Error Details', 'easy-wp-smtp' ); ?> </span> </label> <label class="easy-wp-smtp-checkbox"> <span class="easy-wp-smtp-checkbox__checkmark"></span> <span class="easy-wp-smtp-checkbox__label"> <?php esc_html_e( 'Email log ID', 'easy-wp-smtp' ); ?> </span> </label> <label class="easy-wp-smtp-checkbox"> <span class="easy-wp-smtp-checkbox__checkmark"></span> <span class="easy-wp-smtp-checkbox__label"> <?php esc_html_e( 'Opened', 'easy-wp-smtp' ); ?> </span> </label> <label class="easy-wp-smtp-checkbox"> <span class="easy-wp-smtp-checkbox__checkmark"></span> <span class="easy-wp-smtp-checkbox__label"> <?php esc_html_e( 'Clicked', 'easy-wp-smtp' ); ?> </span> </label> <label class="easy-wp-smtp-checkbox"> <span class="easy-wp-smtp-checkbox__checkmark"></span> <span class="easy-wp-smtp-checkbox__label"> <?php esc_html_e( 'Source', 'easy-wp-smtp' ); ?> </span> </label> </div> </div> </div> </div> </div> <a href="<?php echo esc_url( $button_upgrade_link ); ?>" target="_blank" rel="noopener noreferrer" class="easy-wp-smtp-btn easy-wp-smtp-btn--lg easy-wp-smtp-btn--green"> <?php esc_html_e( 'Upgrade to Easy WP SMTP Pro', 'easy-wp-smtp' ); ?> </a> <?php } } PK 0/]�v�3�/ �/ SmartRoutingTab.phpnu ��� <?php namespace EasyWPSMTP\Admin\Pages; use EasyWPSMTP\Admin\PageAbstract; /** * Class SmartRoutingTab is a placeholder for Pro smart routing feature. * Displays product education. * * @since 2.5.0 */ class SmartRoutingTab extends PageAbstract { /** * Part of the slug of a tab. * * @since 2.5.0 * * @var string */ protected $slug = 'routing'; /** * Constructor. * * @since 2.5.0 * * @param PageAbstract $parent_page Parent page object. */ public function __construct( $parent_page = null ) { parent::__construct( $parent_page ); if ( easy_wp_smtp()->get_admin()->get_current_tab() === $this->slug && ! easy_wp_smtp()->is_pro() ) { $this->hooks(); } } /** * Link label of a tab. * * @since 2.5.0 * * @return string */ public function get_label() { return esc_html__( 'Smart Routing', 'easy-wp-smtp' ); } /** * Register hooks. * * @since 2.5.0 */ public function hooks() { add_action( 'easy_wp_smtp_admin_area_enqueue_assets', [ $this, 'enqueue_assets' ] ); } /** * Enqueue required JS and CSS. * * @since 2.5.0 */ public function enqueue_assets() { wp_enqueue_style( 'easy-wp-smtp-smart-routing', easy_wp_smtp()->plugin_url . '/assets/css/smtp-smart-routing.min.css', [], EasyWPSMTP_PLUGIN_VERSION ); } /** * Output HTML of smart routing education. * * @since 2.5.0 */ public function display() { $upgrade_button_url = easy_wp_smtp()->get_upgrade_link( [ 'medium' => 'Smart Routing Settings', 'content' => 'Upgrade to Easy WP SMTP Pro Button Top', ] ); ?> <div class="easy-wp-smtp-meta-box"> <div class="easy-wp-smtp-meta-box__header"> <div class="easy-wp-smtp-meta-box__heading"> <?php esc_html_e( 'Smart Routing', 'easy-wp-smtp' ); ?> </div> <a href="<?php echo esc_url( $upgrade_button_url ); ?>" target="_blank" rel="noopener noreferrer" class="easy-wp-smtp-btn easy-wp-smtp-btn--sm easy-wp-smtp-btn--green"> <?php esc_html_e( 'Upgrade to Pro', 'easy-wp-smtp' ); ?> </a> </div> <div class="easy-wp-smtp-meta-box__content"> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-row__desc"> <?php echo wp_kses( sprintf( /* translators: %s - EasyWPSMTP.com page URL. */ __( 'Route emails through different additional connections depending on your set conditions. Any emails that don\'t meet these conditions will be sent through your Primary Connection. <a href="%s" target="_blank" rel="noopener noreferrer">Upgrade to Easy WP SMTP Pro</a>.', 'easy-wp-smtp' ), esc_url( $upgrade_button_url ) ), [ 'a' => [ 'href' => [], 'rel' => [], 'target' => [], ], ] ); ?> </div> </div> <div class="easy-wp-smtp-row"> <label for="easy-wp-smtp-setting-from_name_force" class="easy-wp-smtp-toggle"> <input type="checkbox" value="true" id="easy-wp-smtp-setting-from_name_force" disabled/> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--static"> <?php esc_html_e( 'Enable Smart Routing', 'easy-wp-smtp' ); ?> </span> </label> </div> </div> </div> <div class="easy-wp-smtp-meta-box"> <div class="easy-wp-smtp-meta-box__header"> <div class="easy-wp-smtp-meta-box__heading"> <?php esc_html_e( 'Conditions', 'easy-wp-smtp' ); ?> </div> </div> <div class="easy-wp-smtp-meta-box__content"> <div class="easy-wp-smtp-smart-routing-routes"> <div class="easy-wp-smtp-setting-row easy-wp-smtp-row--inactive easy-wp-smtp-smart-routing-route"> <div class="easy-wp-smtp-smart-routing-route__header"> <span><?php esc_html_e( 'Send with', 'easy-wp-smtp' ); ?></span> <select class="easy-wp-smtp-smart-routing-route__connection"> <option><?php esc_html_e( 'WooCommerce Emails (SendLayer)', 'easy-wp-smtp' ); ?></option> </select> <span><?php esc_html_e( 'if the following conditions are met...', 'easy-wp-smtp' ); ?></span> <div class="easy-wp-smtp-smart-routing-route__actions"> <div class="easy-wp-smtp-smart-routing-route__order"> <button class="easy-wp-smtp-smart-routing-route__order-btn easy-wp-smtp-smart-routing-route__order-btn--up"></button> <button class="easy-wp-smtp-smart-routing-route__order-btn easy-wp-smtp-smart-routing-route__order-btn--down"></button> </div> <button class="easy-wp-smtp-smart-routing-route__delete"> <i class="dashicons dashicons-trash"></i> </button> </div> </div> <div class="easy-wp-smtp-smart-routing-route__main"> <div class="easy-wp-smtp-conditional"> <div class="easy-wp-smtp-conditional__group"> <table> <tbody> <tr class="easy-wp-smtp-conditional__row"> <td class="easy-wp-smtp-conditional__property-col"> <select> <option><?php esc_html_e( 'Subject', 'easy-wp-smtp' ); ?></option> </select> </td> <td class="easy-wp-smtp-conditional__operator-col"> <select class="easy-wp-smtp-conditional__operator"> <option><?php esc_html_e( 'Contains', 'easy-wp-smtp' ); ?></option> </select> </td> <td class="easy-wp-smtp-conditional__value-col"> <input type="text" value="<?php esc_html_e( 'Order', 'easy-wp-smtp' ); ?>" class="easy-wp-smt-conditional__value"> </td> <td class="easy-wp-smtp-conditional__actions"> <button class="easy-wp-smtp-conditional__add-rule easy-wp-smtp-btn easy-wp-smtp-btn easy-wp-smtp-btn--secondary"> <?php esc_html_e( 'And', 'easy-wp-smtp' ); ?> </button> <button class="easy-wp-smtp-conditional__delete-rule"> <i class="dashicons dashicons-trash" aria-hidden="true"></i> </button> </td> </tr> <tr class="easy-wp-smtp-conditional__row"> <td class="easy-wp-smtp-conditional__property-col"> <select class="easy-wp-smtp-conditional__property"> <option><?php esc_html_e( 'From Email', 'easy-wp-smtp' ); ?></option> </select> </td> <td class="easy-wp-smtp-conditional__operator-col"> <select class="easy-wp-smtp-conditional__operator"> <option><?php esc_html_e( 'Is', 'easy-wp-smtp' ); ?></option> </select> </td> <td class="easy-wp-smtp-conditional__value-col"> <input type="text" value="shop@easywpsmtp.com" class="easy-wp-smtp-conditional__value"> </td> <td class="easy-wp-smtp-conditional__actions"> <button class="easy-wp-smtp-conditional__add-rule easy-wp-smtp-btn easy-wp-smtp-btn easy-wp-smtp-btn--secondary"> <?php esc_html_e( 'And', 'easy-wp-smtp' ); ?> </button> <button class="easy-wp-smtp-conditional__delete-rule"> <i class="dashicons dashicons-trash" aria-hidden="true"></i> </button> </td> </tr> </tbody> </table> <div class="easy-wp-smtp-conditional__group-delimiter"><?php esc_html_e( 'or', 'easy-wp-smtp' ); ?></div> </div> <div class="easy-wp-smtp-conditional__group"> <table> <tbody> <tr class="easy-wp-smtp-conditional__row"> <td class="easy-wp-smtp-conditional__property-col"> <select class="easy-wp-smtp-conditional__property"> <option><?php esc_html_e( 'From Email', 'easy-wp-smtp' ); ?></option> </select> </td> <td class="easy-wp-smtp-conditional__operator-col"> <select class="easy-wp-smtp-conditional__operator"> <option><?php esc_html_e( 'Is', 'easy-wp-smtp' ); ?></option> </select> </td> <td class="easy-wp-smtp-conditional__value-col"> <input type="text" value="returns@easywpsmtp.com" class="easy-wp-smtp-conditional__value"> </td> <td class="easy-wp-smtp-conditional__actions"> <button class="easy-wp-smtp-conditional__add-rule easy-wp-smtp-btn easy-wp-smtp-btn easy-wp-smtp-btn--secondary"> <?php esc_html_e( 'And', 'easy-wp-smtp' ); ?> </button> <button class="easy-wp-smtp-conditional__delete-rule"> <i class="dashicons dashicons-trash" aria-hidden="true"></i> </button> </td> </tr> </tbody> </table> <div class="easy-wp-smtp-conditional__group-delimiter"><?php esc_html_e( 'or', 'easy-wp-smtp' ); ?></div> </div> <button class="easy-wp-smtp-conditional__add-group easy-wp-smtp-btn easy-wp-smtp-btn easy-wp-smtp-btn--secondary"> <?php esc_html_e( 'Add New Group', 'easy-wp-smtp' ); ?> </button> </div> </div> </div> <div class="easy-wp-smtp-setting-row easy-wp-smtp-row--inactive easy-wp-smtp-smart-routing-route"> <div class="easy-wp-smtp-smart-routing-route__header"> <span><?php esc_html_e( 'Send with', 'easy-wp-smtp' ); ?></span> <select class="easy-wp-smtp-smart-routing-route__connection"> <option><?php esc_html_e( 'Contact Emails (SMTP.com)', 'easy-wp-smtp' ); ?></option> </select> <span><?php esc_html_e( 'if the following conditions are met...', 'easy-wp-smtp' ); ?></span> <div class="easy-wp-smtp-smart-routing-route__actions"> <div class="easy-wp-smtp-smart-routing-route__order"> <button class="easy-wp-smtp-smart-routing-route__order-btn easy-wp-smtp-smart-routing-route__order-btn--up"></button> <button class="easy-wp-smtp-smart-routing-route__order-btn easy-wp-smtp-smart-routing-route__order-btn--down"></button> </div> <button class="easy-wp-smtp-smart-routing-route__delete"> <i class="dashicons dashicons-trash"></i> </button> </div> </div> <div class="easy-wp-smtp-smart-routing-route__main"> <div class="easy-wp-smtp-conditional"> <div class="easy-wp-smtp-conditional__group"> <table> <tbody> <tr class="easy-wp-smtp-conditional__row"> <td class="easy-wp-smtp-conditional__property-col"> <select> <option><?php esc_html_e( 'Initiator', 'easy-wp-smtp' ); ?></option> </select> </td> <td class="easy-wp-smtp-conditional__operator-col"> <select class="easy-wp-smtp-conditional__operator"> <option><?php esc_html_e( 'Is', 'easy-wp-smtp' ); ?></option> </select> </td> <td class="easy-wp-smtp-conditional__value-col"> <input type="text" value="<?php esc_html_e( 'WPForms', 'easy-wp-smtp' ); ?>" class="easy-wp-smtp-conditional__value"> </td> <td class="easy-wp-smtp-conditional__actions"> <button class="easy-wp-smtp-conditional__add-rule easy-wp-smtp-btn easy-wp-smtp-btn easy-wp-smtp-btn--secondary"> <?php esc_html_e( 'And', 'easy-wp-smtp' ); ?> </button> <button class="easy-wp-smtp-conditional__delete-rule"> <i class="dashicons dashicons-trash" aria-hidden="true"></i> </button> </td> </tr> </tbody> </table> <div class="easy-wp-smtp-conditional__group-delimiter"><?php esc_html_e( 'or', 'easy-wp-smtp' ); ?></div> </div> <button class="easy-wp-smtp-conditional__add-group easy-wp-smtp-btn easy-wp-smtp-btn easy-wp-smtp-btn--secondary"> <?php esc_html_e( 'Add New Group', 'easy-wp-smtp' ); ?> </button> </div> </div> </div> </div> </div> </div> <div class="easy-wp-smtp-row"> <a href="<?php echo esc_url( $upgrade_button_url ); ?>" target="_blank" rel="noopener noreferrer" class="easy-wp-smtp-btn easy-wp-smtp-btn--lg easy-wp-smtp-btn--green"> <?php esc_html_e( 'Upgrade to Easy WP SMTP Pro', 'easy-wp-smtp' ); ?> </a> </div> <?php } } PK 0/]U���7U 7U AlertsTab.phpnu ��� <?php namespace EasyWPSMTP\Admin\Pages; use EasyWPSMTP\Admin\PageAbstract; /** * Class AlertsTab is a placeholder for Pro alerts feature. * Displays product education. * * @since 2.4.0 */ class AlertsTab extends PageAbstract { /** * Part of the slug of a tab. * * @since 2.4.0 * * @var string */ protected $slug = 'alerts'; /** * Tab priority. * * @since 2.4.0 * * @var int */ protected $priority = 20; /** * Link label of a tab. * * @since 2.4.0 * * @return string */ public function get_label() { return esc_html__( 'Alerts', 'easy-wp-smtp' ); } /** * Title of a tab. * * @since 2.4.0 * * @return string */ public function get_title() { return $this->get_label(); } /** * Output HTML of the alerts settings preview. * * @since 2.4.0 */ public function display() { $upgrade_link_url = easy_wp_smtp()->get_upgrade_link( [ 'medium' => 'Alerts Settings', 'content' => 'Upgrade to Easy WP SMTP Pro Link', ] ); $upgrade_button_url = easy_wp_smtp()->get_upgrade_link( [ 'medium' => 'Alerts Settings', 'content' => 'Upgrade to Easy WP SMTP Pro Button', ] ); ?> <div class="easy-wp-smtp-meta-box"> <div class="easy-wp-smtp-meta-box__header"> <div class="easy-wp-smtp-meta-box__heading"> <?php esc_html_e( 'Alerts', 'easy-wp-smtp' ); ?> </div> <a href="<?php echo esc_url( $upgrade_button_url ); ?>" target="_blank" rel="noopener noreferrer" class="easy-wp-smtp-btn easy-wp-smtp-btn--sm easy-wp-smtp-btn--green"> <?php esc_html_e( 'Upgrade to Pro', 'easy-wp-smtp' ); ?> </a> </div> <div class="easy-wp-smtp-meta-box__content"> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-row__desc"> <?php echo wp_kses( sprintf( /* translators: %s - EasyWPSMTP.com Upgrade page URL. */ __( 'Configure these alert options 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 Easy WP SMTP Pro!</a>', 'easy-wp-smtp' ), esc_url( $upgrade_link_url ) ), [ 'a' => [ 'href' => [], 'rel' => [], 'target' => [], ], ] ); ?> </div> </div> <div id="easy-wp-smtp-setting-row-alert_event_types" class="easy-wp-smtp-row easy-wp-smtp-setting-row easy-wp-smtp-row--has-divider"> <div class="easy-wp-smtp-setting-row__label"> <label for="easy-wp-smtp-setting-alert_event_types"> <?php esc_html_e( 'Notify when', 'easy-wp-smtp' ); ?> </label> </div> <div class="easy-wp-smtp-setting-row__field"> <div class="easy-wp-smtp-setting-row__sub-row"> <label class="easy-wp-smtp-toggle" for="easy-wp-smtp-setting-alert_events_email_fails"> <input name="easy-wp-smtp[alert_events][email_fails]" type="checkbox" value="true" checked disabled id="easy-wp-smtp-setting-alert_events_email_fails" /> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--static"><?php esc_html_e( 'The initial email sending request fails', 'easy-wp-smtp' ); ?></span> </label> <p class="desc"> <?php esc_html_e( 'This option is always enabled and will notify you about instant email sending failures.', 'easy-wp-smtp' ); ?> </p> </div> <div class="easy-wp-smtp-setting-row__sub-row"> <label class="easy-wp-smtp-toggle" for="easy-wp-smtp-setting-alerts_hard_bounced"> <input name="easy-wp-smtp[alert_events][email_hard_bounced]" type="checkbox" value="true" disabled id="easy-wp-smtp-setting-alert_events_email_hard_bounced" /> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--static"><?php esc_html_e( 'The deliverability verification process detects a hard bounce', 'easy-wp-smtp' ); ?></span> </label> <p class="desc"> <?php esc_html_e( 'Get notified about emails that were successfully sent, but have hard bounced on delivery attempt. A hard bounce is an email that has failed to deliver for permanent reasons, such as the recipient\'s email address being invalid.', 'easy-wp-smtp' ); ?> </p> </div> </div> </div> <div class="easy-wp-smtp-row easy-wp-smtp-row--has-divider easy-wp-smtp-row--inactive easy-wp-smtp-alert-setting-row"> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-row__heading"> <?php esc_html_e( 'Email', 'easy-wp-smtp' ); ?> </div> <div class="easy-wp-smtp-row__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.', 'easy-wp-smtp' ); ?> </div> </div> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <label><?php esc_html_e( 'Email Alerts', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"> <label class="easy-wp-smtp-toggle"> <input type="checkbox"/> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--checked"><?php esc_html_e( 'On', 'easy-wp-smtp' ); ?></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--unchecked"><?php esc_html_e( 'Off', 'easy-wp-smtp' ); ?></span> </label> </div> </div> </div> <div class="easy-wp-smtp-row easy-wp-smtp-alert-setting-row-options"> <div class="easy-wp-smtp-row easy-wp-smtp-alert-setting-row-connection-options"> <div class="easy-wp-smtp-setting-row easy-wp-smtp-setting-row--text"> <div class="easy-wp-smtp-setting-row__label"> <label><?php esc_html_e( 'Send To', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"><input type="text"></div> </div> </div> </div> </div> <div class="easy-wp-smtp-row easy-wp-smtp-row--has-divider easy-wp-smtp-row--inactive easy-wp-smtp-alert-setting-row"> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-row__heading"> <?php esc_html_e( 'Slack', 'easy-wp-smtp' ); ?> </div> <div class="easy-wp-smtp-row__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.', 'easy-wp-smtp' ); ?> </div> </div> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <label><?php esc_html_e( 'Slack Alerts', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"> <label class="easy-wp-smtp-toggle"> <input type="checkbox"/> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--checked"><?php esc_html_e( 'On', 'easy-wp-smtp' ); ?></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--unchecked"><?php esc_html_e( 'Off', 'easy-wp-smtp' ); ?></span> </label> </div> </div> </div> <div class="easy-wp-smtp-row easy-wp-smtp-alert-setting-row-options"> <div class="easy-wp-smtp-row easy-wp-smtp-alert-setting-row-connection-options"> <div class="easy-wp-smtp-setting-row easy-wp-smtp-setting-row--text"> <div class="easy-wp-smtp-setting-row__label"> <label><?php esc_html_e( 'Webhook URL', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"><input type="text"></div> </div> </div> </div> </div> <div class="easy-wp-smtp-row easy-wp-smtp-row--has-divider easy-wp-smtp-row--inactive easy-wp-smtp-alert-setting-row"> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-row__heading"> <?php esc_html_e( 'Discord', 'easy-wp-smtp' ); ?> </div> <div class="easy-wp-smtp-row__desc"> <?php esc_html_e( 'Paste in the Discord webhook URL you’d like to use to receive alerts when email sending fails. Read our documentation on setting up Discord alerts.', 'easy-wp-smtp' ); ?> </div> </div> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <label><?php esc_html_e( 'Discord', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"> <label class="easy-wp-smtp-toggle"> <input type="checkbox"/> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--checked"><?php esc_html_e( 'On', 'easy-wp-smtp' ); ?></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--unchecked"><?php esc_html_e( 'Off', 'easy-wp-smtp' ); ?></span> </label> </div> </div> </div> <div class="easy-wp-smtp-row easy-wp-smtp-alert-setting-row-options"> <div class="easy-wp-smtp-row easy-wp-smtp-alert-setting-row-connection-options"> <div class="easy-wp-smtp-setting-row easy-wp-smtp-setting-row--text"> <div class="easy-wp-smtp-setting-row__label"> <label><?php esc_html_e( 'Webhook URL', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"><input type="text"></div> </div> </div> </div> </div> <div class="easy-wp-smtp-row easy-wp-smtp-row--has-divider easy-wp-smtp-row--inactive easy-wp-smtp-alert-setting-row"> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-row__heading"> <?php esc_html_e( 'Microsoft Teams', 'easy-wp-smtp' ); ?> </div> <div class="easy-wp-smtp-row__desc"> <?php esc_html_e( 'Paste in the Microsoft Teams webhook URL you’d like to use to receive alerts when email sending fails. Read our documentation on setting up Microsoft Teams alerts.', 'easy-wp-smtp' ); ?> </div> </div> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <label><?php esc_html_e( 'Microsoft Teams Alerts', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"> <label class="easy-wp-smtp-toggle"> <input type="checkbox"/> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--checked"><?php esc_html_e( 'On', 'easy-wp-smtp' ); ?></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--unchecked"><?php esc_html_e( 'Off', 'easy-wp-smtp' ); ?></span> </label> </div> </div> </div> <div class="easy-wp-smtp-row easy-wp-smtp-alert-setting-row-options"> <div class="easy-wp-smtp-row easy-wp-smtp-alert-setting-row-connection-options"> <div class="easy-wp-smtp-setting-row easy-wp-smtp-setting-row--text"> <div class="easy-wp-smtp-setting-row__label"> <label><?php esc_html_e( 'Webhook URL', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"><input type="text"></div> </div> </div> </div> </div> <div class="easy-wp-smtp-row easy-wp-smtp-row--has-divider easy-wp-smtp-row--inactive easy-wp-smtp-alert-setting-row"> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-row__heading"> <?php esc_html_e( 'SMS via Twilio', 'easy-wp-smtp' ); ?> </div> <div class="easy-wp-smtp-row__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.', 'easy-wp-smtp' ); ?> </div> </div> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <label><?php esc_html_e( 'SMS via Twilio Alerts', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"> <label class="easy-wp-smtp-toggle"> <input type="checkbox"/> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--checked"><?php esc_html_e( 'On', 'easy-wp-smtp' ); ?></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--unchecked"><?php esc_html_e( 'Off', 'easy-wp-smtp' ); ?></span> </label> </div> </div> </div> <div class="easy-wp-smtp-row easy-wp-smtp-alert-setting-row-options"> <div class="easy-wp-smtp-row easy-wp-smtp-alert-setting-row-connection-options"> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-setting-row easy-wp-smtp-setting-row--text"> <div class="easy-wp-smtp-setting-row__label"> <label><?php esc_html_e( 'Twilio Account ID', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"><input type="text"></div> </div> </div> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-setting-row easy-wp-smtp-setting-row--text"> <div class="easy-wp-smtp-setting-row__label"> <label><?php esc_html_e( 'Twilio Auth Token', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"><input type="text"></div> </div> </div> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-setting-row easy-wp-smtp-setting-row--text"> <div class="easy-wp-smtp-setting-row__label"> <label><?php esc_html_e( 'From Phone Number', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"><input type="text"></div> </div> </div> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-setting-row easy-wp-smtp-setting-row--text"> <div class="easy-wp-smtp-setting-row__label"> <label><?php esc_html_e( 'To Phone Number', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"><input type="text"></div> </div> </div> </div> </div> </div> <div class="easy-wp-smtp-row easy-wp-smtp-row--has-divider easy-wp-smtp-row--inactive easy-wp-smtp-alert-setting-row"> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-row__heading"> <?php esc_html_e( 'Webhook', 'easy-wp-smtp' ); ?> </div> <div class="easy-wp-smtp-row__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.', 'easy-wp-smtp' ); ?> </div> </div> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <label><?php esc_html_e( 'Webhook Alerts', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"> <label class="easy-wp-smtp-toggle"> <input type="checkbox"/> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--checked"><?php esc_html_e( 'On', 'easy-wp-smtp' ); ?></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--unchecked"><?php esc_html_e( 'Off', 'easy-wp-smtp' ); ?></span> </label> </div> </div> </div> <div class="easy-wp-smtp-row easy-wp-smtp-alert-setting-row-options"> <div class="easy-wp-smtp-row easy-wp-smtp-alert-setting-row-connection-options"> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-setting-row easy-wp-smtp-setting-row--text"> <div class="easy-wp-smtp-setting-row__label"> <label><?php esc_html_e( 'Webhook URL', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"><input type="text"></div> </div> </div> </div> </div> </div> <div class="easy-wp-smtp-row easy-wp-smtp-row--has-divider easy-wp-smtp-row--inactive easy-wp-smtp-alert-setting-row"> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-row__heading"> <?php esc_html_e( 'Push Notifications', 'easy-wp-smtp' ); ?> </div> <div class="easy-wp-smtp-row__desc"> <?php esc_html_e( 'To receive push notifications on this device, you\'ll need to allow our plugin to send notifications via this browser. Read our documentation on setting up Push Notification alerts.', 'easy-wp-smtp' ); ?> </div> </div> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <label><?php esc_html_e( 'Push Notification Alerts', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"> <label class="easy-wp-smtp-toggle"> <input type="checkbox"/> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--checked"><?php esc_html_e( 'On', 'easy-wp-smtp' ); ?></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--unchecked"><?php esc_html_e( 'Off', 'easy-wp-smtp' ); ?></span> </label> </div> </div> </div> <div class="easy-wp-smtp-row easy-wp-smtp-alert-setting-row-options"> <div class="easy-wp-smtp-row easy-wp-smtp-alert-setting-row-connection-options"> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-setting-row easy-wp-smtp-setting-row--text"> <div class="easy-wp-smtp-setting-row__label"> <label><?php esc_html_e( 'Connection Name', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"><input type="text"></div> </div> </div> </div> </div> </div> <div class="easy-wp-smtp-row easy-wp-smtp-row--has-divider easy-wp-smtp-row--inactive easy-wp-smtp-alert-setting-row"> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-row__heading"> <?php esc_html_e( 'WhatsApp', 'easy-wp-smtp' ); ?> </div> <div class="easy-wp-smtp-row__desc"> <?php esc_html_e( 'Enter your WhatsApp Cloud API credentials to receive alerts when email sending fails. You\'ll need to create a Meta developer account and set up WhatsApp Business Platform.', 'easy-wp-smtp' ); ?> </div> </div> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <label><?php esc_html_e( 'WhatsApp Alerts', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"> <label class="easy-wp-smtp-toggle"> <input type="checkbox"/> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--checked"><?php esc_html_e( 'On', 'easy-wp-smtp' ); ?></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--unchecked"><?php esc_html_e( 'Off', 'easy-wp-smtp' ); ?></span> </label> </div> </div> </div> <div class="easy-wp-smtp-row easy-wp-smtp-alert-setting-row-options"> <div class="easy-wp-smtp-row easy-wp-smtp-alert-setting-row-connection-options"> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-setting-row easy-wp-smtp-setting-row--text"> <div class="easy-wp-smtp-setting-row__label"> <label><?php esc_html_e( 'Access Token', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"><input type="text"></div> </div> <div class="easy-wp-smtp-setting-row easy-wp-smtp-setting-row--text"> <div class="easy-wp-smtp-setting-row__label"> <label><?php esc_html_e( 'WhatsApp Business Account ID', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"><input type="text"></div> </div> <div class="easy-wp-smtp-setting-row easy-wp-smtp-setting-row--text"> <div class="easy-wp-smtp-setting-row__label"> <label><?php esc_html_e( 'Phone Number ID', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"><input type="text"></div> </div> <div class="easy-wp-smtp-setting-row easy-wp-smtp-setting-row--text"> <div class="easy-wp-smtp-setting-row__label"> <label><?php esc_html_e( 'To Phone Number', 'easy-wp-smtp' ); ?></label> </div> <div class="easy-wp-smtp-setting-row__field"><input type="text"></div> </div> </div> </div> </div> </div> </div> </div> <a href="<?php echo esc_url( $upgrade_button_url ); ?>" target="_blank" rel="noopener noreferrer" class="easy-wp-smtp-btn easy-wp-smtp-btn--lg easy-wp-smtp-btn--green"> <?php esc_html_e( 'Upgrade to Easy WP SMTP Pro', 'easy-wp-smtp' ); ?> </a> <?php } } PK 0/]n·��6 �6 ControlTab.phpnu ��� <?php namespace EasyWPSMTP\Admin\Pages; use EasyWPSMTP\Admin\PageAbstract; use EasyWPSMTP\WP; /** * Class ControlTab is a placeholder for Pro Email Control tab settings. * Displays an upsell. * * @since 2.6.0 */ class ControlTab extends PageAbstract { /** * Slug of a tab. * * @since 2.6.0 * * @var string */ protected $slug = 'control'; /** * Link label of a tab. * * @since 2.6.0 * * @return string */ public function get_label() { return esc_html__( 'Email Controls', 'easy-wp-smtp' ); } /** * Title of a tab. * * @since 2.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 2.6.0 * * @return array */ public static function get_controls() { return [ 'comments' => [ 'title' => esc_html__( 'Comments', 'easy-wp-smtp' ), 'emails' => [ 'dis_comments_awaiting_moderation' => [ 'label' => esc_html__( 'Awaiting Moderation', 'easy-wp-smtp' ), 'desc' => esc_html__( 'Comment is awaiting moderation. Sent to the site admin and post author if they can edit comments.', 'easy-wp-smtp' ), ], 'dis_comments_published' => [ 'label' => esc_html__( 'Published', 'easy-wp-smtp' ), 'desc' => esc_html__( 'Comment has been published. Sent to the post author.', 'easy-wp-smtp' ), ], ], ], 'admin_email' => [ 'title' => esc_html__( 'Change of Admin Email', 'easy-wp-smtp' ), 'emails' => [ 'dis_admin_email_attempt' => [ 'label' => esc_html__( 'Site Admin Email Change Attempt', 'easy-wp-smtp' ), 'desc' => esc_html__( 'Change of site admin email address was attempted. Sent to the proposed new email address.', 'easy-wp-smtp' ), ], 'dis_admin_email_changed' => [ 'label' => esc_html__( 'Site Admin Email Changed', 'easy-wp-smtp' ), 'desc' => esc_html__( 'Site admin email address was changed. Sent to the old site admin email address.', 'easy-wp-smtp' ), ], 'dis_admin_email_network_attempt' => [ 'label' => esc_html__( 'Network Admin Email Change Attempt', 'easy-wp-smtp' ), 'desc' => esc_html__( 'Change of network admin email address was attempted. Sent to the proposed new email address.', 'easy-wp-smtp' ), ], 'dis_admin_email_network_changed' => [ 'label' => esc_html__( 'Network Admin Email Changed', 'easy-wp-smtp' ), 'desc' => esc_html__( 'Network admin email address was changed. Sent to the old network admin email address.', 'easy-wp-smtp' ), ], ], ], 'user_details' => [ 'title' => esc_html__( 'Change of User Email or Password', 'easy-wp-smtp' ), 'emails' => [ 'dis_user_details_password_reset_request' => [ 'label' => esc_html__( 'Reset Password Request', 'easy-wp-smtp' ), 'desc' => esc_html__( 'User requested a password reset via "Lost your password?". Sent to the user.', 'easy-wp-smtp' ), ], 'dis_user_details_password_reset' => [ 'label' => esc_html__( 'Password Reset Successfully', 'easy-wp-smtp' ), 'desc' => esc_html__( 'User reset their password from the password reset link. Sent to the site admin.', 'easy-wp-smtp' ), ], 'dis_user_details_password_changed' => [ 'label' => esc_html__( 'Password Changed', 'easy-wp-smtp' ), 'desc' => esc_html__( 'User changed their password. Sent to the user.', 'easy-wp-smtp' ), ], 'dis_user_details_email_change_attempt' => [ 'label' => esc_html__( 'Email Change Attempt', 'easy-wp-smtp' ), 'desc' => esc_html__( 'User attempted to change their email address. Sent to the proposed new email address.', 'easy-wp-smtp' ), ], 'dis_user_details_email_changed' => [ 'label' => esc_html__( 'Email Changed', 'easy-wp-smtp' ), 'desc' => esc_html__( 'User changed their email address. Sent to the user.', 'easy-wp-smtp' ), ], ], ], 'personal_data' => [ 'title' => esc_html__( 'Personal Data Requests', 'easy-wp-smtp' ), 'emails' => [ 'dis_personal_data_user_confirmed' => [ 'label' => esc_html__( 'User Confirmed Export / Erasure Request', 'easy-wp-smtp' ), 'desc' => esc_html__( 'User clicked a confirmation link in personal data export or erasure request email. Sent to the site or network admin.', 'easy-wp-smtp' ), ], 'dis_personal_data_erased_data' => [ 'label' => esc_html__( 'Admin Erased Data', 'easy-wp-smtp' ), 'desc' => esc_html__( 'Site admin clicked "Erase Personal Data" button next to a confirmed data erasure request. Sent to the requester email address.', 'easy-wp-smtp' ), ], 'dis_personal_data_sent_export_link' => [ 'label' => esc_html__( 'Admin Sent Link to Export Data', 'easy-wp-smtp' ), 'desc' => esc_html__( 'Site admin clicked "Email Data" button next to a confirmed data export request. Sent to the requester email address.', 'easy-wp-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.', 'easy-wp-smtp' ) . '</strong>', ], ], ], 'auto_updates' => [ 'title' => esc_html__( 'Automatic Updates', 'easy-wp-smtp' ), 'emails' => [ 'dis_auto_updates_plugin_status' => [ 'label' => esc_html__( 'Plugin Status', 'easy-wp-smtp' ), 'desc' => esc_html__( 'Completion or failure of a background automatic plugin update. Sent to the site or network admin.', 'easy-wp-smtp' ), ], 'dis_auto_updates_theme_status' => [ 'label' => esc_html__( 'Theme Status', 'easy-wp-smtp' ), 'desc' => esc_html__( 'Completion or failure of a background automatic theme update. Sent to the site or network admin.', 'easy-wp-smtp' ), ], 'dis_auto_updates_status' => [ 'label' => esc_html__( 'WP Core Status', 'easy-wp-smtp' ), 'desc' => esc_html__( 'Completion or failure of a background automatic core update. Sent to the site or network admin.', 'easy-wp-smtp' ), ], 'dis_auto_updates_full_log' => [ 'label' => esc_html__( 'Full Log', 'easy-wp-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.', 'easy-wp-smtp' ), ], ], ], 'new_user' => [ 'title' => esc_html__( 'New User', 'easy-wp-smtp' ), 'emails' => [ 'dis_new_user_created_to_admin' => [ 'label' => esc_html__( 'Created (Admin)', 'easy-wp-smtp' ), 'desc' => esc_html__( 'A new user was created. Sent to the site admin.', 'easy-wp-smtp' ), ], 'dis_new_user_created_to_user' => [ 'label' => esc_html__( 'Created (User)', 'easy-wp-smtp' ), 'desc' => esc_html__( 'A new user was created. Sent to the new user.', 'easy-wp-smtp' ), ], 'dis_new_user_invited_to_site_network' => [ 'label' => esc_html__( 'Invited To Site', 'easy-wp-smtp' ), 'desc' => esc_html__( 'A new user was invited to a site from Users -> Add New -> Add New User. Sent to the invited user.', 'easy-wp-smtp' ), ], 'dis_new_user_created_network' => [ 'label' => esc_html__( 'Created On Site', 'easy-wp-smtp' ), 'desc' => esc_html__( 'A new user account was created. Sent to Network Admin.', 'easy-wp-smtp' ), ], 'dis_new_user_added_activated_network' => [ 'label' => esc_html__( 'Added / Activated on Site', 'easy-wp-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.', 'easy-wp-smtp' ), ], ], ], 'network_new_site' => [ 'title' => esc_html__( 'New Site', 'easy-wp-smtp' ), 'emails' => [ 'dis_new_site_user_registered_site_network' => [ 'label' => esc_html__( 'User Created Site', 'easy-wp-smtp' ), 'desc' => esc_html__( 'User registered for a new site. Sent to the site admin.', 'easy-wp-smtp' ), ], 'dis_new_site_user_added_activated_site_in_network_to_admin' => [ 'label' => esc_html__( 'Network Admin: User Activated / Added Site', 'easy-wp-smtp' ), 'desc' => esc_html__( 'User activated their new site, or site was added from Network Admin -> Sites -> Add New. Sent to Network Admin.', 'easy-wp-smtp' ), ], 'dis_new_site_user_added_activated_site_in_network_to_site' => [ 'label' => esc_html__( 'Site Admin: Activated / Added Site', 'easy-wp-smtp' ), 'desc' => esc_html__( 'User activated their new site, or site was added from Network Admin -> Sites -> Add New. Sent to Site Admin.', 'easy-wp-smtp' ), ], ], ], ]; } /** * Output HTML of the email controls settings preview. * * @since 2.6.0 */ public function display() { // phpcs:ignore Generic.Metrics.CyclomaticComplexity.TooHigh $top_upgrade_button_url = add_query_arg( [ 'discount' => 'LITEUPGRADE' ], easy_wp_smtp()->get_upgrade_link( [ 'medium' => 'Email Controls', 'content' => 'Upgrade to Easy WP SMTP Pro Button Top', ] ) ); $upgrade_link_url = add_query_arg( [ 'discount' => 'LITEUPGRADE' ], easy_wp_smtp()->get_upgrade_link( [ 'medium' => 'Email Controls', 'content' => 'Upgrade to Easy WP SMTP Pro Link', ] ) ); $bottom_upgrade_button_url = add_query_arg( [ 'discount' => 'LITEUPGRADE' ], easy_wp_smtp()->get_upgrade_link( [ 'medium' => 'Email Controls', 'content' => 'Upgrade to Easy WP SMTP Pro Button Bottom', ] ) ); ?> <div class="easy-wp-smtp-email-controls-product-education"> <div class="easy-wp-smtp-meta-box"> <div class="easy-wp-smtp-meta-box__header"> <div class="easy-wp-smtp-meta-box__heading"> <?php esc_html_e( 'Email Controls', 'easy-wp-smtp' ); ?> </div> <a href="<?php echo esc_url( $top_upgrade_button_url ); ?>" target="_blank" rel="noopener noreferrer" class="easy-wp-smtp-btn easy-wp-smtp-btn--sm easy-wp-smtp-btn--green"> <?php esc_html_e( 'Upgrade to Pro', 'easy-wp-smtp' ); ?> </a> </div> <div class="easy-wp-smtp-meta-box__content"> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-row__desc"> <?php echo wp_kses( sprintf( /* translators: %s - EasyWPSMTP.com page URL. */ __( 'With email controls, you can manage the automatic notifications sent by your WordPress site. A simple switch lets you reduce inbox clutter and focus on the alerts that truly matter. Easily turn off emails related to comments, account changes, updates, registrations, and data requests. <a href="%s" target="_blank" rel="noopener noreferrer">Upgrade to Easy WP SMTP Pro</a>.', 'easy-wp-smtp' ), esc_url( $upgrade_link_url ) ), [ 'a' => [ 'href' => [], 'rel' => [], 'target' => [], ], ] ); ?> </div> </div> </div> </div> <?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="easy-wp-smtp-meta-box"> <div class="easy-wp-smtp-meta-box__header"> <div class="easy-wp-smtp-meta-box__heading"> <?php echo esc_html( $section['title'] ); ?> </div> </div> <div class="easy-wp-smtp-meta-box__content"> <?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="easy-wp-smtp-row easy-wp-smtp-setting-row easy-wp-smtp-row--inactive"> <div class="easy-wp-smtp-setting-row__label"> <label> <?php echo esc_html( $email['label'] ); ?> </label> </div> <div class="easy-wp-smtp-setting-row__field"> <label class="easy-wp-smtp-toggle"> <input type="checkbox" checked/> <span class="easy-wp-smtp-toggle__switch"></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--checked"><?php esc_html_e( 'ON', 'easy-wp-smtp' ); ?></span> <span class="easy-wp-smtp-toggle__label easy-wp-smtp-toggle__label--unchecked"><?php esc_html_e( 'OFF', 'easy-wp-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; ?> </div> </div> <?php endforeach; ?> <a href="<?php echo esc_url( $bottom_upgrade_button_url ); ?>" target="_blank" rel="noopener noreferrer" class="easy-wp-smtp-btn easy-wp-smtp-btn--lg easy-wp-smtp-btn--green"> <?php esc_html_e( 'Upgrade to Easy WP SMTP Pro', 'easy-wp-smtp' ); ?> </a> </div> <?php } /** * Whether this key dedicated to MultiSite environment. * * @since 2.6.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 2.6.0 * * @param array $data Post data specific for the plugin. */ public function process_post( $data ) {} } PK 0/]�3� � EmailReports.phpnu ��� <?php namespace EasyWPSMTP\Admin\Pages; use EasyWPSMTP\Admin\ParentPageAbstract; /** * Class EmailReports. * * @since 2.1.0 */ class EmailReports extends ParentPageAbstract { /** * Page default tab slug. * * @since 2.1.0 * * @var string */ protected $default_tab = 'reports'; /** * Slug of a page. * * @since 2.1.0 * * @var string */ protected $slug = 'reports'; /** * Link label of a page. * * @since 2.1.0 * * @return string */ public function get_label() { return esc_html__( 'Email Reports', 'easy-wp-smtp' ); } /** * Title of a page. * * @since 2.1.0 * * @return string */ public function get_title() { return $this->get_label(); } } PK 0/]Cu� LogsTab.phpnu ��� <?php namespace EasyWPSMTP\Admin\Pages; use EasyWPSMTP\Admin\PageAbstract; use EasyWPSMTP\Admin\ParentPageAbstract; /** * Class LogsTab is a placeholder for Lite users and redirects them to Email Log page. * * @since 2.1.0 */ class LogsTab extends PageAbstract { /** * Part of the slug of a tab. * * @since 2.1.0 * * @var string */ protected $slug = 'logs'; /** * Constructor. * * @since 2.1.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 ( easy_wp_smtp()->get_admin()->is_admin_page() && $current_tab === 'logs' ) { $this->hooks(); } } /** * Link label of a tab. * * @since 2.1.0 * * @return string */ public function get_label() { return esc_html__( 'Email Log', 'easy-wp-smtp' ); } /** * Title of a tab. * * @since 2.1.0 * * @return string */ public function get_title() { return $this->get_label(); } /** * Register hooks. * * @since 2.1.0 */ public function hooks() { add_action( 'easy_wp_smtp_admin_area_enqueue_assets', [ $this, 'enqueue_assets' ] ); } /** * Enqueue required JS and CSS. * * @since 2.1.0 */ public function enqueue_assets() { wp_enqueue_style( 'easy-wp-smtp-admin-lity', easy_wp_smtp()->assets_url . '/css/vendor/lity.min.css', [], '2.4.1' ); wp_enqueue_script( 'easy-wp-smtp-admin-lity', easy_wp_smtp()->assets_url . '/js/vendor/lity.min.js', [], '2.4.1', false ); } /** * Display the upsell content for the Email Log feature. * * @since 2.1.0 */ public function display() { $button_upgrade_link = add_query_arg( [ 'discount' => 'LITEUPGRADE' ], easy_wp_smtp()->get_upgrade_link( [ 'medium' => 'logs', 'content' => 'Upgrade to Pro Button', ] ) ); $link_upgrade_link = add_query_arg( [ 'discount' => 'LITEUPGRADE' ], easy_wp_smtp()->get_upgrade_link( [ 'medium' => 'logs', 'content' => 'upgrade-to-easy-wp-smtp-pro-text-link', ] ) ); $assets_url = easy_wp_smtp()->assets_url . '/images/education/logs/'; $screenshots = [ [ 'url' => $assets_url . 'screenshot-01.png', 'url_thumbnail' => $assets_url . 'thumbnail-01.png', 'title' => __( 'Email Logs', 'easy-wp-smtp' ), ], [ 'url' => $assets_url . 'screenshot-02.png', 'url_thumbnail' => $assets_url . 'thumbnail-02.png', 'title' => __( 'Detailed Email Log', 'easy-wp-smtp' ), ], ]; ?> <div class="easy-wp-smtp-meta-box"> <div class="easy-wp-smtp-meta-box__header"> <div class="easy-wp-smtp-meta-box__heading"> <?php echo esc_html( $this->get_title() ); ?> </div> <a href="<?php echo esc_url( $button_upgrade_link ); ?>" target="_blank" rel="noopener noreferrer" class="easy-wp-smtp-btn easy-wp-smtp-btn--sm easy-wp-smtp-btn--green"> <?php esc_html_e( 'Upgrade to Pro', 'easy-wp-smtp' ); ?> </a> </div> <div class="easy-wp-smtp-meta-box__content"> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-row__desc"> <?php echo wp_kses( sprintf( /* translators: %s - EasyWPSMTP.com page URL. */ __( 'Email Logging saves information about all the emails sent from your WordPress site. Search and filter the email log to find specific emails and check their delivery statuses. When you enable email logging, you’ll also be able to resend emails, save attachments, and export logs as a CSV, Excel, or EML file. <a href="%s" target="_blank" rel="noopener noreferrer">Upgrade to Easy WP SMTP Pro</a> to start using email logs today.', 'easy-wp-smtp' ), esc_url( $link_upgrade_link ) ), [ 'a' => [ 'href' => [], 'rel' => [], 'target' => [], ], ] ); ?> </div> </div> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-product-education-screenshots easy-wp-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="easy-wp-smtp-row easy-wp-smtp-row--has-bg-color easy-wp-smtp-product-education-cta-row"> <div class="easy-wp-smtp-row__heading easy-wp-smtp-settings-heading"> <?php esc_html_e( 'Unlock these awesome logging features:', 'easy-wp-smtp' ); ?> </div> <div class="easy-wp-smtp-product-education-list"> <ul> <li><?php esc_html_e( 'Save detailed email headers', 'easy-wp-smtp' ); ?></li> <li><?php esc_html_e( 'View email delivery status (sent or failed)', 'easy-wp-smtp' ); ?></li> </ul> <ul> <li><?php esc_html_e( 'Resend emails and attachments', 'easy-wp-smtp' ); ?></li> <li><?php esc_html_e( 'Track email opens and clicks', 'easy-wp-smtp' ); ?></li> </ul> <ul> <li><?php esc_html_e( 'Print or save email logs as PDFs', 'easy-wp-smtp' ); ?></li> <li><?php esc_html_e( 'Export logs to CSV, XLSX, or EML', 'easy-wp-smtp' ); ?></li> </ul> </div> <a href="<?php echo esc_url( $button_upgrade_link ); ?>" target="_blank" rel="noopener noreferrer" class="easy-wp-smtp-btn easy-wp-smtp-btn--lg easy-wp-smtp-btn--green"> <?php esc_html_e( 'Upgrade to Easy WP SMTP Pro', 'easy-wp-smtp' ); ?> </a> </div> </div> </div> <?php } /** * Not used as we are simply redirecting users. * * @since 2.1.0 * * @param array $data Post data specific for the plugin. */ public function process_post( $data ) { } } PK 0/]7�KG G ActionSchedulerTab.phpnu ��� <?php namespace EasyWPSMTP\Admin\Pages; use EasyWPSMTP\Admin\PageAbstract; /** * Class ActionScheduler. * * @since 2.1.0 */ class ActionSchedulerTab extends PageAbstract { /** * Part of the slug of a tab. * * @since 2.1.0 * * @var string */ protected $slug = 'action-scheduler'; /** * Tab priority. * * @since 2.1.0 * * @var int */ protected $priority = 30; /** * Link label of a tab. * * @since 2.1.0 * * @return string */ public function get_label() { return esc_html__( 'Scheduled Actions', 'easy-wp-smtp' ); } /** * Title of a tab. * * @since 2.1.0 * * @return string */ public function get_title() { return $this->get_label(); } /** * URL to a tab. * * @since 2.1.0 * * @return string */ public function get_link() { return add_query_arg( [ 's' => 'easy_wp_smtp' ], parent::get_link() ); } /** * Register hooks. * * @since 2.1.0 */ public function hooks() { add_action( 'current_screen', [ $this, 'init' ], 20 ); } /** * Init. * * @since 2.1.0 */ public function init() { if ( $this->is_applicable() ) { \ActionScheduler_AdminView::instance()->process_admin_ui(); } } /** * Display scheduled actions table. * * @since 2.1.0 */ public function display() { if ( ! $this->is_applicable() ) { return; } ?> <div class="easy-wp-smtp-meta-box"> <div class="easy-wp-smtp-meta-box__header"> <div class="easy-wp-smtp-meta-box__heading"> <?php esc_html_e( 'Scheduled Actions', 'easy-wp-smtp' ); ?> </div> </div> <div class="easy-wp-smtp-meta-box__content"> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-row__desc"> <p> <?php echo sprintf( wp_kses( /* translators: %s - Action Scheduler website URL. */ __( 'Easy WP SMTP uses the <a href="%s" target="_blank" rel="noopener noreferrer">Action Scheduler</a> library, which lets it queue and process large tasks in the background without slowing down your site for visitors. Here you can see the list of all Easy WP SMTP Action Scheduler tasks and their statuses. This table can help with debugging certain issues.', 'easy-wp-smtp' ), [ 'a' => [ 'href' => [], 'rel' => [], 'target' => [], ], ] ), 'https://actionscheduler.org/' ); ?> </p> <p> <?php echo esc_html__( 'The Action Scheduler library is also used by other plugins, such as WPForms and WooCommerce. You might see tasks below that are not related to our plugin.', 'easy-wp-smtp' ); ?> </p> </div> </div> </div> </div> <?php if ( isset( $_GET['s'] ) ) : // phpcs:ignore WordPress.Security.NonceVerification.Recommended ?> <div id="easy-wp-smtp-reset-filter"> <?php echo wp_kses( sprintf( /* translators: %s - search term. */ __( 'Search results for <strong>%s</strong>', 'easy-wp-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; ?> <div class="easy-wp-smtp-wp-list-table"> <?php \ActionScheduler_AdminView::instance()->render_admin_ui(); ?> </div> <!-- Remove `.wp-header-end` element from DOM to prevent wrong notices position. --> <script> (function() { const headerEnd = document.querySelector( '.wrap > hr.wp-header-end' ); if ( headerEnd !== null ) headerEnd.remove(); })(); </script> <?php } /** * Check if ActionScheduler_AdminView class exists. * * @since 2.1.0 * * @return bool */ private function is_applicable() { return class_exists( 'ActionScheduler_AdminView' ); } } PK 0/]��}?�? �? SettingsTab.phpnu ��� <?php namespace EasyWPSMTP\Admin\Pages; use EasyWPSMTP\Admin\ConnectionSettings; use EasyWPSMTP\Admin\PageAbstract; use EasyWPSMTP\Admin\SetupWizard; use EasyWPSMTP\Options; use EasyWPSMTP\WP; /** * Class SettingsTab is part of Area, displays general settings of the plugin. * * @since 2.0.0 */ class SettingsTab extends PageAbstract { /** * Settings constructor. * * @since 2.1.0 */ public function __construct() { parent::__construct(); $this->hooks(); } /** * Slug of a tab. * * @since 2.0.0 * * @var string */ protected $slug = 'settings'; /** * Link label of a tab. * * @since 2.0.0 * * @return string */ public function get_label() { return esc_html__( 'Settings', 'easy-wp-smtp' ); } /** * Title of a tab. * * @since 2.0.0 * * @return string */ public function get_title() { return $this->get_label(); } /** * Register hooks. * * @since 2.1.0 */ public function hooks() { add_action( 'easy_wp_smtp_admin_pages_settings_license_key', [ __CLASS__, 'display_license_key_field_content' ] ); add_action( 'easy_wp_smtp_admin_area_enqueue_assets', [ $this, 'enqueue_assets' ] ); } /** * Enqueue required JS and CSS. * * @since 2.1.0 */ public function enqueue_assets() { if ( ! easy_wp_smtp()->get_admin()->is_admin_page( 'general' ) ) { return; } if ( $this->is_display_pro_banner() ) { wp_enqueue_style( 'easy-wp-smtp-admin-lity', easy_wp_smtp()->assets_url . '/css/vendor/lity.min.css', [], '2.4.1' ); wp_enqueue_script( 'easy-wp-smtp-admin-lity', easy_wp_smtp()->assets_url . '/js/vendor/lity.min.js', [], '2.4.1', false ); } } /** * Settings tab content. * * @since 2.0.0 */ public function display() { ?> <form method="POST" action="" autocomplete="off" class="easy-wp-smtp-connection-settings-form"> <?php $this->wp_nonce_field(); ?> <?php ob_start(); ?> <div class="easy-wp-smtp-meta-box"> <div class="easy-wp-smtp-meta-box__header"> <div class="easy-wp-smtp-meta-box__heading"> <?php esc_html_e( 'License', 'easy-wp-smtp' ); ?> </div> </div> <div class="easy-wp-smtp-meta-box__content"> <?php do_action( 'easy_wp_smtp_admin_pages_settings_license_key', Options::init() ); ?> </div> </div> <?php $connection = easy_wp_smtp()->get_connections_manager()->get_primary_connection(); $connection_settings = new ConnectionSettings( $connection ); // Display connection settings. $connection_settings->display(); ?> <?php $settings_content = apply_filters( 'easy_wp_smtp_admin_settings_tab_display', ob_get_clean() ); echo $settings_content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> <?php $this->display_backup_connection_education(); ?> <?php $this->display_save_btn(); ?> </form> <?php if ( $this->is_display_pro_banner() ) { $this->display_pro_banner(); } } /** * License key text for a Lite version of the plugin. * * @since 2.1.0 * * @param Options $options */ public static function display_license_key_field_content( $options ) { ?> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-row__desc"> <?php esc_html_e( 'You\'re using Easy WP SMTP Lite - no license key required. Enjoy!', 'easy-wp-smtp' ); ?> </div> </div> <div class="easy-wp-smtp-row easy-wp-smtp-row--has-divider"> <div class="easy-wp-smtp-license-upgrade-notice"> <p> <b> <?php printf( wp_kses( /* translators: %s - EasyWPSMTP.com upgrade URL. */ __( 'Unlock more features by <strong><a href="%s" target="_blank" rel="noopener noreferrer">upgrading to PRO</a></strong>.', 'easy-wp-smtp' ), array( 'a' => array( 'href' => array(), 'class' => array(), 'target' => array(), 'rel' => array(), ), 'strong' => array(), ) ), esc_url( easy_wp_smtp()->get_upgrade_link( 'general-license-key' ) ) ); ?> </b> </p> <p> <?php printf( wp_kses( /* Translators: %s - discount value 50% */ __( 'As thanks for being an Easy WP SMTP Lite user, we’re offering you <span>%s off</span>, applied automatically at checkout.', 'easy-wp-smtp' ), array( 'span' => array(), ) ), '50%' ); ?> </p> </div> </div> <!-- License Key --> <div class="easy-wp-smtp-row easy-wp-smtp-setting-row easy-wp-smtp-setting-row--text"> <div class="easy-wp-smtp-setting-row__label"> <label for="easy-wp-smtp-setting-license_key"> <?php esc_html_e( 'License Key', 'easy-wp-smtp' ); ?> </label> </div> <div class="easy-wp-smtp-setting-row__field"> <div class="easy-wp-smtp-input-btn-row"> <input type="password" id="easy-wp-smtp-setting-upgrade-license-key" class="easy-wp-smtp-not-form-input" placeholder="<?php esc_attr_e( 'Paste license key here', 'easy-wp-smtp' ); ?>" value="" /> <button type="button" class="easy-wp-smtp-btn easy-wp-smtp-btn--primary" id="easy-wp-smtp-setting-upgrade-license-button"> <?php esc_attr_e( 'Connect', 'easy-wp-smtp' ); ?> </button> </div> <p class="desc"> <?php esc_html_e( 'Already purchased? Simply enter your license key above to connect with Easy WP SMTP Pro!', 'easy-wp-smtp' ); ?> </p> </div> </div> <?php } /** * Whether to display Easy WP SMTP Pro upgrade banner. * * @since 2.1.0 * * @return bool */ private function is_display_pro_banner() { // Display only to site admins. Only site admins can install plugins. if ( ! is_super_admin() ) { return false; } // Do not display if Easy WP SMTP Pro already installed. if ( easy_wp_smtp()->is_pro() ) { return false; } $is_dismissed = get_user_meta( get_current_user_id(), 'easy_wp_smtp_pro_banner_dismissed', true ); // Do not display if user dismissed. if ( (bool) $is_dismissed === true ) { return false; } return true; } /** * Display Easy WP SMTP Pro upgrade banner. * * @since 2.1.0 */ protected function display_pro_banner() { $assets_url = easy_wp_smtp()->assets_url . '/images/education/'; $screenshots = [ [ 'url' => $assets_url . 'logs/screenshot-01.png', 'url_thumbnail' => $assets_url . 'logs/thumbnail-01.png', 'title' => __( 'Email Logs', 'easy-wp-smtp' ), ], [ 'url' => $assets_url . 'reports/screenshot-01.png', 'url_thumbnail' => $assets_url . 'reports/thumbnail-01.png', 'title' => __( 'Email Reports', 'easy-wp-smtp' ), ], [ 'url' => $assets_url . 'reports/screenshot-03.png', 'url_thumbnail' => $assets_url . 'reports/thumbnail-03.png', 'title' => __( 'Weekly Email Report', 'easy-wp-smtp' ), ], ]; $upgrade_link = easy_wp_smtp()->get_upgrade_link( [ 'medium' => 'pro-banner', 'content' => 'upgrade-today-link', ] ); $button_upgrade_link = easy_wp_smtp()->get_upgrade_link( [ 'medium' => 'pro-banner', 'content' => 'upgrade-to-easy-wp-smtp-pro-button-link', ] ); ?> <div class="easy-wp-smtp-meta-box easy-wp-smtp-pro-banner"> <div class="easy-wp-smtp-meta-box__content"> <a href="#" title="<?php esc_attr_e( 'Dismiss', 'easy-wp-smtp' ); ?>" class="easy-wp-smtp-pro-banner__dismiss js-easy-wp-smtp-pro-banner-dismiss"> <svg fill="none" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> <path d="m8 0.25c-4.2812 0-7.75 3.4688-7.75 7.75 0 4.2812 3.4688 7.75 7.75 7.75 4.2812 0 7.75-3.4688 7.75-7.75 0-4.2812-3.4688-7.75-7.75-7.75zm0 14c-3.4688 0-6.25-2.7812-6.25-6.25 0-3.4375 2.7812-6.25 6.25-6.25 3.4375 0 6.25 2.8125 6.25 6.25 0 3.4688-2.8125 6.25-6.25 6.25zm3.1562-8.1875c0.1563-0.125 0.1563-0.375 0-0.53125l-0.6874-0.6875c-0.1563-0.15625-0.4063-0.15625-0.5313 0l-1.9375 1.9375-1.9688-1.9375c-0.125-0.15625-0.375-0.15625-0.53125 0l-0.6875 0.6875c-0.15625 0.15625-0.15625 0.40625 0 0.53125l1.9375 1.9375-1.9375 1.9688c-0.15625 0.12505-0.15625 0.37505 0 0.53125l0.6875 0.6875c0.15625 0.1563 0.40625 0.1563 0.53125 0l1.9688-1.9375 1.9375 1.9375c0.125 0.1563 0.375 0.1563 0.5313 0l0.6874-0.6875c0.1563-0.1562 0.1563-0.4062 0-0.53125l-1.9374-1.9688 1.9374-1.9375z" fill="currentColor"/> </svg> </a> <div class="easy-wp-smtp-row"> <div class="easy-wp-smtp-row__heading"> <?php esc_html_e( 'Get Easy WP SMTP Pro and Gain Access to more Powerful Features', 'easy-wp-smtp' ); ?> </div> <div class="easy-wp-smtp-row__desc"> <?php printf( wp_kses( /* translators: %s - sendlayer.com URL. */ __( 'Learn the full potential of Easy WP SMTP with our Pro version. <a href="%s" target="_blank" rel="noopener noreferrer">Upgrade today</a> and start using advanced features to track and monitor email activity.', 'easy-wp-smtp' ), [ 'a' => [ 'href' => [], 'target' => [], 'rel' => [], ], ] ), $upgrade_link ); ?> </div> </div> <div class="easy-wp-smtp-row easy-wp-smtp-row--has-divider"> <div class="easy-wp-smtp-product-education-screenshots easy-wp-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="easy-wp-smtp-row"> <div class="easy-wp-smtp-row__heading easy-wp-smtp-settings-heading"> <?php esc_html_e( 'Pro Features:', 'easy-wp-smtp' ); ?> </div> <div class="easy-wp-smtp-product-education-list-v2"> <ul> <li> <strong><?php esc_html_e( 'Email Logs', 'easy-wp-smtp' ); ?></strong> <ul> <li><?php esc_html_e( 'Open and click tracking', 'easy-wp-smtp' ); ?></li> <li><?php esc_html_e( 'Status (was the email delivered, sent, pending, or failed)', 'easy-wp-smtp' ); ?></li> <li><?php esc_html_e( 'Email log export (.eml, .csv, .xlsx) and bulk exporter', 'easy-wp-smtp' ); ?></li> <li><?php esc_html_e( 'Source (which plugin/theme sent the email and it\'s path location)', 'easy-wp-smtp' ); ?></li> </ul> </li> </ul> <ul> <li><?php esc_html_e( 'Backup Connection - send emails through a backup if the primary connection fails', 'easy-wp-smtp' ); ?></li> <li><?php esc_html_e( 'Smart Routing - set specific conditions for how your emails are sent', 'easy-wp-smtp' ); ?></li> <li><?php esc_html_e( 'Pro mailers: Amazon SES and Microsoft 365 / Outlook', 'easy-wp-smtp' ); ?></li> <li><?php esc_html_e( 'Advanced Email Reports', 'easy-wp-smtp' ); ?></li> <li><?php esc_html_e( 'Intuitive Dashboard Widget with email stats', 'easy-wp-smtp' ); ?></li> <li><?php esc_html_e( 'Weekly Email Summaries delivered to your inbox', 'easy-wp-smtp' ); ?></li> </ul> </div> </div> <div class="easy-wp-smtp-row"> <a href="<?php echo esc_url( $button_upgrade_link ); ?>" target="_blank" rel="noopener noreferrer" class="easy-wp-smtp-btn easy-wp-smtp-btn--lg easy-wp-smtp-btn--green"> <?php esc_html_e( 'Upgrade to Easy WP SMTP Pro', 'easy-wp-smtp' ); ?> </a> </div> </div> </div> <?php } /** * Display backup connection education section. * * @since 2.6.0 */ private function display_backup_connection_education() { if ( easy_wp_smtp()->is_pro() ) { return; } $upgrade_button_url = add_query_arg( [ 'discount' => 'LITEUPGRADE' ], easy_wp_smtp()->get_upgrade_link( [ 'medium' => 'Backup Connections', 'content' => 'Upgrade to Pro Button', ] ) ); $upgrade_link_url = add_query_arg( [ 'discount' => 'LITEUPGRADE' ], easy_wp_smtp()->get_upgrade_link( [ 'medium' => 'Backup Connections', 'content' => 'Upgrade to Pro Link', ] ) ); ?> <div class="easy-wp-smtp-meta-box"> <div class="easy-wp-smtp-meta-box__header"> <div class="easy-wp-smtp-meta-box__heading"> <?php esc_html_e( 'Backup Connection', 'easy-wp-smtp' ); ?> </div> <a href="<?php echo esc_url( $upgrade_button_url ); ?>" target="_blank" rel="noopener noreferrer" class="easy-wp-smtp-btn easy-wp-smtp-btn--sm easy-wp-smtp-btn--green"> <?php esc_html_e( 'Upgrade to Pro', 'easy-wp-smtp' ); ?> </a> </div> <div class="easy-wp-smtp-meta-box__content"> <!-- Backup Connection Section Title --> <div class="easy-wp-smtp-row easy-wp-smtp-row--has-divider"> <div class="easy-wp-smtp-row__desc"> <p> <?php echo wp_kses( sprintf( /* translators: %s - EasyWPSMTP.com Upgrade page URL. */ __( 'Avoid the risk of losing emails by adding an additional connection and setting it as your Backup Connection. Should the Primary Connection fail to send an email, the Backup Connection will take over. <a href="%s" target="_blank" rel="noopener noreferrer">Upgrade to Easy WP SMTP Pro</a>.', 'easy-wp-smtp' ), esc_url( $upgrade_link_url ) ), [ 'a' => [ 'href' => [], 'rel' => [], 'target' => [], ], ] ); ?> </p> </div> </div> <!-- Backup Connection Selector --> <div id="easy-wp-smtp-setting-row-backup_connection" class="easy-wp-smtp-row easy-wp-smtp-setting-row"> <div class="easy-wp-smtp-setting-row__label"> <label> <?php esc_html_e( 'Backup Connection', 'easy-wp-smtp' ); ?> </label> </div> <div class="easy-wp-smtp-setting-row__field"> <div class="easy-wp-smtp-radio-group easy-wp-smtp-connection-selector"> <label class="easy-wp-smtp-radio" for="easy-wp-smtp-setting-row-backup_connection_none"> <input type="radio" id="easy-wp-smtp-setting-row-backup_connection_none" checked/> <span class="easy-wp-smtp-radio__checkmark"></span> <span class="easy-wp-smtp-radio__label"><?php esc_html_e( 'None', 'easy-wp-smtp' ); ?></span> </label> </div> <p class="desc"> <?php echo wp_kses( sprintf( /* translators: %s - Additional connections settings page url. */ __( 'Once you add an <a href="%s">additional connection</a>, you can select it here.', 'easy-wp-smtp' ), add_query_arg( [ 'tab' => 'connections', ], easy_wp_smtp()->get_admin()->get_admin_page_url() ) ), [ 'a' => [ 'href' => [], ], ] ); ?> </p> </div> </div> </div> </div> <?php } /** * Process tab form submission ($_POST). * * @since 2.0.0 * * @param array $data Post data specific for the plugin. */ public function process_post( $data ) { $this->check_admin_referer(); $connection = easy_wp_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.0.0 * * @param array $data Settings data. */ $data = apply_filters( 'easy_wp_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.', 'easy-wp-smtp' ), WP::ADMIN_NOTICE_SUCCESS ); } } PK 0/]vɻ|v v Logs.phpnu ��� <?php namespace EasyWPSMTP\Admin\Pages; use EasyWPSMTP\Admin\Area; use EasyWPSMTP\Admin\PageAbstract; use EasyWPSMTP\WP; /** * Class Logs */ class Logs extends PageAbstract { /** * Slug of a page. * * @since 2.1.0 * * @var string */ protected $slug = 'logs'; /** * Get the page/tab link. * * @since 2.1.0 * * @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 2.1.0 * * @return string */ public function get_label() { return esc_html__( 'Email Log', 'easy-wp-smtp' ); } /** * Title of a tab. * * @since 2.1.0 * * @return string */ public function get_title() { return $this->get_label(); } /** * Tab content. * * @since 2.1.0 */ public function display() {} } PK 0/]�F'��F �F DebugEventsTab.phpnu ��� PK 0/]���p �p &G MiscTab.phpnu ��� PK 0/]�� L� AuthTab.phpnu ��� PK 0/]䪉d� � �� TestTab.phpnu ��� PK 0/]\�Kf� � �� AdditionalConnectionsTab.phpnu ��� PK 0/]�~E¯ � �� Tools.phpnu ��� PK 0/]k��;& & �� EmailReportsTab.phpnu ��� PK 0/]�{, {, ExportTab.phpnu ��� PK 0/]�v�3�/ �/ �: SmartRoutingTab.phpnu ��� PK 0/]U���7U 7U �j AlertsTab.phpnu ��� PK 0/]n·��6 �6 N� ControlTab.phpnu ��� PK 0/]�3� � }� EmailReports.phpnu ��� PK 0/]Cu� �� LogsTab.phpnu ��� PK 0/]7�KG G � ActionSchedulerTab.phpnu ��� PK 0/]��}?�? �? P" SettingsTab.phpnu ��� PK 0/]vɻ|v v vb Logs.phpnu ��� PK � $f
| ver. 1.6 |
Github
|
.
| PHP 8.1.34 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка