diff --git a/modules/website/wordpress/wordpress-cron-manager.sh b/modules/website/wordpress/wordpress-cron-manager.sh index 72ac6f9..3421195 100755 --- a/modules/website/wordpress/wordpress-cron-manager.sh +++ b/modules/website/wordpress/wordpress-cron-manager.sh @@ -162,24 +162,37 @@ echo "" echo -e "${BOLD}What would you like to do?${NC}" echo "" echo -e "${GREEN}Enable System Cron:${NC}" -echo " 1) Scan for WordPress installations" -echo " 2) Disable wp-cron for specific domain" -echo " 3) Disable wp-cron for specific user (all their WP sites)" -echo " 4) Disable wp-cron server-wide (all WordPress sites)" +echo -e " ${CYAN}1)${NC} Scan for WordPress installations" +echo -e " ${CYAN}2)${NC} Disable wp-cron for specific domain" +echo -e " ${CYAN}3)${NC} Disable wp-cron for specific user (all their WP sites)" +echo -e " ${CYAN}4)${NC} Disable wp-cron server-wide (all WordPress sites)" echo "" echo -e "${YELLOW}Revert to WP-Cron:${NC}" -echo " 6) Re-enable wp-cron for specific domain" -echo " 7) Re-enable wp-cron for specific user (all their WP sites)" -echo " 8) Re-enable wp-cron server-wide (all WordPress sites)" +echo -e " ${CYAN}6)${NC} Re-enable wp-cron for specific domain" +echo -e " ${CYAN}7)${NC} Re-enable wp-cron for specific user (all their WP sites)" +echo -e " ${CYAN}8)${NC} Re-enable wp-cron server-wide (all WordPress sites)" echo "" echo -e "${CYAN}Status & Information:${NC}" -echo " 5) Check wp-cron status for domain/user" +echo -e " ${CYAN}5)${NC} Check wp-cron status for domain/user" echo "" -echo " 0) Return to menu" +echo -e " ${RED}0)${NC} Return to menu" echo "" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo -n "Select option [0]: " -read -r choice -choice="${choice:-0}" + +# Validate choice input +while true; do + read -r choice + choice="${choice:-0}" + + if ! [[ "$choice" =~ ^[0-8]$ ]]; then + echo "" + print_error "Invalid choice. Please enter 0-8" + echo "" + continue + fi + break +done case "$choice" in 1)