# WordPress Plugin Compatibility Testing Guide

## Phase 1: Setup Local Testing Environment

### Step 1: Install Local WordPress 6.9

Create a directory for testing:

```bash
mkdir ~/wordpress-plugin-test
cd ~/wordpress-plugin-test
```

Download WordPress 6.9:

```bash
wp core download --version=6.9
```

**If you encounter memory issues:**

1. Find the php.ini file location:

```bash
   php --ini
```

2. Edit the `memory_limit` parameter in php.ini:

```ini
   memory_limit = 512M
```

3. Run the download command again

---

### Step 2: Configure WordPress

Create wp-config.php:

```bash
wp config create --dbname=wp_plugin_test \
  --dbuser=root \
  --dbpass=your_password \
  --dbhost=localhost
```

> **Note:** Remove `--dbpass=your_password` if using a local database without a password.

Create the database:

```bash
wp db create
```

Install WordPress:

```bash
wp core install \
  --url=http://localhost:8080 \
  --title="Plugin Test Site" \
  --admin_user=admin \
  --admin_password=admin123 \
  --admin_email=test@example.com
```

---

### Step 3: Install Your Plugin

**Option A: Clone from Git Repository**

```bash
cd wp-content/plugins/
git clone https://github.com/razoo-dev/mc-wordpress-plugin.git
```

**Option B: Copy Local Plugin**

```bash
cp -r ~/mc-wordpress-plugin wp-content/plugins/mc-wordpress-plugin
```

Activate the plugin:

```bash
wp plugin activate mc-wordpress-plugin
```

---

### Step 4: Start Local Server

From the WordPress root directory:

```bash
php -S localhost:8080
```

Your test environment is now ready at `http://localhost:8080`

---

## Next Steps

- Access the WordPress admin at `http://localhost:8080/wp-admin`
- Login with username: `admin` and password: `admin123`
- Configure the Mightycause plugin with your API token
- Begin testing plugin functionality
- Changes can be made to the plugin code at `wp-content/plugins/mc-wordpress-plugin/` directly while testing
- Copy the changes made to your plugin repository and commit your code
