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/helper-functions.php +11 -1 4.1.19 → 4.1.20 View file →
@@ -1935,9 +1935,15 @@
1935 1935
1936 1936 if (!got_mod_rewrite()) {
1937 1937 return;
1938 1938 }
1939 +
1940 + $htaccess_path = $cache_dir . '.htaccess';
1939 1941
1942 + if (!is_writable($htaccess_path)) {
1943 + return;
1944 + }
1945 +
1940 1946 $rules = <<<HTACCESS
1941 1947 Order allow,deny
1942 1948 Deny from all
1943 1949
@@ -1956,9 +1962,9 @@
1956 1962 Deny from all
1957 1963 </FilesMatch>
1958 1964 HTACCESS;
1959 1965
1960 - file_put_contents($cache_dir . '.htaccess', $rules);
1966 + file_put_contents($htaccess_path, $rules);
1961 1967
1962 1968 // Suppress directory listing
1963 1969 $index_stub = $cache_dir . 'index.php';
1964 1970 if (!file_exists($index_stub)) {
@@ -1998,8 +2004,12 @@
1998 2004 }
1999 2005
2000 2006 $htaccess = get_home_path() . '.htaccess';
2001 2007 $cache_tag_host = parse_url(home_url(), PHP_URL_HOST);
2008 +
2009 + if (!is_writable($htaccess)) {
2010 + return;
2011 + }
2002 2012
2003 2013 // Match the cache-serving RewriteCond to the site's actual permalink convention,
2004 2014 // so caching works whether the site uses trailing slashes or not.
2005 2015 $permalink_structure = get_option('permalink_structure');