=== Pewit AI Schema Builder ===
Contributors: michalczajka, pewitlabs
Tags: ai, schema, json-ld, rich-snippets, structured-data
Requires at least: 6.0
Tested up to: 7.1
Stable tag: 1.1.5
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Generate and maintain JSON-LD structured data and rich snippets from your posts, products and pages with your own AI key.

== Description ==

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

Pewit AI Schema Builder generates and maintains JSON-LD structured data for WordPress posts, products and pages. Article, Product, FAQ, HowTo, LocalBusiness and more — synced with your content, not generic templates.

= Fully functional and free =
Every feature in this plugin is free and fully functional: bring your own API key (OpenAI, Anthropic Claude or Google Gemini), generate and validate schema per post/page, use all schema types (Product, FAQ, HowTo, LocalBusiness…), auto-sync schema on publish & update, bulk generate for existing posts and products, Score Booster bulk fixes, background validation jobs, WooCommerce product schema, custom post type (CPT) discovery and mapping, JetEngine CCT and MetaBox field mapping, and white-label branding. Nothing is locked behind a license.

= What it does =
* Generate Article, WebPage, Product, FAQ, HowTo, LocalBusiness and more schema types.
* JSON-LD preview, edit and validate before publish.
* Rich Results Score (0–100) with validation hints.
* Auto-sync schema on publish & update.
* Bulk generate for existing posts & products.
* Score Booster — bulk fix low scores.
* Background validation jobs with fix suggestions.
* WooCommerce product schema, including variable products.
* Custom post type discovery, schema-type mapping, JetEngine CCT + MetaBox field mapping.
* Works alongside Rank Math / Yoast (coexistence and sync modes, no duplicate output).

= Bring your own AI key =
Use your own API key from OpenAI, Anthropic (Claude) or Google Gemini. You pay your AI provider directly for usage; no data passes through the plugin author.

== Installation ==

1. Upload the plugin ZIP through Plugins -> Add New -> Upload Plugin, or extract it to wp-content/plugins/pewit-ai-schema-builder/.
2. Activate the plugin.
3. Open Pewit AI Schema Builder -> Settings, paste your AI provider API key, click Save & Test.
4. Choose which post types get schema, then generate JSON-LD per post or in bulk.

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

== External services ==

This plugin connects to third-party services to generate structured data. 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 a generation. 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: schema generation uses `wp_ai_client_prompt()` so credentials stay in core (Settings → Connectors). Your post content and prompt context are sent to whichever provider the site administrator configured.

OpenAI API (https://openai.com):
* What and when: when you generate or regenerate JSON-LD schema for a post, page or product, or test your API key, your content (title, excerpt/content, mapped fields and any context you configure) and the selected model name are sent to OpenAI to produce the structured data.
* Data sent: the post/product content and metadata used for the schema, optional context text you configure, 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 — when you generate schema or test your API key, your content and the selected model name are sent to Anthropic to produce the structured data.
* Data sent: the post/product content and metadata used for the schema, optional context text you configure, 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 — when you generate schema or test your API key, your content and the selected model name are sent to Google's Generative Language API to produce the structured data.
* Data sent: the post/product content and metadata used for the schema, optional context text you configure, and the selected model name.
* Terms: https://ai.google.dev/gemini-api/terms — Privacy: https://policies.google.com/privacy

Freemius (licensing & updates — https://freemius.com):
* What and when: used for plugin updates and optional, opt-in usage diagnostics. 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 ==

= Is the plugin really free? =
Yes. Every feature is free and fully functional with your own AI API key — including all schema types, automation, bulk generation, background jobs and field mapping. Nothing is locked behind a license.

= Do I need an AI API key? =
Yes. Bring your own key from OpenAI, Anthropic (Claude) or Google Gemini. You pay your provider directly for API usage.

= Will this conflict with Yoast or Rank Math? =
No. Use SEO plugin coexistence or sync mode in Settings to avoid duplicate JSON-LD.

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

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

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

== Changelog ==

= 1.1.2 =
* Added: WordPress 7.0+ AI Client integration — uses `wp_ai_client_prompt()` when site connectors are configured (Settings → Connectors), with BYOK direct API fallback.
* Changed: settings and readiness checks recognize core AI connectors as a valid configuration.

= 1.1.1 =
* Changed: the wordpress.org build now ships with ZERO license/plan feature gating — every feature is fully functional with no trialware or upgrade prompts. Premium plan logic lives only in the separate Freemius add-on build.
* Changed: all internal globals are properly prefixed (aisb/AISB).
* Added: "Source code" documentation — all bundled JS/CSS is hand-written, unminified source with no build step; the only third-party library is the Freemius SDK.

= 1.1.0 =
* Changed: renamed to "Pewit AI Schema Builder" (new slug pewit-ai-schema-builder) for a distinctive directory name.
* Changed: every feature is now free and fully functional — all schema types, automation, bulk jobs, Score Booster, validation autopilot, CPT/field mapping and white-label are no longer license-gated.
* Added: External services documentation for OpenAI, Anthropic (Claude), Google Gemini and Freemius, including terms/privacy links.
* Fixed: removed Google Fonts (no external font requests); admin uses a system font stack.
* Fixed: build now excludes filesystem-incompatible 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, output escaping, prepared SQL annotations, 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 public release: Rich Results Score, score column, CSV export, Score Booster.
* Yoast / Rank Math coexistence and sync, WooCommerce variable products, JetEngine CCT + MetaBox mapping.
* Onboarding, validation autopilot, FAQ pair with Content Assist, admin PL.

= 0.7.0 =
* Score Booster bulk regeneration for posts with low or missing schema scores.

= 0.6.0 =
* Schema score admin column and CSV export.

= 0.5.0 =
* Rich Results Score (0–100) with validation hints.

= 0.4.0 =
* Yoast / Rank Math sync, Woo variable offers, validation autopilot, onboarding.

= 0.3.0 =
* JetEngine CCT and MetaBox field mapping.

= 0.2.0 =
* CPT discovery, Google/Bing validation, BreadcrumbList, SEO coexistence, EtchWP.

= 0.1.0 =
* Metabox JSON-LD (Article/WebPage), bulk generation and Product/FAQ schema.
