upskill-event-manager/scripts/remove-debug-logs.sh
bengizmo a58ea1603c fix: Resolve duplicate initialization and jQuery selector errors
- Implement singleton pattern for HVAC_Enhanced_Settings to prevent duplicate initialization
- Fix jQuery selector error by checking for valid hash selectors before using $(href)
- Add default email templates with professional copy for trainer notifications
- Update plugin version to 1.0.1 for cache busting
- Remove duplicate Enhanced Settings initialization from HVAC_Community_Events
- Add force cache refresh suffix to admin scripts

This resolves the duplicate content issue on email templates page and fixes
JavaScript errors in the admin interface.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-28 17:58:39 -03:00

45 lines
No EOL
1.3 KiB
Bash
Executable file

#!/bin/bash
# Script to remove or comment out debug error_log statements for production
echo "=== Removing Debug Logs for Production ==="
echo "Date: $(date)"
echo
# Files to process
FILES=(
"includes/class-hvac-registration.php"
"includes/class-hvac-community-events.php"
"includes/admin/class-zoho-admin.php"
)
# Backup directory
BACKUP_DIR="debug-log-backups"
mkdir -p "$BACKUP_DIR"
for file in "${FILES[@]}"; do
if [ -f "$file" ]; then
echo "Processing: $file"
# Create backup
cp "$file" "$BACKUP_DIR/$(basename $file).backup"
# Comment out error_log lines with HVAC DEBUG or similar patterns
sed -i '' 's/^[[:space:]]*error_log.*\[HVAC/\/\/ &/' "$file"
sed -i '' 's/^[[:space:]]*error_log.*Adding hvac_oauth/\/\/ &/' "$file"
sed -i '' 's/^[[:space:]]*error_log.*Current vars count:/\/\/ &/' "$file"
# Count changes
CHANGED=$(diff "$BACKUP_DIR/$(basename $file).backup" "$file" | grep "^>" | wc -l)
echo " - Commented out $CHANGED debug log lines"
else
echo "Warning: $file not found"
fi
done
echo
echo "✅ Debug logs removed/commented out"
echo "Backups saved in: $BACKUP_DIR/"
echo
echo "To restore:"
echo " cp $BACKUP_DIR/*.backup includes/"