# Freemius Patch Maintenance Policy

## Purpose
This plugin carries wp.org/compliance patches in `freemius/` files.  
Those patches must be re-applied whenever the SDK is upgraded.

## Rules
1. Do not edit `freemius/` on `main`.
2. Use a dedicated branch for SDK patching.
3. Reapply local patch commits after every SDK bump.
4. Re-run Plugin Check + PHPCS before merge.
5. If upstream SDK fixes an issue, remove local patch intentionally and document why.

## Workflow
1. Create SDK update branch (example: `chore/freemius-sdk-update-x.y.z`).
2. Run `../tools/reapply-freemius-patches.sh` from plugin directory (or `tools/reapply-freemius-patches.sh` from repo root).
3. Resolve conflicts, then run checks.
4. Commit with clear summary of reapplied/dropped patches.

## Validation Gate
- `wp plugin check` (static + runtime, if available)
- PHPCS on changed `freemius/` files
- Manual smoke test: license activation, upgrade UI, settings screens

## Packaging Rule
- Keep maintenance scripts outside the plugin directory so Plugin Check does not flag `application_detected`.
