=== GetSei ===
Contributors: santowilem
Tags: seo, readability, ai, meta description, block editor
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.3.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

SEO, readability and AI-answer (GEO) checks for your posts as you write, in the block editor, alongside your SEO plugin.

== Description ==

Sei scores each post while you write it: for search (SEO), for readability, and for how likely AI answers are to quote it (GEO, generative engine optimisation). The checks run in your browser, in the Sei sidebar of the block editor. They need no account and send nothing anywhere.

**In the block editor**

* An SEO, a readability and an AI-answer score for the post, updated as you type.
* 34 checks, among them: the focus keyphrase in the title, introduction, subheadings, slug and meta description; keyphrase density; title width and meta description length; internal and outbound links; sentence and paragraph length, passive voice, transition words and Flesch reading ease; answer-first introductions, statistics, quotes, comparison tables and freshness; heading order and image alt text; affiliate links marked as sponsored.
* Click a check to jump to the block it is about.
* The post's focus keyphrase, SEO title and meta description, with a search snippet preview.

**Works with your SEO plugin**

When Yoast SEO, Rank Math, All in One SEO, SEOPress or The SEO Framework is active, Sei writes the SEO title, meta description and focus keyphrase into that plugin's fields and leaves the page's head to it. When one of those fields is edited directly (in the SEO plugin's own box, or by another tool), Sei keeps that value and shows it, rather than writing its own over it. Without an SEO plugin, Sei prints the SEO title and meta description itself.

**Optional: write and publish from Sei**

Sei is also a web app (https://getsei.vercel.app) where you write and score articles, see Google Search Console data, check your site's health and track how AI engines answer your customers' questions. Connecting this site there lets Sei import your posts and publish articles to WordPress as blocks, with their SEO fields. Connecting is optional and happens in the Sei app: WordPress asks you to approve an application password for Sei. The plugin itself stores no secrets and makes no requests to Sei. See "External services" below.

**Privacy**

Sei's post meta (the SEO fields, the Sei article id and Sei's bookkeeping) is readable over the REST API only by users who can edit the post, in the edit context. The plugin adds no tracking, no cookies and no front-end scripts.

== Installation ==

1. In WordPress, go to Plugins → Add New, search for "GetSei" and click Install, then Activate. Or upload the `getsei` folder to `/wp-content/plugins/` and activate it on the Plugins screen.
2. Open a post in the block editor and click the Sei icon in the top bar (or Options → Sei) to open the sidebar.
3. Optional: to import posts into Sei and publish from it, sign in at https://getsei.vercel.app, add this site and choose Settings → Connect WordPress. WordPress shows its own "Authorize application" screen; approve it.

== Frequently Asked Questions ==

= Do I need a Sei account? =

No. The sidebar's checks run in your browser and work without an account. An account is only needed to write and publish from the Sei web app.

= Does the plugin send my content anywhere? =

No. The plugin makes no outbound requests. If you connect the site in the Sei web app, Sei's servers read and write posts through the WordPress REST API with the application password you approved. See "External services".

= Does it replace Yoast SEO or Rank Math? =

It works alongside them. With one of the supported SEO plugins active, Sei writes into that plugin's fields and leaves the page's meta tags to it.

= Which post types are supported? =

Posts, in the block editor. Pages and custom post types are not scored yet.

= How do I disconnect the site from Sei? =

Disconnect it in Sei → Settings, or revoke the "Sei" application password under Users → Profile → Application Passwords.

= What happens when I delete the plugin? =

Deleting it from Plugins removes every post meta value whose key starts with `_getsei_` (the SEO title, meta description and keyphrase Sei stored, the Sei article id, and Sei's sync and mirroring records) and its `getsei_db_version` option, unless another copy of GetSei that uses them is still installed. Values an older copy (1.2 or earlier) left under Sei's old `_sei_` keys go too, unless that older copy is still installed. The values Sei mirrored into an SEO plugin's own fields belong to that plugin and stay. Deactivating the plugin removes nothing.

= Where is the source code? =

In the plugin. The sidebar script in `build/` is compiled; its human-readable source is included: `src/` (the sidebar) and `engine/` (the analysis engine it bundles), with the `package.json` that lists the build tools. To rebuild `build/`, run `npm install`, then `npm run build` in the plugin's folder. `src/BUILD.md` has the details.

== External services ==

The plugin itself makes no requests to any external service. Its checks run in the browser.

It is made to work with Sei, a web service at https://getsei.vercel.app run by the plugin's authors. Nothing is sent to Sei unless a user with an account in the Sei web app connects this site there (Settings → Connect WordPress) and an administrator approves the application password WordPress asks about. From then on:

* When the site is connected, Sei reads the site's REST API index (the site's address and whether application passwords are on). Right after the approval, Sei creates a fresh application password named "Sei" for the same user, checks that it works and deletes the one from the approval; Sei stores the password encrypted. Disconnecting the site in Sei deletes Sei's application passwords from WordPress.
* When the site is connected, and before each publish, Sei reads the plugin's status endpoint (`/wp-json/getsei/v1/status`: the plugin's version, which SEO plugin is active, and the site's time zone), the connected WordPress user's name and capabilities, and the site's time zone setting.
* When a user imports posts in Sei, Sei reads the site's posts through the WordPress REST API: each post's id, title, content, slug, status, link, dates and Sei's SEO fields.
* When a user publishes, updates or unpublishes an article in Sei, Sei writes that post through the REST API: its title, slug, content (as blocks; images are linked by their address, not uploaded), status, date and SEO fields, plus the id of the Sei article and a hash of the content it sent (Sei's own records, in `_getsei_*` post meta).
* When a user previews a draft in Sei, Sei sends its title, content and featured image address to `/wp-json/getsei/v1/preview`. The plugin keeps them for ten minutes under a random token and answers with a link to a published post that shows the draft in its place; Sei loads that link once, without a WordPress session, and shows the page in the Sei web app. No post is changed, and the page is sent with no-cache and noindex headers.
* For Sei's Site health feature, Sei's crawler (SeiBot, https://getsei.vercel.app/bot) reads the site's public pages, robots.txt and sitemap, like any search engine crawler.

The links in the plugin ("Connect in Sei") open https://getsei.vercel.app/sites in a new tab; following them sends nothing beyond a normal page visit.

Sei's terms of service: https://getsei.vercel.app/terms
Sei's privacy policy: https://getsei.vercel.app/privacy

== Screenshots ==

1. The Sei sidebar in the block editor: the SEO, readability and GEO scores, and the SEO checks.
2. The GEO tab: what makes the post more likely to be quoted in AI answers.
3. The focus keyphrase, SEO title and meta description, with the search snippet preview.

== Changelog ==

= 1.3.0 =
* Everything the plugin declares or stores now uses the `getsei` prefix, as WordPress.org's guidelines ask: its post meta (`_getsei_*`), REST routes (`/wp-json/getsei/v1/`), functions, options and scripts. Data an earlier version stored under the old `_sei_*` keys is moved automatically when you update or activate the plugin.

= 1.2.0 =
* Draft previews from Sei in your own theme: Sei can show a draft as it will look on your site before it is published. The preview lasts ten minutes, changes no post, and is never cached or indexed.
* Pages: the Sei sidebar, SEO fields and their mirroring into your SEO plugin now work on pages too, and Sei can import and publish your pages.
* Social title and description: set in Sei, they become the shared link's Open Graph tags (printed by Sei when no SEO plugin does, or copied into Yoast, Rank Math, SEOPress or The SEO Framework).
* Old page URLs keep working: when Sei gives a published page a new slug, the old URL redirects to the page (WordPress already does this for posts, but not for pages).
* Inline highlights: choosing a check in the Sei sidebar highlights the text it is about, right in the block. The highlight never changes the post, and goes when you edit the text.

= 1.1.1 =
* "Connect in Sei" opens Sei's Sites screen, where a site is now connected.

= 1.1.0 =
* "No category chosen": the sidebar nudges when a post has no category. It never changes the scores.

= 1.0.0 =
* First public release: the Sei sidebar with its SEO, readability, AI-answer and accessibility checks, the SEO title, meta description and focus keyphrase with a snippet preview, mirroring into Yoast SEO, Rank Math, All in One SEO, SEOPress and The SEO Framework, and the status endpoint for the Sei web app.

== Upgrade Notice ==

= 1.3.0 =
New `getsei` prefix for everything the plugin stores, per WordPress.org's guidelines. Your existing SEO fields and Sei records are moved automatically.

= 1.2.0 =
Preview Sei drafts in your own theme, and see the text each check is about highlighted in the editor.

= 1.1.1 =
"Connect in Sei" points at Sei's Sites screen.

= 1.1.0 =
A nudge when a post has no category.

= 1.0.0 =
First public release.
