From cde9dec39688248da8aa4e99919ddd66a7f7a63f Mon Sep 17 00:00:00 2001 From: Hiroshi Shimoju Date: Tue, 3 Feb 2015 13:54:47 +0900 Subject: [PATCH] Check that WP_CONTENT_DIR and advanced-cache.php are writable --- wp-ffpc-class.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wp-ffpc-class.php b/wp-ffpc-class.php index d1c0bb2..ff5e33c 100644 --- a/wp-ffpc-class.php +++ b/wp-ffpc-class.php @@ -975,6 +975,14 @@ class WP_FFPC extends PluginAbstract { */ private function deploy_advanced_cache( ) { + /* check that WP_CONTENT_DIR is writable */ + if ( ! @is_writable( WP_CONTENT_DIR )) + return false; + + /* check that advanced-cache.php is writable if advanced-cache.php exists */ + if ( @file_exists( $this->acache ) && ! @is_writable( $this->acache )) + return false; + /* if no active site left no need for advanced cache :( */ if ( empty ( $this->global_config ) ) { unlink ( $this->acache );