Core
1 year ago
Util
1 year ago
Check_Email_Encode_Tab.php
1 year ago
Check_Email_SMTP_Tab.php
1 year ago
class-check-email-header-parser.php
1 year ago
class-check-email-log-autoloader.php
1 year ago
class-check-email-newsletter.php
1 year ago
deactivate-feedback.php
1 year ago
helper-function.php
1 year ago
install.php
1 year ago
deactivate-feedback.php
49 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Deactivate Feedback Template |
| 4 | * @since 2.0.27 |
| 5 | */ |
| 6 | defined( 'ABSPATH' ) || exit; // Exit if accessed directly. |
| 7 | $current_user = wp_get_current_user(); |
| 8 | $email = ''; |
| 9 | if( $current_user instanceof WP_User ) { |
| 10 | $email = trim( $current_user->user_email ); |
| 11 | } |
| 12 | |
| 13 | $reasons = array( |
| 14 | 1 => '<li><label><input type="radio" name="ck_mail_disable_reason" required value="temporary"/>' . esc_html__('It is only temporary', 'check-email') . '</label></li>', |
| 15 | 2 => '<li><label><input type="radio" name="ck_mail_disable_reason" required value="stopped showing Using"/>' . esc_html__('I stopped using check & log mail on my site', 'check-email') . '</label></li>', |
| 16 | 3 => '<li><label><input type="radio" name="ck_mail_disable_reason" required value="missing feature"/>' . esc_html__('I miss a feature', 'check-email') . '</label></li> |
| 17 | <li><input type="text" name="ck_mail_disable_text[]" value="" placeholder="'.esc_attr__('Please describe the feature', 'check-email').'"/></li>', |
| 18 | 4 => '<li><label><input type="radio" name="ck_mail_disable_reason" required value="technical issue"/>' . esc_html__('Technical Issue', 'check-email') . '</label></li> |
| 19 | <li><textarea name="ck_mail_disable_text[]" placeholder="' . esc_attr__('Can we help? Please describe your problem', 'check-email') . '"></textarea></li>', |
| 20 | 5 => '<li><label><input type="radio" name="ck_mail_disable_reason" required value="'.esc_attr('other plugin').'"/>' . esc_html__('I switched to another plugin', 'check-email') . '</label></li> |
| 21 | <li><input type="text" name="ck_mail_disable_text[]" value="" placeholder="'.esc_attr__('Name of the plugin', 'check-email').'"/></li>', |
| 22 | 6 => '<li><label><input type="radio" name="ck_mail_disable_reason" required value="other"/>' . __('Other reason', 'check-email') . '</label></li> |
| 23 | <li><textarea name="ck_mail_disable_text[]" placeholder="' . esc_attr__('Please specify, if possible', 'check-email') . '"></textarea></li>', |
| 24 | ); |
| 25 | shuffle($reasons); |
| 26 | ?> |
| 27 | |
| 28 | |
| 29 | <div id="ck-mail-reloaded-feedback-overlay" style="display: none;"> |
| 30 | <div id="ck-mail-reloaded-feedback-content"> |
| 31 | <form action="" method="post"> |
| 32 | <h3><strong><?php esc_html_e('If you have a moment, please let us know why you are deactivating:', 'check-email'); ?></strong></h3> |
| 33 | <ul> |
| 34 | <?php |
| 35 | foreach ($reasons as $reason_escaped){ |
| 36 | //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- all html inside this variable already escaped above in $reasons variable |
| 37 | echo $reason_escaped; |
| 38 | } |
| 39 | ?> |
| 40 | </ul> |
| 41 | <?php if( null !== $email && !empty( $email ) ) : ?> |
| 42 | <input type="hidden" name="ck_mail_disable_from" value="<?php echo esc_attr($email); ?>" /> |
| 43 | <?php endif; ?> |
| 44 | <input id="ck-mail-reloaded-feedback-submit" class="button button-primary" type="submit" name="ck_mail_disable_submit" value="<?php esc_html_e('Submit & Deactivate', 'check-email'); ?>"/> |
| 45 | <a class="button ck-mail-feedback-only-deactivate"><?php esc_html_e('Only Deactivate', 'check-email'); ?></a> |
| 46 | <a class="ck-mail-feedback-not-deactivate" href="#"><?php esc_html_e('Don\'t deactivate', 'check-email'); ?></a> |
| 47 | </form> |
| 48 | </div> |
| 49 | </div> |