=== Lyra AI ContentBuilder ===
Contributors: nicoquindt
Tags: ai, content generation, openai, page builder, ai writer
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 8.1
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Generate WordPress post and page drafts using AI. Write a prompt — the AI builds the content for you.

== Description ==

**Lyra AI ContentBuilder** adds an AI-powered content generator to your WordPress admin. Instead of dragging blocks, copying text, and formatting manually, you write a prompt describing what you want — and the AI generates a complete, styled HTML draft ready to review and publish.

= How it works =

1. Go to **Lyra AI ContentBuilder → AI Generator**.
2. Write a prompt describing the page or post you want.
3. Choose between Post or Page.
4. Click **Generate draft** — the AI creates a fully structured HTML draft with headings, sections, and inline styles.
5. Review and edit in the built-in editor, then publish.

= Key features =

* **Prompt-based generation** — describe what you want in plain language, in any language.
* **Any OpenAI model** — use the model that fits your budget and quality needs. We suggest gpt-4o-mini to keep costs low, but you decide.
* **Encrypted API key storage** — your OpenAI API key is stored encrypted in the WordPress database. It is never exposed in the page source or logs.
* **Draft-only workflow** — content is always saved as a draft. Nothing is published without your review.
* **Built-in editor** — review and adjust AI-generated content before publishing.
* **Clean HTML output** — generated content is sanitized before saving. No scripts, no iframes, no unsafe attributes.
* **Works in any language** — the AI responds in the same language you write your prompt in.

= You need your own OpenAI API key =

This plugin does not include API credits. You need a valid API key from [OpenAI](https://platform.openai.com/api-keys). The plugin guides you through the setup process.

OpenAI charges are based on usage and are billed directly by OpenAI to your account. The plugin recommends gpt-4o-mini as the most economical option.

= Third-party services =

This plugin connects to the **OpenAI API** (https://api.openai.com) to generate content based on your prompts. Your prompt text is sent to OpenAI's servers for processing.

* [OpenAI Privacy Policy](https://openai.com/privacy)
* [OpenAI Terms of Use](https://openai.com/terms)

By using this plugin you agree to OpenAI's terms of service and privacy policy.

= Privacy =

* Your API key is stored encrypted in the WordPress database using PHP sodium or OpenSSL.
* Prompts you submit are sent to OpenAI for processing. No data is sent to any other third-party server.
* The plugin does not collect, store, or transmit any analytics or usage data.

= Looking for more? =

**AI Builder Pro** (coming soon) adds:

* Connect to additional AI providers: Anthropic (Claude), Google (Gemini), and more.
* Bulk generation — generate multiple drafts from a list of prompts at once.
* AI image generation and automatic featured image assignment.
* Prompt templates — save and reuse your best prompts.
* Generation history — track every draft generated, with provider and model info.
* Custom system prompts — fine-tune how the AI writes for your site.
* Built-in AI SEO editor — analyze and optimize title, meta description, and keywords without third-party plugins.

== Installation ==

= Automatic installation =

1. Go to **Plugins → Add New** in your WordPress admin.
2. Search for **Lyra AI ContentBuilder**.
3. Click **Install Now**, then **Activate**.
4. Go to **Lyra  ContentBuilder → Settings** and enter your OpenAI API key.

= Manual installation =

1. Download the plugin zip file.
2. Go to **Plugins → Add New → Upload Plugin**.
3. Upload the zip file and click **Install Now**, then **Activate**.
4. Go to **Lyra AI ContentBuilder → Settings** and enter your OpenAI API key.

= Requirements =

* WordPress 6.2 or higher
* PHP 8.1 or higher
* A valid OpenAI API key ([get one here](https://platform.openai.com/api-keys))
* HTTPS recommended (required for secure API key handling)

== Frequently Asked Questions ==

= Does the plugin include its own API credits? =

No. You need your own OpenAI API key. OpenAI charges are billed directly to your OpenAI account based on usage. We recommend gpt-4o-mini as the most economical model.

= Is my API key secure? =

Your API key is encrypted before being stored in the WordPress database using PHP's sodium extension (or OpenSSL as fallback). It is never output in page source, HTTP responses, or debug logs.

= Does the plugin publish content automatically? =

No. All generated content is saved as a **draft**. You review and edit it in the built-in editor before publishing.

= What languages does the plugin support? =

The AI responds in the same language you write your prompt in. There is no language restriction.

= Which OpenAI model should I use? =

For most use cases, **gpt-4o-mini** offers the best balance of quality and cost. The plugin lets you choose any valid OpenAI model — you are not restricted to a specific one.

= What happens to my content if I uninstall the plugin? =

Drafts created by the plugin remain in your WordPress database as regular posts/pages. The plugin's options and post meta are removed on uninstall, but your content is preserved.

= Is there a Pro version? =

Yes, AI Builder Pro is in development. It adds support for multiple AI providers, bulk generation, image generation, prompt templates, generation history, custom system prompts, and a built-in AI SEO editor.

== Changelog ==

= 1.0.0 =
* First public release.
* Prompt-based HTML draft generation via OpenAI API.
* Encrypted API key storage (sodium / OpenSSL fallback).
* Any OpenAI model selectable by the user.
* Built-in editor for reviewing generated content.
* Clean HTML sanitization before saving.
* Extension hooks for AI Builder Pro compatibility.
* Full internationalization support.

== Upgrade Notice ==

= 1.0.0 =
First public release. No upgrade required.
