=== Subset PersonaMark ===
Contributors: functionform
Tags: seo, meta description, title, audit, personamark
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 0.2.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

See your PersonaMark to-dos in wp-admin and apply its title and meta description rewrites, one reviewed change at a time.

== Description ==

Subset PersonaMark connects your site to PersonaMark with a site API key. It shows the site's to-dos next to the posts they affect, and applies PersonaMark's title and meta description rewrites after showing you the before and after. Each change is saved as a post revision, so you can undo it.

* **Overview.** Subset > PersonaMark shows the latest audit's score and its to-dos, each linking into PersonaMark, with a button to run a new audit.
* **Editor panel.** In the block editor, a PersonaMark panel in the post's settings lists the issues the latest audit found on that page, each linking into PersonaMark, and its title and meta description rewrites. Each rewrite shows the current text next to the suggestion. Nothing changes until you choose Apply and confirm it.
* **WP-CLI.** `wp subset personamark` connects, checks and disconnects the site, lists the to-dos, runs an audit and waits for it, and shows a post's issues and rewrites. `wp subset personamark apply` applies one field of one rewrite, after showing the before and after and asking you to confirm, with the same revisions as the editor panel. The API key is read from STDIN or a hidden prompt and never printed.
* **Where changes go.** A title or description is saved to Subset SEO when it's active, otherwise to Yoast SEO or Rank Math. Without an SEO plugin, a title goes to the post's own title, and descriptions can't be applied. Only people who can edit the post can apply a rewrite.

The rewrites are written by a model that read your page, so check each one before you apply it. The plugin applies only the text PersonaMark holds for that rewrite, fetched again on your server when you choose Apply.

== External services ==

This plugin connects to PersonaMark (https://work.personamark.app), which audits your site. When you connect, check the connection, open its screens or open the PersonaMark panel on a published post, your site sends its PersonaMark site API key to PersonaMark's API to read the site's details and audits and ask PersonaMark to check its ownership. PersonaMark then loads your homepage to find the verification meta tag the plugin adds. The editor panel also sends the post's public address, to find that page in the latest audit. Nothing is sent until you paste a key and choose Connect.

== Installation ==

1. Upload the plugin and activate it.
2. In PersonaMark, open your site's Settings > API tab and make a key.
3. Go to Subset > PersonaMark > Settings, paste the key and choose Connect.

== Changelog ==

= 0.2.1 =
* Security: Applying rewrites is limited to 10 a minute per user, so one account can't use up the site's PersonaMark rate limit. The `subset_personamark_apply_limit` filter changes it (0 for no limit). Applying also reuses the site details the panel already loaded.
* Security: The API key field and `wp subset personamark status` show a fixed mask instead of the key's last four characters.
* Changed: On a network site other than the main one, the API key field now says when `SUBSET_PERSONAMARK_API_KEY` in wp-config.php gives every site in the network the same key.
* Security: The Subset menu and its Overview page now need the same capability as a Subset page you can open, so a subscriber no longer reaches the Overview.
* Changed: Built on subset-core 1.13.3.

= 0.2.0 =
* New: WP-CLI commands under `wp subset personamark`: `status`, `connect`, `verify` and `disconnect`; `todos`; `audit run` (with `--wait`) and `audit status`; and `page <post>`, which lists a post's issues and rewrites.
* New: `wp subset personamark apply <post> <rewrite-id> --field=<title|description>` applies one field of one rewrite. It needs `--user`, shows the before and after, and asks to confirm unless you pass `--yes`. Each change is saved as a post revision, as in the editor panel. There's no bulk apply.
* `connect` reads the API key from STDIN or a hidden prompt, never from an argument, and never prints it.

= 0.1.0 =
* First version: the Subset > PersonaMark screen.
* Connect the site with a PersonaMark site API key, stored encrypted. Connecting adds PersonaMark's verification meta tag and checks the site's ownership.
* The Overview tab: the latest audit's score and to-dos, and Run audit.
* The block editor's PersonaMark panel: the page's issues, and title and meta description rewrites applied one confirmed change at a time, each saved as a post revision.
