=== Virtual LLMS.TXT Generator ===
Contributors: cyberbrand
Tags: llms, robots.txt, artificial intelligence, text file, crawler
Requires at least: 5.0
Tested up to: 6.9
Stable tag: 2.5.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Safely creates a virtual llms.txt dynamically. Features interactive bot targeting, map auto-syncing, and decoupled custom instructions.

== Description ===

Keep your site lightning fast while making your content perfectly readable to Large Language Models (LLMs) and AI agents.

This plugin allows you to easily manage your AI crawler protocol directly from the WordPress dashboard. It serves the file dynamically and securely, adhering to advanced security protocols necessary for enterprise hosting environments. Version 2.5.0 aligns with 2026 AEO standards including mission statements and extended context support.

= Features =

* **Crawler Analytics Log:** Track how many times your `llms.txt` file is accessed and exactly which AI bots are visiting. Features a detailed daily log (in your local timezone) that automatically expunges data older than 30 days to keep your database light.
* **Granular Taxonomy Controls:** Filter your auto-generated AI map by specific category or tag slugs. Ensure only your most relevant "High Signal" content is mapped for bots.
* **Custom Sitemap Override:** By default, the plugin points AI agents to your standard WordPress `wp-sitemap.xml`. You can now explicitly override this to point to any custom SEO sitemap (e.g., Yoast, RankMath).
* **Post & Page Exclusions:** You can easily omit private or sensitive content from your AI map by entering a comma separated list of Post IDs. The generator strictly ignores them.
* **Background Auto-Syncing:** Hooks into WordPress saves. When you publish or delete a post, the plugin silently regenerates your AI map in the background. You never have to manually update your crawler map again.
* **Interactive License Presets:** Click to instantly apply standard data scraping licenses (CC-BY-4.0, Proprietary/No-AI, MIT, etc.) with helpful, plain English explanations showing exactly what rules apply to bots.
* **Expanded Bot Targeting Library:** Easily construct your crawler protocols using quick-add toggle buttons for major and lesser-known AI agents.
* **Modular 3-Tier Architecture:** Manage your Targeted Bots, Auto-Generated AI Map, and Custom Instructions in completely separate fields. Your manual prompts are safe from automated overwrites.
* **Virtual File Technology:** Acts exactly like a physical text file to AI crawlers, but requires zero file write permissions on your server.
* **Live Dashboard Preview:** See exactly what your `llms.txt` file looks like in real-time as you change settings, featuring a high-contrast terminal theme.
* **Custom Post Type Selector:** Dynamically choose which content types (Portfolios, Products, Events, etc.) appear in your AI map.

== Installation ==

1.  Upload the plugin files to the `/wp-content/plugins/virtual-llms-txt-generator` directory, or install the plugin through the WordPress plugins screen directly.
2.  Activate the plugin through the 'Plugins' screen in WordPress.
3.  Navigate to Tools -> LLMS.TXT to configure your content.

== Changelog ==

= 2.5.0 =
* FEATURE: Added "Crawler Analytics" to track hits and log specific bot activity over a rolling 30-day period (using local WordPress timezone).
* FEATURE: Implemented "Granular Taxonomy Controls" allowing the AI map to be strictly filtered by specific category or tag slugs.
* FEATURE: Added "Custom Sitemap URL" override for compatibility with third-party SEO plugins.
* UI/UX: Complete redesign of the admin settings page featuring a robust flexbox layout, subtle native-feeling toggle buttons, and a high-contrast terminal theme for the Live Preview.
* OPTIMIZATION: Resolved all strict CodeSniffer warnings and improved overall PHP sanitization compliance.

= 2.4.0 =
* FEATURE: Added "Site Mission Statement" field for 2026 AEO standard compliance (rendered as a blockquote).
* FEATURE: Implemented "Live Dashboard Preview" to show real-time `llms.txt` output while editing.
* FEATURE: Added "Custom Post Type Selector" to allow inclusion of any public CPT in the AI map.
* FEATURE: Added support for `llms-full.txt` (Extended Context) which serves concatenated Markdown content for deep ingestion.
* FEATURE: Automatically adds `sitemap:` field to YAML frontmatter for improved AI discoverability.
* ENHANCEMENT: Version bumped to 2.4.0.

= 2.3.0 =
* REFACTOR: Completely restructured codebase into a modular Object-Oriented architecture for improved maintainability and scalability.
* SECURITY: Hardened YAML frontmatter generation with strict escaping and quoting for site titles, bot names, and licenses. This prevents malformed YAML files if site metadata contains special characters.
* OPTIMIZATION: Extracted administrative JavaScript to a dedicated asset file for better caching and CSP compliance.
* ENHANCEMENT: Version bumped to 2.3.0.

= 2.2.1 =
* FIXED: Resolved issue where special characters (like ampersands) in post titles were being converted to HTML entities (e.g., `&amp;`) inside the auto-generated AI Map. The map now properly decodes entities to preserve raw string values for plain text and YAML compliance.
* ENHANCEMENT: Double quotes inside post titles are now safely escaped so they do not break the strict YAML file structure during generation.

= 2.2.0 =
* SECURITY: Codebase audited and verified against standard CSRF, XSS, and SQL Injection vectors. Raw endpoints correctly enforce `text/plain` formatting.
* OPTIMIZATION: Database queries (`get_posts`) inside the AI Map generator heavily optimized with `no_found_rows` and cache bypassing flags to decrease memory footprint during generation.
* OPTIMIZATION: Products query bypass logic implemented. The plugin will now intelligently skip product searches if WooCommerce or similar custom post types are not active on the site.

= 2.1.0 =
* FEATURE: Added "Exclude Post IDs" field. Users can now pass a comma separated list of IDs to hide specific Pages, Posts, and Products from the auto-generated YAML map.
* ENHANCEMENT: AI Map generator logic and Auto-Sync background hooks updated to strictly respect excluded IDs.

= 2.0.0 =
* FEATURE: Added Background Auto-Sync setting. The plugin will now hook into `save_post` and `deleted_post` to dynamically regenerate the AI map in the background whenever content changes.
* FEATURE: Interactive Content License buttons added. Clicking a preset automatically inputs the license and displays a dynamic description of its AI crawling rules.
* FEATURE: Expanded the quick-add bot library to include newer/lesser-known agents.
* ENHANCEMENT: Added clear inline descriptions explaining the technical impact of Targeted Bots, Licenses, and Auto-Generated Maps directly in the dashboard UI.

= 1.9.0 =
* FEATURE: Decoupled architecture. Separated Targeted Bots, AI Map, and Custom Text into three distinct fields to prevent accidental overwrites.
* ENHANCEMENT: AI Map generator now specifically targets the middle mapping textarea, keeping user instructions perfectly safe in the bottom text area.

= 1.8.0 =
* FEATURE: Added quick-add buttons for major AI User-Agents to streamline crawler targeting.
* ENHANCEMENT: JavaScript logic to auto-format comma separation and prevent duplicate entries in the bot target list.

= 1.7.0 =
* FEATURE: Added Dedicated UI inputs for AI Target Bots and Content Licensing.
* FEATURE: Upgraded template generation to dynamically query the WordPress database.
* FEATURE: Auto-maps Core Pages, WooCommerce Products, and Recent Posts into a structured YAML metadata block optimized for LLM ingestion.

= 1.6.3 =
* FIXED: Synchronized Stable Tag and Version headers to strictly match.

= 1.0.0 =
* Initial release.
