# Ppok AI Toolkit — Licensing Policy

This plugin is distributed under **two licenses**, applied per-file. Every PHP, JS, and CSS source file carries an `@license` tag indicating which license governs it.

## 1. GPL-2.0-or-later (default)

**Applies to:** every file in the plugin **except** those in `includes/lib/`.

These files load inside the WordPress runtime, register hooks via `add_action` / `add_filter`, call WordPress core functions (`register_rest_route`, `wp_enqueue_*`, the Settings API, etc.), and/or extend WordPress classes. They are derivative works of WordPress, which is GPL-2.0-or-later, and they inherit that license.

Full text: see `LICENSE-GPL.txt` or <https://www.gnu.org/licenses/gpl-2.0.html>.

You may redistribute and/or modify these files under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.

## 2. Proprietary (`includes/lib/`)

**Applies to:** every file in `includes/lib/`.

These files contain protocol primitives and helpers that have **no WordPress dependency** — no `WP_*` symbols, no calls to `get_option`, no `wp_*` functions, no WordPress class references. They are not derivative works of WordPress and are therefore not covered by GPL.

Full text: see `LICENSE-PROPRIETARY.txt`.

Use of those files outside this distribution requires a separate written license from Ppok.

## Rule for contributors

When adding new code:

* If your file imports or calls anything from WordPress (hooks, REST, options, capabilities, post/user APIs, etc.), place it **outside** `includes/lib/` and stamp it `@license GPL-2.0-or-later`.
* If your file is pure PHP with zero WordPress symbols, place it **inside** `includes/lib/` and stamp it `@license Proprietary`.
* Never call WordPress functions from `includes/lib/`. If you need WP context, expose a pure interface from `lib/` and call it from a GPL file under `includes/mcp/` or `includes/rest/`.

If a file's `@license` header conflicts with its location, the location wins — `includes/lib/` is proprietary, everywhere else is GPL.
