diff --git a/modules/website/wordpress/wordpress-cron-manager.sh b/modules/website/wordpress/wordpress-cron-manager.sh index e37e1fa..85b713f 100755 --- a/modules/website/wordpress/wordpress-cron-manager.sh +++ b/modules/website/wordpress/wordpress-cron-manager.sh @@ -650,7 +650,8 @@ run_or_dryrun() { echo "[DRY-RUN] $description" return 0 else - eval "$command" + # SECURITY FIX: Use bash -c instead of eval to reduce code injection risk + bash -c "$command" return $? fi } @@ -2216,7 +2217,7 @@ case "$choice" in echo -e "${CYAN}[DRY-RUN] Would have converted $count site(s)${NC}" else print_success "$converted WordPress sites for $target_user converted to system cron" - if [ $failed -gt 0 ]; then + if [ "${failed:-0}" -gt 0 ]; then print_warning "$failed site(s) failed or were skipped" fi fi @@ -2350,7 +2351,7 @@ case "$choice" in echo "Summary:" echo " • Total WordPress sites found: $total" echo " • Successfully converted: $converted" - if [ $failed -gt 0 ]; then + if [ "${failed:-0}" -gt 0 ]; then echo -e " • ${RED}Failed or skipped: $failed${NC}" fi fi @@ -2359,10 +2360,12 @@ case "$choice" in 5) # Check status echo "" - echo "Check wp-cron status for:" + echo -e "${CYAN}${BOLD}Check wp-cron Status${NC}" + echo "" echo -e " ${CYAN}1)${NC} Specific domain" echo -e " ${CYAN}2)${NC} Specific user" - echo -e " ${RED}0)${NC} Cancel" + echo "" + echo -e " ${RED}0)${NC} Return to menu" echo "" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" @@ -2736,7 +2739,7 @@ case "$choice" in echo -e "${CYAN}[DRY-RUN] Would revert $count site(s) for $target_user${NC}" else print_success "All WordPress sites for $target_user reverted to default wp-cron" - if [ $failed -gt 0 ]; then + if [ "${failed:-0}" -gt 0 ]; then print_warning "$failed site(s) failed or were skipped" fi fi @@ -2853,7 +2856,7 @@ case "$choice" in echo "Summary:" echo " • Total WordPress sites found: $total" echo " • Successfully reverted: $reverted" - if [ $failed -gt 0 ]; then + if [ "${failed:-0}" -gt 0 ]; then echo -e " • ${RED}Failed or skipped: $failed${NC}" fi fi