=== WP Claude ===
Contributors: wpclaude
Tags: claude, ai, mcp, model context protocol, automation
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 1.8.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Give Claude a safe, permissioned connection to your WordPress site over the Model Context Protocol (MCP).

== Description ==

WP Claude exposes your WordPress site as a set of tools Claude (or any MCP-compatible AI client) can use: reading and writing content, managing media, users, plugins and themes, reading and setting basic SEO metadata, and running a read-only speed-optimization audit - all guarded by your own license key and an admin-approval workflow for anything that changes the site.

= What it does today (v1.0.0) =

* **Content & media** - list, read, create, and update posts/pages; list media library items.
* **Plugins & themes** - list installed plugins/themes, activate/deactivate plugins, switch the active theme.
* **Users** - list user accounts and roles (read-only; never exposes passwords or auth secrets).
* **SEO metadata** - read and set the SEO title/description for any post or page. Detects Yoast SEO or RankMath automatically and writes to their meta fields if either is active, so you don't end up with duplicate/conflicting SEO data; falls back to its own fields if neither is installed.
* **Speed optimization audit** - a read-only tool that checks active-plugin count, PHP version, HTTPS, page-caching and object-cache status, database bloat (post revisions, transients, oversized autoloaded options), image weight in the media library, and response compression - and turns each into a plain-English finding with a concrete recommendation. It never changes anything on its own; you (or Claude, through the other tools, with your approval) decide what to act on.
* **Approval workflow** - any tool call that changes your site (publishing, editing existing content, toggling a plugin, switching a theme) is queued for you to approve or deny under Settings > WP Claude > Approvals, unless you turn that requirement off. Purely read-only calls (listing, the speed audit) never need approval.
* **Audit log** - every tool call, approved or not, is recorded under Settings > WP Claude > Audit Log so you can see everything Claude has done or tried to do.
* **Licensing** - paste a free Standard license key (or a Pro one) from https://wpforclaude.com to activate. Standard includes a daily API call cap and a trimmed audit-log history; Pro removes both.

= What's on the roadmap (not in this release) =

To be upfront about scope: the following capabilities are described on the WP Claude website as the long-term vision for the product, but are **not** implemented in this 1.0.0 release, so Claude won't be able to do them yet: draft-theme previews, fleet management across multiple sites, saved/reusable skills, WP-CLI-style bulk operations, Unsplash image search, navigation-menu building, redirect rules, broken-link checking, and opt-in raw SQL/PHP execution. These are real, substantial features in their own right and will ship in later versions rather than as untested stubs in this one.

== Installation ==

1. Upload the plugin (Plugins > Add New > Upload Plugin) and activate it.
2. Go to Settings > WP Claude and paste in your license key (get a free one at https://wpforclaude.com/register if you don't have one).
3. Copy the connector URL shown on that same page (it includes your license key), then in Claude go to Settings > Connectors > Add custom connector, paste it, and set Authentication to "No sign-in". Clients that can send headers can instead use the plain server URL with your license key as a Bearer token.
4. Decide whether you want the approval workflow on (recommended, and on by default) or off, under the same Settings > WP Claude page.
5. Start delegating WordPress tasks to Claude.

== Frequently Asked Questions ==

= Does this send my site's content to WP Claude's servers? =

No. The license server (wpforclaude.com) only ever sees your license key and site URL, for activation and usage-limit enforcement. All of your content, media, and settings are read and written directly between Claude and your own WordPress install over the MCP connection - this plugin's own code never routes it through a third-party server.

= What happens if Claude tries to do something destructive? =

With the approval workflow on (the default), anything that changes your site - publishing or editing content, toggling a plugin, switching a theme - is queued for you to review and approve or deny first, rather than happening immediately. Purely read-only actions (listing content, the speed audit) always run immediately since there's nothing to approve.

= Is it safe to approve requests from inside the chat? =

That option is OFF by default (Settings > WP Claude > Safety). Please read this before turning it on: a button in the chat panel is not proof that a person clicked it. The one-time approval tokens are delivered to the chat app next to the tool result, so panel approval TRUSTS THE CHAT APP to keep that data away from the AI model. Whoever holds your license key can also connect their own client and read those tokens. Tokens are single use, tied to the chat session that was shown the panel, expire after 10 minutes and are refused in the first 3 seconds; high-risk requests and requests too long to display in full can only be approved in wp-admin. If you do not fully trust your chat app, leave this off and approve in wp-admin.

= Does the speed audit fix anything automatically? =

No, by design. It's a read-only report: a prioritized list of findings and recommendations. Any actual change (e.g. deactivating a plugin, or asking Claude to help clean something up) goes through the normal tools and the same approval workflow as everything else.

== Changelog ==

= 1.8.0 =
* All in One SEO: get_seo_meta, set_seo_meta and the SEO audit now read and write All in One SEO titles and descriptions. The older 2.x post-meta keys were checked on All in One SEO Pack 2.2.7.4; the 4.x database-table path follows its documented layout and has not been tested on a real 4.x install.
* Preview before you delete: every destructive run_command action (post, comment, term and user delete, option delete, plugin/theme/language install) now accepts --dry-run, as do cron event delete and delete_draft_theme (dry_run=true). A preview runs the same safety checks, shows what would happen, changes nothing and needs no approval; the real run still always needs approval.
* New skill "Elementor v4 atomic" for the typed-props / local-styles format of Elementor 4 elements. The format was read from Elementor 4.4.0 source; front-end rendering of hand-built v4 pages is not yet verified.
* WPForms (untested): wpforms_list_forms, wpforms_get_form and wpforms_list_entries, all read-only. Entries show only choice and rating values; names, emails, messages, IP addresses and browser data are never returned. Built against WPForms' documented storage and checked with fakes only, not against a real WPForms install.

= 1.7.0 =
* New get_rendered_html tool: see a public page after JavaScript has run, and what JavaScript added or removed compared with the server HTML. It uses a headless-browser service the owner sets up in WP Claude > Integrations (Browserless, Cloudflare Browser Rendering or your own); nothing is sent anywhere until you add one. Only public pages of your own site are sent; no cookies or logins; 30 renders per hour.

= 1.6.0 =
* New block-theme / Gutenberg tools: list_block_types (block registry, attributes, bindings), block_templates (Site Editor templates and parts: list, get, save, reset), global_styles (theme.json user layer: get, update, reset), block_patterns (registered and custom, synced or not), navigation_menus (block menus from a simple items list). All writes validate block markup, refuse scripts/PHP/external resources, need approval when the workflow is on, and are undoable.
* New "Block themes" skill.

= 1.5.1 =
* SeedProd: save_builder_page now saves layouts of existing SeedProd pages through SeedProd's own seedprod/save-page ability (SeedProd 6.20+, WordPress 6.9+), always with admin approval and an undo snapshot of the layout. Verified on SeedProd Lite 6.20.10. The owner clicks Save once in the SeedProd builder to refresh the front end.

= 1.5.0 =
* In-chat panels (MCP Apps): approve or decline simple requests, and upload files from your computer, right inside the chat, on hosts that support it. Panel approval is off by default (turn it on under WP Claude > Safety), only covers ordinary content edits, and everything else is sent to wp-admin. A link to an upload page in wp-admin is the fallback. New tools: show_approval_panel, request_upload, check_upload, check_approval_status.
* Tailwind is now bundled with the plugin and copied into the theme: no CDN and no outside requests.
* Fixes found by testing against a real WordPress: update_settings failing on Elementor sites, empty edit links and dates on drafts, Beaver Builder module lists, backslashes in image alt text, and numeric user ids.
* More hardening from a second security review: approval risk now looks at the target post, stricter markup checks, panel tokens tied to one session, read-only bundled Tailwind file, stricter external-script checks.
* Multi-site (Pro): update inventory and background update jobs from the wpforclaude.com dashboard. Each site still needs its own approval.

= 1.4.0 =
* Built-in skills: 16 reference guides (Elementor, Divi, Beaver Builder, Breakdance, Bricks, SeedProd, Gutenberg, Kadence, GeneratePress, classic themes, editable fields, PHP snippets, design, SEO audit, site setup, WooCommerce) that Claude loads before building. Saved skills cannot shadow them.
* Page builders: Divi (shortcodes and Divi 5 blocks) can be written; SeedProd can be read. create_post and update_post accept other post types and a validated meta argument.
* WooCommerce: nine tools for products, variations, orders, coupons, reports and read-only store settings. Customer details are redacted; price, stock, status and coupon changes always need approval.
* run_command now has 131 allow-listed commands (comments, terms, menus, media, cron, users, options, permalinks, updates and more). Destructive ones, including user role grants, always need approval. New tools update_plugins and update_themes (wordpress.org only; each run needs approval).
* Media: upload_media accepts inline base64 and sanitized SVG; search_images can use Unsplash (add a key under WP Claude > Integrations); read_media_pdf extracts text from PDFs in the media library.
* Audits: lighthouse_audit (Google PageSpeed Insights), site_health, and a site-wide seo_audit. All read-only.
* bulk_edit_posts (preview by default; a real run needs approval, 50 posts per run, each undoable) and validate_blocks (Gutenberg markup check; warnings are also attached to create_post and update_post).
* PHP snippets: Claude can draft them, but only you can activate one, after reading the full code on a review screen. Strict scan, safe mode, and automatic deactivation when a snippet crashes the site.
* Custom fields: gallery, wysiwyg and repeater types; optional front-end edit link for editors. Live reload now lists changed items with view and edit links (only what the viewer may see).
* Themes: create_classic_theme can add Tailwind (opt-in, dev-grade). Tailwind is bundled, not loaded from a CDN: the official v4 browser build (MIT, shipped in assets/vendor with its license) is copied into the theme and loaded on the front end only, with no external requests. File tools and the theme safety check now reject every external script. publish_draft_theme first saves a zip backup of the live theme.
* Multi-site: new fleet_update_all gateway tool for plugin and theme updates across your sites (each site still needs its own approval).
* Security hardening from an independent review: stricter REST, SQL and option guards, user-meta protection, approval required for options outside a safe list, hidden-character checks on code.

= 1.3.0 =
* New tools: get_page_html (check how a published page really renders, with an SEO/structure summary), search_content and edit_content (find and replace inside post content, with undo), discover_abilities / get_ability_info / run_ability (WordPress 6.9+ Abilities API; running one always needs approval), get_builder_edit_link, search_images (free stock photos with attribution via Openverse), create_classic_theme (scaffolds a new draft theme) and theme_safety_check (scans a theme for risky code).
* Saved skills: save_skill, load_skill, list_skills. Reusable site-specific instructions; every saved or changed skill needs your approval.
* Custom fields: Claude can propose custom post fields, meta boxes and settings pages (define_fields, get_field_values, set_field_values). Nothing is active until you activate it under WP Claude > Fields. Shortcodes [wpc_field] and [wpc_option] print values.
* Live reload: pages you have open refresh after Claude changes the site (can be switched off on your profile). New dashboard widget with usage, approvals and recent changes. Branding page to white-label the plugin name and menu icon.
* Automatic updates from wpforclaude.com, with checksum verification. An update with no checksum is never offered or installed.
* Multi-site: Pro users can connect all their sites through one connector from the wpforclaude.com dashboard (Fleet connector). Each site still applies its own approvals and safety rules.
* Fixes: backslashes in post content are no longer lost when Claude creates or updates a post; undo can no longer re-enable snippets or fields; the REST tool refuses the Abilities routes.


= 1.2.0 =
* Page builders: builder_info, get_builder_page, save_builder_page, list_builder_elements for Elementor, Bricks, Beaver Builder and Breakdance. Layouts are scanned for scripts and unsafe markup before saving.
* Files and themes: list_files, read_file, search_files, get_file_outline, edit_file, write_file, delete_file (themes, plugins and mu-plugins only, PHP syntax-checked), plus a draft-theme workflow: create_draft_theme, get_draft_preview_url, publish_draft_theme, delete_draft_theme. Visitors never see a draft; only a private preview link does.
* run_command: an allow-listed WP-CLI-style command tool with 130+ commands (options, posts, post meta, comments, terms, menus, widgets, users with a safe role set, plugins/themes/core updates and wordpress.org installs, cache, cron, media, search-replace, read-only database queries) with secrets blocked. Destructive and code-changing commands always need admin approval. update_plugins / update_themes: list and run wordpress.org updates (always approved, never updates WP Claude itself). rest_api: call WordPress and plugin REST routes (no batch or URL-fetching routes, no user changes).
* code_snippet: CSS/JS/HTML and PHP snippets that Claude can only save switched OFF. The owner reviews and activates them under WP Claude > Snippets. PHP snippets are syntax-checked and scanned for dangerous functions, always need your approval, run from a verified file in wp-content/uploads/wp-claude-snippets, switch themselves off after a fatal error, and have a safe mode and a one-click "Deactivate all PHP snippets". An activated PHP snippet runs with full site privileges, so read the code before activating it.
* undo_change and a new Changes screen: undo recent edits to posts, builder layouts, settings, CSS and files.
* Safety: edits to PHP, JS, HTML or SVG files and publishing a draft theme ALWAYS need your approval, even if you turned the approval setting off. The approval list now shows readable content, is capped at 100 pending items, and can't be double-approved. upload_media now needs approval. On multisite only a super admin can loosen the safety settings.

= 1.1.0 =
* New tools so Claude no longer needs a browser for common site setup: get_settings / update_settings (site title, tagline, static front page, permalinks, search visibility - allow-listed options only), upload_media (add an image from a URL to the media library, optionally as a featured image), custom_css (read / append / replace Additional CSS), manage_terms (list, create, assign categories and tags), manage_menu (list, create, add items, assign to a theme location) and trash_post (Trash only - never permanent delete).
* Front-page, permalink, search-visibility, menu-location, CSS-replace and trash changes still go through the approval workflow when it is on.

= 1.0.6 =
* License page now shows "Calls used today" and how many remain (the "Daily call limit" row is the plan's cap, which never changes).
* Usage is now reported to the license server shortly after calls happen (at most every 5 minutes) rather than only on the twice-daily check-in.

= 1.0.5 =
* New opt-in setting (Safety section): allow Claude to save page content containing <style> and <script> tags. Off by default, so WordPress keeps stripping them. Needed for custom-designed pages (landing pages, homepages). Content with a <script> tag still always requires approval.

= 1.0.4 =
* Rewrote the "Connect Claude" instructions on the License page for the Claude.ai custom-connector form: one copy-paste connector URL with the key included, and "No sign-in" as the authentication choice. Bearer-header and Claude Code instructions moved to an Advanced section.

= 1.0.3 =
* The MCP endpoint now also accepts the license key as a ?key= URL parameter, so it can be added in Claude.ai's custom-connector form (which cannot send an Authorization header). The Bearer header still works.

= 1.0.2 =
* Fixed blank white page after clicking Activate/Deactivate/Save (the redirect back to the License page used a menu URL that is empty during form submission; it now uses the admin page URL directly). Also fixes the Approvals approve/deny redirect.

= 1.0.1 =
* Fixed a rare blank-white-screen (fatal error) that could occur when clicking Activate/Deactivate on some hosts with a short PHP execution-time limit - activation/deactivation failures now show a normal notice on the License page instead.
* Clearer "Connect Claude" section: step-by-step instructions with one-click copy buttons for the MCP server URL and license key, and a success banner once a license is active.

= 1.0.0 =
* Initial release: MCP server, license activation, content/media/users/plugins/themes/SEO tools, the speed-optimization audit, the approval workflow, and the audit log.
