=== CometRank - AI SEO Writer ===
Contributors: brandsharkteam
Tags: publishing, leads, seo, integration, content
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 0.8.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Publish CometRank pages to WordPress and capture leads locally while syncing to your CometRank account.

== Description ==

CometRank connects your WordPress site to [CometRank](https://cometrank.ai), an external content and lead-generation platform. After you connect your site, CometRank can publish HTML pages to WordPress and provision lead-capture forms on published content.

Official WordPress connector for [CometRank](https://cometrank.ai), developed and maintained by [Brandshark](https://brandshark.in).

**What this plugin does on your WordPress site:**

* Pairs your site with CometRank using a secure bearer token (no manual token copy/paste).
* Receives published HTML or zip bundles from CometRank and creates/updates WordPress posts and pages.
* Normalizes CometRank HTML into native WordPress block markup (images, buttons, FAQs).
* Stores visitor lead submissions locally before forwarding them to CometRank.
* Retries failed lead deliveries automatically and lets admins review or export leads.
* Serves **llms.txt** — an AI-native curated sitemap at `/llms.txt` for LLM crawlers (no API key required).

**External service required**

This plugin is a connector to CometRank. You need a CometRank account and an active connection before publishing and lead forwarding work. See [CometRank](https://cometrank.ai) for product details and account terms.

== Installation ==

1. Install and activate the plugin from the WordPress Plugins screen (or upload the zip).
2. In WordPress admin, open **CometRank** in the left sidebar (Leads, Crawler Helper, Settings).
3. In your CometRank account, open **Settings → WordPress** and click **Connect**.
4. Return to WordPress — the connection completes automatically.

For manual installs, upload the `cometrank-publisher` folder to `wp-content/plugins/` and activate it.

== Frequently Asked Questions ==

= Do I need a CometRank account? =

Yes. Publishing, pairing, and lead forwarding require an active CometRank account and a completed site connection.

= Does the plugin work without CometRank? =

The plugin installs and stores settings locally, but publishing and lead forwarding to CometRank require the external service. Visitor leads are still archived locally when submissions are received.

= What happens if CometRank is temporarily unreachable? =

Lead submissions are saved in WordPress first. The plugin queues failed forwards and retries them automatically. You can review leads under **CometRank → Leads**.

= What is llms.txt? =

llms.txt is a Markdown file served at `/llms.txt` on your site. It lists your most important pages with short descriptions so AI crawlers (ChatGPT, Perplexity, Claude, etc.) can discover your content. Enable it under **CometRank → Crawler Helper**. No external AI API is required — descriptions are built from CometRank SEO meta, Yoast, Rank Math, excerpts, or post content.

= Does llms.txt conflict with Yoast or Rank Math? =

No. The plugin reads SEO meta from Yoast and Rank Math when building llms.txt entries and respects noindex settings. It does not duplicate schema or meta tags on your front end.

= Does the plugin add "powered by" links on my public site? =

No. The plugin does not add branding links to your front-end pages.

= Can I publish from CometRank to existing WordPress posts? =

Yes. CometRank can target an existing post by ID or slug when publishing via the plugin REST API.

== Privacy ==

**Data stored in WordPress**

* Hashed bearer tokens and connection settings (options table).
* Lead form submissions (custom `cometrank_leads` table).
* Post metadata for published CometRank content (SEO fields, asset references, project IDs).

**Data sent to CometRank**

* Site pairing registration (install ID, site URL, plugin version).
* Published content payloads you send from CometRank.
* Lead form submissions (name, email, phone, company, message, source URL, and related metadata).

**When outbound calls occur**

* After activation and when connecting from CometRank (pairing).
* When CometRank publishes content to your site (inbound to WordPress).
* When visitor leads are forwarded or retried to CometRank.

By activating the plugin and completing the Connect flow in CometRank, the site administrator authorizes this integration. Review CometRank privacy and terms on [cometrank.ai](https://cometrank.ai).

== Screenshots ==

1. CometRank admin — Leads tab with connection badge and lead metrics.
2. Crawler Helper tab with llms.txt, Markdown endpoints, and robots.txt settings.
3. Settings tab showing connection and lead capture status.
4. Published CometRank page with lead capture on the front end.

== Changelog ==

= 0.8.0 =
* Top-level **CometRank** admin menu with Leads, **Crawler Helper**, and Settings tabs.
* **llms.txt** AI-native sitemap at `/llms.txt` (curated Markdown index per [llmstxt.org](https://llmstxt.org/), no API key required).
* **Markdown Endpoints** — serve `.md` versions of posts/pages and honor `Accept: text/markdown`.
* **LLM Crawler Access** — append Allow rules for named AI crawlers to `robots.txt`.
* **Cache Management** — flush and regenerate llms.txt cache from admin.
* **Try CometRank** CTA in admin header when not connected to CometRank.
* Descriptions use CometRank meta, Yoast, Rank Math, excerpts, or post content.
* Regenerates on publish, post save, daily cron, and via `POST /llms-txt/regenerate`.
* Legacy Settings submenu URL redirects to the new admin menu.

= 0.7.3 =
* Lead form treats locally stored submissions as success (thank-you when forward is queued).
* Settings page shows last lead forward error for admin debugging.

= 0.7.2 =
* Lead capture modal: always enqueue lead-form script and config when post has lead capture enabled.
* Do not require site-config or inline bundle CSS/JS meta before loading the contact modal.
* Lead-form script depends on config so window.cometrankLeadForm is defined before handlers attach.
* Skip duplicate inline bundled cometrank-lead-form.js; use plugin asset instead.

= 0.7.1 =
* Accept POST on `/categories` for CometRank category sync (avoids cached HTML on GET REST URLs).

= 0.7.0 =
* Seed default blog categories on activation when only Uncategorized exists.
* New GET `/categories` endpoint for CometRank category sync.
* Publish endpoints accept `category_ids` for WordPress posts.
* WordPress.org review: inline bundle CSS, sideload images to Media Library, JSON-LD and inline script escaping fixes.

= 0.6.6 =
* Bundle JS stored in post meta and enqueued via WordPress script API; uploads/cometrank holds static assets only (CSS, images, fonts).

= 0.6.5 =
* install-verify response includes signed `reconnect_url` for CometRank Connect handoff.

= 0.6.4 =
* Text domain aligned to WordPress.org slug `cometrank`.
* Pairing redirect requires `cometrank_verify` matching install-verify nonce (CSRF protection).
* Bundle upload path hardening for version segments and file copy containment.

= 0.6.3 =
* Display name updated to CometRank - AI SEO Writer for WordPress.org.

= 0.6.2 =
* WordPress.org review fixes: Author URI brandshark.com, wp_enqueue for lead config, IP sanitization, normalize-content capability checks, bundle upload allowlist.

= 0.6.1 =
* Renamed display name to CometRank Publisher for WordPress.org clarity.
* Updated author to Brandshark (CometRank) and added official connector affiliation in readme.

= 0.6.0 =
* WordPress.org submission release.
* Added GPL license, uninstall cleanup, and directory hardening.
* Improved REST API permission callbacks and JSON-LD output safety.
* Removed third-party CDN JavaScript loading (WordPress.org guideline compliance).
* Rewrote plugin readme for the WordPress.org plugin directory.

= 0.5.6 =
* Local lead archive with CSV export and retry queue.
* Docker-aware API base URL resolution for lead forwarding.
* Content normalization for images, CTAs, and FAQ sections.

== Upgrade Notice ==

= 0.8.0 =
New CometRank admin menu, llms.txt AI sitemap, and legacy Settings URL redirect.

= 0.7.3 =
Lead form and category sync reliability fixes.

= 0.7.2 =
Fixes lead capture CTA modals not opening on published posts.

= 0.7.1 =
Category sync reliability: POST supported on `/categories` endpoint.

= 0.7.0 =
Category support and WordPress.org compliance updates. Bundle CSS is now inlined like JS; images import to the Media Library.

= 0.6.6 =
Bundle publish stores JavaScript in post meta instead of the uploads directory.

= 0.6.5 =
Pairing handoff update. install-verify now exposes `reconnect_url`.

= 0.6.4 =
Security and pairing contract update. CometRank Connect redirect must include `cometrank_verify`. See COMETRANK_INTEGRATION.md in the plugin repo.

= 0.6.3 =
Display name update only. No functional changes.

= 0.6.2 =
Security and WordPress.org compliance improvements. Recommended for all users.

= 0.6.1 =
Display name and readme updates for WordPress.org plugin directory review. No functional changes.

= 0.6.0 =
WordPress.org release with security and compliance improvements. Recommended for all users.
