=== Rankwell AI — Journalism Assistant ===
Contributors: ejesgist
Tags: ai assistant , writing tools, journalism, seo, gutenberg
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 1.0.1
License: GPL-2.0+
License URI: http://www.gnu.org/licenses/gpl-2.0.txt

AI writing assistant for journalists. Rewrite, fix grammar, improve readability, write articles, SEO optimize, and chat with AI.

== Description ==

Rankwell AI is a professional-grade AI writing assistant purpose-built for journalists, editors, and newsrooms. It integrates directly into the WordPress editor, putting powerful AI tools exactly where you write.

**Multi-Provider AI Engine**

Choose from six leading AI providers — Google AI (Gemini), DeepSeek, ChatGPT (OpenAI), Groq, Mistral AI, and OpenRouter — with automatic failover. If your primary provider is unavailable, Rankwell AI seamlessly switches to your backup. Free providers are prioritized first to minimize costs.

**Six Powerful Actions**

= Rewrite =
Improve clarity, flow, and journalistic style while preserving all facts, names, dates, quotes, and attributions exactly. HTML formatting, links, and embeds are fully preserved.

= Fix Grammar =
Correct only spelling, grammar, and punctuation errors without changing your wording, tone, or sentence structure. Surgical precision editing.

= Improve Readability =
Break up long paragraphs, simplify complex sentences, and vary sentence length for better flow — all without shortening your content.

= Write Article =
Generate comprehensive, publication-ready articles from a topic or source material. Uses accurate general knowledge for evergreen content while maintaining strict factual guardrails for news reporting.

= SEO Optimize =
Naturally weave keywords into your content without changing tone, style, or structure. Includes optional SEO titles, URL slugs, and keyword suggestions.

= Chat with AI =
Interactive chat with headline analysis, title optimization, A/B testing, and audience matching. Includes a full headline scorecard system with clickability, clarity, and mobile-friendliness ratings.

**Journalistic Standards**

Built from the ground up for newsroom workflows:

* **AP Style support** — Strict AP Style rules for numerals, abbreviations, titles, and punctuation
* **Attribution rules** — Automatic self-attribution for original reporting
* **Factual guardrails** — Never invents facts, names, dates, statistics, or quotes
* **Active voice enforcement** — Prioritizes subject-verb-object sentence structure
* **Inverted pyramid** — Most newsworthy information first
* **E-E-A-T compliance** — Experience, Expertise, Authoritativeness, Trustworthiness
* **Smart heading limits** — H2/H3 rules based on word count to prevent AI-looking fragmentation

**Eight Professional Tones**

Professional, Casual, AP Style (News), British Style (UK), Editorial/Opinion, Breaking News, Feature Story, and Interview/Q&A.

**Five Writing Styles**

Inverted Pyramid, Narrative, Explainer, Listicle, and Live Blog.

**Editor Integration**

Works in both the Gutenberg Block Editor and the Classic Editor (TinyMCE). A single click from your editor toolbar opens the AI Assistant popup. Highlight text and the popup grabs it automatically — Replace swaps your selection, Insert Below adds after it.

**Developer Friendly**

* Clean, namespaced PHP 8.0+ code following WordPress coding standards
* All strings are internationalization-ready
* Extensible with action and filter hooks
* Dark mode support for the editor popup
* No jQuery dependency — vanilla JavaScript

== External Services ==

This plugin connects to multiple third-party AI service providers to process your content. When you use any AI feature, the content you're working with is sent to your selected AI provider's API for processing. Each service requires its own API key that you must obtain separately. API calls are made server-side over encrypted HTTPS connections, and no content is stored by the plugin itself beyond what the AI provider requires for processing your request.

= Google AI (Gemini) =

* **Service**: AI text generation using Google's Gemini language models
* **What it does**: Processes your content for rewriting, grammar correction, readability improvement, article writing, SEO optimization, and chat features
* **Data sent**: Your content text, selected action parameters, tone/style preferences, and API key
* **When**: When Google AI is selected as your AI provider and you use any AI feature
* **Terms of Service**: https://ai.google.dev/terms
* **Privacy Policy**: https://policies.google.com/privacy

= DeepSeek =

* **Service**: AI text generation using DeepSeek's language models
* **What it does**: Processes your content for rewriting, grammar correction, readability improvement, article writing, SEO optimization, and chat features
* **Data sent**: Your content text, selected action parameters, tone/style preferences, and API key
* **When**: When DeepSeek is selected as your AI provider and you use any AI feature
* **Terms of Service**: https://platform.deepseek.com/terms
* **Privacy Policy**: https://platform.deepseek.com/privacy

= ChatGPT (OpenAI) =

* **Service**: AI text generation using OpenAI's GPT language models
* **What it does**: Processes your content for rewriting, grammar correction, readability improvement, article writing, SEO optimization, and chat features
* **Data sent**: Your content text, selected action parameters, tone/style preferences, and API key
* **When**: When ChatGPT (OpenAI) is selected as your AI provider and you use any AI feature
* **Terms of Service**: https://openai.com/terms/
* **Privacy Policy**: https://openai.com/privacy/

= Groq =

* **Service**: AI text generation using Groq's fast inference platform
* **What it does**: Processes your content for rewriting, grammar correction, readability improvement, article writing, SEO optimization, and chat features
* **Data sent**: Your content text, selected action parameters, tone/style preferences, and API key
* **When**: When Groq is selected as your AI provider and you use any AI feature
* **Terms of Service**: https://groq.com/terms-of-service/
* **Privacy Policy**: https://groq.com/privacy-policy/

= Mistral AI =

* **Service**: AI text generation using Mistral's language models
* **What it does**: Processes your content for rewriting, grammar correction, readability improvement, article writing, SEO optimization, and chat features
* **Data sent**: Your content text, selected action parameters, tone/style preferences, and API key
* **When**: When Mistral AI is selected as your AI provider and you use any AI feature
* **Terms of Service**: https://mistral.ai/terms/
* **Privacy Policy**: https://legal.mistral.ai/terms/privacy-policy

= OpenRouter =

* **Service**: AI model aggregator service providing access to multiple AI models
* **What it does**: Processes your content through various AI models for rewriting, grammar correction, readability improvement, article writing, SEO optimization, and chat features
* **Data sent**: Your content text, selected action parameters, tone/style preferences, API key, and your site URL
* **When**: When OpenRouter is selected as your AI provider and you use any AI feature
* **Terms of Service**: https://openrouter.ai/terms
* **Privacy Policy**: https://openrouter.ai/privacy

**Important Notes**:

* Your API keys are stored securely in your WordPress database and are only sent to the respective provider's API for authentication
* All data transmission occurs over encrypted HTTPS connections
* No content is stored on external servers beyond what the AI provider requires for processing your request
* You are responsible for reviewing and accepting each provider's terms of service and privacy policy before using their service

== Installation ==

1. Upload the `rankwell-ai` folder to the `/wp-content/plugins/` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Go to **Rankwell AI** in the WordPress admin menu to configure your API keys.
4. Choose your preferred AI provider and enter your API key.
5. Start writing! The AI Assistant button appears in your post editor toolbar.

= API Key Setup =

**Google AI (Gemini)** — Generous free tier. Get your key at [Google AI Studio](https://makersuite.google.com/app/apikey).

**Groq** — Generous free tier with ultra-fast inference. Get your key at [Groq Console](https://console.groq.com/keys).

**Mistral AI** — European AI with free tier. Get your key at [Mistral Console](https://console.mistral.ai/api-keys/).

**DeepSeek** — Competitive pricing. Get your key at [DeepSeek Platform](https://platform.deepseek.com/api_keys).

**OpenRouter** — One key for hundreds of models including free options. Get your key at [OpenRouter](https://openrouter.ai/keys).

**ChatGPT (OpenAI)** — Industry-standard AI. Get your key at [OpenAI Platform](https://platform.openai.com/api-keys).

== Frequently Asked Questions ==

= Is this plugin free? =

Yes! The plugin is completely free and open source. You only pay for API usage directly to your chosen AI provider. Google AI (Gemini), Groq, and Mistral offer generous free tiers.

= Which AI provider should I choose? =

We recommend Google AI (Gemini) for most newsrooms — it's free and high-quality. Groq is also excellent — it's fast, free, and produces great journalism content.

= Does this work with the Classic Editor? =

Yes! Rankwell AI adds a toolbar button to both the Gutenberg Block Editor and the Classic Editor (TinyMCE).

= Can I use multiple AI providers? =

Yes. You can configure API keys for all six providers. If your primary provider fails, Rankwell AI automatically switches to the next available provider — free providers are tried first.

= Does the AI invent facts? =

No. Every prompt includes strict factual guardrails. For news content, the AI relies on supplied facts. For evergreen topics, it uses accurate general knowledge. It never fabricates names, dates, statistics, quotes, or background details.

= What about AP Style? =

Select "AP Style (News)" as your tone for strict AP Style compliance — spell out numbers 1-9, figures for 10+, "Jan. 15, 2026" date format, spell "percent," no Oxford comma.

= Is my content secure? =

Your content is sent directly to your chosen AI provider's API over encrypted HTTPS connections. API keys are stored securely in your WordPress database. No content is stored by the plugin itself. Please review the External Services section above for detailed information about data handling for each provider.

= Can I translate the plugin? =

Yes! All strings are internationalization-ready. A `.pot` file is included in the `/languages` directory.

= Does it preserve my formatting? =

Yes! Bold text, links, italics, headings, lists, and tables are preserved through the AI processing pipeline.

== Screenshots ==

1. AI Assistant popup with Rewrite action and preview panel
2. AI Assistant popup with SEO titles, SEO slugs, preview, insert, retry, and replace buttons
3. Settings page — General tab with provider selection
4. Settings page — AI Providers tab with API key management
5. Gutenberg block editor with AI Assistant toolbar button
6. Classic Editor with TinyMCE AI Assistant button

== Donations ==

If you find Rankwell AI useful for your newsroom, please consider [making a donation](https://flutterwave.com/donate/qtygvg4jjlkf) to support ongoing development and maintenance of this free plugin.


== Changelog ==

= 1.0.1 =
* Fixed: Chat with AI returns plain text consistently instead of JSON wrappers
* Fixed: JSON response format only forced for non-chat actions requesting SEO extras
* Improved: Added "message" key support in response parser for broader AI compatibility

= 1.0.0 =
* Initial release
* Six AI providers: Google AI, DeepSeek, ChatGPT, Groq, Mistral, OpenRouter
* Six AI actions: Rewrite, Fix Grammar, Improve Readability, Write Article, SEO Optimize, Chat
* Eight professional tones and five writing styles
* Automatic provider failover with free providers prioritized
* SEO extras: titles, slugs, keywords
* Chat with headline analysis and scorecard
* Gutenberg and Classic Editor integration
* Dark mode support
* AP Style and British Style presets
* Journalistic quality guidelines and factual guardrails
* Smart heading limits based on word count
* HTML formatting preservation
* PHP 8.0+ with WordPress coding standards
* Vanilla JavaScript — no jQuery dependency
* Comprehensive external services documentation

== Upgrade Notice ==

= 1.0.0 =
Initial release. Configure your API key at Rankwell AI in the WordPress admin menu to get started.

== Credits ==

Developed by Omajemite Don [Ejes Gist](https://ejesgist.com) for newsrooms that demand accuracy, attribution, and editorial standards in AI-assisted writing.

Built with journalistic integrity. Powered by your choice of AI.