=== ROAS Master SEO Fields ===
Contributors: giladch1
Tags: seo, meta description, seo title, rest api, post meta
Requires at least: 5.6
Tested up to: 7.1
Requires PHP: 7.0
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Opens a page's SEO title and meta description to the REST API for users who may edit that page, and prints them when no SEO plugin is active.

== Description ==

ROAS Master is a service by Boost Media that prepares SEO titles and meta descriptions for the pages of a site. The site owner reviews every change on an approval page, and only the approved changes are written to the site, through the WordPress REST API.

WordPress lets an outside service write a page's content through its REST API, but not the SEO title and the meta description: Yoast SEO keeps them in two protected fields (`_yoast_wpseo_title`, `_yoast_wpseo_metadesc`) that its own REST API only reads. This plugin registers exactly those two fields for the REST API, for pages and posts, and nothing else.

* **With Yoast SEO:** the plugin opens the two fields. Yoast SEO keeps printing them, as always.
* **Without an SEO plugin:** the plugin also prints them: the page's title (the browser tab and search results) and the `<meta name="description">` tag.
* **With Rank Math, All in One SEO, SEOPress or The SEO Framework:** the plugin prints nothing; that plugin owns the page's head.

What it does not do:

* It sends no request to any other server, and loads nothing from elsewhere.
* It adds no option, no database table and no admin screen.
* A write is stored only when the logged-in WordPress user may edit that page or post (`edit_post`). An empty value brings back the default title.
* Deactivate or delete it and the fields are closed again. Nothing is deleted: the titles and descriptions stay in the page's fields, and Yoast SEO reads them if it is installed later.

The plugin answers one read-only REST route, `GET /wp-json/roas-seo-fields/v1/status` (users who can edit posts), with its version and mode, so a connected service can see that it is active.

The plugin works on its own: any REST client with a WordPress user that may edit the page can read and write the two fields. It does not require a ROAS Master account.

= About ROAS Master =

ROAS Master (https://roas-master.boostmedia.co.il/) is the service this plugin was written for. The plugin itself never contacts it. When a site owner connects a site to ROAS Master, the service calls the site's REST API with the WordPress user and application password the owner gave it. Its terms: https://roas-master.boostmedia.co.il/terms . Its privacy policy: https://roas-master.boostmedia.co.il/privacy .

The plugin's source is the plugin itself: one readable PHP file, with no build step.

== Installation ==

1. In the WordPress admin: Plugins > Add New Plugin, search for "ROAS Master SEO Fields", Install, Activate.
2. That is all. There are no settings.

A connection whose WordPress user may install plugins can also install it through the WordPress REST API (`POST /wp-json/wp/v2/plugins` with the slug `roas-master-seo-fields`). ROAS Master does that only after the site owner approves that step.

== Frequently Asked Questions ==

= Do I need Yoast SEO? =

No. With Yoast SEO the plugin opens Yoast's two fields; without any SEO plugin it prints the title and the description itself.

= Who can write the fields? =

Only a logged-in WordPress user (for example through an application password) who may edit that page or post. Values are stored as plain text (`sanitize_text_field`).

= Does it change anything when it is activated? =

No. Until a value is written to a page, the page prints exactly what it printed before.

= What happens when I remove the plugin? =

The REST API stops accepting the two fields. The values that were written stay where they are; nothing is deleted.

= Is this plugin made by Yoast? =

No. It is made by Boost Media and is not affiliated with Yoast. It uses the same two field names so that Yoast SEO, when it is active, prints what was written.

== Privacy ==

The plugin collects no data, sets no cookie, stores no personal data and sends nothing to any server. It stores only the SEO title and meta description that an authorised user writes to a page or post, in that page's own fields.

== Changelog ==

= 1.1.0 =
* First release in the WordPress.org plugin directory: readme, text domain, plugin URI, license notice.
* Prints the title and the meta description on a site without an SEO plugin.
* A read-only status route (`roas-seo-fields/v1/status`).

= 1.0.0 =
* Opens Yoast SEO's title and meta description to the WordPress REST API.

== Upgrade Notice ==

= 1.1.0 =
Prints the title and the meta description when no SEO plugin is active. No setting to change.
