=== Nyrav SEO ===
Contributors: nyravai
Tags: seo, schema, internal links, image optimization, llms.txt
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.4.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connects your site to Nyrav so the SEO fixes, schema and articles you approve in Nyrav are applied to WordPress automatically.

== Description ==

Nyrav is an AI SEO and AEO (answer engine optimization) service. It audits your website, writes a 30-day plan every month for Google and AI assistants (such as ChatGPT, Gemini, Perplexity and Claude), and drafts the work. You review and approve each change in the Nyrav app; this plugin then applies it to your site:

* SEO titles and meta descriptions (written into Yoast SEO, Rank Math or All in One SEO if you use one, otherwise output by this plugin)
* Image alt text in your media library
* Schema (JSON-LD) such as Organization, Service and FAQ
* Hiding pages from search engines (noindex)
* 301 redirects
* New blog articles, saved as drafts or published
* An llms.txt file for AI assistants
* Image optimisation: compressing and resizing large media library images (the original is kept as a backup and can be restored), plus an optional WebP copy
* Internal links: linking a phrase in a page's text to another page on your site (and removing that link again)
* A mobile viewport meta tag (only if Nyrav found your theme has none) and the Google Search Console verification meta tag

Nothing changes without your approval in Nyrav. The plugin needs a Nyrav account to do anything; on its own it only shows a connection key under Settings → Nyrav.

Nyrav is operated by JSM GLOBAL BPO SERVICES PVT LTD. Project designed and developed by PPC Expertz.

== Installation ==

1. Install and activate the plugin from Plugins → Add New, or upload the `nyrav-seo` folder to `/wp-content/plugins/`.
2. Go to Settings → Nyrav and copy the connection key.
3. In Nyrav, open Settings → Connect WordPress and paste the key.

To disconnect, click "Create a new key" under Settings → Nyrav, or deactivate the plugin.

== Frequently Asked Questions ==

= Do I need a Nyrav account? =

Yes. The plugin is the connector between your site and the Nyrav service. Without an account it does nothing except show the connection key.

= Can Nyrav change my site without my approval? =

No. Nyrav only sends a change after you approve it in the Nyrav app. Every request is signed with your connection key (HMAC-SHA256 with a timestamp); requests without a valid, fresh signature are rejected.

= Who can see the connection key? =

Only administrators (users who can manage options) can see it, on Settings → Nyrav. Keep it private. If you think it has leaked, click "Create a new key" and paste the new key into Nyrav.

= Does it work with Yoast SEO, Rank Math or All in One SEO? =

Yes. Titles, meta descriptions and noindex settings are written into whichever of those plugins is active. If none is active, the plugin prints the title and meta description itself.

= What happens to an existing llms.txt file? =

If your site root already has an llms.txt file and it is writable, the plugin updates it and keeps a one-time backup named `llms.txt.nyrav-backup`. Otherwise llms.txt is served by WordPress from the plugin's settings.

= How does image optimisation work? =

When you approve it in Nyrav, the plugin compresses the full-size image in your media library (and scales it down if it is wider than the approved maximum, never up), then rebuilds the smaller sizes WordPress uses. Before the first change it saves a copy of the original next to it, named like `photo.jpg.nyrav-orig`. If the result would not be smaller, the original file is put back unchanged. When your server supports WebP, a WebP copy (`photo.jpg.webp`) is also saved next to the image; what WordPress shows visitors is not changed. Nyrav can restore the original at any time.

= How are internal links added? =

Nyrav sends the page, the exact phrase and the page on your site to link to. The plugin links that phrase only where it appears as normal text: never inside an existing link, a heading, code, HTML attributes, block markup or shortcodes. Links to other websites are refused. WordPress keeps a revision of the page, so you can also undo the change from the page's revision history.

= What is removed when I delete the plugin? =

Deleting the plugin removes its settings (connection key, redirects, llms.txt text, schema, viewport and Google verification settings) and the Nyrav fields it stored on posts and images. Articles it created, internal links it added to your content, and titles or descriptions already saved in your SEO plugin, are kept. Files are never deleted: image backups (`*.nyrav-orig`) and WebP copies stay in your uploads folder, and optimised images stay optimised. To get originals back, ask Nyrav to restore them before deleting the plugin, or rename the `.nyrav-orig` files yourself.

== External services ==

This plugin connects your site to **Nyrav**, an AI SEO/AEO service operated by JSM GLOBAL BPO SERVICES PVT LTD (designed and developed by PPC Expertz). It is required for the plugin to work.

The plugin does not make outgoing requests and contains no tracking. Instead, the Nyrav service calls the plugin's REST endpoints (`/wp-json/nyrav/v1/...`) on your site, and only after you have pasted the connection key into Nyrav. Every request must be signed with that key.

When Nyrav calls your site:

* **When you connect the site, and when Nyrav checks the connection** (`GET /wp-json/nyrav/v1/status`): the plugin returns your site name, home URL, WordPress version, plugin version, which SEO plugin is active (Yoast SEO, Rank Math, All in One SEO or none), whether WooCommerce is active, which of the features below this plugin version supports, and the address of your XML sitemap.
* **When you approve page changes** (`POST /wp-json/nyrav/v1/apply`): Nyrav sends the page URL and the new SEO title, meta description, image alt text, schema, noindex setting or redirect target. The plugin returns whether each change was applied.
* **When you approve an article** (`POST /wp-json/nyrav/v1/post`): Nyrav sends the article title, slug, content, meta description, FAQ and whether to publish it or save it as a draft. The plugin returns the new post's ID, status, URL and edit link.
* **When you approve an llms.txt file** (`POST /wp-json/nyrav/v1/llms`): Nyrav sends the llms.txt text. The plugin returns whether an llms.txt file in the site root was updated.
* **When you approve an image optimisation, or ask to undo one** (`POST /wp-json/nyrav/v1/images/optimize`, `POST /wp-json/nyrav/v1/images/restore`): Nyrav sends the image URL and the maximum width, quality and whether to make a WebP copy. The plugin returns the media library ID, the file size before and after, and the WebP copy's URL.
* **When you approve an internal link, or ask to remove one** (`POST /wp-json/nyrav/v1/links/insert`, `POST /wp-json/nyrav/v1/links/remove`): Nyrav sends the page URL, the phrase to link and the page on your site to link to. The plugin returns the post ID and whether the link was added or removed.
* **When you approve head tags** (`POST /wp-json/nyrav/v1/head`): Nyrav sends whether to add a mobile viewport meta tag and your Google Search Console verification code. The plugin returns which of the two are now switched on.

No visitor data, user accounts, passwords or other personal data are sent to Nyrav by this plugin.

* Nyrav terms of service: https://nyrav.ai/terms
* Nyrav privacy policy: https://nyrav.ai/privacy
* Contact: marketing@ppcexpertz.com

== Changelog ==

= 1.4.0 =
* New: articles Nyrav saved as drafts can be published from Nyrav after you approve them (undo puts them back to draft).

= 1.3.0 =
* New: Pause Nyrav. One click hides every change Nyrav made (titles, descriptions, schema, redirects, links, llms.txt, noindex) without deleting anything; Resume brings them back.
* New: change log in Settings → Nyrav, with Undo on every change and "Undo the last 24 hours".
* Undo never overwrites an edit someone made after Nyrav.

= 1.2.0 =
* Safer redirects: a Nyrav redirect only applies to an address that no longer exists, never to a page that is live.
* New: Settings → Nyrav lists the redirects Nyrav added, each with a Remove button.

= 1.1.0 =
* New: image optimisation (compress / resize media library images, with a backup and one-click restore, plus an optional WebP copy).
* New: approved internal links can be added to page content, and removed again.
* New: optional mobile viewport and Google Search Console verification meta tags.
* The connection check now also reports supported features and the sitemap address.

= 1.0.3 =
* Prepared for the WordPress.org directory: security hardening, translations, readme.

= 1.0.2 =
* llms.txt: also updates an existing llms.txt file in the site root (keeps a backup).

= 1.0.1 =
* Safer redirects: never redirect the homepage or a page to itself.

= 1.0.0 =
* First release.

== Upgrade Notice ==

= 1.4.0 =
Lets you publish Nyrav's draft articles from Nyrav after approving them.

= 1.3.0 =
Adds Pause and Undo for every Nyrav change. Recommended for all sites.

= 1.2.0 =
Redirects now never hide a page that exists. Recommended for all sites.

= 1.1.0 =
Adds image optimisation, internal links and head tags. Nothing changes on your site until you approve it in Nyrav; your connection key keeps working.

= 1.0.3 =
Security hardening and translation improvements. No settings change; your connection key keeps working.

= 1.0.2 =
Lets Nyrav update an existing llms.txt file in your site root.
