# EasySite Pro — Distributor Guide

Connect licensing, updates, and white-label delivery for agency customers.

## License activation

The theme checks `easysite_license_api_url` (filter). When empty and no key is stored, local dev works without enforcement.

### Local format keys

Without a server, keys must match `ESITE-XXXX-XXXX` (alphanumeric).

### Remote API

POST body:

| Field | Value |
|-------|-------|
| `license_key` | Customer key |
| `site_url` | `home_url('/')` |
| `action` | `activate`, `deactivate`, or `check` |

Response JSON:

```json
{ "success": true, "message": "Activated." }
```

Weekly cron re-validates when a remote URL is configured.

## Theme updates

Set `easysite_update_url` to a JSON manifest:

```json
{
  "version": "1.6.1",
  "download_url": "https://cdn.example.com/easysite-pro-ultimate-bundle.zip",
  "homepage": "https://example.com/easysite-pro",
  "changelog": "Bug fixes and demo kits."
}
```

Updates appear under **Appearance → Themes** and as a notice on EasySite Setup pages.

## MU-plugin setup

Copy `mu-plugin-example/easysite-distributor.php` to `wp-content/mu-plugins/` on customer sites (or ship it with your bundle).

## Stub server

A reference implementation lives in `license-server/` at the project root:

```bash
node license-server/server.js
```

Demo keys: `ESITE-DEMO-2026`, `ESITE-TEST-1234`

## Staging sites

Define in `wp-config.php`:

```php
define( 'EASYSITE_DEV_MODE', true );
```

This disables license enforcement.

## Bundle gating

| Function | Meaning |
|----------|---------|
| `easysite_is_bundle()` | Ultimate tier (constant) |
| `easysite_license_is_active()` | Valid license or dev bypass |
| `easysite_bundle_active()` | Tier + license — gates Site Kit, Section Library, commerce extras |

## Filters reference

| Filter | Purpose |
|--------|---------|
| `easysite_license_api_url` | License server POST endpoint |
| `easysite_update_url` | Update manifest GET URL |
| `easysite_is_bundle` | Override bundle tier |
| `easysite_starter_content` | Customize demo import content |
