=== Cruech Watch ===
Contributors: cruechone
Tags: mcp, ai, elementor, gutenberg, wp-cli
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 2.5.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Hybrid WordPress + MCP agent with 3-layer Anti-WSOD protection, Elementor JSON editing, Gutenberg support, media upload, and PHP WP-CLI emulation.

== Description ==

Cruech Watch connects your WordPress site directly to modern AI coding assistants and MCP clients (Antigravity, Claude, Cursor, Windsurf) through a built-in Streamable HTTP MCP endpoint (`/wp-json/cruech-watch/v1/mcp`) and REST API.

Key features included in the free core plugin:

* **3-Layer Anti-WSOD Shield:** Pre-write PHP syntax validation, automatic `.cw-bak` file snapshots, and fatal-error shutdown rollback so edits never leave your site with a White Screen of Death.
* **Shared Hosting Ready:** Automatic capability discovery with built-in PHP emulation for common WP-CLI operations even when `exec()` / `shell_exec()` are disabled by your hosting provider.
* **Elementor JSON & CSS Flush:** Read and update `_elementor_data` trees safely and regenerate Elementor CSS caches automatically.
* **Design Token Extraction:** Real theme.json and active Elementor Kit token inspection (`cw_design_tokens`) exposing exact colors, typography, breakpoints, and CSS variables to AI agents.
* **Surgical File Toggle:** Soft-disable and re-enable files safely with `.cw-disabled` isolation (`cw_fs_toggle`) and Anti-WSOD syntax check before re-enabling.
* **MCP Tools Hub:** Granular per-site control to enable or disable individual MCP tools directly from wp-admin.
* **Cache Clearing:** Flush the WordPress object cache and call the available purge APIs for LiteSpeed Cache, WP Rocket, W3 Total Cache, WP Fastest Cache, and Autoptimize.
* **Gutenberg & Content Management:** Inspect and update posts, pages, and block structures.
* **Direct Media Upload:** Upload images and assets straight into the WordPress Media Library.
* **Site Diagnostics & Logs:** Built-in `/context` discovery, safe file inspection, and `debug.log` reader.
* **AI Skills:** Browse built-in Markdown skills, retrieve them through MCP, and manage custom skills from the WordPress admin or authenticated MCP tools.

Need agency-grade features such as 1-click AI Revisions (Time Machine Undo), Persistent AI Memory, Sandbox testing, 35+ plugin/builder Specializations, Read/Ghost modes, and centralized license management? Check out [Cruech Watch Pro](https://cruechone.com/plugins/cruech-watch).

== Installation ==

1. Upload the `cruech-watch` folder to `/wp-content/plugins/` or install directly from Plugins > Add New.
2. Activate the plugin through the Plugins menu in WordPress.
3. Open **Cruech Watch** in the left admin menu to copy your MCP endpoint and `X-Cruech-Token` snippet.

== Frequently Asked Questions ==

= Does Cruech Watch work on shared hosting without SSH or exec()? =
Yes. Cruech Watch detects disabled shell functions and automatically switches to safe PHP emulation over HTTPS.

= How does the Anti-WSOD shield protect my site? =
Before writing any `.php` file, Cruech Watch validates syntax, saves a `.cw-bak` backup, and registers a shutdown rollback handler that restores the previous file if a fatal error occurs.

== External or Third-Party Services ==

Cruech Watch operates as a local-first, standalone plugin that executes entirely on your own WordPress hosting server. It does not track users, collect analytics, or transmit telemetry to external servers.

Optionally, administrators may interact with the following official Cruech One service:

* **Cruech Hub (https://hub.cruechone.com):**
    * **Service provided:** Optional centralized licensing portal, 1-click OAuth authentication, and multi-site agency management.
    * **When it is called:** Only when an administrator explicitly initiates a connection via the "Portal Cruech Hub" link or connects an optional Pro license.
    * **Data transmitted:** Site URL and public domain name for license verification and OAuth callback token exchange.
    * **Terms of Service:** [https://cruechone.com/terminos-condiciones](https://cruechone.com/terminos-condiciones)
    * **Privacy Policy:** [https://cruechone.com/politica-privacidad](https://cruechone.com/politica-privacidad)

== Changelog ==

= 2.5.0 =
* Added real design token extraction via `cw_design_tokens` (theme.json and active Elementor Kit).
* Added surgical file toggling via `cw_fs_toggle` (.cw-disabled soft isolation with Anti-WSOD pre-activation validation).
* Added Tools Hub with granular MCP tool toggling per site (`cruech_watch_disabled_tools`).

= 2.4.1 =
* Read local Skills Markdown without relying on a connected FTP filesystem; return errors cleanly when filesystem writes cannot initialize.

= 2.4.0 =
* Added built-in and custom AI Skills with WordPress filesystem support, an authenticated admin preview, and MCP list/get/save/delete tools.

= 2.3.0 =
* Split into WordPress.org compliant GPLv2+ core plugin (`cruech-watch`) with clean extension hooks for `cruech-watch-pro`.
* Added standard `readme.txt` and top-level `Cruech Watch` admin dashboard.
