#!/bin/bash

# Direct fix for the broken class-zoho-admin.php file
# This script uploads the fixed file directly to the server

# Set variables
SERVER="wordpress-974670-5399585.cloudwaysapps.com"
LOCAL_FILE="fixed-zoho-admin.php"
REMOTE_PATH="/home/974670/public_html/wp-content/plugins/hvac-community-events/includes/admin/class-zoho-admin.php"
BACKUP_PATH="${REMOTE_PATH}.bak.$(date +%Y%m%d%H%M%S)"

# Upload the fixed file to the server
echo "Creating backup of existing file..."
ssh $SERVER "cp $REMOTE_PATH $BACKUP_PATH"

echo "Uploading fixed file to server..."
scp $LOCAL_FILE $SERVER:$REMOTE_PATH

echo "Fix applied successfully!"
echo "Backup created at: $BACKUP_PATH"