PluginProbe
BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript / 4.1.20
BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript v4.1.20
4.1.20 4.1.19 4.1.18 4.1.17 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 All 174 releases
← All changes | inc/cache/class-berqcache.php +20 -1 4.1.13 → 4.1.20 View file →
@@ -91,10 +91,16 @@
91 91
92 92 // Apache htaccess cache rules (skip on LiteSpeed — remove any existing rules)
93 93 add_action('berqwp_activate_plugin', 'bwp_write_htaccess_rules');
94 94 add_action('berqwp_flush_all_cache', 'bwp_write_htaccess_rules');
95 + add_action('berqwp_flush_all_cache', 'bwp_delete_php_files_in_cache');
95 96 add_action('berqwp_deactivate_plugin', 'bwp_remove_htaccess_rules');
96 97
98 + // Keep the dropin's cached permalink convention in sync with WordPress
99 + add_action('init', 'bwp_sync_permalink_config');
100 + add_action('update_option_permalink_structure', 'bwp_sync_permalink_config');
101 + add_action('berqwp_activate_plugin', 'bwp_sync_permalink_config');
102 +
97 103 if (bwp_is_openlitespeed_server()) {
98 104 add_action('berqwp_activate_plugin', 'bwp_remove_htaccess_rules');
99 105 }
100 106
@@ -181,8 +187,11 @@
181 187 $berq_log->info("Processing updates");
182 188
183 189 self::stale_cloud_assets();
184 190 $this->purge_critical_css_cache();
191 +
192 + // trigger cache warmup
193 + do_action('berqwp_cache_warmup');
185 194
186 195 }
187 196
188 197 static function stale_cloud_assets() {
@@ -934,8 +943,18 @@
934 943 self::miss_cache_headers();
935 944 return;
936 945 }
937 946
947 +
948 + // Redirect non-canonical URLs (wrong trailing slash) the same way WordPress would,
949 + // before ever touching the cache — works for both trailing-slash and non-trailing-slash
950 + // permalink structures.
951 + $canonical_url = bwp_canonicalize_page_url($page_url);
952 + if ($canonical_url !== $page_url) {
953 + wp_safe_redirect($canonical_url, 301);
954 + exit();
955 + }
956 +
938 957 if (is_singular()) {
939 958 $post_type = get_post_type();
940 959
941 960 if (empty($post_type) || !in_array($post_type, get_option('berqwp_optimize_post_types'))) {
@@ -1001,9 +1020,9 @@
1001 1020 // Prevent PHP/Apache from re-compressing the already-gzipped cache file
1002 1021 if (ini_get('zlib.output_compression')) {
1003 1022 ini_set('zlib.output_compression', 'Off');
1004 1023 }
1005 -
1024 +
1006 1025 while (ob_get_level()) {
1007 1026 ob_end_clean();
1008 1027 }
1009 1028