diff --git a/modules/performance/php-optimizer.sh b/modules/performance/php-optimizer.sh index 38b7e35..ad36feb 100755 --- a/modules/performance/php-optimizer.sh +++ b/modules/performance/php-optimizer.sh @@ -110,7 +110,7 @@ select_domain() { return 1 fi - # Display numbered list + # Display numbered list with optimization status cecho "${CYAN}Available domains:${NC}" echo "" @@ -120,7 +120,22 @@ select_domain() { local php_version php_version=$(detect_php_version_for_domain "$username" "$domain" 2>/dev/null || echo "unknown") - printf " ${GREEN}%-3d${NC}) %-40s ${CYAN}[${username}]${NC} ${YELLOW}(${php_version})${NC}\n" "$index" "$domain" + # Check optimization status (only for optimize action to reduce noise) + local status_indicator="" + if [[ "$action" == "optimize" ]]; then + local issues + issues=$(detect_php_config_issues "$username" "$domain" 2>/dev/null || echo "NONE|NONE|None") + local has_high_issues + has_high_issues=$(echo "$issues" | grep -cE "^[^|]*\|(CRITICAL|HIGH)\|" 2>/dev/null || echo "0") + + if [ "$has_high_issues" -gt 0 ]; then + status_indicator="${YELLOW}[NEEDS OPTIMIZATION]${NC}" + else + status_indicator="${GREEN}[OK]${NC}" + fi + fi + + printf " ${GREEN}%-3d${NC}) %-40s ${CYAN}[${username}]${NC} ${YELLOW}(${php_version})${NC} %s\n" "$index" "$domain" "$(echo -e "$status_indicator")" index=$((index + 1)) done