PluginProbe ʕ •ᴥ•ʔ
NitroPack – Performance, Page Speed & Cache Plugin for Core Web Vitals, CDN & Image Optimization / 1.18.1
NitroPack – Performance, Page Speed & Cache Plugin for Core Web Vitals, CDN & Image Optimization v1.18.1
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 / dashboard-oneclick.php
nitropack / view Last commit date
images 1 year ago javascript 1 year ago modals 1 year ago stylesheet 1 year ago templates 1 year ago admin.php 1 year ago connect-oneclick.php 1 year ago connect.php 1 year ago dashboard-oneclick.php 1 year ago dashboard.php 1 year ago oneclick.php 1 year ago system-report.php 1 year ago
dashboard-oneclick.php
502 lines
1 <?php
2 $settings = new \NitroPack\WordPress\Settings();
3 $notifications = new \NitroPack\WordPress\Notifications\Notifications();
4 $usage = '0 MB';
5 $max_usage = '1 GB';
6 $page_views = '0';
7 $max_page_views = '10000'; ?>
8
9 <?php $notifications->nitropack_display_admin_notices(); ?>
10
11 <div class="grid grid-cols-2 gap-6 grid-col-1-tablet items-start nitropack-dashboard">
12 <div class="col-span-1">
13 <!-- Optimized Pages Card -->
14 <div class="card card-optimized-pages">
15 <div class="card-header">
16 <h3><?php esc_html_e( 'Optimized pages', 'nitropack' ); ?></h3>
17 <div class="flex flex-row items-center" style="display: none;" id="pending-optimizations-section">
18 <img src="<?php echo plugin_dir_url( __FILE__ ) . 'images/loading.svg'; ?>" alt="loading" class="w-4 h-4">
19 <span class="ml-2 mr-1 text-primary"> <?php esc_html_e( 'Processing', 'nitropack' ); ?>
20 <span id="pending-optimizations-count">X</span>
21 <?php esc_html_e( 'page(s) in the background', 'nitropack' ); ?></span>
22 </div>
23 </div>
24 <div class="card-body">
25 <div class="card-body-inner">
26 <div class="optimized-pages"><span data-optimized-pages-total>0</span></div>
27 <div class="text-box">
28 <div class="time-ago"><?php esc_html_e( 'Last cache purge', 'nitropack' ); ?>: <span
29 data-last-cache-purge><?php esc_html_e( 'Never', 'nitropack' ); ?></span></div>
30 <div class="reason"><?php esc_html_e( 'Reason', 'nitropack' ); ?>: <span
31 data-purge-reason><?php esc_html_e( 'Unknown', 'nitropack' ); ?></span></div>
32 </div>
33 <button id="optimizations-purge-cache" type="button" class="btn btn-secondary"
34 data-modal-target="modal-purge-cache"
35 data-modal-toggle="modal-purge-cache"><?php esc_html_e( 'Purge cache', 'nitropack' ); ?></button>
36 </div>
37 </div>
38 <?php require_once NITROPACK_PLUGIN_DIR . 'view/modals/modal-purge-cache.php'; ?>
39 </div>
40 <!-- Optimized Pages Card End -->
41 <!-- Optimization Mode Card -->
42 <div class="card card-optimization-mode">
43 <div class="card-header no-border mb-0">
44 <div class="flex items-center">
45 <h3 class="mb-0"><?php esc_html_e( 'Optimization mode', 'nitropack' ); ?></h3>
46 <span class="tooltip-icon" data-tooltip-target="tooltip-optimization">
47 <img src="<?php echo plugin_dir_url( __FILE__ ) . 'images/info.svg'; ?>">
48 </span>
49 <div id="tooltip-optimization" role="tooltip" class="tooltip-container hidden">
50 <?php esc_html_e( 'Select from our range of predefined optimization modes to boost your site\'s performance.', 'nitropack' );
51 ?>
52 <div class="tooltip-arrow" data-popper-arrow></div>
53 </div>
54 </div>
55 </div>
56 <?php $modes = array( 'standard' => esc_html__( 'Standard', 'nitropack' ), 'medium' => esc_html__( 'Medium', 'nitropack' ), 'strong' => esc_html__( 'Strong', 'nitropack' ), 'ludicrous' => esc_html__( 'Ludicrous', 'nitropack' ), 'custom' => esc_html__( 'Custom', 'nitropack' ) ); ?>
57 <div class="tabs-wrapper">
58 <div class="tabs" id="optimization-modes">
59 <?php foreach ( $modes as $mode_id => $mode ) :
60 $disabled = ( $mode_id === 'custom' ) ? 'disabled' : '';
61 ?>
62 <a class="btn tab-link btn-link <?php echo $disabled; ?>" data-mode="<?php echo $mode_id; ?>"
63 data-modal-target="modal-optimization-mode" data-modal-toggle="modal-optimization-mode" <?php echo $disabled; ?>><?php echo $mode; ?></a>
64 <?php endforeach; ?>
65 </div>
66 <p><?php esc_html_e( 'Active Mode', 'nitropack' ); ?>: <span class="active-mode"></span></p>
67 <div class="tab-content-wrapper">
68 <div class="hidden tab-content" role="tabpanel" data-tab="standard-tab">
69 <p class="text-secondary mt-2">
70 <?php esc_html_e( 'Standard optimization features enabled for your site. Ideal choice for maximum stability.', 'nitropack' ); ?>
71 </p>
72 </div>
73 <div class="hidden tab-content" role="tabpanel" data-tab="medium-tab">
74 <p class="text-secondary mt-2">
75 <?php esc_html_e( 'Adds image lazy loading to standard optimizations. Uses built-in browser techniques for loading resources.', 'nitropack' ); ?>
76 </p>
77 </div>
78 <div class="hidden tab-content" role="tabpanel" data-tab="strong-tab">
79 <p class="text-secondary mt-2">
80 <?php esc_html_e( 'Includes smart resource loading on top of Medium optimizations. Balances speed boost with stability.', 'nitropack' ); ?>
81 </p>
82 </div>
83 <div class="hidden tab-content" role="tabpanel" data-tab="ludicrous-tab">
84 <p class="text-secondary mt-2">
85 <?php esc_html_e( 'Applies deferred JS and advanced resource loading for optimal performance and Core Web Vitals.', 'nitropack' ); ?>
86 </p>
87 </div>
88 <div class="hidden tab-content" role="tabpanel" data-tab="custom-tab">
89 <p class="text-secondary mt-2">
90 <?php esc_html_e( 'Activated when manual setups are made. Ideal for advanced NitroPack optimizations.', 'nitropack' ); ?>
91 </p>
92 </div>
93 </div>
94 </div>
95 <div class="card-footer">
96 <div class="flex flex-row">
97 <p class=""><?php esc_html_e( 'Which optimization mode to choose?', 'nitropack' ); ?></p>
98 <a class="text-primary btn-link ml-auto see-modes" data-modal-target="modes-modal"
99 data-modal-toggle="modes-modal"><?php esc_html_e( 'See modes comparison', 'nitropack' ); ?></a>
100 <?php require_once NITROPACK_PLUGIN_DIR . 'view/modals/modal-modes.php'; ?>
101 </div>
102 </div>
103 <?php require_once NITROPACK_PLUGIN_DIR . 'view/modals/modal-optimization-mode.php'; ?>
104 </div>
105 <!-- Optimization Mode Card End -->
106 <!-- Automated Behavior Card -->
107 <div class="card card-automated-behavior">
108 <div class="card-header">
109 <h3><?php esc_html_e( 'Automated Behavior', 'nitropack' ); ?></h3>
110 </div>
111 <div class="card-body">
112 <div class="options-container">
113 <div class="nitro-option" id="purge-cache-widget">
114 <div class="nitro-option-main">
115 <div class="text-box">
116 <h6><?php esc_html_e( 'Purge cache', 'nitropack' ); ?></h6>
117 <p><?php esc_html_e( 'Purge affected cache when content is updated or published', 'nitropack' ); ?></p>
118 </div>
119 <label class="inline-flex items-center cursor-pointer ml-auto">
120 <input type="checkbox" value="" class="sr-only peer" name="purge_cache" id="auto-purge-status" <?php if ( $autoCachePurge )
121 echo "checked"; ?>>
122 <div class="toggle"></div>
123 </label>
124 </div>
125 </div>
126 <div class="nitro-option" id="page-optimization-widget">
127 <div class="nitro-option-main">
128 <div class="text-box">
129 <h6><?php esc_html_e( 'Page optimization', 'nitropack' ); ?></h6>
130 <p><?php esc_html_e( 'Select what post/page types get optimized', 'nitropack' ); ?></p>
131 </div>
132 <a data-modal-target="modal-posttypes" data-modal-toggle="modal-posttypes"
133 class="btn btn-secondary btn-icon">
134 <img src="<?php echo plugin_dir_url( __FILE__ ); ?>images/setting-icon.svg">
135 </a>
136 </div>
137 <?php require_once NITROPACK_PLUGIN_DIR . 'view/modals/modal-posttypes.php'; ?>
138 </div>
139 </div>
140 </div>
141 </div>
142 <!-- Automated Behavior Card End -->
143 <!-- Go to app Card -->
144 <div class="card exclusion-card">
145 <div class="card-header">
146 <h3><?php esc_html_e( 'Exclusions', 'nitropack' ); ?></h3>
147 </div>
148 <div class="card-body">
149 <div class="options-container">
150 <div class="nitro-option" id="ajax-shortcodes-widget">
151 <?php $settings->render_ajax_shortcodes_setting(); ?>
152 </div>
153 </div>
154 </div>
155 </div>
156 <!-- Go to app card End -->
157
158
159 </div>
160 <div class="col-span-1">
161 <!-- Subscription Card End -->
162 <!-- Basic Settings Card -->
163 <div class="card card-basic-settings">
164 <div class="card-header">
165 <h3><?php esc_html_e( 'Basic Settings', 'nitropack' ); ?></h3>
166 </div>
167 <div class="card-body">
168 <div class="options-container">
169 <div class="nitro-option" id="cache-warmup-widget">
170 <div class="nitro-option-main">
171 <div class="text-box" id="warmup-status-slider">
172
173 <?php $sitemap = get_option( 'np_warmup_sitemap', false );
174 $toolTipDisplayState = $sitemap ? '' : 'hidden'; ?>
175
176 <h6><?php esc_html_e( 'Cache warmup', 'nitropack' ); ?> <span
177 class="badge badge-primary ml-2"><?php esc_html_e( 'Recommended', 'nitropack' ); ?></span> <span
178 class="tooltip-icon <?php echo $toolTipDisplayState; ?>" data-tooltip-target="tooltip-sitemap">
179 <img src="<?php echo plugin_dir_url( __FILE__ ) . 'images/info.svg'; ?>">
180 </span></h6>
181 <div id="tooltip-sitemap" role="tooltip" class="tooltip-container hidden">
182 <?php echo $sitemap; ?>
183 <div class="tooltip-arrow" data-popper-arrow></div>
184 </div>
185 <p><?php esc_html_e( 'Automatically pre-caches your website\'s page content', 'nitropack' ); ?>. <a
186 href="https://support.nitropack.io/en/articles/8390320-cache-warmup" class="text-blue"
187 target="_blank"><?php esc_html_e( 'Learn more', 'nitropack' ); ?></a></p>
188 </div>
189 <label class="inline-flex items-center cursor-pointer ml-auto">
190 <input id="warmup-status" type="checkbox" class="sr-only peer">
191 <div class="toggle"></div>
192 </label>
193 </div>
194 <div class="msg-container" id="loading-warmup-status">
195 <img src="<?php echo plugin_dir_url( __FILE__ ) . 'images/loading.svg'; ?>" alt="loading" class="icon">
196 <span class="msg"><?php esc_html_e( 'Loading cache warmup status', 'nitropack' ); ?></span>
197 </div>
198 </div>
199 <div class="nitro-option" id="test-mode-widget">
200 <div class="nitro-option-main">
201 <div class="text-box" id="safemode-status-slider">
202 <h6><?php esc_html_e( 'Test Mode', 'nitropack' ); ?></h6>
203 <p>
204 <?php esc_html_e( 'Test NitroPack\'s features without affecting your visitors\' experience', 'nitropack' ); ?>.
205 <a href="https://support.nitropack.io/en/articles/8390292-test-mode" class="text-blue"
206 target="_blank"><?php esc_html_e( 'Learn more', 'nitropack' ); ?></a></p>
207 </div>
208
209 <label class="inline-flex items-center cursor-pointer ml-auto">
210 <input type="checkbox" class="sr-only peer" id="safemode-status">
211
212 <div class="toggle"></div>
213 </label>
214 </div>
215 <div class="msg-container" id="loading-safemode-status">
216 <img src="<?php echo plugin_dir_url( __FILE__ ) . 'images/loading.svg'; ?>" alt="loading" class="icon">
217 <?php esc_html_e( 'Loading test mode status', 'nitropack' ); ?>
218 </div>
219 <?php require_once NITROPACK_PLUGIN_DIR . 'view/modals/modal-test-mode.php'; ?>
220 </div>
221 <div class="nitro-option" id="compression-widget">
222 <div class="nitro-option-main">
223 <div class="text-box">
224 <h6><span id="detected-compression"><?php esc_html_e( 'HTML Compression', 'nitropack' ); ?> </span></h6>
225 <p>
226 <?php esc_html_e( 'Compressing the structure of your HTML, ensures faster page rendering and an optimized browsing experience for your users.', 'nitropack' ); ?>
227 <a href="https://support.nitropack.io/en/articles/8390333-nitropack-plugin-settings-in-wordpress#h_29b7ab4836"
228 class="text-blue" target="_blank"><?php esc_html_e( 'Learn more', 'nitropack' ); ?></a></p>
229 </div>
230 <label class="inline-flex items-center cursor-pointer ml-auto">
231 <input type="checkbox" id="compression-status" class="sr-only peer" <?php echo (int) $enableCompression === 1 ? "checked" : ""; ?>>
232 <div class="toggle"></div>
233 </label>
234 </div>
235 <div class="mt-4 text-primary">
236 <a href="javascript:void(0);" id="compression-test-btn"
237 class="text-primary"><?php esc_html_e( 'Run compression test', 'nitropack' ); ?></a>
238 <div class="flex items-start msg-container hidden">
239 <span class="msg"></span>
240 </div>
241 </div>
242 </div>
243 <?php if ( \NitroPack\Integration\Plugin\BeaverBuilder::isActive() ) { ?>
244 <div class="nitro-option" id="beaver-builder-widget">
245 <div class="nitro-option-main">
246 <div class="text-box">
247 <h6><span
248 id="detected-compression"><?php esc_html_e( 'Sync NitroPack Purge with Beaver Builder', 'nitropack' ); ?>
249 </span></h6>
250 <p>
251 <?php esc_html_e( 'When Beaver Builder cache is purged, NitroPack will perform a full cache purge keeping your site\'s content up-to-date.', 'nitropack' ); ?>
252 </p>
253 </div>
254 <label class="inline-flex items-center cursor-pointer ml-auto">
255 <input type="checkbox" class="sr-only peer" id="bb-purge-status" <?php if ( $bbCacheSyncPurge )
256 echo "checked"; ?>>
257 <div class="toggle"></div>
258 </label>
259 </div>
260 </div>
261 <?php } ?>
262 <div class="nitro-option" id="can-editor-clear-cache-widget">
263 <div class="nitro-option-main">
264 <div class="text-box">
265 <h6><?php esc_html_e( 'Allow Editors to purge cache', 'nitropack' ); ?> <span
266 class="badge badge-success ml-2">New</span></h6>
267 <p><?php esc_html_e( 'Give Editors the right to purge cache when content is updated.', 'nitropack' ); ?>
268 </p>
269 </div>
270 <label class="inline-flex items-center cursor-pointer ml-auto">
271 <input type="checkbox" id="can-editor-clear-cache" class="sr-only peer" <?php echo (int) $canEditorClearCache === 1 ? "checked" : ""; ?>>
272 <div class="toggle"></div>
273 </label>
274 </div>
275 </div>
276 </div>
277 </div>
278 </div>
279 </div>
280 <?php $notOptimizedCPTs = nitropack_filter_non_optimized();
281 $notices = get_option('nitropack-dismissed-notices', []);
282 $optimizedCPT_notice = in_array( 'OptimizeCPT', $notices, true ) ? true : false;
283 if (!$optimizedCPT_notice && !empty($notOptimizedCPTs)) require_once NITROPACK_PLUGIN_DIR . 'view/modals/modal-not-optimized-CPT.php'; ?>
284 </div>
285 <?php require_once NITROPACK_PLUGIN_DIR . 'view/modals/modal-unsaved-changes.php'; ?>
286 <script>
287 ($ => {
288 var getOptimizationsTimeout = null;
289 let isClearing = false;
290 var paid_plan = false;
291 $(window).on("load", function () {
292 getOptimizations();
293 getPlan();
294 <?php if ( $checkedCompression != 1 ) { ?>
295 autoDetectCompression();
296 <?php } ?>
297 });
298
299 /* Cache Purge begin */
300 window.performCachePurge = () => {
301 purgeCache();
302 }
303
304 let purgeCache = () => {
305 let purgeEvent = new Event("cache.purge.request");
306 window.dispatchEvent(purgeEvent);
307 }
308
309 var getOptimizations = _ => {
310 var url = '<?php echo $optimizationDetailsUrl; ?>';
311 ((s, e, f) => {
312 if (window.fetch) {
313 fetch(url)
314 .then(resp => resp.json())
315 .then(s)
316 .catch(e)
317 .finally(f);
318 } else {
319 $.ajax({
320 url: url,
321 type: 'GET',
322 dataType: 'json',
323 success: s,
324 error: e,
325 complete: f
326 })
327 }
328 })(data => {
329 $('[data-last-cache-purge]').text(data.last_cache_purge.timeAgo);
330 if (data.last_cache_purge.reason) {
331 $('[data-purge-reason]').text(data.last_cache_purge.reason);
332 $('[data-purge-reason]').attr('title', data.last_cache_purge.reason);
333 $('#last-cache-purge-reason').show();
334 } else {
335 $('#last-cache-purge-reason').hide();
336 }
337 if (data.pending_count) {
338 $("#pending-optimizations-count").text(data.pending_count);
339 $("#pending-optimizations-section").show();
340 } else {
341 $("#pending-optimizations-section").hide();
342 }
343
344 $('[data-optimized-pages-total]').text(data.optimized_pages.total);
345
346 }, __ => {
347 console.error("An error occurred while fetching data for optimized pages");
348 }, __ => {
349 if (!getOptimizationsTimeout) {
350 getOptimizationsTimeout = setTimeout(function () {
351 getOptimizationsTimeout = null;
352 getOptimizations();
353 }, 60000);
354 }
355 });
356 }
357
358 var getPlan = _ => {
359
360 var url = '<?php echo $planDetailsUrl; ?>';
361 ((s, e, f) => {
362 if (window.fetch) {
363 fetch(url)
364 .then(resp => resp.json())
365 .then(s)
366 .catch(e)
367 .finally(f);
368 } else {
369 $.ajax({
370 url: url,
371 type: 'GET',
372 dataType: 'json',
373 success: s,
374 error: e,
375 complete: f
376 })
377 }
378 })(data => {
379
380 $('.plan-name').text(data.plan_title);
381 $('[data-next-billing]').text(data.next_billing ? data.next_billing : 'N/A');
382 $('[data-next-reset]').text(data.next_reset ? data.next_reset : 'N/A');
383 $('[data-page-views]').text(data.page_views ? data.page_views : 'N/A');
384 $('[data-cdn-bandwidth]').text(data.cdn_bandwidth ? data.cdn_bandwidth + ' out of ' + data.max_cdn_bandwidth : 'N/A');
385
386 for (prop in data) {
387 if (prop.indexOf("show_") === 0) continue;
388 if (prop.indexOf("label_") === 0) continue;
389 if (prop.indexOf("max_") === 0) continue;
390 if (
391 typeof data["show_" + prop] != "undefined" &&
392 data["show_" + prop] &&
393 typeof data["label_" + prop] != "undefined" &&
394 typeof data["max_" + prop] != "undefined"
395 ) {
396 let propertyLabel = data["label_" + prop];
397 let propertyValue = data[prop];
398 let propertyLimit = data["max_" + prop];
399 $("#plan-quotas").append('<li class="list-group-item px-0 d-flex justify-content-between align-items-center">' + propertyLabel + ' <span><span data-optimizations>' + propertyValue + '</span> out of <span data-max-optimizations>' + propertyLimit + '</span></span></li>');
400 }
401 }
402
403 }, __ => {
404 NitropackUI.triggerToast('error', '<?php esc_html_e( 'Error while fetching plan data', 'nitropack' ); ?>');
405 }, __ => { });
406 }
407
408
409 $(document).on('click', "#compression-test-btn", e => {
410 e.preventDefault();
411 autoDetectCompression();
412 });
413 /* Compression end */
414
415 /* HTML Compression begin */
416 var autoDetectCompression = function () {
417 let msg_container = $('#compression-widget .msg-container'),
418 msg_icon = msg_container.find('.icon'),
419 msg_box = msg_container.find('.msg'),
420 compression_setting = $('#compression-status'),
421 compression_btn = $('#compression-test-btn');
422 //add spinner here
423 msg_box.html('<img src="<?php echo plugin_dir_url( __FILE__ ) . 'images/loading.svg'; ?>" alt="loading" class="icon"> <?php esc_html_e( 'Testing current compression status', 'nitropack' ); ?>');
424 compression_btn.addClass('hidden');
425 msg_container.removeClass('hidden');
426 $.post(ajaxurl, {
427 action: 'nitropack_test_compression_ajax',
428 nonce: nitroNonce
429 }, function (response) {
430 var resp = JSON.parse(response);
431
432 if (resp.status == "success") {
433 if (resp.hasCompression) { // compression already enabled
434 compression_setting.attr("checked", false);
435
436 msg_box.text('<?php esc_html_e( 'Compression is already enabled on your server! There is no need to enable it in NitroPack.', 'nitropack' ); ?>')
437 } else {
438 compression_setting.attr("checked", true);
439 msg_box.text('<?php esc_html_e( 'No compression was detected! We will now enable it in NitroPack.', 'nitropack' ); ?>');
440 }
441 NitropackUI.triggerToast(resp.type, resp.message);
442 } else {
443 msg_box.text('<?php esc_html_e( 'Could not determine compression status automatically. Please configure it manually.', 'nitropack' ); ?>');
444 }
445 setTimeout(function () {
446 msg_container.addClass('hidden');
447 compression_btn.removeClass('hidden');
448 }, 5000);
449 });
450 }
451
452
453 $("#compression-status").on("click", function (e) {
454 $.post(ajaxurl, {
455 action: 'nitropack_set_compression_ajax',
456 nonce: nitroNonce,
457 data: {
458 compressionStatus: $(this).is(":checked") ? 1 : 0
459 }
460 }, function (response) {
461 var resp = JSON.parse(response);
462 NitropackUI.triggerToast(resp.type, resp.message);
463 });
464 });
465 $("#can-editor-clear-cache").on("click", function (e) {
466 $.post(ajaxurl, {
467 action: 'nitropack_set_can_editor_clear_cache',
468 nonce: nitroNonce,
469 data: {
470 canEditorClearCache: $(this).is(":checked") ? 1 : 0
471 }
472 }, function (response) {
473 var resp = JSON.parse(response);
474 NitropackUI.triggerToast(resp.type, resp.message);
475 });
476 });
477
478 $("#auto-purge-status").on("click", function (e) {
479 $.post(ajaxurl, {
480 action: 'nitropack_set_auto_cache_purge_ajax',
481 nonce: nitroNonce,
482 autoCachePurgeStatus: $(this).is(":checked") ? 1 : 0
483 }, function (response) {
484 var resp = JSON.parse(response);
485 NitropackUI.triggerToast(resp.type, resp.message);
486 });
487 });
488
489 $("#bb-purge-status").on("click", function (e) {
490 $.post(ajaxurl, {
491 action: 'nitropack_set_bb_cache_purge_sync_ajax',
492 nonce: nitroNonce,
493 bbCachePurgeSyncStatus: $(this).is(":checked") ? 1 : 0
494 }, function (response) {
495 var resp = JSON.parse(response);
496 NitropackUI.triggerToast(resp.type, resp.message);
497 });
498 });
499
500
501 })(jQuery);
502 </script>