# Easy WordPress Bootstrap (Herd + DBngin) — Windows Edition

This kit lets Windows devs spin up a new local WordPress project using **PowerShell only**.

## Includes

- `wp-bootstrap.ps1` — main PowerShell script
- `bootstrap.bat` — one-click launcher
- `plugins.json` — minimal default plugin list (use file from repo root)

## Prerequisites

- **PHP** installed and in PATH
- **MySQL client** (`mysql.exe`) in PATH (DBngin/MySQL installed and running)
- **Git** installed (for cloning the starter theme)
- **WP-CLI**: either installed globally as `wp`, **or** put `wp-cli.phar` next to this script and call with:
  - `-WpCliPath "php .\wp-cli.phar"`

## Quick Start

1. Right-click **PowerShell** → *Run as Administrator* (first run only):

   ```powershell
   Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
   ```

2. Open a normal PowerShell in this folder and run:

   ```powershell
   .\wp-bootstrap.ps1 -ProjectName "Client Site"
   ```

   or double-click `bootstrap.bat` and enter the project name when prompted.

### Optional parameters

- `-AdminUser` (default: `vdidev`)
- `-AdminEmail` (default: `dev@vincentdesign.ca`)
- `-ThemeStarterRepo` (default: VDI starter theme)
- `-HerdWorkspace` (default: `"$HOME\Herd"`)
- `-LocalTld` (default: `test`)
- `-MysqlHost` / `-MysqlPort` / `-MysqlRootUser` / `-MysqlRootPass`
- `-WpCliPath` (set to `"php .\wp-cli.phar"` if not installed globally)

## What it does

- Creates project folder under your Herd workspace
- Downloads WordPress core
- Creates database + user with random password
- Generates `wp-config.php`, shuffles salts
- Installs WordPress and sets the site/home URLs
- Creates **Home** and **News** pages, sets **front page**/**posts page**
- Sets permalinks to `/%postname%/` and flushes
- Clones the starter theme, strips history, re-initializes a clean repo, and activates it
- Installs and (optionally) activates plugins from `plugins.json`
- Prints and saves a summary (`bootstrap-summary.txt`)

## Troubleshooting

- **WP-CLI not found**: pass `-WpCliPath "php .\wp-cli.phar"` (place `wp-cli.phar` beside this script).
- **MySQL not found**: ensure `mysql.exe` is in PATH. With DBngin, add the MySQL bin folder to PATH.
- **Access denied creating DB**: verify `-MysqlRootUser`/`-MysqlRootPass`, or create a dev-only MySQL user with `CREATE` privileges.
- **Herd not serving**: Add/link the folder in Herd and browse to `http://<slug>.test` (or your chosen TLD).

## Philosophy

DIY-first: keep `plugins.json` minimal. Only add big off‑the‑shelf stacks (e.g., ecomm) when warranted.
