=== AI Data Index ===
Contributors: aidataindex
Tags: ai, structured-data, json, json-ld, llms
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
Stable tag: 0.2.10
License: GPLv2 or later

AI Data Index for WordPress creates a synchronized machine-readable version of the website, designed for AI agents and language models.

== Description ==

This MVP focuses on WordPress pages and blogs.

It generates static files:

* /json/index.json
* /json/index.php
* /json/pages/index.json
* /json/pages/home.json
* /json/pages/{page-id}-{slug}.json
* /json/{blog-page-json}.json, or /json/blog.json when no blog page is detected
* /json/articles/{post-id}-{slug}.json
* /json/sitemap-ai.xml
* /llms.txt

It also adds discovery signals in the HTML head and provides the shortcode:

* [ai_data_index_link]

Each page and post also gets an "AI Data Index" editor box where you can write a short manual AI description. If left empty, the plugin uses SEO meta descriptions, excerpts, or cleaned page content.

The admin screen includes a Content Sources section that detects public WordPress post types and lets administrators choose what should be included in the generated JSON files. WordPress system pages and known WooCommerce account/cart/checkout pages are excluded automatically.

Each custom content source can be treated as "Page + single JSON-LD" or "List only". Embedded/module content such as FAQ and testimonials defaults to list-only mode to avoid generating links to non-existent standalone human pages.

== Multilingual ==

The plugin detects Polylang, WPML, and TranslatePress.

* Polylang and WPML: the global manifest includes availableLanguage and languageManifests, and the plugin generates lightweight localized manifests.
* TranslatePress: languages are detected in the admin check, but localized manifests are not generated automatically because translated content is often rendered dynamically from the same WordPress post.
* Manual translations without a translation plugin are not inferred automatically.

== Security Model ==

The plugin is intentionally limited.

* It does not include a file manager.
* It does not ask for FTP credentials.
* It writes only to /json/ and /llms.txt.
* It generates file paths internally.
* It backs up existing unmanaged files before overwriting them.
* Admin settings require manage_options and WordPress nonces.

== Format Rules ==

In indexes and lists:

* id = short internal identifier
* dataUrl = JSON file URL
* htmlUrl = human-readable page URL

In final JSON-LD entities:

* @id = global canonical identifier of the JSON-LD node
* identifier = short internal identifier, when useful
* url or mainEntityOfPage = real human-readable HTML page

== Installation ==

1. Upload ai-data-index.zip from the WordPress plugin installer.
2. Activate the plugin.
3. Open the left admin menu item "AI Data Index".
4. Check folder permissions.
5. Click "Regenerate files now".

If WordPress cannot create /json/, create it manually in the site root and make it writable by WordPress.

== Changelog ==

= 0.2.10 =
Fixes the head discovery JSON script so it outputs valid JSON instead of HTML-escaped quotes.

= 0.2.9 =
Keeps standard content source labels consistent in English in the plugin admin page.

= 0.2.8 =
Adds a link to the official AI Data Index documentation in the plugin admin page.

= 0.2.7 =
Security hardening: excludes password-protected published content from generated files and escapes the head discovery JSON more strictly.

= 0.2.6 =
Adds Google Search Console guidance next to the generated AI sitemap URL.

= 0.2.5 =
Simplifies the Generated URLs admin section by showing only the main manifest, AI sitemap, and llms.txt.

= 0.2.4 =
Clarifies the enable/disable setting and hides the manual language fallback when WPML/Polylang language manifests are available.

= 0.2.3 =
Improves List only descriptions so FAQ/module list items use extended cleaned content instead of short 35-word summaries.

= 0.2.2 =
Hotfix for saving Content Source modes. Restores missing return values in generated index builders.

= 0.2.1 =
Adds content source modes. Administrators can choose Page + single JSON-LD or List only per content type. FAQ/testimonial/module-like post types default to List only.

= 0.2.0 =
Adds a Content Sources admin section for selecting public post types, generates generic indexes and JSON-LD files for enabled custom post types, supports WooCommerce products as Product entities, and excludes known system pages automatically.

= 0.1.3 =
Changes multilingual global manifests to act as a site-level map: when complete language manifests exist, /json/index.json no longer repeats all localized pages and posts.

= 0.1.2 =
Fixes multilingual collection by querying all published content across languages, assigns entity inLanguage from Polylang/WPML when available, and adds localized home JSON files for language manifests.

= 0.1.1 =
Indexes all published posts and pages using batched queries, removes the fake article limit, and adds an admin robots.txt discovery snippet.

= 0.1.0 =
Initial blog-focused MVP.
