=== VisiBeacon - llms.txt, AI Crawler Tracking and AI Search Visibility ===
Contributors: miotix
Tags: llms-txt, ai-seo, ai-search, chatgpt, seo
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.8.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

See which AI engines crawl and cite you - ChatGPT, Perplexity, Claude, AI Overviews. Plus llms.txt, FAQ schema and crawler controls.

== Description ==

AI answer engines are the new search. VisiBeacon makes your WordPress site visible, readable and quotable for them - a practice known as Generative Engine Optimization (GEO).

**Free features**

* **llms.txt generator** - serves a spec-compliant `/llms.txt` file (per llmstxt.org): site name, summary, and curated link sections with descriptions. Auto-updates as your content changes. Works alongside Yoast, Rank Math, SEOPress and AIOSEO (reuses their meta descriptions).
* **AI bot detection** - see which AI crawlers visit your site: GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, PerplexityBot, Google-Extended, Applebot-Extended, Bytespider, CCBot, Meta, Amazon, Cohere, Mistral and more, with a 30-day "which AI engines see you" overview on the dashboard.
* **Per-bot crawler controls** - allow, block via robots.txt, or hard-block (403) each AI bot individually. Block training bots while staying visible to AI search.
* **FAQ + FAQPage schema** - add FAQ sections to any post or page with valid FAQPage JSON-LD and accordion styling, from a simple editor in the post sidebar.
* **Active AI push (IndexNow)** - publishes and updates are pushed instantly to the index that powers ChatGPT search. No account needed.

**VisiBeacon Pro (separate plugin, sold on visibeacon.com)**

* **AI traffic trends** - daily crawl charts, most-crawled URLs, recent activity and referral visits from ChatGPT, Perplexity, Gemini, Copilot and other AI engines.
* **Readiness score** - analyzes each post for what AI engines need: a direct answer near the top, question headings, scannable structure, FAQ, freshness. Graded A-D with a fix checklist.
* **Auto-generated FAQs** - one-click FAQ generation per post (manual FAQ editing is free).
* **llms-full.txt** - full-content companion file for deeper AI ingestion.
* **AI enhancement (optional)** - bring your own OpenAI, Anthropic or Gemini API key for AI-written summaries, descriptions and FAQs.

== Frequently Asked Questions ==

= What is llms.txt? =
A proposed standard (llmstxt.org) that gives large language models a concise, curated map of your site - like robots.txt, but for helping AI understand and cite your content rather than just crawl it.

= Does this plugin send my content to third parties? =
No. The free plugin sends no post content anywhere. (The separate Pro plugin has an optional bring-your-own-key AI feature; even there, nothing is sent unless you add a key.)

= Does it work with my SEO plugin? =
Yes. VisiBeacon complements Yoast, Rank Math, SEOPress and AIOSEO - it reuses their meta descriptions in llms.txt and adds GEO features they don't have.

= Does uninstalling delete my data? =
No. Your settings, AI traffic history, FAQs and readiness scores are kept when the plugin is deleted, so reinstalling picks up right where you left off. If you want a full cleanup instead, enable "Remove ALL VisiBeacon data when the plugin is deleted" on the "Data & Backup" tab before uninstalling. You can also export a complete JSON backup (and import it back) from the "Data & Backup" tab.

= Will blocking AI bots hurt my rankings? =
Blocking training-only bots (e.g. GPTBot) does not affect Google rankings. Blocking AI search bots (e.g. OAI-SearchBot, PerplexityBot) will reduce your visibility in those AI engines - the plugin labels each bot's purpose so you can decide.

== Screenshots ==

1. Dashboard - AI crawls, referral visits and engines seen over the last 30 days, which engines are reading you, and your average quotability score at install compared with now.
2. AI traffic trends - daily crawl volume across all engines, a per-engine trend chart for each crawler, and referral visits broken down by engine.
3. llms.txt tab - site name, summary and about text, with content sections and item counts selectable per language.
4. AI Traffic tab - tracking and retention settings with IP anonymisation, the daily activity chart, and the most-crawled URLs.
5. FAQ tab - bulk question and answer generation with FAQPage schema, plus per-item FAQ status across published content.
6. Readiness tab - every published item graded A to D, with analyse, FAQ and describe actions on each row.

== External services ==

This plugin connects to the following external services. No service is required - each can be disabled in the plugin settings, and the plugin remains functional without them.

**IndexNow (api.indexnow.org, operated by Microsoft Bing)**
Purpose: the "Active AI push" feature submits the public URLs of your published content (and your llms.txt URL) to the IndexNow endpoint so search and AI engines index changes faster.
Data sent: your site's host name, the public URLs being submitted, and a plugin-generated verification key. Sent when you publish or update content, and when you click "Push all URLs now". No personal data, post content, or visitor data is sent.
Can be disabled: VisiBeacon → IndexNow → Active AI push.
Terms: https://www.indexnow.org/faq | Microsoft privacy statement: https://privacy.microsoft.com/privacystatement

**VisiBeacon bot registry (visibeacon.com)**
Purpose: once a week the plugin downloads an updated list of known AI crawler user-agents from visibeacon.com/bots.json so new AI bots are detected without waiting for a plugin update.
Data sent: a standard HTTP GET request (your server's IP and WordPress user-agent, as with any HTTP request). No site content or personal data is sent.
Terms: https://visibeacon.com/terms/ | Privacy: https://visibeacon.com/privacy-policy/

The AI traffic tracker stores its data locally in your own database only. Visitor IP addresses are stored as salted hashes by default and can be anonymized entirely. No analytics or tracking data is sent to any third party.

== Third-party libraries ==

* Chart.js v4 (https://www.chartjs.org) - MIT License - bundled unmodified at admin/js/vendor/chart.umd.min.js for the admin dashboard charts.

== Changelog ==

= 1.8.3 =
* Removed: unused image files that shipped inside the plugin folder (smaller download; the build now blocks images outside assets/img/).
* Fixed: the plugin name and description on the Plugins screen now match the directory listing.
* Improved: consistent punctuation across all admin messages.

= 1.8.2 =
* Improved: the backup folder's protection file now uses Apache 2.4 and 2.2 compatible syntax (existing files are updated automatically).
* Security: the AI API key is no longer included in data exports or automatic snapshots; restoring a backup keeps the key already saved on the site.

= 1.8.1 =
* Removed: the FAQ Custom CSS input. Custom styling now goes through WordPress's own editor (Appearance → Customize → Additional CSS); the FAQ settings document the CSS classes to target.

= 1.8.0 =
* New (Pro): Auto-Optimize - one click runs the full pipeline in the background (baseline scores, site summary if empty, descriptions, FAQs with schema, re-score) and reports the average readiness before and after with example pages that improved.
* New (Pro): Auto-Maintain - newly published or updated content automatically gets its description, FAQs and readiness score, then the enriched version is pushed via IndexNow. Daily cap and activity digest included; your edits are never overwritten.
* New: automatic daily safety snapshot - a full backup file written to the uploads folder (it survives database problems) with one-click restore on the Data & Backup tab.
* New: Content sections are now set per language on multilingual sites, with published counts shown next to each type and a warning when a section has more items than the max-per-section limit.
* Improved: counts explain themselves - lists now say exactly how many items were left out and why (excluded by you, utility page, noindex), and a page you explicitly checked as a Key Page is never auto-excluded.
* Improved: the readiness table shows what changed since the last analysis (previous score and which checks gained or lost points).
* Improved: the IndexNow tab shows how many URLs a full push would send now, compared with the last push.

= 1.7.15 =
* Improved: database queries for the traffic-log export/import and the SEO-plugin noindex lookup now use prepared identifier placeholders (Plugin Check hardening; no behavior change).

= 1.7.14 =
* Fixed: custom post types registered as queryable but not fully "public" (many theme and builder types such as projects/portfolios) now appear in the Content sections picker.
* Fixed: on WPML/Polylang sites, content whose post type is not set as translatable no longer disappears from the per-language lists - it now appears in every language, matching how the multilingual plugin serves it.
* Changed: when you have curated Key Pages, llms.txt no longer also lists every other page in a generic Pages section - the checked pages are the pages list.
* New: FAQ appearance setting - keep the styled VisiBeacon accordion or switch to unstyled (theme styles).
* Fixed: the bulk FAQ generator now remembers your last "Target questions" count instead of resetting to 3.
* Fixed: "Enable/Disable schema for all" and "Make all visible/Hide all" now act only on the language selected in the switcher, not on every language at once.

= 1.7.13 =
* Changed: the llms.txt conflict resolver no longer writes to any other plugin's stored settings. AIOSEO's llms.txt feature is switched off through AIOSEO's own public settings API, dedicated llms.txt-only plugins are deactivated, and for everything else (including Rank Math) the conflict notice now guides you to the exact setting to switch off manually.

= 1.7.12 =
* New (Pro): "AI Connection" tab, second in the tab bar - the AI provider, API key, model and Test connection now live in one obvious place instead of at the bottom of the push tab. The push tab is now simply "IndexNow".
* Improved: content you keep out of AI/search no longer appears anywhere in VisiBeacon. Pages excluded from llms.txt, content marked noindex by your SEO plugin (Yoast, Rank Math, SEOPress, All in One SEO) and password-protected content are now left out of llms.txt itself and out of the FAQ, Readiness and description lists, counts and bulk jobs.

= 1.7.11 =
* Improved: on the llms.txt tab, the bulk "llms.txt descriptions" tool now sits directly under Save Changes, and the long file preview moved to the bottom of the tab - the tool was easy to miss below the preview.

= 1.7.10 =
* Improved: the export/import and uninstall-behavior controls moved from the Dashboard to their own "Data & Backup" tab (last in the tab bar).

= 1.7.9 =
* New: your data now survives uninstalling. Deleting the plugin keeps all settings, AI traffic history, FAQs, descriptions and readiness scores by default; a new opt-in "Remove ALL VisiBeacon data when the plugin is deleted" checkbox (with a clear warning) restores the old wipe-everything behavior for those who want it.
* New: full data export and import. A "Your data" card on the Dashboard downloads everything the plugin stores as a JSON backup and restores it on the same site - take one before deleting or migrating.

= 1.7.8 =
* Dev: replaced the direct is_writable()/unlink() calls in the llms.txt conflict resolver with WordPress's wp_is_writable() and wp_delete_file(), per Plugin Check.
* Dev: documented that the wpml_* hook calls are WPML's own public API (Plugin Check false positives), so the check now passes clean.

= 1.7.7 =
* Dev: renamed the Freemius accessor from vis_fs() to visibeacon_fs() (function, global and the loaded action) so every identifier carries the full plugin prefix, per WordPress.org naming guidelines. No functional change.

= 1.7.6 =
* Fix: the Dashboard's per-language llms.txt links showed the same URL for every language on WPML sites (WPML rewrites admin URLs to the current language). The served files were always correct; the displayed links now are too.
* Improved (Pro): when FAQ placement is "Schema only", the bulk visibility buttons now read "Enable/Disable schema for all" - making clear that enabling adds no visible section, only the FAQPage schema AI engines read (which the readiness score counts).
* Improved: a small gap between the two bulk visibility buttons.

= 1.7.5 =
* Fix (Pro): on multilingual sites a background job (generate / analyze / describe) started for one language no longer appears as "running" on the other languages' tabs. Each language now has its own independent job, so you can run them in parallel and each tab shows only its own progress.

= 1.7.4 =
* Fix (Pro): on multilingual sites the FAQ, Readiness and llms.txt-descriptions item counts and lists were showing the same totals for every language. They now count and list each language's own items correctly (WordPress admin does not scope queries by language, so VisiBeacon now filters by each item's language directly).
* Fix (Pro): the background "generate / analyze / describe all" jobs now process only the selected language's items.

= 1.7.3 =
* New: the language switcher now appears on the FAQ and Readiness tabs too (not just llms.txt), so the whole panel is managed per language.
* New (Pro): the FAQ and Readiness item tables, their status counts, and the background "generate/analyze/describe all" jobs now operate on the language you have selected - each language's items are handled separately.
* New: the visible FAQ heading is now set per language and shown to each language's visitors in their own language.

= 1.7.2 =
* New: on multilingual sites (WPML or Polylang) the llms.txt tab now has a language switcher, so you can set the site name, summary and "About your site" text separately for each language.
* New: Key pages and Excluded content are now chosen per language (leave a language empty to reuse the primary language's picks, matched to their translations).
* New: post-type section headings in each language's llms.txt are now shown in that language where the multilingual plugin provides a translation.
* Improved: the Key pages / Excluded content pickers are now checkbox lists - no more holding Ctrl/Cmd to select several.
* Fix: selecting pages in one language no longer clears them when you switch to another language (each language keeps its own selection).
* Improved (Pro): "Generate with AI" for the summary and About text now writes in the language you are currently editing.

= 1.7.1 =
* Fix: the Dashboard now shows the correct per-language llms.txt URL for each language (it was showing the default language's URL for all of them; the files themselves were always correct).
* Fix: the "another plugin is serving llms.txt" notice no longer appears when VisiBeacon is in fact serving your llms.txt (a stale file left on disk by another plugin no longer triggers a false alarm).
* Improved (Pro): the AI key field turns green automatically once a generation succeeds with it - no need to click "Test connection" first.
* Improved (Pro): the per-item table (score / FAQ / describe) now appears on the FAQ tab too, not only Readiness.
* Improved: clearer FAQ tab icon.

= 1.7.0 =
* New: multilingual llms.txt. On WPML or Polylang sites, VisiBeacon serves a separate llms.txt for each language (for example /he/llms.txt and /en/llms.txt), each listing that language's content, with key and excluded pages mapped to their translations. The dashboard lists every language's URL.
* New (Pro): the AI "Summary" and "About your site" writers now write in your site's language instead of always English, and the "About your site" field gets its own "Generate with AI" button. (Per-post FAQ and description generation already followed each item's language.)

= 1.6.0 =
* New: redesigned admin. A card-based layout with brand-coloured section headers and tab icons, so each screen reads at a glance.
* Improved: Pro tools now live on the screen where they belong - "Write llms.txt descriptions" moved to the llms.txt tab, and the content-readiness score table moved to its own new "Readiness" tab. FAQ generation stays on the FAQ tab. No more mixed tools under one screen.

= 1.5.14 =
* Changed: the admin is reorganised around features - every setting now lives on the screen where you use it. FAQ output moves to a new FAQ tab; IndexNow and (Pro) your AI key move to a new "AI & Push" tab; the catch-all Settings tab is gone. Tabs and section headings now carry icons for faster scanning. No settings were lost - existing values carry over.

= 1.5.13 =
* Fix (Pro): bulk FAQ generation no longer shows an alarming "last error: Could not parse the AI response" when it simply couldn't build FAQs for a few thin-content items (e.g. gallery or image entries with almost no text). Those items are skipped quietly; only genuine API/connection errors are now flagged.

= 1.5.12 =
* Improved: the "Key pages" and "Excluded content" pickers now list only the content types you selected under "Content sections" - not every type on the site.
* Fix (Pro): the Quotability tools (FAQ generation, descriptions, analysis and the per-item counts) now cover exactly the content types you selected for llms.txt, custom post types included, instead of only posts and pages. Counts update once you save your Content sections choice.

= 1.5.11 =
* New: "Key pages" and "Excluded content" now list every public content type - posts, pages and custom post types (Projects, Events, News, etc.) - not just Pages, so any item can be highlighted in or kept out of llms.txt. They are grouped by type for easy picking.
* Improved: the llms.txt "About your site" field (previously "Details (optional paragraphs)") has a clearer label and example.
* Improved: FAQ generation wording is now generic ("items") instead of "products", so it reads correctly on sites without WooCommerce.

= 1.5.10 =
* Fix (Pro): the Quotability tab's "FAQ generation" and "llms.txt descriptions" bulk tools were only shown on WooCommerce sites - they now appear on every site (posts and pages included).
* Fix: "Push all URLs now" (IndexNow) returned HTTP 422 on multilingual sites whose home URL is language-prefixed (e.g. /he/). The verification key is now referenced at the site root, which authorises every language path.
* Improved (Pro): after "Test connection" succeeds, the saved AI-key field turns green immediately instead of only after a page reload.
* Improved: clearer wording on the Quotability analysis section.

= 1.5.9 =
* Improved (Pro): when the Pro plugin is installed but not yet licensed, the post editor's VisiBeacon box now shows a single clear "Activate your license" prompt instead of AI action buttons (Analyze, Generate FAQ, Suggest opening, Suggest description) that can't run until Pro is active. No dead controls before activation.

= 1.5.8 =
* Improved: clearer license activation. Unlicensed Pro installs now show a prominent "Enter your license key" button that opens the right screen (your Account page when connected, otherwise the activation screen), so activating a license you already bought is obvious.

= 1.5.7 =
* Fix: the one-click "let VisiBeacon take over" now correctly switches off All in One SEO's llms.txt (it targets AIOSEO's real setting, Sitemaps → LLMs.txt → Enable). The confirmation message is also clearer when a source can't be switched off automatically.

= 1.5.6 =
* New: smarter llms.txt conflict handling. If another plugin (All in One SEO, Rank Math, Yoast, SEOPress, or a static file) is already producing /llms.txt, VisiBeacon now names the exact source and offers a one-click "let VisiBeacon take over" - it switches off just that plugin's llms.txt feature (leaving its other SEO features untouched) and removes the stale file, so your live, auto-synced llms.txt is served.

= 1.5.5 =
* Fix (Pro): AI FAQ generation no longer reports "Could not parse the AI response" when a model wraps its output in a code block or returns a slightly longer answer. The response parser now tolerates code fences, object-wrapped arrays and truncated JSON, and salvages every complete question/answer pair. Also raised the AI token limit so longer (and right-to-left) answers are less likely to be cut off.

= 1.5.4 =
* Reliability: the free edition now bundles the Freemius licensing SDK (with no features gated - everything in the free build stays fully functional) so the free and Pro editions install and update cleanly side by side without conflicts. No user-facing changes.

= 1.5.3 =
* Added the direct-access guard (ABSPATH check) to the shared uninstall-cleanup include so Plugin Check passes with 0 errors.

= 1.5.2 =
* Restructure: all Pro functionality now lives entirely in the separately distributed Pro plugin. The free plugin ships zero licensing code and zero references to paid modules - every feature included is fully functional.
* The admin dashboard, traffic, llms.txt and settings screens expose public hooks (actions/filters) that extensions can build on.
* llms-full.txt serving moved out of the free plugin completely (it previously kept a stub endpoint).

= 1.5.1 =
* FAQ output, FAQPage schema and accordion styling are now always active in the free plugin.
* llms-full.txt generation moved to the separately distributed premium plugin; the free plugin contains no restricted functionality.
* Admin menu icon styling now uses wp_add_inline_style().

= 1.5.0 =
* Restructure: the free version now ships completely without premium code - manual FAQ editing with FAQPage schema, llms.txt, Active AI push, bot detection and crawler controls are fully functional free features with nothing locked or disabled.
* Pro (readiness scoring, auto-FAQ, AI traffic dashboard, AI writing) is delivered as separate modules in the premium build.

= 1.4.5 =
* New: the AI bot registry now refreshes automatically every week from visibeacon.com, so new crawlers are detected without waiting for a plugin update. Built-in bots always keep working.
* Improved: FAQ visibility buttons renamed for clarity - "Make all visible (N visible now)" / "Hide all (N hidden now)".

= 1.4.4 =
* Improved: FAQ visibility is now a single-row segmented control showing which state is active and how many items are displayed vs hidden, updating live.
* Improved: dashboard score cards (average at install / now) moved to their own second row.

= 1.4.3 =
* Improved: "Push all URLs now" has a once-a-day cooldown - the button disables and shows when the next full push is available (automatic per-publish pushes are unaffected).
* Improved: the IndexNow status line refreshes immediately after a push instead of showing the stale pre-push state.

= 1.4.2 =
* Improved: IndexNow's one-time key verification ("SiteVerificationNotCompleted") is now handled gracefully - the batch is kept in the queue and retried automatically every 2 hours until verification completes, with a clear status message instead of an error.

= 1.4.1 =
* Fix: IndexNow push returned HTTP 403 - the key file could be unreachable after a rewrite-rules flush. The key file is now served directly from the request (no rewrite rules), reliable on any permalink/cache setup.
* Improved: AI model is now a dropdown with per-provider options and a recommended choice (custom entry still available).

= 1.4.0 =
* New: Active AI push (IndexNow) - publishes and updates are pushed instantly to the index that powers ChatGPT search (and supplements Perplexity). Self-generated key, batched pings, "Push all URLs now" button, no account needed.

= 1.3.5 =
* Fix: admin menu icon enlarged - removed WordPress's default icon padding and thickened the mark for small sizes.

= 1.3.4 =
* Fix: admin menu icon rendered too small (tightened icon bounds).

= 1.3.3 =
* Branding: admin menu now shows the VisiBeacon beacon icon (from the official logo) instead of a generic dashicon.

= 1.3.2 =
* Branding: official VisiBeacon logo and indigo brand color applied across the admin (header mark, tabs, charts).

= 1.3.1 =
* Improved: admin tabs restyled - flat Site Kit-style tabs with underline indicator.

= 1.3.0 =
* New: Google Gemini supported as AI provider (alongside OpenAI and Anthropic).
* Improved: AI Traffic tab now uses the interactive daily chart (crawls + referral visits) instead of the old bar strip.
* Improved: refreshed dashboard design - KPI cards and engine bars restyled.


= 1.0.0 =
* Initial release: llms.txt generator, AI traffic tracker, quotability scoring with auto-FAQ + FAQPage schema, per-bot crawler controls.
