=== AgenticWP ===
Contributors: brettswindells
Tags: ai, gutenberg, content, automation, openai
Requires at least: 6.5
Tested up to: 6.9
Stable tag: 1.1.0
Requires PHP: 8.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI-powered content creation and editing for WordPress. Generate posts, images, and SEO metadata with a single prompt.

== Description ==

Struggling to publish consistently? AgenticWP turns one idea into a complete, SEO-ready blog post—with images, headings, and metadata—in minutes.

= Why AgenticWP? =

* **Writes like a human, works like a pro** – Creates real WordPress content with proper formatting, headings, and structure—not walls of plain text that need fixing
* **One prompt, complete articles** – Generates full posts with headings, images, and SEO metadata in minutes
* **Handles heavy lifting in the background** – Generate 10 blog posts while you keep working on other things
* **Your API key, your data** – No middleman servers, no usage tracking, no surprises on your bill

= AI Content Writing =

Save hours on content creation. Just describe what you want and get publish-ready posts:

* Generate complete blog posts with proper headings, paragraphs, and structure
* Edit existing content—simplify, expand, add examples, or change tone
* Translate posts into other languages with a single prompt
* Create content in bulk using background jobs
* Customize your writing style

= Image Generation =

Create unique images without leaving WordPress:

* Generate AI images using OpenAI's latest gpt-image-1.5 model
* Images automatically save to your Media Library
* Multiple size options for different use cases
* No external image tools or subscriptions needed

= SEO Tools =

Rank better without SEO expertise:

* Auto-generate meta descriptions that encourage clicks
* Add schema markup (BlogPosting, WebPage) for rich search results
* Internal linking suggestions to boost page authority
* Focus keywords and SEO metadata automation

= Bulk Operations =

Scale your content production:

* Queue multiple posts for background generation
* Monitor progress in the Background Jobs dashboard
* Automatic retry with exponential backoff for API limits
* Cancel or review jobs anytime

= Gamification =

Stay motivated and track your progress:

* Earn achievements for content milestones
* Level up as you create more content
* Track streaks and usage statistics
* View your progress on the dashboard

= Quick Start =

1. **Configure API Key** - Navigate to Settings → AgenticWP and enter your OpenAI API key
2. **Access Chat Interface** - Click the AgenticWP icon in the WordPress admin bar
3. **Create Content** - Enter a prompt like "Write a blog post about WordPress automation"
4. **Monitor Jobs** - View background task progress in Tools → Background Jobs
5. **Edit Content** - Open posts in the block editor, select blocks, and request changes via chat

= Requirements =

* WordPress 6.5 or higher
* PHP 8.0 or higher (PHP 8.3 recommended)
* Gutenberg block editor (Classic Editor not supported)
* Valid OpenAI API key from https://platform.openai.com/
* Outbound HTTPS access to api.openai.com
* Cron or WP-CLI for background job processing
* Recommended: 256MB+ PHP memory limit
* Multisite: Fully supported (each site needs its own API key)

= Configuration Settings =

After activation, configure these settings at Settings → AgenticWP:

* **OpenAI API Key** - Your API key from OpenAI (required)
* **Model** - Choose your OpenAI model (default: gpt-5-mini)
* **Reasoning Effort** - Computational effort level: low, medium, or high (default: medium)
* **Max Output Tokens** - Token limit per response (default: 32000) - adjust based on content length needs
* **Message History Limit** - Number of messages kept in conversation context (default: 50)
* **Toast Notifications** - Show visual feedback for background job progress (default: On)
* **Web Search** - Enable web search tool for research-backed content (default: Off)
* **Sample Prompts** - Pre-configured prompt templates for quick-start common tasks

= Usage Examples =

**For Content Editors:**

Creating new posts:
* "Create a tutorial about custom post types in WordPress"
* "Write a beginner's guide to WordPress hooks"

Editing existing content:
* Open a post, select blocks, then use chat: "Simplify this paragraph" or "Add bullet points"
* "Make this more concise"
* "Add code examples to this section"

Translation workflows:
* "Create a Spanish version of this post"

**For Administrators:**

* **Background Jobs Monitor** - Access Tools → Background Jobs to view, cancel, and review job results
* **API Key Management** - Securely store and update your OpenAI API key in Settings → AgenticWP

= Privacy & Data =

**This plugin does NOT collect telemetry or usage data.** All operations occur locally on your WordPress installation and via your OpenAI API account.

**What IS sent to OpenAI:**
* User prompts entered in the chat interface
* Post content when editing existing posts
* Post metadata (title, excerpt, custom fields if relevant to the task)
* Tool definitions for function calling

**What is NOT sent:**
* API keys or credentials
* User personal information (name, email, IP addresses)
* WordPress installation details or server information

**Data Retention:**
* Chat history is stored in WordPress transients for 24 hours
* Background jobs are limited to 100 entries (oldest removed when limit is reached)
* API logs are not stored by default; enable WP_DEBUG_LOG for debugging only

Content you send to OpenAI is subject to OpenAI's data usage policy. For enhanced privacy controls, review OpenAI's enterprise options.

= For Developers =

AgenticWP is built for extensibility. Customize and extend the plugin to fit your workflow:

* **GitHub Repository** – Report issues, contribute, or fork: https://github.com/brettswindells/agenticwp
* **12 AI Function Tools** – Content creation, editing, SEO, internal linking, and more
* **WordPress Hooks** – Filter AI responses, modify tool behavior, add custom tools
* **Documentation** – See the `/docs` folder for API reference and integration guides

= Credits =

* Action Scheduler - Background job processing (GPL-3.0)
* Chart.js - Interactive charts (MIT)
* DOMPurify - XSS sanitization (Apache-2.0 or MPL-2.0)
* Marked - Markdown parsing (MIT)

== Installation ==

1. Download the plugin ZIP file
2. Navigate to Plugins → Add New → Upload Plugin in your WordPress admin panel
3. Select the ZIP file and click "Install Now"
4. Click "Activate"
5. Navigate to Settings → AgenticWP
6. Enter your OpenAI API key
7. Configure your preferred model and settings
8. Click the AgenticWP icon in the admin bar to access the chat interface

== Screenshots ==

1. Chat interface - AI assistant panel accessible from the WordPress admin bar
2. Settings - AI Setup section with model selection and configuration options
3. Image Generator - Create AI images with templates and save to Media Library
4. Dashboard - Usage statistics, streaks, and gamification progress tracking
5. Achievements - Unlock badges and level up as you create content

== Frequently Asked Questions ==

= Getting Started =

**Do I need an OpenAI API key?**

Yes, AgenticWP requires your own OpenAI API key. Get one at https://platform.openai.com/api-keys. Using your own key means you pay OpenAI directly with no markup—you control your costs and usage limits.

**How do I get started?**

1. Install and activate the plugin
2. Go to Settings → AgenticWP and enter your OpenAI API key
3. Click the AgenticWP icon in the admin bar
4. Type a prompt like "Write a blog post about [your topic]"

**Does it work with my theme?**

Yes. AgenticWP works with any WordPress theme that supports the Gutenberg block editor, including classic themes, block themes, and Full Site Editing themes.

= Cost & Billing =

**How much does using AgenticWP cost?**

The plugin is free. You pay OpenAI directly for API usage based on the model you choose. Typical costs for a 1,000-word blog post range from $0.01-0.10 depending on the model. Set up billing limits in your OpenAI account to prevent unexpected charges.

**How much does image generation cost?**

Image generation uses OpenAI's gpt-image-1.5 model. Costs vary by quality and size—typically $0.02-0.19 per image. You can control costs by choosing appropriate quality settings.

**Will I get surprise bills?**

Not if you set up billing limits. Go to your OpenAI account settings and configure a monthly spending cap. AgenticWP shows you exactly what's being sent to the API so there are no hidden requests.

= Content Quality =

**Is AI-generated content good enough to publish?**

AI creates solid first drafts with proper structure and formatting. Most users review and add their personal voice before publishing. Think of it as having a skilled assistant write the framework—you add the finishing touches.

**Will my content be unique?**

Yes. Each piece is generated fresh based on your specific prompt. Unlike template-based tools, AI creates original content every time based on your direction. For extra confidence, run important posts through a plagiarism checker.

**Can AI write in my brand's voice?**

Yes. Describe your preferred tone in your prompts ("write in a casual, friendly tone" or "use formal business language"). You can also save custom sample prompts in settings to maintain consistency across posts.

**What if the AI makes mistakes?**

AI can occasionally produce inaccuracies, especially with statistics, dates, or niche topics. Always review AI-generated content before publishing, particularly for factual claims. This is why AgenticWP creates drafts, not published posts.

= Content Ownership & Copyright =

**Do I own the content AgenticWP creates?**

Yes. OpenAI's terms grant you ownership of content generated through their API. However, purely AI-generated content may not qualify for copyright protection in some jurisdictions. Adding your own edits and creative input strengthens your ownership claim.

**Can I use AI content commercially?**

Yes. There are no restrictions on using AI-generated content for business purposes, affiliate sites, or commercial blogs.

= SEO & Search Rankings =

**Will Google penalize AI content?**

No. Google has stated they focus on content quality, not how it was created. AI content that provides genuine value to readers is treated the same as human-written content. Low-quality spam is penalized regardless of who wrote it.

**Does AgenticWP help with SEO?**

Yes. The plugin can automatically generate meta descriptions, add schema markup (BlogPosting for posts, WebPage for pages), and suggest internal links to boost your site's search performance.

= Image Generation =

**How does image generation work?**

Open the Image Generator from the AgenticWP menu, describe what you want, and click generate. Images are created using OpenAI's latest gpt-image-1.5 model and automatically saved to your Media Library.

**Are AI-generated images unique?**

Yes. Each image is generated fresh from your prompt. You won't find duplicates elsewhere because they're created specifically for your request.

**What image sizes are available?**

Multiple sizes from square (1024×1024) to landscape and portrait orientations. Choose the size that fits your use case—featured images, social media, or in-content graphics.

**Can I use AI images commercially?**

Yes. OpenAI's terms allow commercial use of images generated through their API.

= Achievements & Gamification =

**What is the gamification system?**

AgenticWP tracks your content creation and rewards milestones. You'll earn achievements (like "First Steps" for your first draft, or "Prolific Publisher" for 50 posts), level up from Beginner to Legend, and build streaks for consistent usage.

**Where do I see my progress?**

Your dashboard shows your current level, achievements earned, usage statistics, and streak information. Access it from the AgenticWP settings page.

**Do achievements affect functionality?**

No. Gamification is purely motivational. All features work the same regardless of your level.

= Privacy & Security =

**Is my content private?**

AgenticWP doesn't collect any data. Your prompts and content are sent directly to OpenAI—no middleman servers, no analytics, no tracking. Review OpenAI's privacy policy for how they handle API data.

**Is this GDPR compliant?**

AgenticWP stores no personal data from your visitors. For content creation, your posts and prompts are sent to OpenAI's API. If you're in the EU, review OpenAI's data processing terms.

**Is my API key secure?**

Your API key is stored in your WordPress database and never transmitted anywhere except to OpenAI's servers for authentication.

= Compatibility =

**Does it require Gutenberg?**

Yes. AgenticWP generates proper WordPress blocks and requires the block editor. The Classic Editor plugin is not supported.

**Does it work with custom post types?**

Yes. Any post type using the Gutenberg block editor works with AgenticWP.

**Is Multisite supported?**

Yes. Each site in your network needs its own API key configured.

**Does it conflict with other plugins?**

AgenticWP works alongside most plugins. If you use aggressive caching or security plugins, you may need to exclude the AgenticWP REST API endpoints from optimization.

= Troubleshooting =

**What if content generation fails?**

Check these common issues:
1. Verify your API key is correct in Settings → AgenticWP
2. Ensure your server can reach api.openai.com (some hosts block outbound connections)
3. Check if you've exceeded your OpenAI spending limit
4. Review the Background Jobs interface for specific error messages

**What happens if a background job fails?**

Jobs automatically retry with increasing delays (5s → 10s → 20s). If all retries fail, you'll see the error in Tools → Background Jobs. Most failures are temporary API limits that resolve on their own.

**Where can I get help?**

Visit the [support forum](https://wordpress.org/support/plugin/agenticwp/) for questions and bug reports.

== Changelog ==

= 1.0.0 =
* Initial release
* Core: AI chat interface with multi-agent system
* Content: Block-aware post creation and editing
* Images: AI image generation with media library integration
* SEO: Meta descriptions, schema markup, internal linking
* Engagement: Usage stats, achievements, and gamification
* Admin: Background jobs monitor, action manager

== Upgrade Notice ==

= 1.0.0 =
Initial release of AgenticWP. Requires WordPress 6.5+ and PHP 8.0+.
