=== SEOMedic — SEO Booster & Link Auditor ===
Contributors: andrewmurray
Tags: broken links, seo, meta description, focus keyword, schema
Requires at least: 5.8
Tested up to: 7.0
Stable tag: 2.8.3
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Audit broken links, fix missing meta descriptions, detect H1 issues, fix YouTube embeds, and clean up internal linking — all from one dashboard.

== Description ==

Broken links, missing meta descriptions, duplicate H1s, unembedded YouTube videos — small technical issues that quietly cost you rankings and clicks every day. SEOMedic finds all of them in one place and gives you the tools to fix them fast.

No more crawling through posts one by one. No more spreadsheets. One dashboard, every issue, fixed in minutes.

**🔗 Broken Link Detection**

Scan every post and page for broken external links. SEOMedic checks the live HTTP status of each URL and flags anything returning an error. Fix the URL inline — no need to open the post editor — then re-check immediately to confirm.

**📝 Missing & Broken Meta Descriptions**

See every post missing a meta description in one sorted list. Flags meta descriptions that are too short (rewritten by Google) or too long (truncated in SERPs).

**🔍 Focus Keyword Assistant**

See every post missing a focus keyphrase. Bulk-sync focus keywords to Yoast SEO or Rank Math with one click.

**🧹 Content Pruning & Redirects**

Find low-performing posts that drag the rest of your site down. Save 301 redirect targets per post (stored locally — no external service). Decide which trashed posts should redirect somewhere and which should 404 cleanly.

**🖼️ Image Optimisation**

Rename uploaded image files to SEO-friendly basenames, audit alt-text coverage, and find images embedded without dimensions.

**H1 Tag Issues**

Posts with more than one H1 confuse search engines. SEOMedic lists every offending post and shows you the exact text of each H1 so you know which ones to demote to H2 or H3.

**▶️ YouTube & Video Issues**

Three video problems caught in one panel: plain YouTube links that will never auto-embed, Gutenberg embed blocks missing the 16:9 aspect ratio class, and Classic Editor iframes with hardcoded dimensions that break on mobile.

**🔀 Internal Link Health**

Find orphan posts with no inbound internal links, and spot link opportunities where another post on your site already mentions the topic but does not link to it.

**🗺️ Sitemap & Schema Audits**

Verify your sitemap is reachable and well-formed. Scan every post for Schema.org markup coverage and surface missing types.

**⚡ Core Web Vitals (optional)**

Connect a free Google PageSpeed Insights API key and audit your site's Core Web Vitals (LCP, INP, CLS) per page. The API key is yours — the plugin never proxies through us.

**⚙️ Bulk Link Management**

Browse every link across your entire site in one table. Apply nofollow, sponsored, UGC, or open-in-new-tab to hundreds of links at once. Find and replace a URL site-wide in seconds.

**Works with Yoast SEO and Rank Math**

Meta descriptions and SEO titles sync with Yoast SEO or Rank Math if active. Falls back to the native post excerpt when neither is installed.

= Want AI generation, Search Console, and Bing? =

Those features live in the separate **SEOMedic Pro** add-on plugin, which you can install alongside this one. Pro adds AI meta/title generation (Claude), Google Search Console integration with CTR opportunity scoring, Bing Webmaster Tools integration, and a Gutenberg post-insights sidebar. Install Pro from your account at the plugin author's site — it is not hosted here.

== Installation ==

1. Upload the `seomedic-seo-link-auditor` folder to `/wp-content/plugins/`, or install via **Plugins → Add New** in your WordPress admin.
2. Activate the plugin through the **Plugins** screen.
3. Navigate to **SEOMedic** in the WordPress admin sidebar.

**For Core Web Vitals audits (optional):**

1. Get a free [Google PageSpeed Insights API key](https://developers.google.com/speed/docs/insights/v5/get-started).
2. Enter it under **SEOMedic → Settings → Performance**.

== Frequently Asked Questions ==

= Does this work with any theme? =

Yes. The plugin operates entirely through the WordPress admin area and the REST API — it is theme-independent.

= Which SEO plugins are supported for focus keywords? =

Yoast SEO and Rank Math. If neither is installed the focus keyword is stored in the plugin's own post meta field.

= Will editing links here change my post content? =

Yes. When you save a link change the plugin updates the post content in the database via the WordPress REST API, exactly as if you had edited the post in the block editor.

= Does this plugin send any data to external servers? =

Link checking, meta description scanning, focus keywords, redirect saving, image rename, H1/video/schema/sitemap detection, and internal link health all run entirely within your WordPress site.

Two optional connections exist:

* If you opt in to Freemius on activation (it shows a notice — you can skip), your site URL, WordPress version, PHP version, and admin email are sent to Freemius for licence management and usage telemetry.
* If you provide a Google PageSpeed Insights API key and run the Core Web Vitals audit, the plugin sends each page URL to Google PageSpeed Insights.

Nothing else leaves your server.

== External Services ==

This plugin only contacts third-party services in the two cases listed below, and only when you have explicitly opted in or provided your own credentials.

= Google PageSpeed Insights API =

* **What it does:** Retrieves Core Web Vitals (LCP, INP, CLS) for individual page URLs so you can audit performance.
* **When it connects:** Only when you have entered a PageSpeed Insights API key under SEOMedic → Settings and you run the Core Web Vitals audit.
* **Data sent:** The page URL being audited. No post content, no user data.
* **Service URL:** https://www.googleapis.com/pagespeedonline/v5/runPagespeed
* **Privacy Policy:** https://policies.google.com/privacy
* **Terms of Service:** https://developers.google.com/terms

= Freemius =

* **What it does:** Handles plugin activation, opt-in usage telemetry, and software updates.
* **When it connects:** Upon plugin activation (opt-in only — users are shown a notice and can skip data sharing). Also during licence verification and update checks.
* **Data sent:** Site URL, WordPress version, plugin version, PHP version, and (if opted in) admin email address.
* **Service URL:** https://wp.freemius.com/
* **Privacy Policy:** https://freemius.com/privacy/
* **Terms of Service:** https://freemius.com/terms/

== Source code & build instructions ==

The React admin UI in `admin/build/` is built from the human-readable
TypeScript/TSX sources in `admin/src/`, which are included in this zip.
No third-party AI/Claude code is bundled into the free distribution —
those features live in the separate SEOMedic Pro add-on plugin.

To rebuild the admin UI from source:

    cd admin
    npm install
    npm run build

Build tool: Vite 6 with @vitejs/plugin-react. See `admin/package.json`
and `admin/vite.config.ts` for the full configuration. The output is
written to `admin/build/index.js` and `admin/build/index.css`.

== Screenshots ==

1. Link audit table — browse, filter, and edit all links across your posts.
2. Bulk actions bar — apply nofollow, sponsored, UGC, and new-tab to multiple links at once.
3. Focus Keyword Assistant — detect and bulk-fill missing SEO focus keyphrases.
4. YouTube & Video Issues — find unembedded links and wrong-aspect-ratio embeds.
5. Content Pruning — save per-post redirect targets for low-performing posts.
6. Internal Link Health — surface orphan posts and missed internal link opportunities.

== Changelog ==

= 2.4.7 =
* WP.org compliance pass: removed all Pro-only Claude/Anthropic handler code from the free distribution (moved to the separate SEOMedic Pro add-on plugin). The free zip no longer contains any calls to third-party AI APIs.
* Included the React UI source files (`admin/src/`) and build configuration in the zip so the compiled `admin/build/index.js` is reproducible from human-readable source.
* Tightened REST API permission checks: `GET/POST /seomedic/v1/settings` now requires `manage_options`; `POST /seomedic/v1/posts/{id}/dismiss` and `/undismiss` now verify `edit_post` on the specific target post.

= 2.4.0 =
* Plugin split for WordPress.org compliance: AI generation, Google Search Console, Bing Webmaster Tools, and Keywords Everywhere features moved to a separate **SEOMedic Pro** add-on plugin.
* Unlocked: Content Pruning redirect saving and Image File Rename are now available to all users (no Pro requirement).
* Tightened REST API permission checks on `/trashed-pending/{id}/dismiss` and `/check-link`.
* Renamed plugin text domain to `seomedic-seo-link-auditor` (matches plugin slug).
* Cleaned readme — removed entries for services this plugin no longer contacts.

= 2.3.x =
* Dashboard refactor — bulk meta operations, scroll-to-top, sitemap audit upgrades, plugin checker fixes.
* Gutenberg post-insights sidebar (moved to Pro in 2.4.0).
* Various fixes for keyword cannibalisation detection, readme stable-tag sync, and WP.org plugin-checker warnings.

= 1.0.x =
* Initial public releases — see git history for full per-version notes.

== Upgrade Notice ==

= 2.5.1 =
Stability and polish release. Adds an in-plugin Support link and renames the plugin to "SEOMedic — SEO Booster & Link Auditor". Free-version features unchanged. Safe to update.

= 2.4.0 =
**Plugin split.** AI/GSC/Bing features moved to the separate SEOMedic Pro add-on. Content Pruning redirects and Image Rename are now free. Strongly recommended update.
