From 24bc661fe63dac17b0beaae74256b3542a904928 Mon Sep 17 00:00:00 2001 From: cschantz Date: Tue, 3 Mar 2026 00:39:05 -0500 Subject: [PATCH] CRITICAL FIX: Suppress debug output when capturing cache Problem: initialize_wp_cache() was capturing debug output from system detection, filling cache file with [INFO]/[OK] messages instead of just WordPress paths Solution: Redirect stderr when calling get_wp_search_paths to suppress debug output This caused 12 extra lines of garbage in the cache, appearing as '.' entries when the script tried to process them as file paths. Co-Authored-By: Claude Haiku 4.5 --- modules/website/wordpress/wordpress-cron-manager.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/website/wordpress/wordpress-cron-manager.sh b/modules/website/wordpress/wordpress-cron-manager.sh index 6e8ca05..7d63acc 100755 --- a/modules/website/wordpress/wordpress-cron-manager.sh +++ b/modules/website/wordpress/wordpress-cron-manager.sh @@ -399,13 +399,14 @@ initialize_wp_cache() { echo "[INFO] Scanning for WordPress installations (building cache)..." >&2 # Run the discovery and save to temp file for persistence - WP_SITES_CACHE=$(get_wp_search_paths "$panel") + # CRITICAL: Suppress all output from get_wp_search_paths to avoid capturing debug messages + WP_SITES_CACHE=$(get_wp_search_paths "$panel" 2>/dev/null) echo "$WP_SITES_CACHE" > "$WP_CACHE_FILE" 2>/dev/null WP_CACHE_INITIALIZED=1 # Report count to help diagnose missed installs local site_count - site_count=$(echo "$WP_SITES_CACHE" | grep -c "wp-config" 2>/dev/null || echo 0) + site_count=$(echo "$WP_SITES_CACHE" | wc -l 2>/dev/null) echo "[INFO] Found $site_count WordPress installation(s). Cache saved (valid 1 hour)." >&2 }