← All changes
|
freemius/templates/forms/subscription-cancellation.php
+12
-18
8.0.2
→
2.1.2
View file →
| @@ -33,19 +33,13 @@ | ||
| 33 | 33 | if ( $VARS['is_license_deactivation'] ) { |
| 34 | 34 | $subscription_cancellation_text = ''; |
| 35 | 35 | } else { |
| 36 | 36 | $subscription_cancellation_text = sprintf( |
| 37 | - ( $fs->is_theme() ? | |
| 38 | - fs_text_inline( | |
| 39 | - "Deactivating or uninstalling the %s will automatically disable the license, which you'll be able to use on another site.", | |
| 40 | - 'deactivation-or-uninstall-message', | |
| 41 | - $slug | |
| 42 | - ) : | |
| 43 | - fs_text_inline( | |
| 44 | - "Uninstalling the %s will automatically disable the license, which you'll be able to use on another site.", | |
| 45 | - 'uninstall-message', | |
| 46 | - $slug | |
| 47 | - ) ), | |
| 37 | + fs_text_inline( | |
| 38 | + "Deactivating or uninstalling the %s will automatically disable the license, which you'll be able to use on another site.", | |
| 39 | + 'deactivation-or-uninstall-message', | |
| 40 | + $slug | |
| 41 | + ), | |
| 48 | 42 | $module_label |
| 49 | 43 | ) . ' '; |
| 50 | 44 | } |
| 51 | 45 | |
| @@ -100,10 +94,10 @@ | ||
| 100 | 94 | HTML; |
| 101 | 95 | |
| 102 | 96 | $downgrading_plan_text = fs_text_inline( 'Downgrading your plan', 'downgrading-plan', $slug ); |
| 103 | 97 | $cancelling_subscription_text = fs_text_inline( 'Cancelling the subscription', 'cancelling-subscription', $slug ); |
| 104 | -/* translators: %1$s: Either 'Downgrading your plan' or 'Cancelling the subscription' */ | |
| 105 | -$downgrade_x_confirm_text = fs_text_inline( '%1$s will immediately stop all future recurring payments and your %2$s plan license will expire in %3$s.', 'downgrade-x-confirm', $slug ); | |
| 98 | +/* translators: %1s: Either 'Downgrading your plan' or 'Cancelling the subscription' */ | |
| 99 | +$downgrade_x_confirm_text = fs_text_inline( '%1s will immediately stop all future recurring payments and your %s plan license will expire in %s.', 'downgrade-x-confirm', $slug ); | |
| 106 | 100 | $prices_increase_text = fs_text_inline( 'Please note that we will not be able to grandfather outdated pricing for renewals/new subscriptions after a cancellation. If you choose to renew the subscription manually in the future, after a price increase, which typically occurs once a year, you will be charged the updated price.', 'pricing-increase-warning', $slug ); |
| 107 | 101 | $after_downgrade_non_blocking_text = fs_text_inline( 'You can still enjoy all %s features but you will not have access to %s security & feature updates, nor support.', 'after-downgrade-non-blocking', $slug ); |
| 108 | 102 | $after_downgrade_blocking_text = fs_text_inline( 'Once your license expires you can still use the Free version but you will NOT have access to the %s features.', 'after-downgrade-blocking', $slug ); |
| 109 | 103 | $after_downgrade_blocking_text_premium_only = fs_text_inline( 'Once your license expires you will no longer be able to use the %s, unless you activate it again with a valid premium license.', 'after-downgrade-blocking-premium-only', $slug ); |
| @@ -138,15 +132,15 @@ | ||
| 138 | 132 | var modalHtml = |
| 139 | 133 | '<div class="fs-modal fs-modal-subscription-cancellation fs-modal-subscription-cancellation-<?php echo $fs->get_id() ?>">' |
| 140 | 134 | + ' <div class="fs-modal-dialog">' |
| 141 | 135 | + ' <div class="fs-modal-header">' |
| 142 | - + ' <h4><?php echo esc_html( sprintf( fs_text_inline( 'Cancel %s?', 'cancel-x', $slug ), ucfirst( $subscription_cancellation_context ) ) ) ?></h4>' | |
| 136 | + + ' <h4><?php echo esc_attr( sprintf( fs_text_inline( 'Cancel %s?', 'cancel-x', $slug ), ucfirst( $subscription_cancellation_context ) ) ) ?></h4>' | |
| 143 | 137 | + ' </div>' |
| 144 | 138 | + ' <div class="fs-modal-body">' |
| 145 | 139 | + ' <div class="fs-modal-panel active">' + <?php echo json_encode( $subscription_cancellation_html ) ?> + '<p class="fs-price-increase-warning" style="display: none;">' + <?php echo json_encode( $prices_increase_text ) ?> + '</p></div>' |
| 146 | 140 | + ' </div>' |
| 147 | 141 | + ' <div class="fs-modal-footer">' |
| 148 | - + ' <a href="#" class="button button-secondary button-close"><?php fs_esc_attr_echo_inline( 'Cancel', 'cancel', $slug ) ?></a>' | |
| 142 | + + ' <a href="#" class="button button-secondary button-close"><?php fs_esc_attr_echo( 'cancel', $slug ) ?></a>' | |
| 149 | 143 | + ' <a href="#" class="button button-primary button-deactivate disabled"><?php fs_esc_attr_echo_inline( 'Proceed', 'proceed', $slug ) ?></a>' |
| 150 | 144 | + ' </div>' |
| 151 | 145 | + ' </div>' |
| 152 | 146 | + '</div>', |
| @@ -175,9 +169,9 @@ | ||
| 175 | 169 | var _this = $(this), |
| 176 | 170 | subscriptionCancellationActionEventName = <?php echo json_encode( $fs->get_action_tag( 'subscription_cancellation_action' ) ) ?>; |
| 177 | 171 | |
| 178 | 172 | if ( _this.hasClass( 'button-primary' ) ) { |
| 179 | - if ( 'true' !== $modal.find( 'input[name="cancel-subscription"]:checked' ).val() ) { | |
| 173 | + if ( 'true' !== $( 'input[name="cancel-subscription"]:checked' ).val() ) { | |
| 180 | 174 | $modal.trigger( subscriptionCancellationActionEventName, false ); |
| 181 | 175 | } else { |
| 182 | 176 | if ( confirm( <?php echo json_encode( $subscription_cancellation_confirmation_message ) ?> ) ) { |
| 183 | 177 | $modal.trigger( subscriptionCancellationActionEventName, true ); |
| @@ -199,9 +193,9 @@ | ||
| 199 | 193 | ) ) ?> ); |
| 200 | 194 | |
| 201 | 195 | $modal.find('.fs-price-increase-warning').show(); |
| 202 | 196 | } else { |
| 203 | - $primaryButton.html( <?php fs_json_encode_echo_inline( 'Proceed', 'proceed', $slug ) ?> ); | |
| 197 | + $primaryButton.html( <?php echo fs_json_encode_echo_inline( 'Proceed', 'proceed', $slug ) ?> ); | |
| 204 | 198 | $modal.find('.fs-price-increase-warning').hide(); |
| 205 | 199 | } |
| 206 | 200 | |
| 207 | 201 | $primaryButton.toggleClass( 'warn', isSelected ); |
| @@ -276,8 +270,8 @@ | ||
| 276 | 270 | |
| 277 | 271 | function updateButtonLabels() { |
| 278 | 272 | $modal.find('.button-primary').text( <?php fs_json_encode_echo_inline( 'Proceed', 'proceed', $slug ) ?> ); |
| 279 | 273 | |
| 280 | - $modal.find('.button-secondary').text( <?php fs_json_encode_echo_inline( 'Cancel', 'cancel', $slug ) ?> ); | |
| 274 | + $modal.find('.button-secondary').text( <?php fs_json_encode_echo( 'cancel', $slug ) ?> ); | |
| 281 | 275 | } |
| 282 | 276 | })( jQuery ); |
| 283 | 277 | </script> |