# FTP Upload Methods for Mac Cursor

You have three options to upload your WordPress plugin files via FTP on Mac:

## Option 1: Bash Script (Mac/Linux Native)

**File:** `upload-ftp.sh`

**Usage:**
```bash
# Make it executable
chmod +x upload-ftp.sh

# Run it
./upload-ftp.sh
```

**Requirements:**
- `curl` (pre-installed on Mac)
- Bash shell

**Pros:**
- Native Mac/Linux tool
- Simple and fast
- No additional dependencies

## Option 2: Python Script (Cross-platform)

**File:** `upload-ftp-python.py`

**Usage:**
```bash
# Make it executable
chmod +x upload-ftp-python.py

# Run it
python3 upload-ftp-python.py
```

**Requirements:**
- Python 3 (pre-installed on Mac)
- No additional packages needed (uses built-in `ftplib`)

**Pros:**
- Works on Mac, Linux, and Windows
- More control and error handling
- Easy to modify

## Option 3: Using Terminal Commands Directly

You can also use `curl` directly in the terminal:

```bash
# Upload a single file
curl -T wp-better-export.php \
  --ftp-create-dirs \
  "ftp://aamir@plugintest2.xyz:Aamir.8878.9200@198.54.116.105/wp-content/plugins/better-export/wp-better-export.php"

# Upload readme.txt
curl -T readme.txt \
  --ftp-create-dirs \
  "ftp://aamir@plugintest2.xyz:Aamir.8878.9200@198.54.116.105/wp-content/plugins/better-export/readme.txt"
```

## Security Note

⚠️ **Important:** These scripts contain FTP credentials in plain text. For better security:

1. Use environment variables:
```bash
export FTP_USER="your-username"
export FTP_PASS="your-password"
```

2. Or use a `.env` file (not committed to git)

3. Or use SFTP/SSH instead of FTP (more secure)

## Recommended: Python Script

I recommend using the Python script (`upload-ftp-python.py`) because:
- ✅ Works on all platforms
- ✅ Better error handling
- ✅ More maintainable
- ✅ Easy to extend

## Quick Setup

1. Make the script executable:
   ```bash
   chmod +x upload-ftp-python.py
   ```

2. Update the FTP credentials in the script if needed

3. Run it:
   ```bash
   python3 upload-ftp-python.py
   ```

That's it! Your files will be uploaded to your WordPress site.

