=== Pagewright – AI Page Designer ===
Contributors: som9663
Tags: page builder, ai, tailwind, landing page, blocks
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.2
Stable tag: 1.0.1
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Describe a page in a chat and get a designed draft built from Tailwind blocks, in your brand's colors and fonts, ready to edit in the block editor.

== Description ==

Pagewright turns a short description into draft pages. Connect an AI through the WordPress AI Client,
write what the page is for, and the plugin designs it section by section with its Tailwind blocks:
containers, text, images, icons and links. Every page is a draft you edit in the block editor like
any other page.

Open **Pagewright → Design desk**, connect an AI, describe the page and click **Design drafts**.

* **Several pages at once.** Pick Home, About, Services, Contact and more, or name your own.
* **Runs in the background.** The plan is made first, then the sections are written in parallel. Leave the screen and come back: the job keeps going.
* **Your brand.** The Brand kit keeps your colors, fonts, logo, voice and business facts, and every page uses them. Fill it in from your active theme or an existing website in one click.
* **Real photos.** Photos come from your Media Library first, then Unsplash, Pexels or Openverse, or are generated by OpenAI.
* **Edit a section from the editor.** Select a section in the block editor and ask for a change in the Pagewright sidebar. The rest of the page stays as it is.
* **Start from a reference.** Give a site URL or an image to borrow its layout, rhythm and type scale.
* **Variations and revisions.** Ask for another take on a section, and restore an earlier version of the page.
* **Review and SEO.** A review pass checks contrast, headings and links, and writes a title and description for Yoast SEO or Rank Math when one is active.
* **Tailwind settings.** Add your own theme tokens and rules on the Tailwind screen; the brand tokens are added for you.

= Supported AI providers =

On WordPress 7.0 and later, Pagewright uses the AI you set up once in **Settings → Connectors**, through the WordPress AI Client. It is selected by default, and no key is entered in this plugin.

For sites without an AI connector, such as sites on WordPress 6.5 to 6.9, you can instead connect Claude, OpenAI, Gemini, Groq, Grok, DeepSeek or Mistral directly, each with your own API key.

== Installation ==

1. Upload the `pagewright` folder to `/wp-content/plugins/`, or install the zip from **Plugins → Add New → Upload Plugin**.
2. Activate the plugin.
3. Open **Pagewright → Design desk**. Choose **This site's AI** to use Settings → Connectors, or choose a provider and paste its API key. Click **Save and test**.
4. Optionally fill in the **Brand kit**, then describe a page and click **Design drafts**.

== External services ==

Pagewright contacts the services below only when you use a feature that needs them: **Save and
test**, **Design drafts**, a request in the editor, or **Fill in from a website** in the Brand kit.
Nothing is sent when the plugin is activated. Requests from your server carry WordPress's standard
user agent, which includes your site's address.

= The AI that designs your pages =

The AI receives what it needs to write each page:

* your chat messages, the pages you picked, your site name and your Brand kit facts;
* the titles and addresses of your published pages, so it can link between them, and the names of
  your forms when Everest Forms, Contact Form 7 or WPForms is active;
* the page's current sections when you change a page in the editor, and the page's text when you
  ask for an SEO title and description;
* a reference image, or the text, colors and fonts of a reference website, when you add one;
* the text of the website you read with **Fill in from a website**.

**Save and test** sends one short test request.

With **This site's AI**, the default on WordPress 7.0 and later, these requests go through the
WordPress AI Client to the provider set up in **Settings → Connectors**, under that provider's
terms. The AI Client may also ask that provider for its list of models. Otherwise they go straight
to the provider you choose here, with your API key:

* Claude (Anthropic), `api.anthropic.com`: [Terms](https://www.anthropic.com/legal/commercial-terms), [Privacy Policy](https://www.anthropic.com/legal/privacy)
* OpenAI, `api.openai.com`: [Terms](https://openai.com/policies/terms-of-use), [Privacy Policy](https://openai.com/policies/privacy-policy)
* Gemini (Google), `generativelanguage.googleapis.com`: [Terms](https://ai.google.dev/gemini-api/terms), [Privacy Policy](https://policies.google.com/privacy)
* Groq, `api.groq.com`: [Terms](https://groq.com/terms-of-use/), [Privacy Policy](https://groq.com/privacy-policy/)
* Grok (xAI), `api.x.ai`: [Terms](https://x.ai/legal/terms-of-service), [Privacy Policy](https://x.ai/legal/privacy-policy)
* DeepSeek, `api.deepseek.com`: [Terms](https://cdn.deepseek.com/policies/en-US/deepseek-terms-of-use.html), [Privacy Policy](https://cdn.deepseek.com/policies/en-US/deepseek-privacy-policy.html)
* Mistral, `api.mistral.ai`: [Terms](https://mistral.ai/terms/), [Privacy Policy](https://mistral.ai/terms/#privacy-policy)

= Photo services =

While a page is designed, a short search phrase for each photo (such as "fresh bread on a counter")
is sent to the photo sources turned on in **Settings**. Nothing about your site or its visitors is
part of the search. Openverse is on by default and needs no key. Unsplash and Pexels are searched
only after you add their keys.

* Unsplash, `api.unsplash.com`, with your Unsplash key. Unsplash requires its photos to be shown
  from its own servers, so visitors' browsers load them from `images.unsplash.com`, and the plugin
  tells Unsplash when one of its photos is used. [Terms](https://unsplash.com/terms), [Privacy Policy](https://unsplash.com/privacy)
* Pexels, `api.pexels.com`, with your Pexels key. Its photos come from `images.pexels.com`. [Terms](https://www.pexels.com/terms-of-service/), [Privacy Policy](https://www.pexels.com/privacy-policy/)
* Openverse, `api.openverse.org`, no key. Its photos are hosted by the sites it indexes, such as
  Flickr and Wikimedia Commons. [Terms](https://docs.openverse.org/terms_of_service.html), [Privacy Policy](https://wordpress.org/about/privacy/)
* AI photos are made by the site's AI connector when it can make images, otherwise by OpenAI
  (`api.openai.com`) with your OpenAI key. The photo's description is sent, and the provider bills
  each image.

With **Save photos to the Media Library** on, the default, your server downloads each Pexels and
Openverse photo once and the page uses that copy. With it off, visitors' browsers load those photos
from the hosts above. AI photos are always saved to the Media Library. Photos are saved only for
users who may upload files. When no source finds a photo, a plain placeholder shipped with the
plugin is used, so nothing is requested.

= Google Fonts =

Off by default. When **Load brand fonts from Google Fonts** is on in **Settings**, the Brand kit's fonts are loaded
from `fonts.googleapis.com` in the editor and on pages that use them, which shows the visitor's IP
address to Google. [Google Privacy Policy](https://policies.google.com/privacy)

= Websites you read =

When you give a reference website, or fill in the Brand kit from a website, your server downloads
that page once, and up to three of its stylesheets from the same site, to read its colors, fonts,
layout and text. Only those addresses are requested.

== Source code ==

The scripts in `resources/build` are compiled from the TypeScript and CSS in `resources/scripts`
and `resources/styles`, which ship with the plugin together with the build tools: `package.json`,
`webpack.config.js`, `tsconfig.json`, `postcss.config.js`, `gulpfile.mjs` and the helpers in
`scripts/`. To rebuild them, install Node.js 20 or later and run `pnpm install` and
`pnpm run build` (npm works too). `pnpm run release` builds the release zip.

The plugin bundles these open-source libraries, served from the plugin's own folder. Their licences
are in `assets/vendor`.

* [Tailwind CSS browser build](https://github.com/tailwindlabs/tailwindcss) 4.3.3 (`assets/vendor/tailwindcss-browser.js`), MIT
* [tailwindcss-in-browser](https://github.com/balintbrews/tailwindcss-in-browser), MIT, compiled into `resources/build`
* [Lucide](https://github.com/lucide-icons/lucide) icons (`resources/data/icons.json`, made by `scripts/generate-icons.mjs`), ISC

== Frequently Asked Questions ==

= Do I need an API key? =

Not in this plugin, if your site runs WordPress 7.0 or later and has an AI set up in
**Settings → Connectors**: choose **This site's AI** on the Design desk. Otherwise, connect a provider
here with your own API key. Either way the provider bills you for what you use.

= Will it change my live pages? =

No. Every page is made as a draft. **Set as front page** and **Add to menu** on the Design desk
change the homepage and the menu when the page is published, and only when you leave them on.
On a block theme, **Also design the site header and footer** saves new header and footer template
parts straight away, because template parts have no drafts. You can go back to the theme's own
parts in the Site Editor.

= Can I edit the pages afterwards? =

Yes. They are ordinary pages built from blocks. Edit them in the block editor, or select a section
and ask for a change in the Pagewright sidebar.

= What happens when I uninstall the plugin? =

Its settings, Brand kit, API keys, chats and background jobs are deleted. The pages it made are kept.

== Screenshots ==

1. Describe a page on the Design desk. Pagewright plans it, writes each section in your Brand kit, finds photos, and saves a draft you can preview and edit.

== Changelog ==

= 1.0.1 =
* Fix: pages keep their Brand kit colors and fonts after their CSS is saved. Pages saved with 1.0.0 rebuild their CSS once.
* Fix: Openverse finds photos for the AI's photo descriptions. It now searches their key words instead of the whole sentence.

= 1.0.0 =
* First release.
