=== SnippetDesk – SEO Title & Meta Description Manager ===
Contributors: rat7758
Tags: seo, meta description, meta title, bulk edit, woocommerce
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

See the SEO title and meta description every page really outputs, find what is missing, too long or duplicated, and fix it from one screen.

== Description ==

Your SEO plugin decides each page's title and meta description from a chain of rules: the page's own value, a template, the excerpt, or nothing at all. To see the result you normally have to open pages one by one.

SnippetDesk shows the **real output** for every page, post, product, category and tag on one screen, tells you **where each value comes from**, and lets you **fix it right there**.

It works with the SEO plugin you already use:

* **Rank Math**
* **Yoast SEO**
* **All in One SEO**

It does not replace your SEO plugin and adds nothing to your site's front end. Every value is read and saved through your SEO plugin's own code, so what you see is exactly what search engines get.

= What you can do =

* **See the real output** of every page: custom value, template, excerpt, or nothing output at all.
* **Find problems fast:** missing titles and descriptions, too long, too short, duplicates across the whole site, and noindex pages.
* **Search and filter** the whole site by status in one click.
* **Edit in place** and save many changes at once. If someone else changed a value while you were editing, you are warned instead of overwriting it.
* **Undo** any save or CSV import from the Recent changes list. Each undo is listed there too, so you can see what was restored.
* **Verify against live pages:** fetch each page as a visitor and compare the real `<title>` and meta description.
* **CSV export and import** with a preview of every change before anything is saved. Formula injection in spreadsheets is blocked.
* **AI suggestions (optional):** on WordPress 7.0 or later SnippetDesk uses WordPress AI, the provider you set up once in Settings → Connectors, so no key is stored in the plugin. You can also use your own API key with Claude, ChatGPT, Gemini, OpenRouter, DeepSeek, Mistral, Groq, xAI, or a local or other OpenAI-compatible server. Suggestions only fill the edit boxes; you review them and click Save.
* **Email report** weekly or monthly: how many pages need attention, what is new and what was fixed.
* **WooCommerce aware:** products, the Shop page, product categories and tags; Cart, Checkout and My account shown as noindex.

= Categories and tags =

Rank Math and Yoast SEO keep their own title and description for each category and tag, so they are editable here. The free version of All in One SEO has no per-term fields (that is an All in One SEO Pro feature), so categories and tags are shown and checked but read-only.

= Privacy and security =

* Only administrators (the `manage_options` capability) can use the plugin, and each item is also checked with WordPress's own edit permissions.
* Nothing is sent anywhere unless you set up AI suggestions and click a Suggest button (see External services).
* Your AI API key is stored encrypted and is never written to logs.
* "Verify against live pages" only requests pages on your own site and never follows redirects.

== External services ==

This plugin can send page details to an AI service to suggest meta titles and descriptions. This is optional: nothing is sent until an administrator sets up AI in SnippetDesk → Settings and clicks "Save and test AI", "✨ Suggest" or "Suggest for selected". Loading the Settings screen with a saved own API key also asks that provider for the list of models the key can use.

With **WordPress AI** (WordPress 7.0 or later), SnippetDesk hands the request to WordPress's built-in AI Client, which sends it to the AI provider the site owner set up in Settings → Connectors, under that provider's terms. SnippetDesk stores no key and contacts no AI service itself in this mode.

With **your own API key**, only the provider chosen in the settings is contacted.

Each suggestion request contains: the site name, the page name, URL and content type, the page's current meta title and description, the optional house style text from the settings, and up to 6,000 characters of the page's text (for categories and tags: the term description and the names of up to 25 items in it). With your own API key, the key is sent to that provider too; with OpenRouter, the site address and the plugin name are also sent, because OpenRouter asks apps to identify themselves.

The providers SnippetDesk can contact directly with your own API key, the addresses used, and their terms and privacy policies:

* **Anthropic (Claude)**: api.anthropic.com. [Terms](https://www.anthropic.com/legal/commercial-terms), [Privacy policy](https://www.anthropic.com/legal/privacy)
* **OpenAI (ChatGPT)**: api.openai.com. [Terms](https://openai.com/policies/services-agreement/), [Privacy policy](https://openai.com/policies/privacy-policy/)
* **Google (Gemini)**: generativelanguage.googleapis.com. [Terms](https://ai.google.dev/gemini-api/terms), [Privacy policy](https://policies.google.com/privacy)
* **OpenRouter**: openrouter.ai. [Terms](https://openrouter.ai/terms), [Privacy policy](https://openrouter.ai/privacy)
* **DeepSeek**: api.deepseek.com. [Terms](https://cdn.deepseek.com/policies/en-US/deepseek-open-platform-terms-of-service.html), [Privacy policy](https://cdn.deepseek.com/policies/en-US/deepseek-privacy-policy.html)
* **Mistral AI**: api.mistral.ai. [Terms](https://legal.mistral.ai/terms), [Privacy policy](https://legal.mistral.ai/terms/privacy-policy)
* **Groq**: api.groq.com. [Terms](https://groq.com/terms-of-use), [Privacy policy](https://groq.com/privacy-policy)
* **xAI (Grok)**: api.x.ai. [Terms](https://x.ai/legal/terms-of-service-enterprise), [Privacy policy](https://x.ai/legal/privacy-policy)
* **Other / local server**: the address you enter yourself (https, or http on localhost only, for example Ollama or LM Studio). The same data goes to that address under that service's own terms.

The plugin sends the optional email report with WordPress's own mail function (`wp_mail()`), to the addresses you enter in the settings. It contacts no other external service.

== Installation ==

1. Install and activate an SEO plugin: Rank Math, Yoast SEO or All in One SEO.
2. Install SnippetDesk from Plugins → Add New, or upload the plugin folder to `/wp-content/plugins/`, then activate it.
3. Open **SnippetDesk** in the admin menu. It reads every page once (this starts by itself and takes a moment).
4. Tick the content types you want to manage and click **Load**.
5. Optional: add an AI API key and choose an email report schedule under **SnippetDesk → Settings**.

== Frequently Asked Questions ==

= Do I still need my SEO plugin? =

Yes. SnippetDesk is a control panel for Rank Math, Yoast SEO or All in One SEO. It reads and saves through them and outputs nothing on its own.

= Why does a page show "Template" instead of my text? =

The page has no own value, so your SEO plugin builds one from the template for that content type. Type a value in the box to give the page its own, or leave it empty to keep the template.

= Can I undo a change? =

Yes. Every save and CSV import is listed under "Recent changes" with an Undo button. Undo only restores a value that nobody has changed since. The undo itself is also listed (marked "Undo") as a record of what was restored; it cannot be undone again, but you can simply save the value you want.

= Is AI required? Does it cost money? =

No. AI suggestions are optional. With WordPress AI, usage is billed by the provider set up in Settings → Connectors; with your own API key, by that AI provider. Never by this plugin.

= Why are categories read-only with All in One SEO? =

The free version of All in One SEO has no per-category or per-tag title and description; every term uses the taxonomy template. You can change that template in All in One SEO → Search Appearance → Taxonomies.

= What happens when I switch SEO plugin? =

SnippetDesk detects the switch and asks you to rescan, so every value is read again from the new plugin.

= Does it slow down my site? =

No. It only runs in the admin area. The index it uses for search and filters is updated in the background when a page is saved.

= What is removed when I delete the plugin? =

Its two database tables, its settings, the saved API key, each user's screen preferences and the scheduled report. Your SEO plugin's data is never touched.

== Changelog ==

= 1.0.0 =
* First release.

== Upgrade Notice ==

= 1.0.0 =
First release.
