# Environment & testing policy

## Kurzfassung (DE)

- **Cloudways-Staging ist keine Produktionsumgebung** für Plugin-Releases — nur zum **Testen**.
- Der **Server kann produktive Webseiten** mit hosten → **keine** Deploys/Tests, die **Fatal Errors** oder sonstige Ausfälle riskieren, die **andere Sites** oder PHP-Worker mitreißen.
- **Trotzdem:** alles **Notwendige** ausführen, um Aufgaben **vollständig** abzuschließen (Tests, Fixes, WP-CLI-Checks), solange sie **stabil und reversibel** bleiben.
- **Keine** bewussten **Sicherheitslücken**; Security-Fixes haben Vorrang.

## Cloudways staging (credentials: `STAGING-ACCESS.local.md`, gitignored)

- **Not a production release environment** — use only for **testing** plugin builds, updates, and regressions.
- The **same server can host other live sites**. Treat it like shared production infrastructure:
  - **Do not** deploy code that risks **fatal errors**, **uncaught exceptions in global hooks**, or **white-screen** scenarios that could affect PHP workers for neighboring sites.
  - Prefer **staging-only URLs**, **backups** before risky DB operations, and **small, reversible** changes when testing.
- **Security:** do **not** introduce or leave known vulnerabilities; security fixes take precedence over convenience.

## Auto-update filter (`auto_update_plugin`)

The free plugin limits **background** auto-updates to **same major + same minor** (patch-only). **Manual** updates in **Plugins →** remain available for larger jumps (e.g. 5.x).

### Verify on a WordPress install (WP-CLI, read-only)

Run **once** on SSH where `wp` is available (replace versions in `$tests` as needed):

```bash
wp eval '
$slug = "webinar-ignition";
$plugins = get_plugins();
$current = "";
foreach ( $plugins as $file => $data ) {
	if ( strpos( $file, $slug . "/" ) === 0 ) {
		$current = $data["Version"];
		break;
	}
}
echo "Installed {$slug}: " . ( $current ?: "(not found)" ) . PHP_EOL;
$tests = array( "4.06.10", "4.07.0", "5.0.0" );
foreach ( $tests as $newv ) {
	$item = (object) array( "slug" => $slug, "new_version" => $newv );
	$r = apply_filters( "auto_update_plugin", true, $item );
	echo "auto_update_plugin( new={$newv} ) => " . ( $r ? "ALLOW" : "DENY" ) . PHP_EOL;
}
'
```

If the plugin is not active or path differs, adjust `$slug` / folder name (`webinarignition-premium` for the premium slug).

## Repositories using this file

- **wp.org 4.x free slice** (this tree; plugin under `webinar-ignition/`).
- **Bitbucket** `webinarignition` main repo — same `SETTINGS.md` at repo root.

Keep this file **committed** (no secrets). Staging login stays in `STAGING-ACCESS.local.md` only.
