=== Shakvaro Content Engine ===
Contributors: devshakil, shakvaro
Plugin URI: https://shakvaro.com/shakvaro-content-engine
Author URI: https://shakvaro.com
Tags: seo, ai, content generation, content automation, meta description
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.1.1
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.
* **Yoast / Rank Math integration** — writes generated meta descriptions to whichever SEO plugin you run.
* **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 overview with queue stats, error counts, recent activity, Resume Workflow CTA
* 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
* CSV keyword/location bulk import
* WP-CLI compatible (`wp cron event run shakcoen_process_queue`)
* GPLv2-licensed; secrets stored encrypted via `SHAKCOEN_Secrets`

== Free vs Pro ==

Everything above ships in the free plugin and works standalone — no account, no key, no locked buttons. **Shakvaro Content Engine Pro** is a separate paid add-on (distributed off WordPress.org) that turns the engine into a hands-off SEO suite. Pro adds:

* **Automation** — auto-process queue cron, 404 AI validator with auto-queue, scheduled auto-image for drafts
* **AI images** — multi-provider generation (DALL·E 3, Imagen, Replicate SDXL), smart alt text, near-duplicate rejection, media offload to Cloudflare R2 / S3
* **Internal linking suite** — automatic anchor engine, bulk re-link, broken-link scanner, anchor-diversity warnings, per-post stats
* **RSS auto-blog** — multi-feed import with per-feed AI prompts, AI-rewrite or direct publish, deduplication
* **SEO automation** — JSON-LD schema (Article / FAQ / Breadcrumb), content-decay detection + auto-refresh, crawl hygiene (noindex thin/paginated/empty archives), pillar consolidation with 301 redirects
* **Content intelligence** — Originality.ai AI-detection + plagiarism gate, DataForSEO keyword volume / difficulty / CPC
* **Multi-template routing** (auto by category / post type), **REST API** (headless), **activity-log CSV export**, **dashboard widget**, **failure notice with one-click retry**, and priority support

Learn more: https://shakvaro.com/shakvaro-content-engine

== 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

**Shakvaro WP Insights (track.shakvaro.cloud)** — optional, privacy-first usage analytics. **Off by default — nothing is sent unless you explicitly opt in** via the in-admin notice or Settings → Data Sharing. When enabled, it sends, on activation and once weekly: anonymized environment data (WordPress / PHP / MySQL versions, locale, multisite flag), the plugin version, which plugin features are turned on, aggregate usage counts (e.g. how many posts have been generated, 404s tracked, templates created — numbers only, never your content, titles, keywords, prompts, or API keys), and a one-way SHA-256 hash of your site URL plus the site title. Your admin email is sent only if you separately opt in to the marketing tier. Opting out or uninstalling sends a one-time erasure request and removes the local data. This service is operated by the plugin author.
Privacy policy: https://shakvaro.com/wp-insights/privacy

== 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? =

Your content goes only to the AI provider you configure (OpenAI, Gemini, or any endpoint you set) — your prompt and the generated response transit that provider's API. The plugin also includes optional, privacy-first usage analytics (Shakvaro WP Insights) that is **off by default**: nothing is sent unless you explicitly opt in, and it never includes your content, prompts, keywords, or API keys. See "External services" for the full disclosure.

= 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.1.1 =
* Fix: deactivating the plugin could show two dialogs (the plugin's own "keep / delete data" prompt plus the analytics survey). Removed the duplicate analytics survey so the plugin's own deactivation dialog is the single, reliable flow.

= 1.1.0 =
* New: optional, privacy-first usage analytics (off by default, opt-in only) to help prioritise development. See "External services".
* New: "Free vs Pro" comparison page under the plugin menu, with a one-tap "notify me when Pro launches" opt-in.
* New: Support link on the Plugins screen.
* Fix: readme now lists only features included in the free plugin (schema, advanced internal linking, auto-image, multi-template routing, CSV log export, and failure-retry are Pro features).

= 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.1.1 =
Fixes a double dialog on plugin deactivation. Recommended.

= 1.1.0 =
Adds optional opt-in usage analytics (off by default) and a Free vs Pro page. Recommended update.

= 1.0.0 =
Initial public release.
