PluginProbe
BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript / trunk
BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript vtrunk
4.1.16 4.1.15 4.1.14 4.1.13 4.1.12 4.1.11 4.1.10 4.0.30 4.0.29 4.0.28 4.0.27 4.0.26 4.0.24 4.0.25 4.0.23 4.0.22 4.0.21 4.0.19 4.0.18 4.0.17 4.0.16 1.9.3 1.9.4 1.9.5 1.9.6 All 170 releases
← All changes | admin/admin-page.php +96 -8 4.0.17trunk View file →
@@ -29,8 +29,18 @@
29 29 }
30 30
31 31 ?>" alt="BerqWP Logo">
32 32 <div class="berqwp-header-right">
33 + <?php if (empty(berqwp_get_license_key()) || $this->key_response->product_ref == 'Free Account') { ?>
34 + <a class="bwp-action-btn light bwp-upgrade-btn" href="https://berqwp.com/dashboard/?referrer=plugin-installation" target="_blank">
35 + <div class="icon">
36 + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rocket-icon lucide-rocket"><path d="M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"/><path d="M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09"/><path d="M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z"/><path d="M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05"/></svg>
37 + </div>
38 + <?php esc_html_e('Upgrade to Premium', 'searchpro'); ?>
39 + </a>
40 + <?php } ?>
41 +
42 + <?php if ($this->is_key_verified) { ?>
33 43 <div class="optimization-methods-switch <?php echo esc_attr($configs['optimization_method'])?>" title="Optimization method">
34 44 <a class="method-local" href="<?php echo esc_attr(wp_nonce_url(admin_url('admin-post.php?action=switch_optimization_method_local'), 'switch_optimization_method_local_action')); ?>">
35 45 <div class="icon">
36 46 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-server-icon lucide-server">
@@ -39,9 +49,9 @@
39 49 <line x1="6" x2="6.01" y1="6" y2="6" />
40 50 <line x1="6" x2="6.01" y1="18" y2="18" />
41 51 </svg>
42 52 </div>
43 - Local (free)
53 + Self-hosted
44 54
45 55 </a>
46 56
47 57 <a class="method-cloud" href="<?php echo esc_attr(wp_nonce_url(admin_url('admin-post.php?action=switch_optimization_method_cloud'), 'switch_optimization_method_cloud_action')); ?>">
@@ -54,14 +64,23 @@
54 64 BerqWP Cloud
55 65 </a>
56 66 </div>
57 67
68 + <?php } ?>
69 +
58 70 <a class="bwp-action-btn light" href="<?php echo esc_attr(wp_nonce_url(admin_url('admin-post.php?action=clear_cache'), 'clear_cache_action')); ?>">
71 + <div class="icon">
72 + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-brush-cleaning-icon lucide-brush-cleaning"><path d="m16 22-1-4"/><path d="M19 14a1 1 0 0 0 1-1v-1a2 2 0 0 0-2-2h-3a1 1 0 0 1-1-1V4a2 2 0 0 0-4 0v5a1 1 0 0 1-1 1H6a2 2 0 0 0-2 2v1a1 1 0 0 0 1 1"/><path d="M19 14H5l-1.973 6.767A1 1 0 0 0 4 22h16a1 1 0 0 0 .973-1.233z"/><path d="m8 22 1-4"/></svg>
73 + </div>
59 74 Flush cache
60 75 </a>
61 76
62 77 <?php if ($berqwp_can_use_cloud) { ?>
63 78 <a class="bwp-action-btn" href="<?php echo esc_attr(wp_nonce_url(admin_url('admin-post.php?action=warmup_cache'), 'warmup_cache_action')); ?>">
79 +
80 + <div class="icon">
81 + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-refresh-ccw-icon lucide-refresh-ccw"><path d="M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/><path d="M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16"/><path d="M16 16h5v5"/></svg>
82 + </div>
64 83 Warmup cache
65 84 </a>
66 85 <?php } ?>
67 86
@@ -112,17 +131,30 @@
112 131 <div class="berqwp-tab <?php bwp_is_tab_nav('script-manager'); ?>" data-tab="script-manager">
113 132 <div class="icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file-code-corner-icon lucide-file-code-corner"><path d="M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/><path d="m5 16-3 3 3 3"/><path d="m9 22 3-3-3-3"/></svg></div>
114 133 <?php esc_html_e('Script Manager', 'searchpro'); ?>
115 134 </div>-->
135 + <div class="berqwp-tab <?php bwp_is_tab_nav('database'); ?>" data-tab="database">
136 + <div class="icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-database-icon lucide-database"><ellipse cx="12" cy="5" rx="9" ry="3"/><path d="M3 5V19A9 3 0 0 0 21 19V5"/><path d="M3 12A9 3 0 0 0 21 12"/></svg></div>
137 + <?php esc_html_e('Database', 'searchpro'); ?>
138 + </div>
139 + <div class="berqwp-tab <?php bwp_is_tab_nav('debloat'); ?>" data-tab="debloat">
140 + <div class="icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-trash2-icon lucide-trash-2"><path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/><line x1="10" x2="10" y1="11" y2="17"/><line x1="14" x2="14" y1="11" y2="17"/></svg></div>
141 + <?php esc_html_e('Debloat', 'searchpro'); ?>
142 + </div>
116 143 <div class="berqwp-tab <?php bwp_is_tab_nav('integration'); ?>" data-tab="integration">
117 144 <div class="icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-blocks-icon lucide-blocks"><path d="M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2"/><rect x="14" y="2" width="8" height="8" rx="1"/></svg></div>
118 145 <?php esc_html_e('Integration', 'searchpro'); ?>
119 146 </div>
120 - <?php if ($berqwp_can_use_cloud) { ?>
121 147 <div class="berqwp-tab <?php bwp_is_tab_nav('activate-license'); ?>" data-tab="activate-license">
122 148 <div class="icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings2-icon lucide-settings-2"><path d="M14 17H5"/><path d="M19 7h-9"/><circle cx="17" cy="17" r="3"/><circle cx="7" cy="7" r="3"/></svg></div>
123 149 <?php esc_html_e('License', 'searchpro'); ?>
124 150 </div>
151 +
152 + <?php if (!defined('BERQWP_HIDE_DOCS') || !BERQWP_HIDE_DOCS) { ?>
153 + <a class="berqwp-tab tab-link" target="_blank" href="https://www.facebook.com/groups/1660827728253423">
154 + <div class="icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" width="24"><!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path d="M576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320C64 440 146.7 540.8 258.2 568.5L258.2 398.2L205.4 398.2L205.4 320L258.2 320L258.2 286.3C258.2 199.2 297.6 158.8 383.2 158.8C399.4 158.8 427.4 162 438.9 165.2L438.9 236C432.9 235.4 422.4 235 409.3 235C367.3 235 351.1 250.9 351.1 292.2L351.1 320L434.7 320L420.3 398.2L351 398.2L351 574.1C477.8 558.8 576 450.9 576 320z"/></svg></svg></div>
155 + <?php esc_html_e('Join BerqWP Community', 'searchpro'); ?>
156 + </a>
125 157 <?php } ?>
126 158 </div>
127 159 <div class="berqwp-tab-content">
128 160 <?php do_action('berqwp_notices'); ?>
@@ -129,9 +161,9 @@
129 161 <form action="" method="post">
130 162 <?php
131 163 wp_nonce_field('berqwp_save_settings', 'berqwp_save_nonce');
132 164 ?>
133 - <input type="hidden" name="bwp_current_tab_id" value="<?php echo !empty($_GET['tab_id']) ? sanitize_text_field($_GET['tab_id']) : 'dashboard'; ?>">
165 + <input type="hidden" name="bwp_current_tab_id" value="<?php echo !empty($_GET['tab_id']) ? esc_attr(sanitize_text_field(wp_unslash($_GET['tab_id']))) : 'dashboard'; ?>">
134 166 <?php
135 167 require_once optifer_PATH . '/admin/tabs/dashboard.php';
136 168 require_once optifer_PATH . '/admin/tabs/cache-management.php';
137 169 require_once optifer_PATH . '/admin/tabs/content-delivery-network.php';
@@ -139,13 +171,12 @@
139 171 // require_once optifer_PATH . '/admin/tabs/image-optimization.php';
140 172 require_once optifer_PATH . '/admin/tabs/media-optimization.php';
141 173 // require_once optifer_PATH . '/admin/tabs/script-manager.php';
142 174 require_once optifer_PATH . '/admin/tabs/integration.php';
175 + require_once optifer_PATH . '/admin/tabs/database.php';
176 + require_once optifer_PATH . '/admin/tabs/debloat.php';
177 + require_once optifer_PATH . '/admin/tabs/activate-license.php';
143 178
144 - if ($berqwp_can_use_cloud) {
145 - require_once optifer_PATH . '/admin/tabs/activate-license.php';
146 - }
147 -
148 179 ?>
149 180 </form>
150 181 </div>
151 182 </div>
@@ -160,8 +191,9 @@
160 191 $(document).ready(function() {
161 192 const bwp_controllers = [];
162 193 // $('.bwp_feedback').hide();
163 194 let berq_nounce = '<?php echo esc_html(wp_create_nonce('wp_rest')); ?>';
195 + let bwp_pages_nonce = '<?php echo esc_html(wp_create_nonce('berqwp_get_optimized_pages_nonce')); ?>';
164 196
165 197 window.addEventListener('beforeunload', () => {
166 198 bwp_controllers.forEach(c => c.abort());
167 199 });
@@ -288,9 +320,9 @@
288 320 }
289 321
290 322 // init_opt_slider();
291 323
292 - $('.berqwp-tab').click(function() {
324 + $('.berqwp-tab[data-tab]').click(function() {
293 325 let tab = $(this).attr('data-tab');
294 326 $("html, body").animate({
295 327 scrollTop: $(".berqwp-dashbaord").offset().top - 30
296 328 }, 200);
@@ -296,8 +328,9 @@
296 328 }, 200);
297 329
298 330 $('.berqwp-tab-content > form > div').css({
299 331 'visibility': 'hidden',
332 + 'display': 'none',
300 333 'opacity': 0,
301 334 'height': '0px',
302 335 'overflow': 'hidden'
303 336 });
@@ -305,8 +338,9 @@
305 338 $(this).addClass('active');
306 339 // $(`.berqwp-tab-content #${tab}`).show();
307 340 $(`.berqwp-tab-content #${tab}`).css({
308 341 'visibility': 'visible',
342 + 'display': 'block',
309 343 'opacity': 1,
310 344 'height': 'auto'
311 345 });
312 346
@@ -390,8 +424,9 @@
390 424 url: ajaxurl, // WordPress AJAX URL
391 425 type: 'POST',
392 426 data: {
393 427 action: 'berqwp_get_optimized_pages',
428 + nonce: bwp_pages_nonce,
394 429 start: start,
395 430 length: length,
396 431 search: data.search.value
397 432 },
@@ -435,8 +470,16 @@
435 470 $('[name="berqwp_preload_yt_poster"]').parent().hide();
436 471 }
437 472 });
438 473
474 + $('[name="berqwp_heartbeat_mode"]').on('change', function() {
475 + if ($('[name="berqwp_heartbeat_mode"]:checked').val() === 'throttle') {
476 + $('.berqwp-heartbeat-interval').show();
477 + } else {
478 + $('.berqwp-heartbeat-interval').hide();
479 + }
480 + });
481 +
439 482 // $(document).ready(function () {
440 483 // const stickyDiv = $('.berqwp-dashbaord');
441 484 // const offset = stickyDiv.offset().top;
442 485
@@ -522,8 +565,53 @@
522 565 },
523 566 error: function() {
524 567 loader.hide();
525 568 alert("Page compression test failed: Please check your internet connection.");
569 + }
570 + });
571 + })
572 + })
573 + })(jQuery)
574 +</script>
575 +<script>
576 + (function($) {
577 + $(document).ready(function() {
578 + let berq_nounce = '<?php echo esc_html(wp_create_nonce('wp_rest')); ?>';
579 +
580 + $('.berqwp-db-run-action').click(function(e) {
581 + e.preventDefault();
582 +
583 + let $btn = $(this);
584 + let $action = $btn.closest('.berqwp-db-action');
585 + let task = $action.data('task');
586 + let limit = $action.find('input[name="berqwp_db_revision_limit"]').val();
587 +
588 + $btn.addClass('disabled').text('Running...');
589 +
590 + $.ajax({
591 + url: ajaxurl,
592 + type: 'POST',
593 + data: {
594 + action: 'berqwp_db_run_action',
595 + task: task,
596 + limit: limit,
597 + nonce: berq_nounce,
598 + },
599 + beforeSend: function(xhr) {
600 + xhr.setRequestHeader('X-WP-Nonce', berq_nounce);
601 + },
602 + success: function(data) {
603 + if (data.success) {
604 + alert(data.data.message);
605 + } else {
606 + alert(data.data && data.data.message ? data.data.message : 'Something went wrong.');
607 + }
608 + },
609 + error: function() {
610 + alert('Request failed. Please check your internet connection.');
611 + },
612 + complete: function() {
613 + $btn.removeClass('disabled').text($btn.data('task') === 'optimize_tables' ? 'Optimize now' : 'Clean now');
526 614 }
527 615 });
528 616 })
529 617 })