=== Agent Builder ===
Contributors: agenticplugin
Tags: AI, LLM, automation, chatbot, AI agent
Requires at least: 6.4
Tested up to: 6.9
Requires PHP: 8.1
Stable tag: 1.6.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Donate link: https://agentic-plugin.com/donate

Build AI agents for WordPress without coding. Automate content creation, SEO, chat, and more with OpenAI, Anthropic Claude, and other LLMs.

== Description ==

Agent Builder turns WordPress into an AI-agent ecosystem — similar to how plugins and themes extend your site, but powered by large language models (LLMs).

Describe your desired AI agent in natural language, and the plugin builds it for you. Install, activate, and manage agents just like regular plugins. Browse a growing library of community agents or create your own.

Key benefits:
- No-code agent creation via chat interface
- Multi-provider support: OpenAI, Anthropic (Claude), local models (Ollama), and more
- Plugin-style management: install, activate, deactivate, delete
- Built-in safeguards: audit logs, human-in-the-loop approvals, rate limiting, cost controls
- Extensible: developers can build custom agents with tools and share them

= Agent Categories =
- **Content** — Drafting, SEO optimization, translation, alt text generation
- **Admin** — Security monitoring, backups, performance tuning
- **E-commerce** — Product management, pricing optimization, inventory
- **Frontend** — Visitor chat, comment moderation, support
- **Developer** — Code generation, debugging, theme/plugin building
- **Marketing** — Campaigns, multi-platform content

= Requirements =
- WordPress 6.4+
- PHP 8.1+
- MySQL 8.0 / MariaDB 10.6+

== Installation ==

1. Search for "Agent Builder" in **Plugins → Add New** and install it (or upload the ZIP via **Add New → Upload Plugin**).
2. Activate the plugin.
3. Go to **Agentic → Settings** in the WordPress admin menu.
4. Enter your AI provider API key (OpenAI, Anthropic, etc.) or configure local models.
5. Visit **Agentic → Agents** to browse/install pre-built agents.
6. Activate any agent to enable its features on your site.

== Frequently Asked Questions ==

= How does this differ from regular WordPress plugins? =
Agents are AI-powered automations that follow a standardized structure. They register tools the LLM can call, integrate with approval workflows, and are managed like plugins (activate/deactivate/delete).

= Can I create my own agents? =
Yes. Create an `agent.php` file with standard headers, register tools/functions, and place it in `wp-content/agents/`. The plugin auto-discovers them. Share your agents with the community!

= Where do custom agents go? =
Place custom agents in `wp-content/agents/` (outside the plugin folder). This keeps them safe during updates. Bundled demo agents live in the plugin's `library/` folder.

= Is my data sent to external AI services? =
Only if using cloud providers (OpenAI, Anthropic, etc.). Use local models via Ollama for full privacy. All external calls are logged and rate-limited.

= Is it production-ready? =
Version 1.1.0+ is stable with strong security (no exec(), nonces, escaping), GDPR-compliant uninstall, and audit logging. Test thoroughly on staging first.

= Which AI providers work? =
xAI (GROK), OpenAI (GPT models), Anthropic (Claude), local Ollama models. More coming soon.

== Screenshots ==

1. Intuitive chat interface for describing and building new AI agents.
2. Agent library screen — browse, install, and manage your agents with one click.
3. Settings page to configure your preferred AI provider, API keys, rate limits, and approvals.
4. Detailed agent controls — permissions, security, and audit log viewer.

== Changelog ==

= 1.6.0 - 2026-02-11 =
* Added: Two-zone architecture — plugin/repo code vs user-space changes.
* Added: Agent_Permissions class with 6 granular permission scopes (all disabled by default).
* Added: Agent_Proposals class for pending change confirmation with diff view.
* Added: write_file tool — create/modify files in active theme or agentic-custom sandbox.
* Added: modify_option tool — set/delete WordPress options (sensitive options blocked).
* Added: manage_transients tool — list, delete, or flush transients.
* Added: modify_postmeta tool — get, set, or delete post meta fields.
* Added: Settings Permissions tab with scope toggles and confirmation mode selector.
* Added: Chat proposal cards with syntax-highlighted diff view and Approve/Reject buttons.
* Added: REST API POST /proposals/{id} endpoint for proposal approve/reject.
* Added: File backup system (wp-content/agentic-backups/) before user-space writes.
* Security: Sensitive core options blocked (siteurl, home, admin_email, passwords, API keys).
* Security: All user-space permissions disabled by default with opt-in confirmation mode.
* Tests: 434 tests, 1,172 assertions (48 new tests for permissions, proposals, user-space tools).

= 1.5.0 - 2026-02-11 =
* Added: Event listeners — agents react to WordPress action hooks in real time.
* Added: Agent_Base::get_event_listeners() for defining hook-triggered behaviour.
* Added: Direct mode event listeners — synchronous PHP callback on hook fire.
* Added: AI Async mode — queues LLM task via wp_schedule_single_event() (non-blocking).
* Added: Smart serialization of hook arguments (WP_Post, WP_Comment, WP_User auto-converted).
* Added: Event Listeners admin page showing agent, hook, priority, mode, status.
* Added: Outcome logging for events (triggered/complete/error with timing).
* Added: Security Monitor event listeners for failed logins and new user registration.

= 1.4.0 - 2026-02-10 =
* Added: Scheduled tasks infrastructure — agents define recurring tasks via get_scheduled_tasks().
* Added: Autonomous cron execution — tasks with prompt field route through LLM with full tool access.
* Added: Generic outcome logging — every task execution wrapped with start/complete/error timing.
* Added: Schedule management core tool (list/pause/resume) available to all agents.
* Added: Agent Tools admin page showing all tools across all agents.
* Added: Scheduled Tasks admin page with Run Now button, mode (AI/Direct), and status.
* Improved: Audit log timestamps, expandable details, dynamic filters, 30-day retention.
* Improved: Agent responses logged in chat_complete audit entries.
* Added: Security Monitor autonomous daily security scan with LLM reasoning.

= 1.3.0 - 2026-02-09 =
* Added: Comprehensive test suite — 346 tests, 881 assertions, all passing.
* Added: Add Agents page overhaul — upload feature (ZIP handler), WP-style card layout.
* Added: CI/CD via GitHub Actions workflow.
* Fixed: 8 source bugs found during test implementation.
* Fixed: All WordPress naming convention violations — 100% compliant.
* Fixed: Prefixed all global variables in admin templates.
* Improved: Code quality and WordPress.org submission readiness.

= 1.1.2 - 2026-02-02 =
* Fixed: Automatic API key saving when returning from marketplace registration
* Improved: Revenue page messaging with link to licensing documentation

= 1.1.1 - 2026-02-02 =
* Added marketplace dashboard stats widget with latest/popular agents and developer revenue.
* Added plugin license validation system (Free/Pro/Enterprise tiers).
* Added developer API key management in Settings with Update Key and Disconnect options.
* Added automatic API key pre-fill when returning from marketplace registration.
* Added support ticketing system integration across all admin pages.
* Implemented Revenue page with full marketplace API integration and Chart.js visualizations.
* Updated dashboard with improved UI, proper timestamps, and marketplace stats.
* Fixed active agent count to show accurate numbers from database.
* Removed obsolete license validation code from marketplace access.
* Created comprehensive API specification documents for marketplace team.

= 1.1.0 - 2026-02-01 =
* Added full GDPR-compliant uninstall handler (deletes options, tables, transients, user meta, crons).
* Added phpcs.xml and VS Code settings for WordPress Coding Standards.
* Improved: Complete @package/@since/@license headers in all PHP files.
* Improved: Renamed classes/files for better naming consistency (e.g., class-llm-client.php).
* Fixed: SQL formatting, unused parameters, nonce ignores, reserved keywords.
* Removed: Obsolete Python fix scripts.

= 1.0.1 - 2026-01-30 =
* Fixed remaining PHPCS issues.
* Improved documentation and inline comments.

= 1.0.0 - 2026-01-28 =
* Added full i18n support (Spanish, French, German .po/.mo files).
* Achieved full WordPress Coding Standards compliance (7,246 auto-fixes).
* Security: Removed all exec() and potential vulnerabilities.
* Simplified namespace to "Agentic".
* Added System Requirements Checker.
* Brand consistency updates ("Agent Builder").

= 0.1.3-alpha - 2026-01-28 =
* Added System Requirements Checker.
* Simplified namespace and plugin naming.

= 0.1.2-alpha - 2026-01-15 =
* Introduced Async Job Queue for background tasks.
* Added real-time progress tracking and job management API.

= 0.1.0-alpha - 2026-01-01 =
* Initial public alpha.
* Core no-code agent builder.
* 10 bundled agents.
* Admin dashboard and multi-LLM support.
* Human-in-the-loop approvals and audit trails.
* Marketplace foundation.

== Upgrade Notice ==

= 1.6.0 =
New: Two-zone user-space permissions and proposals. Agents can now write theme files, modify options, manage transients, and update post meta — all permission-gated with confirmation diffs. No breaking changes.

= 1.5.0 =
New: Event listeners let agents react to WordPress hooks (login failures, new users, etc.). No breaking changes.

= 1.4.0 =
New: Scheduled tasks with autonomous AI execution, tools admin, and audit log improvements. No breaking changes.

= 1.3.0 =
Test suite added (346 tests). Add Agents page overhauled. 8 bugs fixed. No breaking changes.

= 1.1.0 =
Important: GDPR-compliant uninstall added. No data loss or breaking changes. Recommended update for all users.

= 1.0.0 =
First stable release. Smooth upgrade — no migrations needed. Full standards compliance and security hardening.

= 0.1.x-alpha =
Early development versions. Upgrade to 1.0.0+ for stability, i18n, and security fixes.