=== ANDPLUS-LLMO === Contributors: andplus Tags: llms.txt, ai, llm, structured data, seo Requires at least: 6.2 Tested up to: 6.9 Requires PHP: 7.2 Stable tag: 0.3.12 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Monitor AI crawler visits (filters, CSV export), llms.txt, sitemap-ai.xml, and head links for AI discovery via wp_head. == Description == **AI Visibility** logs which known AI crawlers request your public pages. Filter by period, compare bots and paths, and download a UTF-8 CSV—all stored in your database on this site. You also get **llms.txt** and an **AI sitemap** so crawlers can understand your site: public `/llms.txt` and `/sitemap-ai.xml`, plus standard head tags. Many sites already output structured data (such as schema.org), but AI crawlers may still miss context—llms.txt and sitemap help close that gap. ANDPLUS-LLMO helps you: * Monitor AI crawler activity inside WordPress (period filters, bot breakdown, top paths, recent visits, CSV export of the access log) * Provide a public `/llms.txt` endpoint for AI visibility * Add official <link rel="llms"> and <link rel="sitemap"> tags via `wp_head` * Automatically generate `/sitemap-ai.xml` including your llms.txt All of the above works in this plugin without payment. No physical llms files are created on disk, and visibility data stays in your database on this site. **Apache:** copy the mod_rewrite block from **Setup → Redirect** into your site root `.htaccess` (the plugin does not write to `.htaccess`). **Nginx:** configure as shown in Setup. WordPress `robots.txt` can include a comment for the llms.txt URL and a `Sitemap:` line for sitemap-ai.xml (disable or customize via filters `ap_llmo_robots_append_llms_comment`, `ap_llmo_robots_append_sitemap_ai`, `ap_llmo_robots_txt_append`). **Home** can show optional rule-based hints (no API). **Optional Pro add-on** (separate download): Adds AI-assisted content workflows (BYOK with OpenAI), extended endpoints (`llms.full.txt`, `.ai-context`, `docs/ai`), weekly reports, and extended sitemap-ai.xml URLs. Licensing is handled only in the Pro add-on. In the free plugin, upgrade links use the filter `ap_llmo_pro_upgrade_url`; AI Visibility “recent visits” list length can be tuned with `ap_llmo_visibility_recent_limit` (default 100). Filters: `ap_llmo_llms_public_url`, `ap_llmo_sitemap_ai_public_url` are available for custom environments without pretty URLs. AI Visibility retention and export can be tuned with `ap_llmo_access_log_retention_days` (default 90), `ap_llmo_access_log_max_rows`, `ap_llmo_access_log_export_max_rows`, and `ap_llmo_access_log_csv_filename` (default `andplus-llmo-access-log-{period}-{date}.csv`). Extensions can supply `ap_llmo_visibility_trends_url_for_path` (empty string, path) so the access log shows an extra link per path (ANDPLUS-LLMO Pro uses this for **Visibility trends** when licensed). = Support = * **Directory plugin:** Community support and documentation; individual replies are not guaranteed. * **Pro:** Support as described when you purchase **ANDPLUS-LLMO Pro** (see vendor or product page linked from the add-on). We do not support custom theme/plugin conflicts, server configuration, or general WordPress usage beyond this plugin. == Privacy == * **AI Visibility:** When a request is detected as a known AI crawler user-agent, the plugin may store a row with **timestamp**, **request path**, **user agent**, and derived **bot name / service** in a custom database table on this site. A separate **daily summary table** stores **one row per calendar day** (totals only, no per-request paths) for analytics; it follows the same retention policy unless changed via `ap_llmo_visibility_daily_retention_days`. Data stays on your server; it is not sent to the plugin author by this plugin. **Timestamps follow your WordPress timezone** (Settings → General). Rows are **kept for a limited time** (default **90 days**, removed by WordPress’s scheduled tasks). The log also has a **maximum row count** (default **5000**); when that limit is reached, the **oldest rows are removed first**, so on very busy sites you may see fewer days of history than the retention window. **This cap applies to all users of this plugin**—it is not a Pro-only restriction. Administrators can **download a CSV** of stored rows from the AI Visibility screen; the file stays local to your browser. * **No telemetry:** This plugin does not load a licensing SDK and does not call the plugin author’s servers for licensing or analytics. == Installation == 1. Upload the plugin folder to `/wp-content/plugins/` or install from ZIP. 2. Activate the plugin. 3. Go to **ANDPLUS-LLMO → Setup → Redirect**: * **Apache:** paste the provided **mod_rewrite** block into your site root `.htaccess` **before** `# BEGIN WordPress`. * **Nginx:** add the server rules shown in Setup. 4. Edit llms content and save. Open `/llms.txt` (plain text) and `/sitemap-ai.xml` (XML) after your server rules are in place. == Frequently Asked Questions == = Translations? = * **Bundled:** Japanese (`languages/andplus-llmo-ja.mo`, `andplus-llmo-ja_JP.mo` when present). Site language `ja` / `ja_JP` will load automatically. * **Template:** `languages/andplus-llmo.pot` — for translators using Poedit. * **Maintainers / POT:** See `languages/README.md` in the plugin folder (WP-CLI `wp i18n make-pot` workflow). = Why BYOK for AI? = You bring your own OpenAI API key so token usage stays on your account. = Does the plugin connect to external services? = This plugin does not load any licensing SDK. OpenAI is contacted only when using AI features via **ANDPLUS-LLMO Pro** (BYOK). Upgrade links in wp-admin can be customized via the filter `ap_llmo_pro_upgrade_url` (default: https://www.andplus.co.jp/). = Can I export AI Visibility data? = Yes. On **ANDPLUS-LLMO → AI Visibility**, use **Download CSV (current period)** to download UTF-8 CSV (no BOM). The export matches the period tab you selected (7 / 30 / 90 days). Very large exports are capped for stability (see filter `ap_llmo_access_log_export_max_rows` in the plugin). == Screenshots == 1. **ANDPLUS-LLMO Home** — Overview and quick links to Setup and AI Visibility. 2. **Setup** — Edit llms.txt content and review redirect setup notes for Apache/Nginx. 3. **AI Visibility** — Period tabs, bot totals, top paths, recent visits, and CSV download. 4. **Public endpoints** — Verify `/llms.txt` and `/sitemap-ai.xml` are publicly available after setup. == Changelog == = 0.3.12 = * **AI Visibility — bot detection:** Added detection patterns for newer AI agents and grouped the list by vendor for readability. New patterns: **Meta-ExternalAgent**, **Meta-ExternalFetcher**, **Manus-User** (Manus AI; acquired by Meta in Dec 2025), **MistralAI-User** (Le Chat), **DuckAssistBot** (DuckDuckGo Duck.ai). Existing patterns are unchanged; the new entries widen coverage of agent-style traffic. = 0.3.11 = * **AI Visibility — daily cron:** Fixed `ap_llmo_daily_cron` dispatch so the daily rollup (`run_yesterday_rollup`) and access-log maintenance actually run. The previous `do_action( 'ap_llmo_daily_cron' )` inside the same hook caused unbounded recursion and never reached lower-priority callbacks. Core work now runs on internal action `ap_llmo_daily_cron_workers` (documented in `ap-llmo-hooks.php`). Extensions should keep using `ap_llmo_daily_cron`. = 0.3.10 = * **robots.txt compatibility:** `robots_txt` filter priority is now late (`999`) so llms.txt comment and sitemap-ai.xml `Sitemap:` line remain when other plugins (e.g. XML sitemap plugins) also generate robots output. = 0.3.9 = * **Upgrade path:** Updated the default **Upgrade** link in Home/Setup to point to the Freemius checkout for ANDPLUS-LLMO Pro (`ap_llmo_pro_upgrade_url` still allows overrides). = 0.3.8 = * **AI Visibility:** When **ANDPLUS-LLMO Pro** is active and licensed, **Top paths** and **Recent visits** include a **View trends** link that opens **Visibility trends** with the same path prefilled (`ap_llmo_path`, exact match). Filter: `ap_llmo_visibility_trends_url_for_path`. = 0.3.7 = * **AI Visibility:** Raw log **CSV export** is now **UTF-8 without a BOM** (header remains `Content-Type: text/csv; charset=utf-8`). Use **Data → From Text/CSV** in Excel if double-click import mis-detects encoding. = 0.3.6 = * **Documentation:** `docs/PRODUCT-MEMO.md` updated — clarifies **Free vs Pro** for daily aggregates, the **Rebuild daily aggregates** tool (0.3.5), and lists **Pro-only** planned enhancements (custom date range on trends, path drilldown, threshold alerts). No functional change from 0.3.5. = 0.3.5 = * **AI Visibility:** **Rebuild daily aggregates** (advanced) — recompute the daily summary table from the raw access log for a chosen calendar date range (site timezone). Use when WordPress cron did not run (e.g. local dev) or after restoring a database. Filter `ap_llmo_visibility_daily_max_backfill_days` caps how many days are processed per run (default 366). Action `ap_llmo_visibility_daily_backfilled` fires when done. The daily table is also auto-created on demand if missing. * Developer: `Ap_Llmo_Visibility_Daily::ensure_table_exists()`, `::backfill_range_inclusive( $start, $end )`. = 0.3.4 = * **WordPress.org compliance:** The plugin **no longer reads or writes** the site root `.htaccess` file. **Setup → Redirect** shows a copy-paste **Apache mod_rewrite** block (and Nginx examples as before). This addresses Plugins Team feedback on server file modifications. * Uninstall no longer attempts to edit `.htaccess`. = 0.3.3 = * **Apache `.htaccess`:** `/llms.txt` and `/sitemap-ai.xml` use **internal rewrites** to `index.php?…` with `[L,QSA]` instead of **HTTP 302** redirects, so the first request is handled by WordPress (better **AI Visibility** logging for pretty URLs; one fewer round-trip). * **llms / sitemap-ai:** Also match **canonical request paths** (e.g. `/llms.txt`) when query args are missing, in addition to `?ap_llmo_llms=1` / `?ap_llmo_sitemap_ai=1` (helps stacks without server rules). * **AI Visibility:** Logged **`path`** for these endpoints uses the **pretty pathname** (e.g. `/llms.txt`). **HEAD** requests from known AI crawlers are recorded. = 0.3.2 = * **AI Visibility — daily aggregates:** After each daily maintenance run, the plugin stores **one row per calendar day** (site timezone) with total AI bot visits and per-bot counts in a dedicated table. Used for long-term trends and by the Pro add-on (weekly email / charts). Retention defaults to match raw log retention (90 days); extend with filter `ap_llmo_visibility_daily_retention_days`. = 0.3.1 = * **Readme:** Short description and Description opening emphasize **AI crawler visibility** (logs, CSV) before llms.txt / sitemap / head links. Documentation-only; no code changes from 0.3.0. = 0.3.0 = * **Branding:** Plugin display name is now **ANDPLUS-LLMO** (aligned with **ANDPLUS-SchemaBridge**). wp-admin menu and readme use the **ANDPLUS-LLMO** name; Apache documentation uses the `# BEGIN ANDPLUS-LLMO` marker in the suggested snippet. = 0.2.9 = * Home (Free plan): wording now says upgrading **adds** Pro features (AI BYOK, llms.full.txt generation, weekly reports) instead of “unlock,” in EN/JA copy. = 0.2.8 = * **Licensing / Pro gate:** The free plugin no longer simulates Pro via `AP_LLMO_DEV_PRO` or the `ap_llmo_dev_pro` option. `Ap_Llmo_License::is_pro()` is only `apply_filters( 'ap_llmo_is_pro', false )` — the paid **ANDPLUS-LLMO Pro** add-on (or another extension) sets Pro via that filter. For local Pro development without a license, define `AP_LLMO_PRO_DEV` in `wp-config.php` **while the Pro add-on is active** (see Pro add-on readme). = 0.2.7 = * Home: the **Plan** sidebar shows **Pro** only when the **paid Pro add-on** is loaded and Pro is active. Development-only simulation (`AP_LLMO_DEV_PRO` / developer option) no longer shows a misleading Pro plan label. = 0.2.6 = * AI Visibility & Privacy: disclose the **stored row cap** (default 5000) alongside the 90-day retention policy—same behavior as before, not a Pro gate; admins see the effective cap on the AI Visibility screen. = 0.2.5 = * AI Visibility / Privacy copy: removed the extra sentence about a maximum stored row count (the `ap_llmo_access_log_max_rows` filter remains for developers who need it). = 0.2.4 = * AI Visibility: access log **timestamps are stored and aggregated in the WordPress site timezone** (Settings → General), not UTC. Period filters, retention pruning, and CSV use the same clock. **Rows recorded before 0.2.4 were stored in UTC** and may look offset by your timezone until they age out. = 0.2.3 = * AI Visibility CSV download filename uses the `andplus-llmo-access-log-…` prefix (replaces legacy `ap-llmo-…`). Developers can override the full filename with the `ap_llmo_access_log_csv_filename` filter. = 0.2.2 = * AI Visibility: period tabs are **7 / 30 / 90 days** only (the fourth tab duplicated the 90-day retention window; legacy `?period=all` redirects to 90 days). = 0.2.1 = * AI Visibility: raw access log rows are **retained for up to 90 days** (older rows removed by the plugin’s daily WordPress cron); optional **row cap** still trims oldest rows when the table is very large. * AI Visibility: **Download CSV** (current period) for administrators. * Readme: Privacy and FAQ updated for retention and CSV. = 0.2.0 = * Renamed plugin to **Andplus LLMO** (later **ANDPLUS-LLMO** in 0.3.0); text domain `andplus-llmo` (request slug reservation **andplus-llmo** with the Plugins Team when replying). * AI Visibility: full period filters, top paths, and retention limits for everyone in this plugin (no feature gating). * Removed `load_plugin_textdomain()`; WordPress 4.6+ loads translations from `/languages` automatically. * Sanitized access-log `REQUEST_URI` / `HTTP_USER_AGENT` and `ap_llmo_llms_body` on save. = 0.1.9 = * Free: `/sitemap-ai.xml` includes llms.txt; Pro extends sitemap with additional URLs. * Free: `robots.txt` comment for llms.txt URL and `Sitemap:` entry for sitemap-ai.xml. * Free: `wp_head` outputs `rel="sitemap"` for sitemap-ai.xml. * Apache `.htaccess` block now includes `sitemap-ai.xml` redirect alongside `/llms.txt`. == Upgrade Notice == = 0.3.7 = **CSV:** AI Visibility raw log export is UTF-8 **without BOM**. If Excel mis-reads the file when opened directly, import via **Data → From Text/CSV** and choose UTF-8. = 0.3.4 = **Apache:** Does not auto-write `.htaccess`. Copy the **Setup → Redirect** mod_rewrite block into site root `.htaccess` before `# BEGIN WordPress`. Replace any old `# BEGIN ANDPLUS-LLMO` block if your site used a release that wrote rules automatically. = 0.3.3 = **Apache:** Internal rewrite rules for `/llms.txt` and `/sitemap-ai.xml` (see 0.3.3 changelog). When upgrading to **0.3.4**, follow the Upgrade Notice for 0.3.4 for `.htaccess` handling. = 0.3.2 = Adds a **daily aggregate** table (no action required). After the next **daily** WordPress cron run, one row per calendar day is stored for trends; Pro can use it for charts and weekly email. = 0.3.1 = Documentation-only readme update (AI Visibility–first copy). No migration required. = 0.3.0 = Display name is now **ANDPLUS-LLMO**. Apache: use the suggested snippet in Setup (see current version’s Upgrade Notice for whether the plugin writes to `.htaccess`). = 0.2.9 = Minor admin copy: Home “Plan” text uses “adds” instead of “unlocks” for Pro features. = 0.2.8 = The free plugin removes Pro simulation constants/options; use the Pro add-on (and optional `AP_LLMO_PRO_DEV` for dev) for Pro behavior. = 0.2.7 = Home “Plan” no longer shows Pro when only development-mode Pro simulation is enabled. = 0.2.6 = readme Privacy and the AI Visibility screen now mention the stored row cap (default 5000) alongside the 90-day retention policy. = 0.2.5 = Documentation-only clarification on AI Visibility storage; no behavior change from 0.2.4. = 0.2.4 = AI Visibility times now follow your WordPress timezone. Older CSV rows may still show UTC until those rows are removed. = 0.2.3 = CSV exports from AI Visibility now use filenames starting with `andplus-llmo-access-log-`. = 0.2.2 = Minor UI: AI Visibility period tabs simplified to match the 90-day retention policy. = 0.2.1 = AI Visibility now prunes access log rows older than 90 days (daily). Export CSV from AI Visibility if you need a local backup. = 0.2.0 = Renamed to Andplus LLMO; re-activate after upload if WordPress does not pick up the new main file automatically. Replace the plugin folder completely when updating from unofficial ZIPs.