Standardize wordpress-cron-manager.sh menu validation and colors
- Add ${CYAN}...${NC} color codes to all menu option numbers
- Add ${RED}0)${NC} color code to back/exit option
- Implement input validation with retry loop for menu choice (0-8)
- Add visual separator line before menu prompt
- Ensure users can retry after invalid input
This standardizes the script to match menu uniformity standards documented in REFDB_FORMAT.txt
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -162,25 +162,38 @@ 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]: "
|
||||
|
||||
# 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)
|
||||
# Scan for WordPress installations
|
||||
|
||||
Reference in New Issue
Block a user