=== Mephivio Robots LLMs ===
Contributors: mephivio34
Tags: llms.txt, robots.txt, seo, ai, geo
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.3.8
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Generates llms.txt, llms-full.txt, JSON-LD and robots.txt discovery files for AI agents and search crawlers, without promising ranking gains.

== Description ==

**Mephivio Robots LLMs** generates and publishes machine-readable discovery files that can help compatible crawlers understand your public content. llms.txt is an emerging convention and is not guaranteed to be consumed by every AI or search crawler:

* **llms.txt** — a Markdown index of your public content, in the format expected by the [llmstxt.org](https://llmstxt.org) specification.
* **llms-full.txt** — the full text corpus of your content, cleaned up (removal of technical noise from page builders, scripts, styles, shortcodes…).
* **llms-schema.json** — the same index in JSON-LD format (schema.org `ItemList`), for agents able to consume structured data.
* **robots.txt** — a granular policy per bot category (search engines, AI, social networks, "bad bots"), with your custom rules and sitemaps.

= What makes this plugin different =

Mephivio Robots LLMs is designed as a local, auditable discovery-control layer rather than only an llms.txt writer. In one interface it combines multilingual document generation, WooCommerce catalog indexing, robots.txt policy controls by crawler family, per-content exclusions and visibility scoring, diagnostics, previews, and privacy-friendly bot request statistics. It does not require an external API or send site content to a third party.

= Key features =

* Admin interface language switch: English or French, with English as the default, independently of the WordPress locale.
* Smart content extraction: Gutenberg, Elementor, Divi, WPBakery, Beaver Builder, FAQ/accordions, WooCommerce products.
* LLM visibility score per content item (0 to 100), with a configurable minimum threshold.
* Per-post/page exclusion metabox, respects `noindex` (Yoast SEO, Rank Math, All in One SEO).
* Live preview of generated files directly in the admin.
* URL inclusion tester and generation logs.
* Dynamic (virtual, no disk writes), physical, or hybrid publishing.
* Delta mode: only reprocesses content that changed since the last generation.
* Polylang / WPML compatibility: one document per detected language (`llms-fr.txt`, `llms-en.txt`…) in addition to the default document.
* Aggregated, privacy-friendly statistics of known bot requests on your llms.txt / llms-full.txt / robots.txt files.
* CSV export of excluded content, with the exclusion reason.
* WooCommerce-compatible (products are selected by default when WooCommerce is active, but can be disabled in the content-type settings; cart/checkout/account pages are excluded).

= Privacy =

The plugin does not send any data to a third-party service. Bot traffic statistics are stored locally only (aggregated by bot and by day, without storing raw IP addresses or user-agent strings) and can be disabled or reset at any time from the settings.

== Installation ==

1. Install and activate the plugin from your WordPress admin, or upload the `mephivio-robots-llms` folder to `/wp-content/plugins/`.
2. Go to the **Mephivio Robots LLMs** menu in your admin.
3. Review the settings (indexed content types, thresholds, write mode) then click **Regenerate now**.
4. Check the result in the **Live preview** tab, then visit `/llms.txt`, `/llms-full.txt` and `/robots.txt` on your site.

== Frequently Asked Questions ==

= Does the plugin write files to my server? =

By default, no: "Dynamic" mode serves the files virtually (the same way WordPress natively serves `robots.txt`), without writing anything to disk. "Physical" and "Hybrid" modes are available if you prefer real files at the root of your site.

= Is the plugin compatible with Yoast SEO / Rank Math / All in One SEO? =

Yes. If the "Respect SEO noindex" option is enabled, any content marked `noindex` by one of these plugins is automatically excluded from the generated files.

= Is the plugin compatible with WooCommerce? =

Yes, published products are included automatically (description, attributes, categories, SKU), and cart / checkout / account pages are excluded by default.

= How do the bot statistics work? =

When a known bot requests `llms.txt`, `llms-full.txt` or `robots.txt`, the plugin classifies its user-agent and stores an aggregated counter. To protect performance, increments are rate-limited per bot/document. No IP address or raw user-agent is kept. History is kept on a rolling 30-day window.

= What happens when I uninstall the plugin? =

By default, nothing is deleted automatically (your settings remain in the database as long as the plugin is only deactivated). A dedicated "Delete my data on uninstall" option (unchecked by default) allows you to fully clean up the plugin's settings, cache and metadata when it is permanently removed. Any physical files that may have been written (`llms.txt`, `llms-full.txt`, `robots.txt`) are never deleted automatically.

== Screenshots ==

1. Dashboard: overall status, published documents, average score.
2. Live preview of llms.txt, llms-full.txt, llms-schema.json and robots.txt.
3. Settings: content types, thresholds, robots.txt options.
4. AI/search bot request statistics.

== Changelog ==

= 1.3.8 =
* Updated the plugin Author URI to https://www.mephivio.fr.
* Updated version metadata and documentation for the 1.3.8 release.

= 1.3.7 =
* WordPress.org review follow-up: removed the remaining global bootstrap function, prefixed template/uninstall variables, optimized legacy metadata migration to avoid meta-key queries, and documented intentional WPML/core hook usage.


= 1.3.6 =
* WordPress.org review: moved all admin CSS and JavaScript output to properly enqueued assets; removed inline `<style>` and `<script>` output.
* Collision prevention: replaced the former three-letter code, storage, action, script/style and metadata prefixes with the unique `mephroll` / `MEPHROLL` prefix.
* Upgrade safety: added a one-time migration for settings, caches, cron state and per-content metadata created by versions up to 1.3.5.
* Directory packaging: renamed the runtime admin icon so it is not confused with a WordPress.org directory asset, and removed unused directory-style assets from the plugin package.
* Internationalization packaging: removed bundled PO/MO/POT files; WordPress.org can provide community translations while the plugin-specific English/French interface selector keeps its built-in French mapping.
* Documentation: clarified the plugin’s distinct scope around multilingual generation, WooCommerce, diagnostics, robots controls, content auditing and local bot statistics.

= 1.3.5 =
* Fix: Place the WooCommerce product-count translator comment immediately before the translatable string so WordPress Plugin Check recognizes it correctly.

= 1.3.4 =
* Fixed the Plugin Check internationalization error for the WooCommerce published-product counter.
* Added the required translators comment for the localized numeric placeholder.

= 1.3.3 =
* Fixed WooCommerce catalog detection for existing stores and installations where WooCommerce was enabled after the plugin.
* Added a dedicated, default-enabled WooCommerce product inclusion switch with a detected-product count.
* Improved product-save regeneration and WooCommerce load-order compatibility.


= 1.3.2 =
* WordPress.org compliance: fixed all issues reported by Plugin Check.
* Security: explicitly sanitize the submitted Settings array before processing it.
* Compatibility: replaced `strip_tags()` with `wp_strip_all_tags()` and removed discouraged manual translation loading.
* Uninstall: clean post metadata through the WordPress metadata API instead of direct SQL queries.
* Admin: read display query parameters without processing `$_GET` directly in the view.
* CSV: removed the explicit close on the `php://output` stream, which is automatically closed at request end.
* Documentation: declared WordPress 7.1 compatibility and shortened upgrade notices.

= 1.3.1 =
* Fixed: the custom Mephivio icon in the WordPress admin menu is now explicitly constrained to the native 20 × 20 px menu size, preventing oversized icons when another admin theme or plugin overrides image dimensions.
* Documentation: updated English and French readmes and changelogs for version 1.3.1.

= 1.3.0 =
* UI: redesigned Settings into clear visual sections for General, LLM files, Content, Robots, Multilingual, Performance and Advanced options.
* Compatibility: existing setting keys and behavior are unchanged, so upgrades preserve the current configuration.
* Usability: added section descriptions plus Save Settings actions at the top and bottom of the screen.
* Responsive admin: improved the Settings layout for tablets and mobile devices.
* Documentation: updated English and French readmes and changelogs for version 1.3.0.

= 1.2.0 =
* New: plugin-specific admin interface language selector in Settings with English and French options.
* English is now the default Mephivio Robots LLMs interface language, independently of the WordPress user/site locale.
* Switching the plugin interface language does not change the WordPress dashboard language or the public site language.
* Improved: remaining French source labels in Settings were normalized to English source strings and translated cleanly.
* Documentation: English and French readmes and changelogs updated for version 1.2.0.

= 1.1.1 =
* Security: real-page rendering now validates same-site URLs and uses `wp_safe_remote_get()` with TLS verification enabled.
* Security/performance: bot statistics writes are rate-limited to reduce database-write abuse from spoofed public user-agents.
* Reliability: fixed resumable indexing so a time-budget interruption in the middle of a page resumes at the correct item instead of duplicating earlier items.
* Reliability: added a short-lived generation lock to avoid concurrent cron/admin batches corrupting progress.
* Privacy/SEO safety: generated `robots.txt` now respects WordPress' "Discourage search engines" setting and never replaces the core private-site policy in dynamic mode.
* Performance: activation and upgrades now schedule indexing in the background instead of running an 8-second batch inside the activation request.
* Compatibility: physical file writes and log writes now use the WordPress Filesystem API and fail gracefully when direct filesystem access is unavailable.
* Fixed: WooCommerce products can now actually be unchecked after their default selection.
* Fixed: removed a broken admin icon reference and use a WordPress Dashicon instead.
* Validation: numeric settings are now clamped to supported ranges.

= 1.1.0 =
* **Fix: activation could hang / time out on sites with a large number of posts.** Content indexing now runs as a time-budgeted, resumable batch process (about 8 seconds per run by default, filterable via `mephroll_batch_time_budget`) instead of a single blocking pass over the entire catalog. If your content library is too large to process in one go, generation now continues automatically in the background via WP-Cron every ~10 seconds until finished, while previously published files keep being served in the meantime.
* This fix applies uniformly to plugin activation, plugin updates, the "Regenerate now" button, and automatic regeneration on post save/delete — all now go through the same safe batched engine.
* New: a "Background generation in progress…" notice with a processed/estimated-total counter is shown on the Dashboard while a batch is running, with automatic page refresh.
* New: a "Reset generation" button (Diagnostics tab) to clear a stuck batch state (e.g. if WP-Cron is not running on the site) without affecting already-published files.
* New: a stall warning is shown if a background generation hasn't progressed for more than 10 minutes, usually indicating WP-Cron isn't executing on the site.

= 1.0.0 =
* Full rename of the plugin (formerly "Flappy / Master Robots LLMs") to **Mephivio Robots LLMs**, ahead of its free release on WordPress.org.
* New: JSON-LD feed generation (`llms-schema.json`, schema.org `ItemList`) alongside llms.txt/llms-full.txt.
* New: Polylang / WPML multilingual compatibility — generates one document per detected language (`llms-{lang}.txt`, `llms-full-{lang}.txt`).
* New: aggregated, anonymized statistics of known bot requests on the published files ("Bot statistics" tab), can be disabled.
* New: `uninstall.php` with optional cleanup (disabled by default) of the plugin's options and metadata.
* Security: fixed CSV Formula Injection in the exclusions export.
* Security: replaced `maybe_unserialize()` with hardened deserialization (`allowed_classes => false`) on content metadata coming from arbitrary keys, removing any PHP Object Injection risk.
* Security/Performance: the real HTML rendering fallback (outbound HTTP request to the page itself, useful for some page builders such as Divi 5) is now disabled by default and becomes an explicit opt-in setting ("Real HTML rendering (advanced)").
* Reliability: dynamic rendering of llms.txt / llms-full.txt / llms-schema.json now respects their individual enable/disable settings (previously, only robots.txt did).
* Full internationalization of the admin interface (translatable strings via the `mephivio-robots-llms` text domain), with a bundled French translation.
* Removed legacy assets and commercial documentation inherited from another, unrelated product.

= History (under the name Master/Flappy Robots LLMs) =
* 2.6.8 — Formatted llms.txt entries as valid Markdown links compliant with the llmstxt.org spec, grouped entries by section (Posts, Pages, Products…), guaranteed an H1 title.
* 2.6.7 — Removed internal scores from the public llms.txt / llms-full.txt exports (kept in the admin only).
* 2.6.5 — WooCommerce compatibility (automatic inclusion of the product catalog, exclusion of cart/checkout/account pages).
* 2.6.1 — Security audit: sanitized the URL tester, moved the log file out of a publicly accessible directory, filtered custom robots.txt rules.

== Upgrade Notice ==

= 1.3.6 =
WordPress.org compliance update: enqueued admin assets, unique prefixes, safer upgrade migration and cleaner package contents.

= 1.3.2 =
Plugin Check compliance and WordPress 7.1 compatibility updates.

= 1.3.0 =
Redesigns the Settings screen into clearer sections while preserving all existing configuration values.

= 1.2.0 =
Adds an English/French language switch for the plugin administration. English is the default and the setting affects only Mephivio Robots LLMs screens.

= 1.1.1 =
Security, batching, privacy and WordPress.org-readiness hardening.

= 1.1.0 =
Important fix for sites with many posts: activation/generation no longer risks hanging or timing out. Update is recommended for all sites, especially large content libraries.

= 1.0.0 =
Renamed to Mephivio Robots LLMs with security hardening. Existing settings are preserved when migrating from earlier versions that use the same option prefix.