=== Overedge Connector ===
Contributors: timothyolu
Tags: headless, rest-api, react, lovable, vite
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 2.0.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect your WordPress site to any React or Lovable-built frontend as a headless CMS — in minutes.

== Description ==

Overedge Connector bridges your WordPress site with 
AI development tools — enabling post-ship development, 
content management, and site control through Claude Code, 
Claude.ai, and any MCP-compatible AI assistant.

= Two ways to use Overedge =

**1. MCP Server — AI-Powered Site Management**
Connect Claude Code or Claude.ai directly to your 
WordPress site. Ask your AI assistant to:

* Read and update page content and ACF fields
* Create new pages, posts, and WooCommerce products (saved as draft for your review)
* List active plugins and site information
* Read your Overedge theme manifest
* Manage content without touching wp-admin

All content created via MCP is saved as **draft** — 
you review and publish manually.

**2. Headless CMS — React Frontend + WordPress Content**
Use WordPress as a content backend for your 
vibe-coded React app built on Lovable, Bolt.new, 
Replit, or plain React.

* Add one CDN script to your React project
* Manage all content from WordPress admin
* No rebuild required when content changes

= Connect to Claude.ai Web =
1. Go to Claude.ai → Settings → Connectors
2. Click "Add custom connector"
3. Paste your MCP URL from the Overedge admin panel
4. Start managing your WordPress site with AI

= Connect to Claude Code =
Copy the MCP config JSON from the Overedge admin 
panel and add it to your Claude Code config file.

= Works with Overedge Engine =
Convert any vibe-coded React project to a native 
WordPress theme at overedge.dev. Install the converted 
theme and this plugin together for the complete 
Overedge experience — from vibe coding to WordPress 
to AI-powered post-ship development.

= Requirements =
* WordPress 6.0 or higher
* PHP 7.4 or higher
* Advanced Custom Fields (free or Pro) for field management tools
* WooCommerce (optional) for product creation tools

== Installation ==

= Automatic Installation (Recommended) =

1. Log in to your WordPress admin dashboard
2. Go to **Plugins → Add New**
3. Search for **Overedge Connector**
4. Click **Install Now**
5. Click **Activate Plugin**

That's it. The plugin configures everything automatically on activation.

= Manual Installation =

1. Download the plugin ZIP from this page
2. Go to **Plugins → Add New → Upload Plugin**
3. Upload the ZIP file and click **Install Now**
4. Click **Activate Plugin**

= After Activation =

1. Visit **Settings → Permalinks** and click **Save Changes** to flush rewrite rules
2. Test the health endpoint: `https://yoursite.com/wp-json/overedge/v1/health`
3. You should see a JSON response with `"status": "ok"`
4. Connect your React frontend using the Overedge platform at overedge.dev

== Frequently Asked Questions ==

= Does this plugin work without the Overedge platform? =

Yes. The plugin works standalone. It registers custom post types, configures the REST API, and handles CORS. You can connect any React frontend manually using the REST API endpoints.

The Overedge platform (overedge.dev) automates the connection setup and generates the React integration files for you — but it is optional.

= Does my React app need to be on a specific hosting platform? =

No. Overedge works with any React frontend on any hosting — Lovable, Vercel, Netlify, custom servers, or static hosting. Both subdomains and custom domains are supported.

= Do I need a custom domain for my WordPress site? =

No. The plugin works on any WordPress URL — a subdomain (cms.yoursite.com), a main domain (yoursite.com), or a subfolder (yoursite.com/cms).

= Does this plugin require Advanced Custom Fields? =

ACF field groups are registered programmatically using `acf_add_local_field_group()`. If ACF (free or Pro) is installed, the field groups appear automatically. If ACF is not installed, the custom post types still work via the REST API — you just won't have the structured ACF fields.

= How does CORS work? =

On activation, the plugin allows all origins by default so your React app can connect during setup. Once you connect via the Overedge platform, the allowed origin is updated to your specific React frontend URL only.

You can also set the allowed origin manually via the configure endpoint:
`POST /wp-json/overedge/v1/configure` with header `X-Overedge-Secret: [your secret key]` (legacy `X-Overco-Secret` is still accepted)

= Where do I find my Overedge secret key? =

The secret key is auto-generated on plugin activation and stored as a WordPress option. You can retrieve it via WP-CLI: `wp option get overedge_secret_key`

= Is this plugin compatible with caching plugins? =

Yes. The REST API endpoints are excluded from page caching by default on most caching plugins. If you experience issues, add `/wp-json/` to your caching plugin's exclusion list.

= Does the plugin work on multisite? =

Single site support only in version 1.0. Multisite support is planned for a future release.

= How do I report a bug or request a feature? =

Visit overedge.dev or open an issue at https://github.com/timolumide1/overedge-connector

== Screenshots ==

1. The Overedge dashboard showing connected sites
2. The connection wizard — paste two URLs and connect
3. WordPress admin with Overedge custom post types
4. The health endpoint returning site status
5. React frontend fetching content from WordPress

== Changelog ==

= 2.0.2 =
* Implemented MCP JSON-RPC 2.0 protocol for Claude Code compatibility
* Added tools/list, tools/call, and initialize handshake support

= 2.0.1 =
* Added Claude.ai web connector support via query parameter authentication
* Added Connect via Claude.ai Web section in admin panel with pre-filled MCP URL
* Updated plugin description to reflect MCP capabilities

= 2.0.0 =
* Added MCP (Model Context Protocol) server — connect 
  Claude Code to your WordPress site for post-ship development
* 13 MCP tools: read and manage pages, posts, ACF fields, 
  products, and site info via AI
* All AI-created content saved as draft for human review
* Added Connect to Claude Code section in admin panel
* Fixed function_exists guard on ACF field registration
  to prevent conflicts with Overedge converted themes

= 1.3.1 =
* Added Site Editor tab (Pro feature)
* WordPress admin controls React site sections and design
* Added save-site-config edge function
* get-site-config now accepts both cdn_key and secret_key

= 1.3.0 =
* Added shortcode parser endpoint
* GET /wp-json/overedge/v1/shortcodes
* Supports all [overedge_*] shortcodes
* Returns structured JSON for React

= 1.0.1 =
* Unique `overco_` prefix for functions, constants, options, and related identifiers (WordPress.org guidelines)
* Prefixed custom post type slugs: `overedge_testimonial`, `overedge_team_member`, `overedge_faqs` (≤20 characters for WordPress)
* Prefixed ACF local field group and field keys
* REST API namespace `overedge/v1` (configure with `X-Overedge-Secret`)
* Migrates `overco_*` options to `overedge_*` on activation and removes the old keys

= 1.0.0 =
* Initial release
* Custom post types: testimonials, team_members, faqs
* ACF field groups for all post types
* REST API configuration and CORS handling
* Health endpoint with query var fallback
* Site-wide options panel
* Secure configuration endpoint with secret key verification

== Upgrade Notice ==

= 1.0.1 =
After updating, go to Settings → Permalinks and save once to flush rewrite rules. Options migrate automatically on activation.

= 1.0.0 =
Initial release. No upgrade required.
