=== AutoArticle AI by OnlyAIMatters ===
Contributors: onlyaimatters
Tags: ai content generator, autoblogging, auto publish, ai writer, seo
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 2.5.408
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: autoarticle-ai-onlyaimatters
Domain Path: /languages

Auto-generating SEO-optimized articles using AI with multi-agent pipeline, smart internal linking, and 40+ language support.

== Description ==

AutoArticle AI by OnlyAIMatters creates intelligent content agents that automatically research, write, and publish SEO-optimized articles on your WordPress site.

= Features =

* **Multi-Agent AI Pipeline** — Create multiple autonomous agents, each with independent niches, schedules, and writing styles
* **Smart Internal Linking** — 90-day article memory enables context-aware internal linking between related articles
* **40+ Languages** — Full localization support with automatic language detection
* **Real-Time News Research** — Google Trends + Bing News integration for fresh, trending topics
* **SEO Optimization** — Automatic focus keywords, meta descriptions, schema markup, Open Graph tags
* **Telegram Bot Control** — Run agents remotely with /run, /pause, /resume commands (Pro feature)
* **AI Image Generation** — DALL-E integration for featured images (Pro feature)
* **Content Calendar** — Plan and schedule articles in advance (Pro feature)

= How It Works =

1. **Create an Agent** — Define your niche (IPL, Tech, Cricket, etc.), language, and schedule
2. **Set Schedule** — Choose how often to generate (hourly, daily, weekly)
3. **Auto-Run** — Agents pick fresh topics from RSS feeds or news sources, write articles, publish
4. **Review & Edit** — Approve, edit, or schedule manually before publishing

= Supported AI Models =

Claude Haiku 4.5, GPT-4.1, GPT-4.1 Mini, GPT-5, Perplexity Sonar Pro, Perplexity Sonar, and Gemini 2.5 Flash — all routed via the AutoArticle AI API for simplicity.

= Requirements =

A free AutoArticle AI account at [autoarticleai.com](https://autoarticleai.com) is required. Article generation consumes coins (0.75 coins per article). New accounts receive free starter coins to test the plugin.

== Installation ==

1. Upload the `autoarticle-ai-onlyaimatters` folder to `/wp-content/plugins/`
2. Activate "AutoArticle AI by OnlyAIMatters" in WordPress Plugins menu
3. Visit **AutoArticle AI → Settings** and enter your API key from [autoarticleai.com/dashboard](https://autoarticleai.com/dashboard)
4. Create your first agent at **AutoArticle AI → Agents**
5. Click **Run Now** to generate your first article, or configure a schedule for automatic generation

== Frequently Asked Questions ==

= Does this work with any WordPress theme? =

Yes, the plugin is theme-independent and works with any WordPress theme, including Twenty Twenty-Four, Astra, OceanWP, Divi, and custom themes.

= What AI models are supported? =

Claude Haiku 4.5, GPT-4.1, GPT-4.1 Mini, GPT-5, Perplexity Sonar Pro, Perplexity Sonar, and Gemini 2.5 Flash. All models are routed through the AutoArticle AI API — no separate API keys required.

= Do I need my own API keys? =

No, the plugin connects to your AutoArticle AI account. Just get your API key from autoarticleai.com/dashboard and add it in Settings. Pro users can optionally configure custom model endpoints.

= Can I edit the articles before publishing? =

Yes, you can review and edit all articles before they're published. Agents can be configured to save as Draft, Pending Review, or Publish automatically based on your preference.

= How often can articles be generated? =

You can schedule agents to run every hour, every 6 hours, daily, or weekly. There's no limit on the number of agents you can create.

= Does this work with RankMath or Yoast SEO? =

Yes, the plugin automatically adds focus keywords, meta descriptions, schema markup, Open Graph tags, and Twitter cards that RankMath and Yoast SEO can use. It works with both plugins active or standalone.

= What languages are supported? =

40+ languages including English, Spanish, French, German, Hindi, Portuguese, Japanese, Chinese, Arabic, Italian, Russian, Korean, Dutch, Polish, Turkish, and more.

= Is there a free trial? =

Yes, new accounts receive free starter coins to test the plugin. Each article costs 0.75 coins.

= Where does the plugin get article topics from? =

Agents can source topics from:
1. **RSS feeds** — Your curated RSS feeds (primary source)
2. **Smart News** — Google Trends, Google News, and Bing News (supplemental)
3. **Manual topics** — Enter custom topics via Telegram bot or admin panel
4. **Source URLs** — Provide a URL and the AI will write an inspired article

= How does the internal linking work? =

The plugin maintains a 90-day memory table of all published articles. When generating new articles, it analyzes this memory to find contextually relevant articles and inserts internal links automatically.

= Can I disable all external communication? =

Yes. Add this to your `wp-config.php` to disable all telemetry:

`add_filter( 'aaai_disable_telemetry', '__return_true' );`

Note: This will disable coin balance sync but article generation will continue to work (requires API key).

== Screenshots ==

1. Dashboard overview showing all agents with status indicators and recent articles table
2. Agent creation wizard with model selection, niche configuration, and schedule settings
3. Settings page with API key configuration, site identity, and featured image settings
4. Generated article in WordPress editor with SEO meta box and internal links applied

== Changelog ==

= 2.5.292 =
* **FIX:** Post log now shows actual status — quality-gated drafts are labeled "Saved as draft (quality gate)" instead of misleadingly showing "Auto-published"

= 2.5.291 =
* **FIX:** Guaranteed topic bank — entity and concept indices are now decoupled (per-agent offset), ending nonsensical pairings like "Mohamed Salah's defensive line Role" or "Kubernetes cost efficiency Posture"
* **FIX:** Additional keyword stopwords (hallucinations, scandal, controversy, crisis)

= 2.5.290 =
* **FIX:** HEADLINE: prefix leak — when the server wraps its response as `"HEADLINE: ..."` (with a leading quote), the prefix now gets stripped after quote-trimming instead of surviving into the published post title
* **FIX:** Keyword stopword list expanded with 15 more generic nouns (hiring, safety, security, content, study, research, paper, report, analysis, growth, strategy, etc.)

= 2.5.289 =
* **FIX:** Keyword auto-derivation now rejects single generic words (cost, price, platform, audi, etc.) via expanded stopword list + 1.2% density cap — stops junk focus keywords that trigger SEO warnings
* **FIX:** Smashed-keyword scrubber no longer splits single-word brands like "whatsapp" into "Whats App" — only space-recovers keywords with 10+ alpha chars (true smashed compounds)
* **FIX:** Model-metadata topic leak rejected — topics like "google/gemini-2.5-flash-lite Generated Content" are caught and treated as empty (triggers retry/evergreen fallback)
* **FIX:** Keyword injection fallback log no longer false-alarms — only logs failure when no paragraph is genuinely found

= 2.5.288 =
* **FIX:** Writer-model validator allowlist expanded from 6 to 15 models — imported agents with newer models (Sonnet 5, Grok 4.5, Gemini 3.6, etc.) no longer silently reset to gpt-4.1-mini
* **FIX:** 11 cron handlers poison-proofed with try/catch — a crash in style learner, wiki sync, memory prune, lesson decay, daily evolve, SERP analysis, feedback prune, manual-post scan, lesson housekeeping, backup, or recovery can no longer block the rest of the WP-Cron queue
* **FIX:** `aaai_topic_models` filter now applied via `apply_filters` — Pro plugin's topic-model extension (perplexity/sonar-pro) is no longer dead code
* **FIX:** Request-dedup cache fingerprint now includes `task`, `hyper_accuracy`, and `rss_feeds` — calls with different flags no longer collide and return stale cached results
* **FIX:** Topic-model fallback corrected to `gemini-3.5-flash-lite` (was stale `gpt-4.1-nano`)
* **FIX:** Duplicate topic-model entries removed from allowlist

= 2.5.287 =
* **FIX:** Niche gate now FAILS CLOSED — if the domain/quality verdict call errors, the topic is rejected instead of sailing to the writer (stops off-niche stories like politics on a Cricket agent when the gate model hiccups)

= 2.5.286 =
* **FIX:** Punctuation artifact scrub — catches glued comma/period artifacts like "Also,." in the final HTML before publish
* **FIX:** Paragraph splitter — oversized body paragraphs (>55 words) are now broken into shorter, scannable blocks at sentence boundaries
* **FIX:** Guardian catch-up now runs the agent synchronously in-process when the loopback ping fails (hosts blocking server self-requests) — automatic generation continues even with dead WP-Cron + dead loopback
* **FIX:** Cron-queue poison-proofing — account sync, full backup, topic prefetch, scheduled publish, set-images, and article-refresh handlers are crash-safe and self-re-arm; one throwing event can no longer block every other cron
* **FIX:** Post-outage recovery on upgrade — clears the sync circuit breaker, both sync locks, and stale per-agent run locks/mutexes

= 2.5.285 =
* **FIX:** Guardian ping now blocking with failure logging + synchronous in-process fallback so agents fire even when loopback HTTP is blocked
* **FIX:** Cron handlers wrapped in try/catch (account sync, full backup, topic prefetch, scheduled publish, set images, refresh articles)

= 2.5.153 =
* **BREAKING CHANGE:** FAQ generation now OPT-IN (disabled by default). Enable via "Add FAQ Section" checkbox in agent settings.
* **FIX:** Removed "FAQ TOPICS" from outline generation prompt (FAQs no longer forced)
* **FIX:** FAQ completion calls now respect agent setting (no longer run globally)
* **FIX:** Changed default `add_faq_section` from 1 to 0 (opt-in instead of opt-out)

= 2.0.0 =
* **Version alignment:** Unified plugin header, readme Stable tag, and AAAI_VERSION constant to 2.0.0
* **Compatibility:** Tested up to WordPress 6.7
* **Code quality:** Removed disabled/dead code blocks (v2 encryption stubs, disabled sync lock functions)
* **Code quality:** Debug error_log calls now gated behind WP_DEBUG constant

= 1.3.1 =
* **CRITICAL FIX:** Word count now properly enforced - content exceeding 120% of target is rejected
* **CRITICAL FIX:** Reduced max_tokens calculation to prevent excessive content generation (30% reduction)
* **CRITICAL FIX:** Route fallback messages (OpenAI/Anthropic failed) now filtered as diagnostic
* **FIX:** Agents no longer auto-pause due to intermediate route failures

= 1.3.0 =
* **FIX:** Pro tags now hidden in free version — only shown when Pro plugin is active
* **CRITICAL FIX:** Agents no longer auto-pause when adaptive recovery succeeds
* **FIX:** Consecutive failure counter now properly reset after successful recovery
* **IMPROVEMENT:** More precise diagnostic filtering for Writer retry messages

= 1.2.9 =
* **PRICING FIX:** Updated gpt-4.1-mini pricing to 0.3 coins for 400 words (was 2 coins) - 6.67x cheaper!
* **PRICING FIX:** Updated claude-haiku-4-5-20251001 pricing to match server rates
* **FIX:** Dashboard cost estimates now accurately reflect server-side coin deductions
* **IMPROVEMENT:** Server-side pricing updated with word-count tiers for all models

= 1.2.3 =
* **CRITICAL FIX:** Updated sync endpoint from /api/v1/account-sync (doesn't exist) to /api/v1/credits (working endpoint)
* **CRITICAL FIX:** Updated response parsing to handle actual API format: { "coins": 100.50, "pro": true }
* **CRITICAL FIX:** Fixed 0 coin balance issue by using correct API endpoint
* **Improvement:** Added Pro status detection from API response

= 1.2.2 =
* **CRITICAL FIX:** Restored missing aaai_run_account_sync() function that was causing fatal errors
* **CRITICAL FIX:** Reverted API key encryption to v1 (AUTH_KEY-based) - fixes 401 authentication errors
* **CRITICAL FIX:** Disabled v2 encryption functions that were incompatible with existing keys
* **CRITICAL FIX:** Updated sync function to use AAAI_API_VERSION constant (1.3.9)
* **CRITICAL FIX:** Enhanced coin balance parsing with support for multiple API response formats
* **CRITICAL FIX:** Added enhanced logging for debugging coin balance issues
* **Fix:** Removed all disabled helper functions (sync locks, circuit breakers) that were causing syntax errors
* **Fix:** Properly commented out v2 encryption functions to prevent brace mismatches

= 1.2.1 =
* **CRITICAL FIX:** Removed debug log line causing "bad topic returned" error
* **CRITICAL FIX:** Added immediate coin balance sync on plugin activation
* **Improvement:** Enhanced logging for coin balance debugging
* **Improvement:** Better error messages when API returns unexpected response format
* **Fix:** Variables undefined error in topic generation resolved

= 1.2.0 =
* **CRITICAL FIX:** Enhanced coin syncing with plugin-specific encryption (fixes AUTH_KEY dependency issues)
* **NEW:** Exponential backoff retry logic (2s → 4s → 8s delays with jitter)
* **NEW:** Request locking mechanism to prevent concurrent sync operations
* **NEW:** Circuit breaker pattern (pauses sync after 5 consecutive failures)
* **NEW:** User-friendly admin notices for connection status and stale balances
* **NEW:** Enhanced logging with request IDs and timing metrics
* **NEW:** Graceful degradation with offline mode support
* **NEW:** Manual sync buttons with real-time feedback
* **Improvement:** Increased timeout from 20s to 30s for shared hosting compatibility
* **Improvement:** SSL verification can be customized via filter
* **Improvement:** API key migration support for existing installs
* **Improvement:** Connection status tracking with failure counters
* **Security:** All API keys encrypted with plugin-specific key (not AUTH_KEY)
* **Security:** Key rotation mechanism with backup key storage
* **WordPress.org:** Full compliance with no hardcoded credentials

= 1.1.2 =
* New: Performance optimization with deduplication caching (50-70% faster)
* New: Quality gate system with 7-point quality check (80% threshold)
* New: Quality badge column in posts list
* Fix: API connection settings card added
* Fix: Supermemory key saving fixed
* Fix: Hardcoded backup key removed for WordPress.org compliance
* Improvement: Code organization and documentation


= 1.1.1 = Fix: Added API key connection settings card that was missing in 1.1.0
* Fix: Resolved supermemory key saving issue (aggressive sanitization was stripping special characters)
* Fix: Removed hardcoded backup API key for WordPress.org compliance
* Improvement: Performance optimization added (deduplication caching, 50-70% faster)
* Improvement: Quality gate added (7-point quality check before auto-publish)
* Fix: Version bump for proper WordPress upgrade detection (1.1.0 → 1.1.1)

= 1.1.0 =
* New: Multi-agent pipeline with independent schedules and niches
* New: Smart internal linking from 90-day article memory
* New: Telegram bot control (Pro feature)
* New: AI image generation with DALL-E (Pro feature)
* New: Content calendar and scheduling (Pro feature)
* Improvement: Folder structure standardized for WordPress.org compatibility
* Improvement: All external API calls disclosed in readme

= 1.0.0 =
* Initial release of AutoArticle AI by OnlyAIMatters
* Multi-agent AI article pipeline with autonomous topic research, writing, SEO, and publishing
* RankMath integration: focus keywords, meta descriptions, Open Graph, Twitter cards, schema markup
* 40+ language support
* Google Trends and Bing News topic sourcing
* 90-day article memory and smart deduplication
* Publish window scheduling
* Agent wiki — persistent per-agent knowledge base

== Upgrade Notice ==

= 1.0 to 1.1.1 =

Recommended update. Fixes critical API key and supermemory issues. All settings preserved. Verify API key in Settings post-upgrade.

= 1.1.0 to 1.1.1 =

Critical update. Fixes API connection settings, supermemory key saving, adds deduplication caching and quality gate. Verify API key post-upgrade.

== Privacy Policy ==

This plugin communicates with the following external services. Data is only transmitted when you have configured an API key and actively use the relevant features.

= External Services Disclosed =

**1. AutoArticle AI API (autoarticleai.com)**

*Used for:* All AI article generation, topic research, SEO metadata, and license validation.

*Data sent:*
- Article topics and content for AI processing
- License key for account validation
- Domain name for license binding
- Agent configuration (niches, schedules, models)
- Generated article titles and metadata for dashboard storage

*Data stored locally (WordPress database):*
- Article generation logs (wp_options table, 90-day retention)
- Article memory for internal linking (custom table, 365-day retention)
- Agent configurations and settings (until uninstall)
- API license information (encrypted)

*Triggered when:* An agent runs on its schedule, or when "Generate Now" is used manually.

*Required:* Yes — Core functionality requires this service.

*Data retention:* Article logs auto-delete after 90 days. Memory table auto-deletes after 365 days.

*Terms of Service:* https://autoarticleai.com/terms
*Privacy Policy:* https://autoarticleai.com/privacy

---

**2. Anthropic Claude API (api.anthropic.com)**

*Used for:* Claude AI models (Haiku, Sonnet, Opus) for article writing and topic research.

*Data sent:* Article prompts, research queries, and content generation requests.

*Triggered when:* An agent uses a Claude model (GPT-4.1 Haiku is default).

*Required:* Yes — Used via AutoArticle AI API routing.

*Privacy Policy:* https://www.anthropic.com/legal/privacy

---

**3. OpenAI API (api.openai.com)**

*Used for:* GPT models (GPT-4.1, GPT-4.1 Mini, GPT-5) for article writing.

*Data sent:* Article prompts and content generation requests.

*Triggered when:* An agent uses a GPT model.

*Required:* Yes — Used via AutoArticle AI API routing.

*Privacy Policy:* https://openai.com/policies/privacy-policy

---

**4. Perplexity API (api.perplexity.ai)** — *Pro Feature*

*Used for:* Perplexity Sonar models for real-time web research and fact-checking.

*Data sent:* Research queries and fact-checking requests.

*Triggered when:* Pro user selects Perplexity Sonar model.

*Required:* No — Optional for Pro users.

*Privacy Policy:* https://www.perplexity.ai/legal/privacy

---

**5. DALL-E / OpenAI Images (images.dalle.ai)** — *Pro Feature*

*Used for:* AI-generated featured images.

*Data sent:* Image generation prompts based on article topic.

*Triggered when:* Pro user enables AI image generation.

*Required:* No — Optional for Pro users.

*Privacy Policy:* https://openai.com/policies/privacy-policy

---

**6. Telegram Bot API (api.telegram.org)** — *Pro Feature*

*Used for:* Sending publish notifications and accepting slash-commands.

*Data sent:* Article title, URL, word count, and agent name.

*Triggered when:* Pro user configures Telegram Bot token.

*Required:* No — Optional for Pro users.

*Privacy Policy:* https://core.telegram.org/api/privacy

---

**7. Google Trends (trends.google.com)**

*Used for:* Fetching trending topics for article ideas.

*Data sent:* Search queries based on agent niche.

*Triggered when:* Agent has "Smart News" enabled and RSS feeds are empty.

*Required:* No — Falls back to manual RSS feeds if disabled.

*Privacy Policy:* https://policies.google.com/privacy

---

**8. Google News (news.google.com)**

*Used for:* Fetching recent news headlines as article topics.

*Data sent:* Search queries based on agent niche.

*Triggered when:* Agent has "Smart News" enabled and RSS feeds are empty.

*Required:* No — Falls back to manual RSS feeds if disabled.

*Privacy Policy:* https://policies.google.com/privacy

---

**9. Bing News API (api.bing.com)**

*Used for:* Fetching recent news headlines as article topics.

*Data sent:* Search queries based on agent niche.

*Triggered when:* Agent has "Smart News" enabled and RSS feeds are empty.

*Required:* No — Falls back to manual RSS feeds if disabled.

*Privacy Policy:* https://privacy.microsoft.com/en-US/privacystatement

---

**10. Pexels API (api.pexels.com)**

*Used for:* Fetching royalty-free featured images.

*Data sent:* Search keyword derived from article topic.

*Triggered when:* Image fetching enabled and Unsplash image not found.

*Required:* No — Can disable image fetching.

*Terms of Service:* https://www.pexels.com/terms-of-service/

---

= User Rights =

* **Opt-out:** You can disable all external communication by adding `add_filter( 'aaai_disable_telemetry', '__return_true' );` to wp-config.php. This will disable coin sync but article generation will continue (requires API key).
* **Data deletion:** All data is deleted automatically when the plugin is uninstalled. You can also manually delete data via AutoArticle AI → Settings → Delete All Data.
* **Data access:** Article logs and memory are stored in your WordPress database and can be accessed via wp_posts and the custom aaai_memory table.

= Children's Privacy =

This plugin is not directed to children under 13. We do not knowingly collect personal information from children under 13.

= Third-Party Services =

This plugin integrates with third-party services listed above. Each service has its own privacy policy and terms of service. By using this plugin, you agree to comply with the terms of these third-party services.

= Changes to Privacy Policy =

If we make material changes to how we handle data, we will update this readme.txt and notify users via the WordPress admin dashboard.

= Contact =

For privacy-related questions, contact: privacy@autoarticleai.com

For plugin support, visit: https://autoarticleai.com/support
