=== Pewit AI Content Assist ===
Contributors: michalczajka, pewitlabs
Tags: ai, content, openai, internal links, summaries
Requires at least: 6.0
Tested up to: 7.1
Stable tag: 1.0.11
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI drafting, summaries and internal-link suggestions for editors — grounded in your own content.

== Description ==

Plugin homepage, documentation and paid plans: https://pewitlabs.com/product-ai-content-assist.html

AI-powered content assistant for WordPress editors. Drafts paragraphs, generates summaries and suggests internal links grounded in your existing posts and pages — never generic filler.

= Fully functional and free =
Every feature in this plugin is free and fully functional: connect via WordPress 7.0+ AI connectors (Settings → Connectors) or bring your own API key (OpenAI, Anthropic Claude or Google Gemini), draft and rewrite in the block editor, summarize selections, get internal-link suggestions grounded in your content index, run bulk meta/excerpt background jobs, auto re-index on publish, scan for orphan pages and link gaps, export CSV reports and receive email notifications when jobs finish. Nothing is locked behind a license.

Optionally, you can subscribe to **managed AI credits** (so you don't need your own API key) and priority support at https://pewitlabs.com/product-ai-content-assist.html — this is a paid external service, not a requirement to use the plugin.

= Editor sidebar =
* Draft expand — turn bullets or a sentence into a full paragraph.
* Summarize selection — condense text for excerpts and meta descriptions.
* Suggest internal links — grounded in your own published posts and pages.
* Preview every AI suggestion before you insert it.
* Global brand context & tone settings applied to every action.

= Content index & link gaps =
* Content index of your published posts & pages (manual rebuild or incremental on publish).
* Orphan & Link Gap Map: find pages with no inbound links and posts with no outbound internal links.
* Quick-fix panel and CSV export of the full report.

= Background automation =
* Bulk background jobs for missing excerpts & SEO meta descriptions.
* Auto re-index when you publish or update content.
* Pause, resume, stop and clear running jobs with a live activity log.
* Email notification when a background job finishes.

= Providers =
* WordPress 7.0+ AI Client (Settings → Connectors) when configured, with BYOK fallback.
* OpenAI, Anthropic (Claude) and Google Gemini — use your own API key.
* You pay your provider directly for API usage.
* Configurable model (default gpt-4o-mini) and API key test button.

== Installation ==

1. Upload the plugin ZIP through Plugins -> Add New -> Upload Plugin, or extract it to wp-content/plugins/pewit-ai-content-assist/.
2. Activate the plugin.
3. Connect AI under Settings — WordPress 7.0+ Connectors (Settings → Connectors) or your own API key (BYOK — OpenAI, Claude or Gemini).
4. Rebuild the content index, then use the editor sidebar while you write.

The plugin folder must always be pewit-ai-content-assist/ and the main file pewit-ai-content-assist.php.

== External services ==

This plugin connects to third-party services to generate text and content suggestions. Please review this before use.

You choose the AI provider in the plugin settings and use your own API key (BYOK), or on WordPress 7.0+ use the site-wide AI connectors (Settings → Connectors) via the core AI Client. No data is sent to any provider until you trigger an action. Requests go directly from your site to the selected provider under your own credentials and that provider's terms. Nothing is sent to the plugin author.

WordPress AI Client (WordPress 7.0+, when connectors are configured):
* What and when: drafting, summaries and link suggestions use `wp_ai_client_prompt()` so credentials stay in core (Settings → Connectors). Selected text, prompts and grounding context are sent to whichever provider the site administrator configured.

OpenAI API (https://openai.com):
* What and when: when you draft, expand, summarize or request internal-link suggestions, or run a bulk meta/excerpt job, and OpenAI is the selected provider (BYOK fallback), the selected text and prompt are sent to OpenAI to produce the requested text.
* Data sent: the text you select or write, optional global context you configure, titles/snippets of indexed posts used for grounding, and the selected model name.
* Terms: https://openai.com/policies/terms-of-use — Privacy: https://openai.com/policies/privacy-policy

Anthropic (Claude) API (https://www.anthropic.com):
* What and when: only if you select Claude as the provider (BYOK fallback) — when you run a text action, your text prompt and context are sent to Anthropic to produce the requested text.
* Data sent: the text prompt, optional global context you configure, grounding snippets, and the selected model name.
* Terms: https://www.anthropic.com/legal/consumer-terms — Privacy: https://www.anthropic.com/legal/privacy

Google Gemini API (https://ai.google.dev):
* What and when: only if you select Gemini as the provider (BYOK fallback) — when you run a text action, your text prompt and context are sent to Google's Generative Language API to produce the requested text.
* Data sent: the text prompt, optional global context you configure, grounding snippets, and the selected model name.
* Terms: https://ai.google.dev/gemini-api/terms — Privacy: https://policies.google.com/privacy

Freemius (licensing & checkout — https://freemius.com):
* What and when: used for license activation, updates and (for optional paid managed AI credits) checkout as Merchant of Record. Opt-in is optional.
* Terms: https://freemius.com/terms/ — Privacy: https://freemius.com/privacy/

== Source code ==

All JavaScript and CSS shipped in this plugin (in assets/js and assets/css) is the original, hand-written, human-readable source. Nothing is minified, compiled, transpiled or generated by a build tool, so no separate source files are required — what you read in the plugin is the source. The only bundled third-party library is the Freemius SDK (vendor/freemius), whose source is available at https://github.com/Freemius/wordpress-sdk

== Frequently Asked Questions ==

= Do I need an AI API key? =
On WordPress 7.0+ you can use Settings → Connectors (core AI Client). Otherwise bring your own key for OpenAI, Anthropic Claude or Google Gemini. You pay your provider directly for API usage. Optional managed AI credit packs (no key required) are planned.

= Is everything really free? =
Yes. Every feature — editor actions, content index, link gap map, bulk background jobs, auto re-index and email reports — works without a paid license. You only need AI access via WordPress Connectors or your own API key. Optional paid managed AI credits and support remain available as an external service.

= How do I get an OpenAI API key? =
1. Sign up at https://platform.openai.com/ (this is not the same as ChatGPT Plus).
2. Add a payment method under Settings -> Billing and set a monthly spend limit.
3. Go to https://platform.openai.com/api-keys -> Create new secret key -> copy the sk-... value immediately (shown only once).
4. In WordPress: Pewit AI Content Assist -> Settings -> paste the key -> Save & Test.

= 1.0.11 =
* Changed: Tested up to WordPress 7.1.
* Fixed: hide third-party admin notices (license nags from other plugins) on PEWIT admin screens.

= 1.0.10 =
* Fixed: Plugin Check i18n — text domain in shared PEWIT Labs hub must be a string literal (`pewit-labs`).

= 1.0.9 =
* Added: shared PEWIT Labs AI settings hub when 2+ suite plugins are active (provider, API key, model, global context).

== Changelog ==

= 1.0.8 =
* Fixed: Plugin Check — escaped job log level output; AI Client called via function_exists/call_user_func for WP 6.x compatibility; empty languages/ folder for Domain Path.

= 1.0.7 =
* Added: WordPress 7.0+ AI Client integration — uses `wp_ai_client_prompt()` when site connectors are configured (Settings → Connectors), with BYOK direct API fallback.
* Fixed: removed bundled .po/.mo translation files from the wordpress.org package (translations via translate.wordpress.org).

= 1.0.6 =
* Changed: the wordpress.org build now physically ships with zero license/plan gating — every feature is unlocked source with no premium checks. Plan gating lives only in the separate Freemius premium build.
* Added: "Source code" section documenting that all JS/CSS is hand-written, unminified source.

= 1.0.5 =
* Changed: renamed to "Pewit AI Content Assist" (new slug pewit-ai-content-assist) for a distinctive directory name.
* Changed: every feature is now free and fully functional — no license gating of built-in features. Optional paid managed AI credits and support remain available as an external service.
* Added: External services documentation for OpenAI, Anthropic (Claude) and Google Gemini, including terms/privacy links.
* Fixed: removed Google Fonts (no external font requests); admin uses a system font stack.
* Fixed: build now excludes spaced and *.dc.html artifacts.

= 1.0.4 =
* Fixed: Plugin Check advisory warnings — annotated direct DB queries (DirectQuery/NoCaching).

= 1.0.3 =
* Fixed: WordPress Plugin Check — i18n translators comments, in-memory CSV helpers, prefixed LLM client class, removed manual textdomain loading.

= 1.0.2 =
* Fixed: WordPress.org Plugin Check i18n compliance for shared LLM client.

= 1.0.1 =
* Added: Settings provider selector — OpenAI, Claude, Gemini.

= 1.0.0 =
* Stable release: Gutenberg sidebar (draft, summarize, internal links), content index with incremental updates.
* Orphan & Link Gap Map with quick-fix panel, no-outbound list, and CSV export.
* Background bulk meta/excerpt jobs, auto re-index on publish, email after job.
* Onboarding wizard, admin PL. QA checklist: docs/QA_CHECKLIST.md.

= 0.5.0 =
* Orphan quick-fix panel and no-outbound list on dashboard.

= 0.4.0 =
* Incremental index on publish. Link gap CSV export.

= 0.3.0 =
* Orphan & Link Gap Map.

= 0.2.0 =
* Onboarding wizard, email after job, admin PL, FAQ section detection.

= 0.1.0 =
* Initial beta: Gutenberg sidebar, content index, bulk meta job.
