templates
2 years ago
autoupdate_banner.php
2 years ago
cdn_page.php
2 years ago
customer_support.php
2 years ago
deactivation_popup.php
2 years ago
post_custom_column.php
2 years ago
referral_program_page.php
2 years ago
settings_basic.php
11 months ago
settings_connect.php
3 years ago
settings_view.php
1 year ago
two_black_friday.php
3 years ago
two_header.php
3 years ago
white_label_view.php
2 years ago
deactivation_popup.php
197 lines
| 1 | <?php |
| 2 | $two_domain_id = get_site_option('tenweb_domain_id'); |
| 3 | $two_manage_url = trim(TENWEB_DASHBOARD, '/') . '/websites/' . $two_domain_id . '/booster/frontend' . '?from_plugin=' . \TenWebOptimizer\OptimizerUtils::FROM_PLUGIN; |
| 4 | $two_contact_link = $two_manage_url . '&open=livechat'; |
| 5 | $two_disconnect_nonce = wp_create_nonce('two_disconnect_nonce'); |
| 6 | $two_disconnect_button_text = __('Deactivate', 'tenweb-speed-optimizer'); |
| 7 | |
| 8 | $two_so_organization_name = get_option('two_so_organization_name'); |
| 9 | $two_so_organization_support_url = get_option('two_so_organization_support_url'); |
| 10 | |
| 11 | if (!empty($two_so_organization_name) && !empty($two_so_organization_support_url)) { |
| 12 | $two_contact_link = $two_so_organization_support_url; |
| 13 | } |
| 14 | $query_args = [ |
| 15 | 'action' => 'deactivate', |
| 16 | 'plugin' => TENWEB_SO_BASENAME, |
| 17 | '_wpnonce' => wp_create_nonce('deactivate-plugin_' . TENWEB_SO_BASENAME) |
| 18 | ]; |
| 19 | |
| 20 | // disconnect plugin only when image-optimizer is not active, otherwise only deactivate it |
| 21 | if (!is_plugin_active('image-optimizer-wd/tenweb-image-optimizer.php')) { |
| 22 | $query_args['two_disconnect'] = 1; |
| 23 | $query_args['nonce'] = $two_disconnect_nonce; |
| 24 | $two_disconnect_button_text = __('Disconnect & deactivate', 'tenweb-speed-optimizer'); |
| 25 | } |
| 26 | define('TENWEB_SO_DISCONNECT_DEACTIVATE_URL', add_query_arg( |
| 27 | $query_args, |
| 28 | admin_url('plugins.php') |
| 29 | )); |
| 30 | global $TwoSettings; |
| 31 | |
| 32 | if ('on' == $TwoSettings->get_settings('two_test_mode')) { |
| 33 | $two_popup_title = __('You’re about to deactivate ' . TWO_SO_ORGANIZATION_NAME . ' Booster', 'tenweb-speed-optimizer'); |
| 34 | $two_popup_p1 = __(TWO_SO_ORGANIZATION_NAME . ' Booster is currently working in Test mode.', 'tenweb-speed-optimizer'); |
| 35 | $two_popup_p2 = __('If you’re still having issues and no longer wish to optimize your website with ' . TWO_SO_ORGANIZATION_NAME . ' Booster, you can disconnect your site and deactivate the plugin.', 'tenweb-speed-optimizer'); |
| 36 | $two_button_text = __('STAY CONNECTED & RESOLVE', 'tenweb-speed-optimizer'); |
| 37 | $two_button_class = 'two-button-cancel'; |
| 38 | } else { |
| 39 | $two_popup_title = __('Try this before deactivating ' . TWO_SO_ORGANIZATION_NAME . ' Booster', 'tenweb-speed-optimizer'); |
| 40 | $two_popup_p1 = sprintf(__('If you’re having issues with your optimized website, deactivating ' . TWO_SO_ORGANIZATION_NAME . ' Booster is not the only solution. We recommend enabling Test mode and %s to resolve the issue.', 'tenweb-speed-optimizer'), '<a href="' . esc_url($two_contact_link) . '" target="_blank">' . __('contacting our team', 'tenweb-speed-optimizer') . '</a>'); |
| 41 | $two_popup_p2 = sprintf(__('Test mode temporarily disables ' . TWO_SO_ORGANIZATION_NAME . ' Booster for website visitors so you can perform various tests without affecting the live site. To preview optimized version in Test mode, append %s. Choose how you want to proceed.', 'tenweb-speed-optimizer'), '<b>?twbooster=1</b>'); |
| 42 | $two_button_text = __('Enable test mode', 'tenweb-speed-optimizer'); |
| 43 | $two_button_class = 'two-button-test-mode'; |
| 44 | } |
| 45 | ?> |
| 46 | <style> |
| 47 | .two-button { |
| 48 | border-radius: 6px; |
| 49 | padding: 10px 24px; |
| 50 | text-align: center; |
| 51 | text-decoration: none; |
| 52 | width: 260px; |
| 53 | font-size: 14px; |
| 54 | line-height: 20px; |
| 55 | font-weight: 600; |
| 56 | text-transform: uppercase; |
| 57 | color: #FFFFFF; |
| 58 | display: inline-block; |
| 59 | box-sizing: border-box; |
| 60 | margin: 0 0 0 20px; |
| 61 | } |
| 62 | .two-button:hover { |
| 63 | opacity: 0.6; |
| 64 | } |
| 65 | .two-deactivate-popup * { |
| 66 | box-sizing: border-box; |
| 67 | font-family: Open Sans, sans-serif; |
| 68 | } |
| 69 | .two-deactivate-popup { |
| 70 | position: fixed; |
| 71 | top: 0; right: 0; bottom: 0; left: 0; |
| 72 | background-color: #323A4534; |
| 73 | display: none; |
| 74 | flex-direction: column; |
| 75 | justify-content: center; |
| 76 | z-index: 9999; |
| 77 | color: #323A45; |
| 78 | font-family: sans-serif; |
| 79 | } |
| 80 | .two-deactivate-popup.open { |
| 81 | display: flex; |
| 82 | } |
| 83 | .two-deactivate-popup-body { |
| 84 | width: 740px; |
| 85 | margin: 0 auto; |
| 86 | background-color: #FFFFFF; |
| 87 | border-radius: 13px; |
| 88 | display: flex; |
| 89 | flex-direction: column; |
| 90 | align-self: center; |
| 91 | padding: 35px 50px; |
| 92 | font-size: 16px; |
| 93 | line-height: 24px; |
| 94 | justify-content: space-between; |
| 95 | position: relative; |
| 96 | } |
| 97 | .two-deactivate-popup-content { |
| 98 | max-width: 600px; |
| 99 | flex-grow: 1; |
| 100 | margin: 10px 0 15px 0; |
| 101 | } |
| 102 | .two-deactivate-popup-content>p { |
| 103 | font-size: 16px; |
| 104 | line-height: 24px; |
| 105 | margin: 0 0 15px 0; |
| 106 | } |
| 107 | .two-deactivate-popup-content>p a, .two-deactivate-popup-content>p a:hover { |
| 108 | color: #2160B5; |
| 109 | } |
| 110 | .two-deactivate-popup-title { |
| 111 | font-size: 24px; |
| 112 | line-height: 34px; |
| 113 | font-weight: 800; |
| 114 | } |
| 115 | .two-deactivate-popup-button, .two-deactivate-popup-button:hover { |
| 116 | background-color: #22B339; |
| 117 | color: #FFFFFF; |
| 118 | } |
| 119 | .two-button-disconnect, .two-button-disconnect:hover { |
| 120 | background-color: #E6E7E8; |
| 121 | color: #323A45; |
| 122 | } |
| 123 | .two-deactivate-popup-button-container { |
| 124 | display: flex; |
| 125 | flex-direction: row; |
| 126 | justify-content: end; |
| 127 | } |
| 128 | .two-close-img { |
| 129 | position: absolute; |
| 130 | top: 15px; |
| 131 | right: 15px; |
| 132 | cursor: pointer; |
| 133 | } |
| 134 | @media screen and (max-width: 767px){ |
| 135 | .two-deactivate-popup-body { |
| 136 | width: 100%; |
| 137 | height: auto; |
| 138 | top: 35px; |
| 139 | border-radius: 0; |
| 140 | padding: 35px 20px; |
| 141 | } |
| 142 | } |
| 143 | </style> |
| 144 | <script> |
| 145 | jQuery(document).ready(function() { |
| 146 | jQuery('tr[data-plugin="tenweb-speed-optimizer/tenweb_speed_optimizer.php"] span.deactivate a').on('click', function() { |
| 147 | jQuery('.two-deactivate-popup').appendTo('body').addClass('open'); |
| 148 | return false; |
| 149 | }); |
| 150 | jQuery('.two-button-cancel, .two-close-img').on('click', function() { |
| 151 | jQuery('.two-deactivate-popup').removeClass('open'); |
| 152 | return false; |
| 153 | }); |
| 154 | jQuery('.two-button-test-mode').on('click', function() { |
| 155 | jQuery.ajax({ |
| 156 | type: "POST", |
| 157 | url: ajaxurl, |
| 158 | dataType: 'json', |
| 159 | data: { |
| 160 | action: "two_update_setting", |
| 161 | nonce: "<?php echo esc_js(wp_create_nonce('two_ajax_nonce')); ?>", |
| 162 | name: "two_test_mode", |
| 163 | value: "on", |
| 164 | } |
| 165 | }).done(function (data) { |
| 166 | if ( true == data.success ) { |
| 167 | window.location.href = "<?php echo esc_url($two_manage_url); ?>"; |
| 168 | } else { |
| 169 | alert( 'Something went wrong. Could not enable test mode.' ); |
| 170 | } |
| 171 | }); |
| 172 | return false; |
| 173 | }); |
| 174 | }); |
| 175 | </script> |
| 176 | <div class="two-deactivate-popup"> |
| 177 | <div class="two-deactivate-popup-body"> |
| 178 | <div class="two-deactivate-popup-title"> |
| 179 | <?php echo esc_html($two_popup_title); ?> |
| 180 | </div> |
| 181 | <div class="two-deactivate-popup-content"> |
| 182 | <p> |
| 183 | <?php echo wp_kses_post($two_popup_p1); ?> |
| 184 | </p> |
| 185 | <p> |
| 186 | <?php echo wp_kses_post($two_popup_p2); ?> |
| 187 | </p> |
| 188 | </div> |
| 189 | <div class="two-deactivate-popup-button-container"> |
| 190 | <a href="<?php echo esc_url(TENWEB_SO_DISCONNECT_DEACTIVATE_URL); ?>" class="two-button two-button-disconnect"><?php echo esc_html($two_disconnect_button_text); ?></a> |
| 191 | <a href="#" class="two-button two-deactivate-popup-button <?php echo esc_attr($two_button_class); ?>"><?php echo esc_html($two_button_text); ?></a> |
| 192 | </div> |
| 193 | <img src="<?php echo esc_url(TENWEB_SO_URL); ?>/assets/images/close.svg" alt="Close" class="two-close-img" /> |
| 194 | </div> |
| 195 | </div> |
| 196 | <?php |
| 197 |