From f0fee8d0f8e8598e7768d94e3b80dc5893a137ab Mon Sep 17 00:00:00 2001 From: cschantz Date: Tue, 3 Mar 2026 00:39:54 -0500 Subject: [PATCH] CRITICAL FIX: Filter debug output from cache file Problem: System detection messages (from print_info) were being captured in cache file along with actual WordPress paths, creating garbage entries Solution: Filter output to extract only lines matching /path/to/wp-config.php pattern before saving to cache file This ensures cache contains ONLY actual WordPress installation paths. Co-Authored-By: Claude Haiku 4.5 --- modules/website/wordpress/wordpress-cron-manager.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/website/wordpress/wordpress-cron-manager.sh b/modules/website/wordpress/wordpress-cron-manager.sh index 7d63acc..e37e1fa 100755 --- a/modules/website/wordpress/wordpress-cron-manager.sh +++ b/modules/website/wordpress/wordpress-cron-manager.sh @@ -399,8 +399,13 @@ initialize_wp_cache() { echo "[INFO] Scanning for WordPress installations (building cache)..." >&2 # Run the discovery and save to temp file for persistence - # 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) + # CRITICAL: Suppress stdout noise from system detection by redirecting to temp, then extracting only paths + local temp_discovery=$(mktemp) + get_wp_search_paths "$panel" > "$temp_discovery" 2>/dev/null + # Extract only lines that are actual file paths (contain /home or /var, start with /) + WP_SITES_CACHE=$(grep -E "^/.*wp-config\.php$" "$temp_discovery" 2>/dev/null || echo "") + rm -f "$temp_discovery" + echo "$WP_SITES_CACHE" > "$WP_CACHE_FILE" 2>/dev/null WP_CACHE_INITIALIZED=1