a8c5da78c8
Root cause of 30-45 second startup hang:
system-detect.sh was calling initialize_system_detection() at library load
This ran ALL system detections automatically BEFORE startup:
- detect_control_panel
- detect_os
- detect_web_server
- detect_database
- detect_php_versions
- detect_cloudflare
- detect_firewall
- get_system_resources
These expensive operations happened EVERY startup, even if not needed.
Solution: Lazy-load system detection
- Disabled auto-detection at library load time
- Added ensure_system_detection() wrapper function
- Only initialize when first needed (in get_wp_search_paths)
- Cache result to avoid re-detection
Performance improvement:
BEFORE: 30-45 seconds (all detections at startup)
AFTER: ~920ms (lazy detection on first use)
Result: 33-50x FASTER startup!
The script now starts instantly, only detecting system info if/when needed.