From 9f6717af36f7b7986afe2573e1fc2283f225ab3b Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Feb 2026 23:36:41 +0000 Subject: [PATCH] Fix cache directory created with wrong permissions (0644 instead of 0755) mkdir() was called with 0644 (a file permission), which lacks the execute bit required for directories. This made the cache directory non-traversable immediately after creation, causing is_writable() to fail and producing the misleading "permission denied" error. Replaced with wp_mkdir_p() which creates directories recursively with correct permissions (0755). Also improved error message to distinguish between directory creation failure and actual permission issues. https://claude.ai/code/session_01KsZF2sudPbLYyzoWNSjBAG --- class/class-wp-scss.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/class/class-wp-scss.php b/class/class-wp-scss.php index dab7488..35b6af8 100644 --- a/class/class-wp-scss.php +++ b/class/class-wp-scss.php @@ -151,7 +151,7 @@ public function compile() { private function compiler($in, $out) { if (!file_exists($this->cache)) { - mkdir($this->cache, 0644); + wp_mkdir_p($this->cache); } if (is_writable($this->cache)) { try { @@ -176,9 +176,12 @@ private function compiler($in, $out) { array_push($this->compile_errors, $errors); } } else { + $message = !file_exists($this->cache) + ? "File Permission Error, unable to create the cache directory. Please manually create: " . $this->cache + : "File Permission Error, permission denied. Please make the cache directory writable."; $errors = array ( 'file' => $this->cache, - 'message' => "File Permission Error, permission denied. Please make the cache directory writable." + 'message' => $message ); array_push($this->compile_errors, $errors); }