| @@ -11,8 +11,9 @@ | ||
| 11 | 11 | 'exclude_cookies' => [], |
| 12 | 12 | 'exclude_urls' => [], |
| 13 | 13 | 'cache_lifespan' => MONTH_IN_SECONDS, |
| 14 | 14 | 'page_compression' => false, |
| 15 | + 'permalink_trailing_slash' => null, | |
| 15 | 16 | ]; |
| 16 | 17 | |
| 17 | 18 | private static $cached_config = null; |
| 18 | 19 | private static $cached_blog_id = null; |
| @@ -39,9 +40,15 @@ | ||
| 39 | 40 | $config_dir = dirname($this->config_file); |
| 40 | 41 | |
| 41 | 42 | // Ensure the cache directory exists |
| 42 | 43 | if (!is_dir($config_dir)) { |
| 43 | - wp_mkdir_p($config_dir); | |
| 44 | + @mkdir($config_dir, 0755, true); | |
| 45 | + } | |
| 46 | + | |
| 47 | + // If dir still doesn't exist (e.g. permissions failure), use defaults and skip disk I/O | |
| 48 | + if (!is_dir($config_dir)) { | |
| 49 | + self::$cached_config = $this->defaults; | |
| 50 | + return; | |
| 44 | 51 | } |
| 45 | 52 | |
| 46 | 53 | if (!file_exists($this->config_file)) { |
| 47 | 54 | // Create config file with current defaults if it doesn't exist |