# WordPress plugin — Synderesis Customer Agent

**Plugin version:** 1.4.0
**Product package:** `customer-agent` (separate from marketing `website/`)

## For site owners (not developers)

### Install from zip (recommended)

1. Get the zip from your Synderesis contact, **or** build it (see below).
2. WordPress → **Plugins → Add New → Upload Plugin → Install → Activate**.
3. **Settings → Synderesis Agent**
4. Paste your **`pk_live_…`** public site key from
   [agent admin](https://www.synderesis.eu/customer-agent/admin/)
5. **Save settings**
6. Click **Test connection**
7. In Synderesis admin, set **Allowed websites** to your WordPress site URL
   (shown on the settings page), or `*` while testing
8. Visit the public site (purge cache if needed) — chat bubble bottom-right

### Important

- **Never** paste a `syn_…` secret API key — the plugin rejects those.
- Only `pk_live_…` belongs in WordPress.

### Sitewide vs one page

| Mode | How |
|------|-----|
| Whole site (default) | Enable + Sitewide checked |
| One page only | Uncheck Sitewide, add shortcode `[synderesis_agent]` |

### Optional overrides

- Bubble position (left/right)
- Brand colour hex
- Open panel on load
- Suggestion chips (`Q1|Q2|Q3`)

---

## Build the release zip (operators)

From the monorepo:

```powershell
powershell -File customer-agent/integrations/wordpress/scripts/build-zip.ps1
```

Output:

`customer-agent/integrations/wordpress/synderesis-customer-agent-1.4.0.zip`

That zip is what you send customers or upload in WordPress.

Also documented in [docs/SHIPPING.md](../../docs/SHIPPING.md).

---

## Uninstall

1. Deactivate and **Delete** the plugin.
2. `uninstall.php` removes plugin options from WordPress.
3. Agents and FAQs on Synderesis are **not** deleted (manage those in agent admin).

---

## Troubleshooting

| Symptom | Fix |
|---------|-----|
| Test connection 403 | Add this site origin under Allowed websites in Synderesis |
| Test connection 404 | Wrong/inactive site key |
| No bubble after save | Purge page/CDN cache; confirm Enable is on |
| Rejected key | You pasted `syn_…` — use `pk_live_…` |

---

## Support

Point customers to the [customer setup guide](../../docs/customer-setup-guide.md).
