=== Stedica SEO ===
Contributors: stedica
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 3.32.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: seo, schema, structured data, sitemap, redirects

Audit every page and fix what it finds: meta, schema and social gaps, sitemaps, redirects, hreflang. Works with Yoast, Rank Math, SEOPress, AIOSEO.

== Description ==

Most SEO plugins help you optimise a post while you are writing it. Stedica SEO starts from the other end: it audits the pages you already published, scores every issue by severity, and gives you one screen to work through them.

It is also built to be installed *alongside* whatever SEO plugin you already use. Stedica reads and writes Yoast, Rank Math, SEOPress and All in One SEO metadata, so you can run an audit today without migrating anything or losing what you have.

**What the free edition does**

* **Site audit** — scans every URL on the site and groups every issue by severity: Critical, High, Medium, Low.
* **Titles and meta descriptions** — edit inline, with length guidance, a live Google preview, and templates with dynamic variables such as `#current_year`.
* **Canonical URLs and meta robots** — per-post noindex, nofollow, noarchive and nosnippet, merged correctly into WordPress' own robots output.
* **Open Graph and Twitter Cards** — per-post social metadata with an image picker.
* **Core structured data** — Organization, WebSite, WebPage and BreadcrumbList JSON-LD, linked by `@id`, with structured opening hours, a shop return policy, and dynamic variables for hand-written schema.
* **Breadcrumbs** — BreadcrumbList schema on singular views.
* **XML sitemap** — paginated, cached and image-aware, with robots.txt integration.
* **robots.txt editor** — override the virtual robots.txt, with your sitemap appended automatically.
* **IndexNow** — submit new and updated URLs to Bing, Yandex, Seznam and Naver.
* **Redirects** — unlimited rules (301, 302, 307, 410, 451) plus a 404 log, CSV export, and a warning in the editor when a page's URL is redirected.
* **Image alt text** — find every image missing alt text and fix it.
* **Readability** — Flesch Reading Ease, shown right in the editor.
* **CSV export** — take the full issue list anywhere.
* **Elementor compatible** — reads content, headings and images from Elementor's own data, which a plain `post_content` read misses.
* **Works with your existing SEO plugin** — reads and writes Yoast, Rank Math, SEOPress and AIOSEO fields.
* **Translation ready** — every string in the interface is translatable, with translations delivered through translate.wordpress.org.
* **Headline analysis** — length, keyword placement and structure scored as you type.
* **HTML sitemap** — `[stedica_html_sitemap]`, nested and cached.
* **Table of contents** — a block, or `[stedica_toc]`, with stable heading anchors.
* **Cornerstone content** — mark your important pages and their problems are scored higher.
* **hreflang and multilingual sitemaps** — Polylang and WPML aware; the sitemap lists every active language.
* **llms.txt** — a machine-readable summary of your site for AI crawlers.
* **Orphan and under-linked pages** — every page with no inbound internal links, found during the audit.
* **Keyword cannibalisation** — your own pages competing for the same term.
* **Quick wins** — the pages one or two fixes away from being clean.
* **Fix Mode** — work through issues one at a time, approve suggestions and apply them in bulk.
* **Schema editor** — validate your JSON-LD and edit individual `@graph` nodes by hand.
* **Broken link scan** — check outbound links on demand.
* **Undo** — put back a page's SEO fields as they were before Stedica's last change, from Issues or the post editor.
* **SEO permission** — let a contractor do SEO without an administrator account.
* **REST API** — `/wp-json/stedica-seo/v1/` for audits, issues and per-page SEO fields.
* **MCP server** — let Claude, ChatGPT or Cursor read and fix your SEO from a conversation. Sign in with OAuth or an application password; off by default, read-only mode, per-tool switches, one-click disconnect.
* **Primary category** — for breadcrumbs and %category% permalinks, compatible with Yoast, Rank Math, SEOPress and AIOSEO.
* **Preferred Source on Google** — a block asking readers to add your site as a preferred source in Google Search.
* **WP-CLI** — `wp stedica-seo audit`, `analyze`, `status` and `health`.
* **Analytics that wait for consent** — Google Analytics 4, Matomo or Microsoft Clarity, loaded only after your cookie banner says yes (WP Consent API or Google Consent Mode v2). Cache-safe.
* **Health screen** — what is working, and what quietly stopped.
* **Setup wizard** — four questions on first install.

**Stedica SEO Premium**

Premium is a separate plugin that installs alongside this one and both stay active — you will see two rows in your plugins list, the same way Yoast Premium and SEOPress PRO work. Keep this plugin installed; Premium needs it and adds to it. It adds the parts that need automation, an external API, or work across your whole site at once:

* AI meta titles, descriptions, alt text, schema, FAQ blocks and content briefs — using your own API key with OpenAI, Anthropic, Google Gemini, Mistral or Groq, with a screen that tracks tokens and estimated spend.
* Scheduled scans, and scan and weekly digest emails.
* Google Search Console — indexing status, impressions, clicks, average position, and per-URL indexing requests.
* Google Analytics 4 organic sessions.
* Core Web Vitals (LCP, INP, CLS) via PageSpeed Insights.
* Redirect importers for Redirection, Yoast Premium, Rank Math, AIOSEO, SEOPress and Safe Redirect Manager.
* Scheduled broken-link checking on a cron, rather than on demand.
* Internal linking suggestions, with one-click insertion into the donor page.
* AI schema generation, including FAQ and HowTo blocks.
* Multi-location Local SEO — a LocalBusiness entry per branch, with address geocoding.
* Keyword rank tracking — daily positions from Search Console, with biggest movers.
* Content decay — pages whose impressions have fallen away since an earlier audit.
* Monthly SEO reports — on screen, as a PDF, or emailed on a schedule.

Details at [stedica.com](https://stedica.com/).

== External services ==

This plugin can connect to third-party services. All of them are optional and only used when you explicitly enable and configure them in Settings.

**Google Search Console / Google Analytics 4** — When connected, the plugin sends your site URL and individual page URLs to Google in order to retrieve indexing status and traffic metrics. Requires you to authorise access via Google OAuth.
Terms: https://policies.google.com/terms — Privacy: https://policies.google.com/privacy

**Google PageSpeed Insights** — When you request Core Web Vitals for a page, that page's URL is sent to Google.
Terms: https://policies.google.com/terms — Privacy: https://policies.google.com/privacy

**AI providers (OpenAI, Anthropic, Google Gemini, Mistral or Groq — whichever you configure)** — When you use an AI feature (meta generation, alt text, schema generation, content briefs), the plugin sends the relevant page's title, URL, meta description, focus keyword and an excerpt of its text content to the provider you selected, using the API key you supply. No data is sent unless AI is enabled in Settings and a key is present.
OpenAI: https://openai.com/policies/terms-of-use — https://openai.com/policies/privacy-policy
Google Gemini: https://ai.google.dev/terms — https://policies.google.com/privacy
Anthropic: https://www.anthropic.com/legal/commercial-terms — https://www.anthropic.com/legal/privacy
Mistral: https://legal.mistral.ai/terms/ — https://legal.mistral.ai/terms/privacy-policy/
Groq: https://groq.com/terms-of-use — https://groq.com/privacy-policy

**IndexNow (Bing, Yandex, Seznam, Naver)** — **Off by default.** If you tick the IndexNow box in Settings, the URL of each post you publish or update is sent to `https://api.indexnow.org/indexnow`, which passes it to those search engines so they can recrawl it. Only the URL is sent — no page content, no personal data, and nothing about your visitors. Nothing is transmitted until you enable it, and unticking the box stops it immediately.
Service: https://www.indexnow.org/
Terms of use: https://www.indexnow.org/terms
Privacy policy: https://privacy.microsoft.com/privacystatement

**Analytics tags: Google Analytics 4, Matomo, Microsoft Clarity** — **Off by default.** Only when you enter an ID under Settings → Analytics does the plugin add that service's tag to your pages. The tag then loads in the visitor's browser from `https://www.googletagmanager.com` (Google Analytics), from the Matomo server whose address you entered, or from `https://www.clarity.ms` (Microsoft Clarity), and that service receives what its tag collects: the page address, referrer, browser and device details, the visitor's IP address and the service's own cookies. By default no tag loads until the visitor accepts statistics cookies in your consent banner (through the WP Consent API or Google Consent Mode). Stedica itself receives nothing.
Google Analytics: https://marketingplatform.google.com/about/analytics/ — Terms: https://marketingplatform.google.com/about/analytics/terms/us/ — Privacy: https://policies.google.com/privacy
Matomo: https://matomo.org/ — Privacy: https://matomo.org/privacy-policy/ (self-hosted servers: your own policy applies)
Microsoft Clarity: https://clarity.microsoft.com/ — Terms: https://clarity.microsoft.com/terms — Privacy: https://privacy.microsoft.com/privacystatement

**YouTube Data API (Premium — video schema only)** — When a post containing a YouTube video is saved, and a YouTube Data API key is set under Settings → Google, the video's id and your key are sent to `https://www.googleapis.com/youtube/v3/videos` to read its title, description, thumbnail, length and upload date for VideoObject schema. Nothing about the visitor or the page is sent, and nothing is sent while pages are viewed.
Terms: https://developers.google.com/youtube/terms/api-services-terms-of-service — Privacy: https://policies.google.com/privacy

**OpenStreetMap / Nominatim (Premium — Local SEO only)** — When you click *Find coordinates* on the Local SEO settings, the business address you typed is sent to `https://nominatim.openstreetmap.org/search` to look up its latitude and longitude. It runs only on that click, and the request identifies itself with the plugin name, version and your site URL as Nominatim's usage policy requires.
Terms: https://operations.osmfoundation.org/policies/nominatim/ — Privacy: https://wiki.osmfoundation.org/wiki/Privacy_Policy

**Stedica AI model catalogue (Premium — AI only)** — When you click *Check for AI updates* under Settings → AI, and once a week while the AI features are licensed, the add-on downloads `https://wordpress.stedica.com/ai-models.json`, a public list of current AI models and their prices. The request carries only the add-on's version number. No site URL, content or personal data is sent, although, as with any web request, Stedica's server sees the requesting IP address. Nothing downloaded is applied until an administrator reviews it and clicks *Apply updates*.
Terms: https://stedica.com/terms-of-use/ — Privacy: https://stedica.com/privacy-policy/

**Freemius (licensing, updates and optional usage data)** — Freemius handles Premium licence checks and updates. The free plugin ships with tracking switched off: the SDK runs in anonymous mode, so no site or user data is sent unless you accept its opt-in notice, which you can dismiss or decline and still use every feature.
Terms: https://freemius.com/terms/ — Privacy: https://freemius.com/privacy/

If your site serves visitors in the EU, disclose any AI provider you enable in your own privacy policy, since page content is transmitted to that provider.

Note that in the free edition the AI providers, Search Console, Analytics and PageSpeed integrations are not present in the package at all, so nothing is sent to any of them.

== Licence ==

Stedica SEO is licensed **GPL-2.0-or-later**. A copy of the GPL v2 ships in `LICENSE`.

The plugin bundles the Freemius WordPress SDK (`vendor/freemius/`), which is licensed **GPL-3.0**; its own licence text is in `vendor/freemius/LICENSE.txt`. Because Stedica SEO is offered under GPL v2 *or later*, the two are compatible, and the combined distribution you receive is effectively governed by GPL v3. This is noted here so the presence of two different GPL versions in the package is not mistaken for an oversight.

Third-party components and their licences:

* Freemius WordPress SDK — GPL-3.0 — https://github.com/Freemius/wordpress-sdk
* Chart.js (`assets/js/chart.umd.min.js`) — MIT — https://www.chartjs.org/

Everything else in this package is Copyright © 2026 Stedica LLC.

== Installation ==

1. Upload the `stedica-seo` folder to `/wp-content/plugins/`, or install the ZIP via **Plugins → Add New → Upload Plugin**.
2. Activate the plugin through the **Plugins** menu.
3. Go to **Stedica SEO → Settings** to set your title and description lengths.
4. Go to **Stedica SEO → Audit** and run your first scan.

== Frequently Asked Questions ==

= Do I have to remove Yoast / Rank Math / SEOPress / AIOSEO? =

No. Stedica detects the active SEO plugin and reads and writes its metadata fields, so both stay in sync.

= Does it work with Elementor? =

Yes. Content, H1 detection, word count, readability and image alt scanning all read Elementor's stored page data, which a normal `post_content` read would miss.

= Is AI required? =

No. Every AI feature is optional and off until you add your own API key. Without it the plugin still audits, scores, and lets you edit everything manually.

= Who pays for the AI calls? =

You do, directly to whichever provider you configure, using your own API key. The **AI Costs** page tracks token usage and estimated spend.

= What languages is Stedica available in? =

The interface is written in English and is fully translatable — every string, including the screens drawn in the browser by JavaScript. Translations are hosted on translate.wordpress.org and WordPress installs them for you when you set your site language, so nothing ships inside the plugin.

= Can I translate Stedica into another language? =

Yes, and the best place to do it is <https://translate.wordpress.org/projects/wp-plugins/stedica-seo/>. Translating there means your work is reviewed by the WordPress polyglots community, shipped to every site through the normal translation updates, and never lost on a plugin update. A `languages/stedica-seo.pot` template also ships with the plugin; its header explains which strings must be left in English (product names, Schema.org types, and values the plugin stores internally) and how the `%s`/`%d` placeholders work.

If you would rather work offline first, copy the template to `stedica-seo-{your_locale}.po` and translate it in a tool like Poedit, then import the result at translate.wordpress.org. Always validate with `msgfmt --check` before importing — it catches the placeholder mistakes that would otherwise break the plugin in your language only.

A translation you keep locally belongs in `wp-content/languages/plugins/`, which survives plugin updates; WordPress prefers a translation found there.

= Will it slow down my site? =

Front-end work is minimal: the plugin outputs meta tags on singular pages and does one indexed lookup for redirects. Scanning and AI calls happen in the admin area or on a schedule, never during a visitor's page load.

= How do I upgrade to Premium? =

From **Stedica SEO → Upgrade** inside your dashboard. There is a 7-day trial and it does not ask for a card. Stedica SEO Premium installs alongside this plugin rather than replacing it — keep this one active — and nothing in your data changes.

= Is Premium a separate plugin, or does it replace this one? =

Separate. Stedica SEO Premium installs alongside Stedica SEO and both stay active — two rows in your plugins list. Premium contains only the paid features and uses this plugin's code, so it cannot run without it. WordPress enforces that for you: it will not activate Premium without Stedica SEO, and will not let you deactivate Stedica SEO while Premium is active.

= Do I have to reconfigure anything after upgrading? =

No. Your settings, scans, redirects and every meta description you have written stay exactly as they are — Premium reads the same data this plugin already wrote. If you later cancel, deactivating Premium leaves all of it untouched; only the paid features stop.

= What is the difference between the free version and Premium? =

The free edition is complete. It audits every URL on your site, stores as many redirects as you need, and everything it does it does fully — nothing is capped, watermarked or half-written. Stedica SEO Premium is a separate add-on that adds capability this plugin does not contain: AI writing, Google Search Console and Analytics, Core Web Vitals, keyword rank tracking, content decay detection, scheduled auditing, the redirect importers and the broken link checker.

= What happens to my redirects if my licence lapses? =

Nothing. Redirects are part of this free plugin and there is no limit on them, so every rule you created keeps working and you can still add, edit, disable and delete them exactly as before. A lapsed licence only stops the separate Premium add-on from updating.

== Screenshots ==

1. Issues — quick wins first: the pages closest to clean, plus a severity-scored history of every scan.
2. The dashboard after a scan: pages scanned, issues by severity, and connected services. Search Console, Analytics 4 and the AI providers shown here are Premium features.
3. Audit — choose the post types, then scan the pages you already published. Results export to CSV.
4. The post editor: a live search preview with length-checked title and description, and tabs for social, schema and robots. The badge top right names the metadata source, so the same box edits Yoast, Rank Math, SEOPress or All in One SEO fields when one of those is active.
5. Redirects — import existing rules from Redirection, Rank Math or All in One SEO, add exact or regex 301s, and promote a logged 404 to a redirect in one click.
6. Settings — breadcrumb schema, the redirect engine, XML sitemaps and the rest, each opt-in. "Move in from another SEO plugin" copies metadata across without modifying or removing the other plugin.

== Changelog ==

The full history is in `changelog.txt`, which ships with the plugin.

= 3.32.0 =
* **Analytics that wait for consent.** Add Google Analytics 4, Matomo or Microsoft Clarity under Settings → Analytics. No tag loads until your cookie banner reports consent, through the WP Consent API (Complianz, CookieYes, Cookiebot and others) or Google Consent Mode v2, which starts with everything denied. The choice is applied in the visitor's browser, so page caches keep working. Optional: leave out logged-in editors, report 404 visits, GA4 cross-domain. Stedica adds no banner of its own.
* **Opening hours the way Google reads them.** Lines like "Mo-Fr 09:00-17:00" are printed as structured opening hours, closed days are left out, and Settings names any line it cannot read. "Su Closed", which the field itself suggested, used to be printed as an invalid value.
* **Return policy for online shops**, set once under Organization and applied by Google to every product. Address parts left empty are no longer printed as a blank address.
* **Page Head switch** in Settings → General: let another SEO plugin publish the page head and use Stedica to audit.
* **MCP:** assistants can read, add, replace and delete a page's schema, and set a post's primary category.
* Fixed: a schema with a double quote in any value was corrupted on save and vanished from the page, and Undo did nothing for titles containing one. With the Page Head switch off and no other SEO plugin, pages no longer get two title tags.

= 3.31.1 =
* **Undo is back on screen.** Every change Stedica makes to a page's SEO fields has always been recorded, but there was no button to put it back. Issues now has Undo beside Before / After on rows with an applied fix, and the post editor shows what Stedica last changed on the page, and when, with an Undo button.
* **The in-plugin manual is up to date** with everything through 3.31.0: AI assistant sign-in, Search Console data, primary category, multilingual sitemaps, CSV redirects, video schema and the REST API. Several settings locations it named had moved; they are corrected.
* The Health screen's scheduled-task check now knows about the daily Search Console sync.

= 3.31.0 =
* **Connect claude.ai and ChatGPT with one sign-in.** The MCP server now supports OAuth: paste the server URL into the assistant, sign in to your own site and approve, optionally read-only. Settings lists connected assistants with a one-click Disconnect. Works on hosts that block /.well-known/ addresses, such as SiteGround.
* **Test connection** in Settings → AI Assistants (MCP) shows whether credentials and sign-in discovery reach your site, and how to fix it if not. Hosts that drop the Authorization header can use X-Stedica-Authorization, and application passwords now work where WordPress itself would ignore them.
* **Multilingual sitemaps fixed.** With WPML or Polylang the sitemap listed only the default language; it now lists every active language and leaves out inactive ones.
* **Primary category** for breadcrumbs and %category% permalinks, chosen in the editor or taken from Yoast, Rank Math, SEOPress or AIOSEO. A live URL never changes unless you choose.
* **Preferred Source on Google** block and shortcode. **Export redirects to CSV.** The Table of Contents block appears in the editor again.
* IndexNow no longer submits a newly published post twice. 3.30.0 restored submissions for updated posts; first publishes were already being sent.

== Upgrade Notice ==

= 3.32.0 =
Analytics tags that wait for consent, structured opening hours, a shop return policy, and a fix for schemas that contained a double quote.

= 3.31.1 =
Adds Undo buttons to Issues and the post editor, and brings the in-plugin manual up to date.

= 3.31.0 =
Connect claude.ai and ChatGPT with one sign-in, fixes WPML/Polylang sitemaps that listed only the default language, and adds primary categories.
