| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * Deactivation popup admin |
| 4 | 4 | * |
| @@ -11,16 +11,28 @@ | ||
| 11 | 11 | if ( ! defined( 'ABSPATH' ) ) { |
| 12 | 12 | exit; // Exit if accessed directly. |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | -global $status, $page, $s; | |
| 15 | +global $status, $page, $s; | |
| 16 | + | |
| 17 | +$wpbc_plugin_basename = is_plugin_active( 'booking-calendar-com/booking-calendar-com.php' ) | |
| 18 | + ? 'booking-calendar-com/booking-calendar-com.php' | |
| 19 | + : WPBC_PLUGIN_DIRNAME . '/' . WPBC_PLUGIN_FILENAME; | |
| 20 | + | |
| 21 | +$wpbc_deactivate_url = wp_nonce_url( | |
| 22 | + add_query_arg( | |
| 23 | + array( | |
| 24 | + 'action' => 'deactivate', | |
| 25 | + 'plugin' => $wpbc_plugin_basename, | |
| 26 | + 'plugin_status' => (string) $status, | |
| 27 | + 'paged' => (string) $page, | |
| 28 | + 's' => (string) $s, | |
| 29 | + ), | |
| 30 | + self_admin_url( 'plugins.php' ) | |
| 31 | + ), | |
| 32 | + 'deactivate-plugin_' . $wpbc_plugin_basename | |
| 33 | +); | |
| 16 | 34 | |
| 17 | -if ( is_plugin_active( 'booking-calendar-com/booking-calendar-com.php' ) ) { | |
| 18 | - $wpbc_deactivate_url = wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . WPBC_PRO_PLUGIN_DIRNAME . htmlentities('/', ENT_COMPAT) . WPBC_PRO_PLUGIN_FILENAME . '&plugin_status=' . $status . '&paged=' . $page . '&s=' . $s, 'deactivate-plugin_' . WPBC_PRO_PLUGIN_DIRNAME . htmlentities('/', ENT_COMPAT) . WPBC_PRO_PLUGIN_FILENAME ); | |
| 19 | -} else { | |
| 20 | - $wpbc_deactivate_url = wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . WPBC_PLUGIN_DIRNAME . htmlentities('/', ENT_COMPAT) . WPBC_PLUGIN_FILENAME . '&plugin_status=' . $status . '&paged=' . $page . '&s=' . $s, 'deactivate-plugin_' . WPBC_PLUGIN_DIRNAME . htmlentities('/', ENT_COMPAT) . WPBC_PLUGIN_FILENAME ); | |
| 21 | -} | |
| 22 | - | |
| 23 | 35 | ?> |
| 24 | 36 | <div id="wpbc_deactivate-feedback-popup-wrapper"> |
| 25 | 37 | <div class="wpbc_deactivate-feedback-popup-inner"> |
| 26 | 38 | <div class="wpbc_deactivate-feedback-popup-header"> |
| @@ -73,10 +85,13 @@ | ||
| 73 | 85 | <a href="<?php echo esc_url( $wpbc_deactivate_url ); ?>" class="skip"><?php esc_html_e( 'Skip & Deactivate', 'booking' ); ?></a> |
| 74 | 86 | <div class="wpbc_deactivate-feedback-popup-form-more-details"> |
| 75 | 87 | <label for="wpbc_deactivate-feedback-more-details" |
| 76 | 88 | class="wpbc_deactivate-feedback-label"><?php echo wp_kses_post( __( 'Could you share more details? We\'d love to fix them!', 'booking' ) ); ?></label> |
| 77 | - <textarea name="wpbc_deactivate-feedback-more-details" placeholder="<?php echo esc_attr( __( 'Please share your feedback', 'booking' ) ); ?>" | |
| 78 | - class="feedback-textarea" rows="4"></textarea> | |
| 89 | + <textarea id="wpbc_deactivate-feedback-more-details" name="wpbc_deactivate-feedback-more-details" placeholder="<?php echo esc_attr( __( 'Please share your feedback', 'booking' ) ); ?>" | |
| 90 | + class="feedback-textarea" rows="4" aria-describedby="wpbc_deactivate-feedback-more-details-error" aria-invalid="false"></textarea> | |
| 91 | + <span id="wpbc_deactivate-feedback-more-details-error" class="wpbc_deactivate-feedback-more-details-error" aria-live="polite"> | |
| 92 | + <?php esc_html_e( 'Please share more details before submitting.', 'booking' ); ?> | |
| 93 | + </span> | |
| 79 | 94 | </div> |
| 80 | 95 | <button class="submit" type="submit"><?php esc_html_e( 'Submit & Deactivate', 'booking' ); ?></button> |
| 81 | 96 | </div> |
| 82 | 97 | </form> |