deactivate-feedback.php
85 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @var string $email |
| 4 | * |
| 5 | * @see /Backend/Feedback/Feedback.php |
| 6 | * @see loadFeedbackForm() |
| 7 | */ |
| 8 | |
| 9 | $reasons = [ |
| 10 | 1 => [ |
| 11 | 'id' => 'wpstg_disable_reason_temporary', |
| 12 | 'value' => 'temporary', |
| 13 | 'label' => esc_html__('Only temporary', 'wp-staging'), |
| 14 | 'input' => false, |
| 15 | 'placeholder' => '' |
| 16 | ], |
| 17 | 2 => [ |
| 18 | 'id' => 'wpstg_disable_reason_missing', |
| 19 | 'value' => 'missing_feature', |
| 20 | 'label' => esc_html__('Missing a feature', 'wp-staging'), |
| 21 | 'input' => 'input', |
| 22 | 'placeholder' => esc_html__('Please describe the feature', 'wp-staging') |
| 23 | ], |
| 24 | 3 => [ |
| 25 | 'id' => 'wpstg_disable_reason_technical', |
| 26 | 'value' => 'technical_issue', |
| 27 | 'label' => esc_html__('Technical Issue', 'wp-staging'), |
| 28 | 'input' => 'textarea', |
| 29 | 'placeholder' => esc_html__('Can we help? Please describe your problem', 'wp-staging') |
| 30 | ], |
| 31 | 4 => [ |
| 32 | 'id' => 'wpstg_disable_reason_plugin', |
| 33 | 'value' => 'other_plugin', |
| 34 | 'label' => esc_html__('Switched to another plugin/staging solution', 'wp-staging'), |
| 35 | 'input' => 'input', |
| 36 | 'placeholder' => esc_html__('Name of the plugin', 'wp-staging') |
| 37 | ], |
| 38 | 5 => [ |
| 39 | 'id' => 'wpstg_disable_reason_other', |
| 40 | 'value' => 'other_reason', |
| 41 | 'label' => esc_html__('Other reason', 'wp-staging'), |
| 42 | 'input' => 'textarea', |
| 43 | 'placeholder' => esc_html__('Please specify, if possible', 'wp-staging') |
| 44 | ], |
| 45 | ]; |
| 46 | |
| 47 | // Any reason for this shuffling? |
| 48 | shuffle($reasons); |
| 49 | ?> |
| 50 | |
| 51 | <div id="wpstg-feedback-overlay" style="display: none;"> |
| 52 | <div id="wpstg-feedback-content"> |
| 53 | <form action="" method="post"> |
| 54 | <h3><strong><?php esc_html_e('Please let us know why you are deactivating:', 'wp-staging'); ?></strong></h3> |
| 55 | <ul> |
| 56 | <?php foreach ($reasons as $reason) : ?> |
| 57 | <li> |
| 58 | <label id="<?php echo esc_attr($reason['id']) ?>"> |
| 59 | <input type="checkbox" name="wpstg_disable_reason[]" value="<?php echo esc_attr($reason['value']) ?>" /> |
| 60 | <?php echo esc_html($reason['label']) ?> |
| 61 | </label> |
| 62 | </li> |
| 63 | <?php if ($reason['input'] === 'input') : ?> |
| 64 | <li> |
| 65 | <input type="text" name="wpstg_disable_text[<?php echo esc_attr($reason['value']) ?>]" value="" placeholder="<?php echo esc_attr($reason['placeholder']) ?>"/> |
| 66 | </li> |
| 67 | <?php elseif ($reason['input'] === 'textarea') : ?> |
| 68 | <li> |
| 69 | <textarea name="wpstg_disable_text[<?php echo esc_attr($reason['value']) ?>]" placeholder="<?php echo esc_attr($reason['placeholder']) ?>"></textarea> |
| 70 | </li> |
| 71 | <?php endif; ?> |
| 72 | <?php endforeach; ?> |
| 73 | </ul> |
| 74 | <?php if ($email) : ?> |
| 75 | <input type="hidden" name="wpstg_disable_from" value="<?php echo esc_html($email); ?>"/> |
| 76 | <?php endif; ?> |
| 77 | <button id="wpstg-feedback-submit" class="button button-primary" type="submit" name="wpstg_disable_submit"> |
| 78 | <?php esc_html_e('Submit & Deactivate', 'wp-staging'); ?> |
| 79 | </button> |
| 80 | |
| 81 | <a class="button"><?php esc_html_e('Only Deactivate', 'wp-staging'); ?></a> |
| 82 | <a class="wpstg-feedback-not-deactivate" href="#"><?php esc_html_e('Don\'t deactivate', 'wp-staging'); ?></a> |
| 83 | </form> |
| 84 | </div> |
| 85 | </div> |