=== Redesign.ai Connector ===
Contributors: 66firmin
Tags: redesign, migration, woocommerce, page builder, rest api
Requires at least: 5.5
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.3.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect your site to Redesign.ai: read your content to generate a modern redesign, and publish the redesigned pages as drafts.

== Description ==

**Redesign.ai Connector** links your WordPress site to the **Redesign.ai** service, which regenerates your site with a modern design while keeping your identity (logo, colors, content).

Once connected (using a WordPress application password), the plugin lets Redesign.ai:

* **Read your content faithfully**: pages, posts, menus, media, brand colors, fonts, contact details, social links, reviews, and products/listings — whether you use **WooCommerce, a custom content type (e.g. car or real-estate listings), or another system**.
* **Publish the redesign**: create and update redesigned pages, **full width**, **as drafts by default**. Nothing is published without your action.
* **Re-publish**: you edit in Redesign.ai and push again — the **same** page is updated.

= Why a plugin? =

The standard WordPress REST API does not expose everything (theme colors, custom fields, custom listings, and so on). The plugin reads this data cleanly for a redesign that is much more faithful than reading the HTML alone.

= Security =

* Authentication uses a WordPress **application password** (your main password is never transmitted).
* Publishing requires page-editing rights.
* Pages are created as **drafts**; publishing remains your choice.

== External services ==

This plugin connects your site to the third-party service **Redesign.ai** (https://ai-redesign.app).

* **What is sent**: when you authorize the connection from Redesign.ai, the service reads — through this plugin's REST endpoints — the public and brand content of your site (pages, posts, media, menus, colors, fonts, contact details, social links, products/listings) in order to generate a new version of your site. When you publish, Redesign.ai sends the HTML of the redesigned pages to your site.
* **When**: only after you have explicitly authorized the connection, and during the read/publish actions you trigger from Redesign.ai.
* **Terms of service**: https://ai-redesign.app/terms
* **Privacy policy**: https://ai-redesign.app/privacy

== Installation ==

1. Install and activate the plugin (Plugins → Add New).
2. Create an application password: Users → Profile → Application Passwords (or let Redesign.ai generate it through "Connect").
3. In Redesign.ai, choose "Connect WordPress" and authorize the connection.

== Frequently Asked Questions ==

= Does it change my live site? =
No. Pushed pages are created as **drafts**. You preview them and decide whether to publish.

= Are my credentials stored? =
The plugin only uses the WordPress application password (revocable at any time in your profile). Your main password is never transmitted.

= Does it work with WooCommerce? With another system? =
Yes. The plugin automatically detects WooCommerce, or the main content type (listings, real estate, and so on).

== Changelog ==

= 1.3.2 =
* Better catalog capture for custom listing post types (Vehica & co): smarter price detection (scans custom fields, ignores year/mileage) and exposes all listing specs (mileage, year, fuel…) — migrated into the product description.

= 1.3.1 =
* New /unlink endpoint: when the site is disconnected from Redesign.ai, the plugin token is revoked too — both sides stay in sync. Status cache shortened to 10 minutes.

= 1.3.0 =
* New /install-theme endpoint: installs a generated theme directly on the site — NEVER activated automatically; the user previews and activates it from Appearance → Themes. Powers one-click site migration.

= 1.2.0 =
* Deep capture: new /catalog endpoint exposes the FULL product catalog (variants, SKUs, stock, all images, categories, attributes, per-product SEO, weight) — paginated. Works with WooCommerce or the site's main listing post type.
* New /redirects endpoint reads existing redirects (Redirection, Rank Math) so migrations preserve SEO.
* New /import-products endpoint recreates products in WooCommerce as DRAFTS (variants, images, categories, SEO) — powers Shopify to WooCommerce migration.
* Pages now include featured image, SEO meta and ACF fields for a more faithful redesign.

= 1.1.4 =
* Prevent browser auto-translate from duplicating/ghosting UI text on the settings page (translate=no on the branded panel).

= 1.1.3 =
* Layout hardening of the settings page footer area.

= 1.1.2 =
* Connection status is now verified against Redesign.ai: the plugin only shows "Connected" when the service actually confirms the link, and prompts to finalize otherwise.
* Loading state on the Connect button. Label tweaks.

= 1.1.1 =
* New "Site overview" dashboard in the settings page: SEO score, content stats and a live, real-time diagnostic of weak points (indexing, SEO descriptions, image alt text, permalinks, privacy policy, favicon, pending updates…).
* Shows the connected account's subscription plan, linking to account management.
* Connection now adds the site to "My connections" on Redesign.ai for one-click redesigns, without re-entering credentials.
* Various reliability and UI fixes.

= 1.1.0 =
* One-click connection: a "Connect to Redesign.ai" button in the plugin settings links the site **without an application password** (uses a dedicated, revocable token). Works even when a security plugin or host disables application passwords.
* WordPress 7.0: registers native **Abilities** (read site content, publish redesigned pages) and exposes them as an **MCP server** when the MCP Adapter is present — discoverable by AI agents.
* REST endpoints now accept the connection token (Bearer) in addition to application passwords.

= 1.0.2 =
* Use a unique, consistent prefix for the settings page slug (redesignai-settings).

= 1.0.1 =
* Hardening: the full-page canvas render now outputs raw HTML only when the page author has the `unfiltered_html` capability; otherwise the content is passed through wp_kses_post (mirrors WordPress core post content handling).

= 1.0.0 =
* First public release: reads content/brand data (pages, colors, logo, fonts, menus, contact details, social links, reviews, SEO, universal products/listings) and publishes the redesigned pages as drafts.

== Upgrade Notice ==

= 1.0.2 =
Minor compliance fix (settings page slug prefix).

= 1.0.1 =
Security hardening of the page rendering.

= 1.0.0 =
First public release of the Redesign.ai connector.

== Privacy ==

This plugin does not collect or store personal data about your visitors. It exposes REST endpoints that the Redesign.ai service uses — after your authorization — to read your site content and publish pages. See the Redesign.ai privacy policy: https://ai-redesign.app/privacy
