=== iP Claude Connector ===
Contributors: ip-labs.gr
Requires at least: 6.4
Requires PHP: 8.1
Stable tag: 2.0.0
License: GPL-2.0-or-later

Lets Claude (claude.ai) work on your WordPress site: pages, posts, custom post types, menus, categories and tags, site settings and Media Library images. Works on any site, with any theme.

Extra for these themes (detected automatically): GLH (glh.gr), Elegance Hotels (elegance-hotel.gr), AG Services: Claude can also edit the theme settings, homepage sections, design settings and the theme's own content types.
Another theme with the same architecture: add_filter( 'ip_mcp_theme_prefix', fn() => 'xyz' );

== Install ==
1. Plugins → Add New → Upload Plugin → ip-claude-connector.zip → Activate.
2. Settings → Claude Connector → "Run connection test".
3. claude.ai → Settings → Connectors → Add custom connector → paste the address shown on that page.
4. Log in to WordPress when asked and click "Allow".

== What Claude can do ==
On every site:
* Read, create and change pages, blog posts and other public content types (including custom fields registered for the REST API).
  If your site uses the block editor, Claude keeps the block markup intact.
* Move a page or post to the trash (never deletes for good).
* Categories, tags and other taxonomies: list, create, rename, delete empty ones, and assign them to posts.
* Classic menus: read, rebuild and create menus, and assign them to a theme location. Block-theme Navigation menus can be edited as content.
* Site settings: title, tagline, timezone, date and time format, posts per page, homepage and blog page, comments default, search engine visibility.
* Images already in the Media Library: list them, set featured images, write alt text, title and caption.
* Find where a sentence lives on the site. Show and undo every change.

With a supported theme (GLH / Elegance Hotels / AG Services) also: theme texts, design settings (colors, fonts, layout, homepage sections), hotel locations, theme image settings.

Access level (Settings → Claude Connector): Full, Draft first (new content is saved as a draft, Claude cannot publish) or Read only.

It cannot: upload or delete image files, install plugins, change users or passwords, tracking codes, or edit code.

== Moving from GLH Claude Connector ==
1. Plugins → deactivate "GLH Claude Connector".
2. Upload and activate ip-claude-connector.zip.
3. Delete "GLH Claude Connector".
Connections, change history and undo move over automatically. Connectors added in claude.ai
with the old address (…/glh-mcp/mcp) keep working; new connectors use …/ip-mcp/mcp.
Old hook names (glh_mcp_theme_prefix, glh_mcp_post_types, glh_mcp_capability,
glh_mcp_redirect_hosts, glh_mcp_purge_cache) still work.

== Changelog ==
= 2.0.0 =
* Works on any WordPress site, no supported theme needed. Theme tools only appear when a supported theme is active.
* All public custom post types, block-theme navigation and reusable blocks are available as content.
* New tools: get_site_settings / update_site_settings, list_menus / get_menu / update_menu, list_terms / create_term / update_term / delete_term, delete_content (trash).
* create_content / update_content accept `terms` (categories, tags) and registered custom fields.
* New access level setting: Full, Draft first, Read only.
* Menus, terms, site settings and trashing are logged and can be undone.
= 1.5.0 =
* Multilingual sites (Polylang): list_content/get_content show each item's language and translations; list_content can filter by `lang`.
* create_content accepts `lang` and `translation_of` (links the new item to its original).
* get_theme_texts / update_theme_texts accept `lang`: texts, links and images of the homepage and theme are stored per language (GLH theme 1.1.0+); empty = follows the default language. Undo works per language.
= 1.4.0 =
* New tools list_media, update_media (alt text / title / caption) and set_featured_image.
* update_theme_texts and update_location accept image settings: the value is the id of an image already in the Media Library.
* get_content shows the featured image; list_content shows featured_image_id; get_theme_texts lists the image settings.
* All image changes are logged and can be undone (undo_change). Files are never uploaded, replaced or deleted.
= 1.3.0 =
* Renamed to iP Claude Connector (folder ip-claude-connector), by iP-Labs.gr.
* New address …/ip-mcp/mcp; the old …/glh-mcp/mcp keeps working.
* Automatic move of connections, history and settings from GLH Claude Connector.
* Hooks renamed to ip_mcp_*; the old glh_mcp_* names still work.
= 1.2.0 =
* Works with the Elegance Hotels and AG Services themes (automatic theme detection).
* New tools get_locations / update_location (Elegance), with history and undo.
* `location` on create_content / update_content for rooms, offers, facilities, FAQ and pages.
* find_text also searches location fields; contrast checks adapt to the theme's colors.
* Tracking codes, form shortcodes and map provider settings are never exposed.

== Security ==
* OAuth 2.1 with PKCE; only administrators can approve a connection.
* Only Claude's callback addresses (claude.ai / claude.com, plus localhost for Claude Code) can register.
* Tokens are stored hashed; access tokens last 1 hour, refresh tokens 60 days.
* Settings → Claude Connector: disconnect, switch off, see every change and undo it.

== If the connection test shows "Authorization header blocked" ==
Add this line under "RewriteEngine On" in public_html/.htaccess:
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
