=== Shakvaro Content Engine ===
Contributors: shakvaro
Plugin URI: https://shakvaro.com/shakvaro-content-engine
Author URI: https://shakvaro.com
Tags: seo, ai, content generation, internal linking, meta description
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI content automation for WordPress. Bring your own LLM key to generate posts at scale, rewrite meta descriptions, and turn 404s into content.

== Description ==

**Shakvaro Content Engine (SCE)** is a workflow engine for SEO-driven content production. It combines:

* **Guided 8-step workflow** — define a project, pick keywords + locations, choose a template, configure shortcodes, write AI prompts, set SEO rules, configure publishing, launch.
* **Bring-your-own LLM** — works with any OpenAI-compatible chat endpoint. Switch between OpenAI, Gemini, Anthropic, Groq, OpenRouter, or a self-hosted gateway.
* **Bulk meta description regeneration** — pick a category or filter, regenerate hundreds of Yoast / RankMath meta descriptions in a single batch.
* **404 tracker** — log 404s and queue the worthwhile ones into the content pipeline.
* **Template system** — Block Editor / Gutenberg templates with dynamic shortcodes that map to AI-generated sections.
* **Internal linking engine** — automatic anchor placement with category, density, and freshness controls.
* **JSON-LD schema injection** — Article, FAQ, Breadcrumb schema generated alongside each post.
* **Yoast + RankMath integration** — auto-fills focus keyword + meta description; respects sitemap rules.
* **Queue + cron** — long-running generation handled in background with retry, rate-limit, and progress UI.
* **Activity log** — every API call, validation pass, and publish event recorded for audit and debugging.

SCE is built for **agencies, SEO teams, and content operations** that need to produce dozens-to-hundreds of optimized posts on a recurring schedule without burning hours on each one.

== Features ==

* AI provider abstraction with strict OpenAI-compatible contract
* Dashboard widget with queue stats, error counts, recent activity, Resume Workflow CTA
* Failure notice that lists recent broken generations with one-click Retry
* Shakvaro keepalive cron (for hosted-tier deployments that use refresh tokens)
* Workflow JSON state with breadcrumb navigation across all 8 steps
* Settings page with per-provider configuration + diagnostic Test Connection
* Multi-template routing (one template per category or post type)
* CSV keyword/location bulk import
* Auto-image generation for drafts via image-provider abstraction
* CSV log export for compliance / audit
* WP-CLI compatible (`wp cron event run shakcoen_process_queue`)
* GPLv2-licensed; no telemetry; secrets stored encrypted via `SHAKCOEN_Secrets`

== External services ==

This plugin connects to several external services so that AI-generated content, URL validation, and article enrichment can happen. Every service is opt-in via configuration. No data is sent until you configure a provider and trigger a generation.

**OpenAI (api.openai.com)** — only used when you configure an OpenAI API key in Settings → AI Provider. It sends the prompt you author (typically including target keyword and template instructions), generation parameters, and your API key in the `Authorization` header. It is sent on: every queued post generation, every Test AI Prompt click, and every meta-description regen.
Terms of use: https://openai.com/policies/row-terms-of-use/
Privacy policy: https://openai.com/policies/row-privacy-policy/

**Google Gemini (generativelanguage.googleapis.com)** — only used when you configure a Gemini API key in Settings → AI Provider. It sends the prompt, generation parameters, and your API key in the request URL. Same trigger points as OpenAI.
Terms of use: https://ai.google.dev/terms
Privacy policy: https://policies.google.com/privacy

**Wikipedia REST (en.wikipedia.org/api/rest_v1)** — used by the optional `[olink: PHRASE]` shortcode inside generated content to resolve a phrase to its Wikipedia article URL. It sends the literal phrase (URL-encoded) as part of the request path. Up to 3 lookups per article. Responses are cached for 30 days. Triggered only when generated content contains an `[olink: ...]` shortcode.
Terms of use: https://foundation.wikimedia.org/wiki/Policy:Terms_of_Use
Privacy policy: https://foundation.wikimedia.org/wiki/Policy:Privacy_policy

== Installation ==

1. Upload the plugin archive via **Plugins → Add New → Upload Plugin**, or extract into `/wp-content/plugins/shakvaro-content-engine/`.
2. Activate the plugin.
3. Open **SEO AI Generator → Settings** and configure your AI provider (paste an API key + endpoint URL).
4. Open **SEO AI Generator → Workflow Setup** and walk through the 8-step wizard.
5. Hit **Launch** at the end; the queue processes in background via WP-Cron.

== Frequently Asked Questions ==

= Does the plugin send my content to a third-party service? =

Only to the AI provider you configure. The plugin itself does not phone home; there is no telemetry. Your prompt + the generated response transit your chosen provider's API (OpenAI, Gemini, etc.).

= Can I use a self-hosted LLM? =

Yes — any OpenAI-compatible endpoint works. Point `shakvaro_api_endpoint` at your gateway, set `shakvaro_api_flavor` to `openai_compat`.

= Does it work with Yoast SEO or RankMath? =

Yes. The plugin fills focus keyword + meta description fields automatically when either is active.

= Will it conflict with my existing posts? =

No. SCE never modifies posts it didn't create unless you explicitly trigger a bulk action (e.g. "Regenerate meta descriptions"). All generated posts are marked with the `_shakcoen_generated` post meta key.

= Is there a Pro version? =

A Paid tier is planned and will ship as a separate **Pro** plugin distributed off WordPress.org. The free plugin remains fully functional standalone.

== Screenshots ==

1. Dashboard widget — content pipeline at a glance
2. Workflow Setup — 8-step guided wizard with breadcrumb
3. Templates — block-editor template manager with dynamic shortcodes
4. Bulk meta-description regeneration
5. 404 Tracker
6. Settings — provider selection + API key management

== Changelog ==

= 1.0.0 =
* First public release on WordPress.org.
* Guided 8-step AI content workflow (project, keywords + locations, template, shortcodes, AI prompts, SEO + internal linking, publishing, launch).
* Bring-your-own LLM key — OpenAI / Gemini / any OpenAI-compatible endpoint.
* Bulk meta-description regeneration with per-post override.
* 404 tracker with auto-queue to content generation.
* Template engine with chip-block shortcode editor (Gutenberg + Elementor compatible).
* Settings import / export with allowlisted option keys; secret keys encrypted at rest via AES-256-GCM.

== Upgrade Notice ==

= 1.0.0 =
Initial public release.
