PluginProbe ʕ •ᴥ•ʔ
NitroPack – Performance, Page Speed & Cache Plugin for Core Web Vitals, CDN & Image Optimization / trunk
NitroPack – Performance, Page Speed & Cache Plugin for Core Web Vitals, CDN & Image Optimization vtrunk
1.19.8 1.19.7 1.19.6 1.19.5 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.11.0 1.12.0 1.13.0 1.14.0 1.15.0 1.15.1 1.15.2 1.15.3 1.16.0 1.16.1 1.16.2 1.16.3 1.16.4 1.16.5 1.16.6 1.16.7 1.16.8 1.17.0 1.17.6 1.17.7 1.17.8 1.17.9 1.18.0 1.18.1 1.18.2 1.18.3 1.18.4 1.18.5 1.18.6 1.18.7 1.18.8 1.18.9 1.19.0 1.19.1 1.19.2 1.19.3 1.19.4 1.3.19 1.3.20 1.4.0 1.4.1 1.5.0 1.5.1 1.5.10 1.5.11 1.5.12 1.5.13 1.5.14 1.5.15 1.5.16 1.5.17 1.5.18 1.5.19 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.7.0 1.7.1 1.8.0 1.8.1 1.8.3 1.9.0 1.9.1 1.9.2
nitropack / view / modals / modal-disconnect.php
nitropack / view / modals Last commit date
modal-cache-warmup.php 1 month ago modal-disconnect.php 1 month ago modal-go-live.php 1 month ago modal-modes.php 3 days ago modal-not-optimized-CPT.php 1 year ago modal-optimization-mode.php 1 month ago modal-plugin-deactivate.php 1 month ago modal-posttypes.php 3 months ago modal-processing-html-error.php 3 months ago modal-processing-html-success.php 1 month ago modal-processing-html.php 1 month ago modal-purge-cache.php 1 month ago modal-safemode.php 1 month ago modal-test-mode.php 1 month ago modal-unsaved-changes.php 1 month ago
modal-disconnect.php
133 lines
1 <div id="modal-disconnect" data-modal-backdrop="" tabindex="-1" aria-hidden="true" class="hidden modal-wrapper popup-modal">
2 <div class="popup-container">
3 <div class="popup-inner">
4 <!-- Modal header -->
5 <div class="popup-header">
6 <button type="button" class="close-modal">
7 <svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg">
8 <path fill-rule="evenodd" clip-rule="evenodd" d="M0.293031 1.29308C0.480558 1.10561 0.734866 1.00029 1.00003 1.00029C1.26519 1.00029 1.5195 1.10561 1.70703 1.29308L6.00003 5.58608L10.293 1.29308C10.3853 1.19757 10.4956 1.12139 10.6176 1.06898C10.7396 1.01657 10.8709 0.988985 11.0036 0.987831C11.1364 0.986677 11.2681 1.01198 11.391 1.06226C11.5139 1.11254 11.6255 1.18679 11.7194 1.28069C11.8133 1.37458 11.8876 1.48623 11.9379 1.60913C11.9881 1.73202 12.0134 1.8637 12.0123 1.99648C12.0111 2.12926 11.9835 2.26048 11.9311 2.38249C11.8787 2.50449 11.8025 2.61483 11.707 2.70708L7.41403 7.00008L11.707 11.2931C11.8892 11.4817 11.99 11.7343 11.9877 11.9965C11.9854 12.2587 11.8803 12.5095 11.6948 12.6949C11.5094 12.8803 11.2586 12.9855 10.9964 12.9878C10.7342 12.99 10.4816 12.8892 10.293 12.7071L6.00003 8.41408L1.70703 12.7071C1.51843 12.8892 1.26583 12.99 1.00363 12.9878C0.741432 12.9855 0.49062 12.8803 0.305212 12.6949C0.119804 12.5095 0.0146347 12.2587 0.0123563 11.9965C0.0100779 11.7343 0.110873 11.4817 0.293031 11.2931L4.58603 7.00008L0.293031 2.70708C0.10556 2.51955 0.000244141 2.26525 0.000244141 2.00008C0.000244141 1.73492 0.10556 1.48061 0.293031 1.29308Z" fill="#1B004E" />
9 </svg>
10 <span class="sr-only"><?php esc_html_e('Close modal', 'nitropack'); ?></span>
11 </button>
12 <img src="<?php echo NITROPACK_PLUGIN_DIR_URL . 'assets/img/info.svg'; ?>" width="46" height="46" alt="" class="icon rotate-180">
13 <h3><?php esc_html_e('Are you sure you want to disconnect NitroPack?', 'nitropack'); ?></h3>
14 </div>
15 <!-- Modal body -->
16 <div class="popup-body text-center"></div>
17
18 <div class="popup-footer">
19 <button type="button" class="btn btn-secondary modal-close"><?php esc_html_e('Cancel', 'nitropack'); ?></button>
20 <button type="button" class="btn btn-primary"><?php esc_html_e('Disconnect', 'nitropack'); ?></button>
21 </div>
22 </div>
23 </div>
24 </div>
25 <script>
26 jQuery(document).ready(function($) {
27 const $targetEl = document.getElementById('modal-disconnect'),
28 modal = new Modal($targetEl),
29 modal_wrapper = $('#modal-disconnect'),
30 modal_icon = modal_wrapper.find('.icon'),
31 modal_title = modal_wrapper.find('.popup-header h3'),
32 modal_footer = modal_wrapper.find('.popup-footer'),
33 close_modal = modal_wrapper.find('.close-modal'),
34 secondary_btn = modal_footer.find('.modal-close'),
35 action_btn = modal_footer.find('.btn-primary'),
36 modal_text = modal_wrapper.find('.popup-body'),
37 test_mode = '#safemode-status';
38
39 $('#disconnect-btn').click(function() {
40 //always with info icon
41 modal_icon.attr('src', '<?php echo NITROPACK_PLUGIN_DIR_URL . 'assets/img/info.svg'; ?>');
42 //reset clicks
43 secondary_btn.off('click');
44 action_btn.off('click');
45 modal.show();
46 if ($(test_mode).is(':checked')) {
47 modal_title.text('<?php esc_html_e('Are you sure you want to disconnect NitroPack?', 'nitropack'); ?>');
48 modal_text.html('<p><?php esc_html_e('Disconnecting NitroPack will immediately stop page optimizations, potentially slowing down your site and affecting user experience.', 'nitropack'); ?></p>');
49 secondary_btn.text('Cancel');
50 action_btn.text('Disconnect');
51
52 secondary_btn.click(function() {
53 modal.hide();
54 });
55 action_btn.click(function() {
56 disconnectPlugin();
57 })
58 } else {
59 modal_title.text('<?php esc_html_e('Are you sure you want to disconnect NitroPack?', 'nitropack'); ?>');
60 modal_text.html('<p><?php esc_html_e('Disconnecting NitroPack will delete your page optimizations, potentially slowing down your website and worsening the user experience.', 'nitropack'); ?></p>');
61 modal_text.append('<p><?php _e('Please use "Test Mode" for troubleshooting potential issues without negatively impacting your site’s performance.', 'nitropack'); ?></p>');
62 secondary_btn.text('Disconnect Anyway');
63 action_btn.text('Switch to "Test Mode"');
64
65 //disconnect btn
66 secondary_btn.click(function() {
67
68 disconnectPlugin();
69 });
70 //test mode btn
71 action_btn.click(function() {
72 enableSafemode();
73 });
74 }
75 modal_footer.removeClass('hidden');
76 });
77 close_modal.click(function() {
78 modal.hide();
79 });
80 var disconnectPlugin = () => {
81
82 $.ajax({
83 url: ajaxurl,
84 type: "POST",
85 data: {
86 action: "nitropack_disconnect",
87 nonce: nitroNonce
88 },
89 beforeSend: function() {
90 modal_icon.attr('src', '<?php echo NITROPACK_PLUGIN_DIR_URL . 'assets/img/loading.svg'; ?>');
91 modal_title.html('<?php esc_html_e('Disconnecting...', 'nitropack'); ?>');
92 modal_footer.addClass('hidden');
93 modal_text.text('');
94 },
95 success: function(resp) {
96 location.reload();
97 },
98 error: function(xhr) {
99 NitropackUI.triggerToast('error', "Something went wrong");
100 }
101 });
102
103 }
104 var enableSafemode = () => {
105 modal_icon.attr('src', '<?php echo NITROPACK_PLUGIN_DIR_URL . 'assets/img/loading.svg'; ?>');
106 modal_title.html('<?php esc_html_e('Switching to Test Mode...', 'nitropack'); ?>');
107 modal_footer.addClass('hidden');
108 modal_text.text('');
109 $.post(ajaxurl, {
110 action: 'nitropack_enable_safemode',
111 nonce: nitroNonce
112 }, function(response) {
113 var resp = JSON.parse(response);
114 modal_footer.addClass('hidden');
115 if (resp.type == "success") {
116 $(test_mode).prop("checked", true);
117 $("#nitropack-smenabled-notice").closest('.nitro-notification').show();
118 modal.hide();
119 modal_title.text(resp.message);
120 modal_text.text('');
121
122 } else {
123 modal_title.text('<?php esc_html_e('Error!', 'nitropack'); ?>');
124 modal_text.text('');
125 $(test_mode).prop('checked', false);
126
127 }
128 NitropackUI.triggerToast(resp.type, resp.message);
129 close_modal.click();
130 });
131 }
132 });
133 </script>