PluginProbe
BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript / 1.9.3
BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript v1.9.3
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
searchpro / admin / tabs / cache-management.php

cache-management.php in BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript 1.9.3, at admin/tabs/cache-management.php

84 lines 3.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if (!defined('ABSPATH')) exit;
3
4 // Page exclusions
5 $exclude_urls = get_option('berq_exclude_urls', []);
6 $url_lines = implode("\n", $exclude_urls);
7
8 // Ignore URL params
9 $ignore_params = get_option('berq_ignore_urls_params', []);
10 $param_lines = implode("\n", $ignore_params);
11
12 $post_type_names = get_post_types(array(
13 'public' => true,
14 'exclude_from_search' => false,
15 ), 'names');
16 unset($post_type_names['attachment']);
17
18 $taxonomy_names = get_taxonomies(array(
19 'public' => true,
20 'show_in_rest' => true
21 ), 'names');
22
23
24
25 ?>
26 <div id="cache-management" style="display:none">
27 <h2 class="berq-tab-title"><?php esc_html_e('Cache Management', 'searchpro'); ?></h2>
28 <div class="berq-info-box">
29 <h3 class="berq-box-title"><?php esc_html_e('Page exclusions', 'searchpro'); ?></h3>
30 <div class="berq-box-content">
31 <p><?php esc_html_e('Exclude pages from being cached. Enter page URLs, one URL per line.', 'searchpro'); ?> <a href="https://berqwp.com/help-center/exclude-pages-from-being-cached/" target="_blank"><?php esc_html_e('Learn more', 'searchpro'); ?></a></p>
32 <textarea name="berq_exclude_urls" cols="30" rows="10"><?php echo esc_textarea($url_lines); ?></textarea>
33 </div>
34 </div>
35 <div class="berq-info-box">
36 <h3 class="berq-box-title"><?php esc_html_e('Content types', 'searchpro'); ?></h3>
37 <div class="berq-box-content">
38 <p><?php esc_html_e('Choose which post types and archive pages should be cached.', 'searchpro'); ?></p>
39 <div class="optimize-post-types">
40 <?php
41 foreach($post_type_names as $key => $value) {
42 ?>
43 <div>
44 <input type="checkbox" name="berqwp_optimize_post_types[]" value="<?php echo esc_attr($key); ?>" <?php checked(1, in_array($value, get_option('berqwp_optimize_post_types')), true); ?> >
45
46 <?php
47 $post_counts = wp_count_posts($value);
48 $published_count = isset($post_counts->publish) ? $post_counts->publish : 0;
49 echo esc_html(ucfirst($key) . " ($published_count)");
50
51 ?>
52 </div>
53 <?php
54 }
55 foreach($taxonomy_names as $key => $value) {
56 ?>
57 <div>
58 <input type="checkbox" name="berqwp_optimize_taxonomies[]" value="<?php echo esc_attr($key); ?>" <?php checked(1, in_array($value, get_option('berqwp_optimize_taxonomies')), true); ?> >
59
60 <?php
61 echo esc_html(ucfirst($key));
62 ?>
63 </div>
64 <?php
65 }
66 ?>
67
68 </div>
69 </div>
70 </div>
71 <div class="berq-info-box">
72 <h3 class="berq-box-title"><?php esc_html_e('Ignore URL parameters', 'searchpro'); ?></h3>
73 <div class="berq-box-content">
74 <p><?php esc_html_e("Ignore page URL parameters, these parameters will be disregarded and won't be cached separately. Enter one parameter per line."); ?> <a href="https://berqwp.com/help-center/ignore-url-parameters/" target="_blank"><?php esc_html_e('Learn more', 'searchpro'); ?></a></p>
75 <textarea name="berq_ignore_urls_params" cols="30" rows="10"><?php echo esc_textarea($param_lines); ?></textarea>
76 </div>
77 </div>
78 <button type="submit" class="berqwp-save"><svg width="20" height="20" viewBox="0 0 20 20" fill="none"
79 xmlns="http://www.w3.org/2000/svg">
80 <path d="M4.16663 10.8333L7.49996 14.1667L15.8333 5.83334" stroke="white" stroke-width="2"
81 stroke-linecap="round" stroke-linejoin="round" />
82 </svg>
83 <?php esc_html_e("Save changes", "searchpro"); ?></button>
84 </div>