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