Commit 6ccce0c1 authored by Rolf Forst's avatar Rolf Forst
Browse files

Merge branch 'dev' into 'master'

Dev

See merge request !20
parents 4f3f6e51 f69e4f81
...@@ -31,11 +31,6 @@ class Cache ...@@ -31,11 +31,6 @@ class Cache
{ {
$this->setCacheFiles(); $this->setCacheFiles();
if (apply_filters('rrzecache_skip_cache', false)) {
Flush::flushCache();
return;
}
add_action('init', [$this, 'add_publish_hooks'], 99); add_action('init', [$this, 'add_publish_hooks'], 99);
add_action('pre_comment_approved', [$this, 'pre_comment_approved'], 99, 2); add_action('pre_comment_approved', [$this, 'pre_comment_approved'], 99, 2);
add_action('transition_comment_status', [$this, 'transition_comment_status'], 10, 3); add_action('transition_comment_status', [$this, 'transition_comment_status'], 10, 3);
...@@ -276,6 +271,10 @@ class Cache ...@@ -276,6 +271,10 @@ class Cache
return true; return true;
} }
if (apply_filters('rrzecache_skip_cache', false)) {
return true;
}
if (is_search() || is_404() || is_feed() || is_trackback() || is_robots() || is_preview() || post_password_required()) { if (is_search() || is_404() || is_feed() || is_trackback() || is_robots() || is_preview() || post_password_required()) {
return true; return true;
} }
......
...@@ -197,7 +197,7 @@ final class File ...@@ -197,7 +197,7 @@ final class File
protected static function createFiles(string $data): bool protected static function createFiles(string $data): bool
{ {
$filePath = self::filePath(); $filePath = self::filePath();
if (!wp_mkdir_p($filePath)) { if (!$filePath || !wp_mkdir_p($filePath)) {
do_action('rrze.log.error', __('{plugin}: The directory could not be created.', 'rrze-cache'), ['plugin' => 'rrze-cache', 'method' => __METHOD__, '$filePath' => $filePath]); do_action('rrze.log.error', __('{plugin}: The directory could not be created.', 'rrze-cache'), ['plugin' => 'rrze-cache', 'method' => __METHOD__, '$filePath' => $filePath]);
return false; return false;
} }
...@@ -252,7 +252,6 @@ final class File ...@@ -252,7 +252,6 @@ final class File
parse_url('http://' . strtolower($_SERVER['HTTP_HOST']), PHP_URL_HOST); parse_url('http://' . strtolower($_SERVER['HTTP_HOST']), PHP_URL_HOST);
if (validate_file($path) > 0) { if (validate_file($path) > 0) {
do_action('rrze.log.error', __('{plugin}: Invalid file path.'), ['plugin' => 'rrze-cache', 'method' => __METHOD__, '$path' => $path]);
return false; return false;
} }
...@@ -272,7 +271,6 @@ final class File ...@@ -272,7 +271,6 @@ final class File
parse_url(($path ? $path : $_SERVER['REQUEST_URI']), PHP_URL_PATH); parse_url(($path ? $path : $_SERVER['REQUEST_URI']), PHP_URL_PATH);
if (validate_file($path) > 0) { if (validate_file($path) > 0) {
do_action('rrze.log.error', __('{plugin}: Invalid file path.', 'rrze-cache'), ['plugin' => 'rrze-cache', 'method' => __METHOD__, '$path' => $path]);
return false; return false;
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
Plugin Name: RRZE Cache Plugin Name: RRZE Cache
Plugin URI: https://gitlab.rrze.fau.de/rrze-webteam/rrze-cache Plugin URI: https://gitlab.rrze.fau.de/rrze-webteam/rrze-cache
Description: Advanced cache management. Description: Advanced cache management.
Version: 2.7.2 Version: 2.7.3
Author: RRZE-Webteam Author: RRZE-Webteam
Author URI: https://blogs.fau.de/webworking/ Author URI: https://blogs.fau.de/webworking/
License: GNU General Public License v2 License: GNU General Public License v2
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment