=== Trinetra SEO ===
Contributors: vidhaatatechnologies
Tags: seo, geo, aeo, schema, sitemap
Requires at least: 5.6
Tested up to: 7.0
Requires PHP: 7.2
Stable tag: 4.1.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

SEO + GEO/AEO toolkit: real-time score, JSON-LD schema, XML sitemap, redirects, social meta — plus AI-search (AI Overviews, ChatGPT, Perplexity) citation optimization.

== Description ==

**Trinetra SEO** is a complete, lightweight SEO toolkit for WordPress — built for how search works today, including AI search engines like ChatGPT, Perplexity and Google AI Overviews.

Everything you need to rank, in one plugin:

* **Real-time SEO score (0–100)** — analyze any post/page as you write, with clear fixes
* **Schema / structured data (JSON-LD)** — Article, Product, FAQ, HowTo, LocalBusiness, Breadcrumb, Organization, WebSite
* **XML sitemaps** — automatic, search-engine-ready
* **Redirects + 404 monitor** — 301 redirects, preserve link equity
* **Social meta** — Open Graph & Twitter cards
* **Breadcrumbs**, **Robots.txt** & **llms.txt** controls
* **Meta title & description** editor with a Google-style preview
* Works **alongside Yoast or Rank Math** — won't duplicate schema or meta

= AI-Citation — GEO & AEO (optional) =
This is **GEO (Generative Engine Optimization)** and **AEO (Answer Engine Optimization)** for WordPress: Trinetra scores how citable each page is for AI search engines and answer engines like Google AI Overviews, ChatGPT and Perplexity (answer-first structure, FAQ schema, entity clarity, extractable facts). The core toolkit above is free and runs locally; AI-Citation (GEO) along with LLMs.txt, the Google Indexing API, IndexNow and AI Suggestions are part of the optional **Pro** upgrade. Full-page (whole-URL) GEO analysis additionally uses the optional **Trinetra Core** service (see *External services* below).

== External services ==

Every SEO feature in this plugin works locally and for free. The features below are **optional** and only contact a third-party service when you explicitly enable/use them.

**1. Trinetra Core** — a service operated by Vidhaata Technologies for full-page SEO analysis and AI-Citation (GEO) scoring (a full crawl + scoring that cannot be done inside WordPress).

* **When:** only if you set a Trinetra Core API URL under Trinetra SEO → Settings, then click "Trinetra Core scan" (empty/off by default).
* **What is sent:** the URL (or HTML) of the post you choose to analyze, plus the Trinetra Core API key (if set) for authentication. No site-visitor data is sent.
* **Endpoint:** the URL you configure (e.g. https://trinetra-core.onrender.com).
* **Terms:** https://trinetraseo.com/terms — **Privacy:** https://trinetraseo.com/privacy

**2. AI provider (your choice)** — powers the optional "AI Suggestions" feature (meta description, focus keyword, FAQ and title suggestions), using **your own** API key for the provider you select: Google Gemini, Groq, OpenAI or Anthropic Claude.

* **When:** only if you enable AI Suggestions, choose a provider and enter that provider's API key under Trinetra SEO → AI Suggestions, then click a "Generate" button. Off by default.
* **What is sent:** the title and content (trimmed to ~3000 characters) of the post you are editing, sent to the chosen provider's API with your key. No site-visitor data is sent.
* **Endpoints & policies (you only contact the one provider you select):**
    * Google Gemini — endpoint: generativelanguage.googleapis.com — Terms: https://ai.google.dev/gemini-api/terms — Privacy: https://policies.google.com/privacy
    * Groq — endpoint: api.groq.com — Terms: https://groq.com/terms-of-use/ — Privacy: https://groq.com/privacy-policy/
    * OpenAI — endpoint: api.openai.com — Terms: https://openai.com/policies/terms-of-use — Privacy: https://openai.com/policies/privacy-policy
    * Anthropic Claude — endpoint: api.anthropic.com — Terms: https://www.anthropic.com/legal/consumer-terms — Privacy: https://www.anthropic.com/legal/privacy

**3. Google Indexing API** — optional; automatically submits your published/updated post URLs to Google so they can be crawled sooner. This is a Google service, not operated by us.

* **When:** only if you enable "Google Indexing" under Trinetra SEO → Indexing and upload your own Google service-account credentials. Off by default. A request is sent when you publish or update a post of an enabled type.
* **What is sent:** the public URL of the published/updated post and an action type ("URL_UPDATED"), authenticated with an access token obtained from your own Google service account. No site-visitor data is sent.
* **Endpoints:** Google OAuth token (oauth2.googleapis.com), Google Indexing API (indexing.googleapis.com).
* **Terms:** https://developers.google.com/terms — **Privacy:** https://policies.google.com/privacy

**4. IndexNow (Microsoft Bing & participating engines)** — optional; submits your published/updated post URLs to the IndexNow protocol so engines like Bing can discover them sooner. This is a third-party protocol/service, not operated by us.

* **When:** only if you enable "IndexNow" under Trinetra SEO → Indexing and provide/generate an IndexNow key. Off by default. A request is sent when you publish or update a post of an enabled type.
* **What is sent:** the public URL of the published/updated post, your site host, and your IndexNow key. No site-visitor data is sent.
* **Endpoint:** IndexNow (api.indexnow.org).
* **Terms:** https://www.indexnow.org/faq — **Privacy:** https://privacy.microsoft.com/privacystatement

**5. Trinetra license activation server** — a service operated by Vidhaata Technologies, used **only** to activate and validate an optional paid Pro license key on this domain. The plugin and every feature listed above are completely free and fully functional without it; this service is never contacted unless you choose to enter a Pro license key.

* **When:** only when you click **"Activate License"** (after typing a key) under Trinetra SEO → License — and, once a key is active, a once-daily background check re-validates that same key. Nothing is sent on a fresh install, on activation, or at any other time unless you opt in by activating a key.
* **What is sent:** your license key, this site's domain, the admin email address (to bind the license and email your receipt) and the site name. On the daily re-validation only the license key and domain are sent. No usernames, no phone numbers and no site-visitor data are ever sent.
* **Endpoint:** https://license.trinetraseo.com
* **Terms:** https://trinetraseo.com/terms — **Privacy:** https://trinetraseo.com/privacy

== Installation ==

1. Upload the `trinetra-seo` folder to `/wp-content/plugins/`, or install via Plugins → Add New → Upload.
2. Activate the plugin through the **Plugins** menu.
3. Go to **Trinetra SEO** in the admin menu to configure.
4. (Optional) To enable AI-Citation (GEO) / full-page scans, add your Trinetra Core API URL under Trinetra SEO → Settings and your API key under Trinetra SEO → Trinetra Core.

== Frequently Asked Questions ==

= Does it work alongside Yoast or Rank Math? =
Yes. Trinetra detects existing SEO output and won't duplicate schema or meta descriptions.

= Do I need the Trinetra Core service? =
No. All core SEO features (score, schema, sitemap, redirects, meta, social, breadcrumbs) work locally with no external service. The Trinetra Core service only powers optional AI-Citation (GEO) and full-page analysis.

= What is AI-Citation (GEO)? =
GEO (Generative Engine Optimization) scores how likely your content is to be cited by AI search — ChatGPT, Perplexity, Google AI Overviews — and tells you what to improve.

= Is it free? =
Yes. The core SEO toolkit is free and fully functional on its own — real-time SEO score, JSON-LD schema, XML sitemaps, redirects + 404 monitor, social meta, breadcrumbs, robots.txt, auto meta descriptions, auto image alt and auto internal linking all work with no key and no external service.

An optional paid **Pro** upgrade unlocks advanced extras — AI-Citation (GEO) analysis, LLMs.txt, the Google Indexing API and IndexNow integrations, and AI Suggestions. Pro is activated with a license key on the **License** tab; activating that key is the only time the plugin contacts the Trinetra license server (see *External services*). You never have to buy or activate anything to use the free toolkit.

= Do I need an API key for AI Suggestions? =
Yes. The optional "AI Suggestions" feature uses an AI provider of your choice (Google Gemini, Groq, OpenAI or Anthropic Claude) with **your own** API key, so you control the (typically very small) cost directly. It is off until you enable it and add your key.

== Screenshots ==

1. Real-time SEO score in the post editor.
2. Trinetra Core full-page / AI-Citation (GEO) scan.
3. Schema (JSON-LD) generator.
4. Dashboard with feature status.
5. Redirects & 404 monitor.

== Changelog ==

= 4.1.1 =
* Clarified GEO (Generative Engine Optimization) and AEO (Answer Engine Optimization) wording so it's easier to find the AI-search features. No functional changes.

= 4.1.0 =
* Privacy: removed all automatic "phone home." The license server is now contacted ONLY when you explicitly click "Activate License" — nothing is sent on install or admin load. Trimmed the data sent on activation to domain, admin email and site name (no usernames or phone numbers).
* IndexNow is now OFF by default — no external request is made on publish unless you enable it.
* Documented the Trinetra license activation server and added explicit Terms + Privacy links for every AI provider (Gemini, Groq, OpenAI, Anthropic) in the External services section.
* Security: the GEO REST endpoint now verifies edit access to the specific requested post (current_user_can('edit_post', $post_id)) instead of only the broad edit_posts capability.
* Clarified in the readme which features are free vs part of the optional Pro upgrade.

= 2.2.4 =
* Documented all external services (Google Indexing API, IndexNow) in the readme with what data is sent, when, and links to each service's Terms and Privacy policy.
* Hardened the Trinetra Core REST endpoint: the permission callback now verifies edit access to the specific requested post (not just the broad edit_posts capability).
* Sanitized all nonce values read from $_POST with wp_unslash + sanitize_text_field before verification.
* Escaped all output: JSON-LD schema now hex-escapes script-breaking characters, and array indices/attribute values are cast/escaped before output.

= 2.0.3 =
* Fixed duplicate meta boxes in the post editor — the consolidated "Trinetra SEO" box now correctly replaces the older individual boxes.

= 2.0.2 =
* AI Suggestions now supports multiple providers (Google Gemini, Groq, OpenAI or Anthropic Claude) — bring your own key.

= 2.0.1 =
* All features are now free and fully functional locally (no feature gated behind a license).
* Reframed the former "License" tab as optional Trinetra Core service connection.
* Moved all inline admin scripts/styles to properly enqueued assets.
* Hardened input sanitization (wp_unslash + sanitization on all request data).
* Documented external services (Trinetra Core, Anthropic Claude API) in the readme.

= 2.0.0 =
* Rebranded to Trinetra SEO.
* Added Trinetra Core integration: full-page analysis and AI-Citation (GEO) scoring.
* Shared license across WordPress and the Trinetra Shopify app.

= 1.7.1 =
* SEO analyzer, schema generators, sitemap, redirects, social meta, breadcrumbs, robots/llms, Indexing API, IndexNow.

== Upgrade Notice ==

= 2.0.0 =
Adds AI-Citation (GEO) optimization via the optional Trinetra Core service.
