=== Relinka for Internal Linking ===
Contributors: krafts03
Tags: internal links, internal linking, seo, link building, related posts
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 8.1
Stable tag: 0.8.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Internal linking toolkit: visualize your link graph, score link health, find broken links, and add relevant internal links with one-click undo.

== Description ==

**Relinka** is an **internal linking plugin** that turns hours of manual work into a fast, visual review. It maps how your posts link to each other, scores how well your site is interlinked, finds broken and orphaned pages, and proposes relevant internal links — each with a short reason. You stay in control: **approve or undo any change in one click**, with a full before/after snapshot.

Internal links are one of the highest-leverage, most-neglected parts of on-page SEO: they spread link equity, fix orphaned pages, and help readers (and crawlers) discover related content. Relinka makes that work fast and safe — and it's **completely free and fully functional**: no account, no API key, no locked features.

= What you get =
* **Internal link analysis & visualization** — inbound/outbound counts, orphaned pages, pages with no outbound links.
* **Internal-link health score** — one number (0–100) for how well your site is interlinked, with one-click fixing of orphaned pages.
* **Broken internal link finder** — see and fix dead internal links in one list.
* **Keyword cluster graph** — see how your topics connect.
* **Relevant link suggestions with a reason** — context-aware suggestions, in your content's language, built from your own text (no external service).
* **One-click approve / undo** — every applied link is a revertable snapshot. Nothing is rewritten without your say-so.
* **Natural placement** — links land at sensible spots, never splitting a lead-in from its list, never inside a list, call-to-action, or summary.
* **Link card or inline** — choose how new links are inserted; theme-agnostic card designs included, or defer to your theme's own card.
* **No lock-in, no key** — works on any theme, Gutenberg or Classic, with nothing to sign up for.

= Why Relinka =
Relinka explains *why* each link is suggested, takes every anchor word-for-word from your real text, and lets you undo instantly. It runs entirely on your own server — your content never leaves your site, and the plugin does not phone home.

= Automatic internal linking, done safely =
Suggestions come with a reason, anchors are taken from your real text, and every change is one-click reversible. You decide what gets applied — nothing is auto-published without you. It does not invent links: it only suggests links to pages that already exist on your site.

= Find and fix orphaned pages =
Relinka surfaces orphaned content (pages with no inbound links) and pages with no outbound links, and can suggest links to fix them in one click — so link equity reaches every page.

= Works with your SEO stack =
Complements Yoast, Rank Math, SEOPress, The SEO Framework, and All in One SEO — and respects pages you've set to noindex. Page-builder content (Elementor, Divi, WPBakery, Beaver) is protected from card insertion.

== Installation ==

1. Upload the plugin to `/wp-content/plugins/relinka/` or install from the Plugins screen.
2. Activate **Relinka for Internal Linking**.
3. Open **Relinka** in the admin menu and run an index. The analysis, graph and broken-link tools work immediately.
4. Generate suggestions and approve the ones you like — undo any change in one click.

== Frequently Asked Questions ==

= Does it need an account or API key? =
No. Relinka is fully functional with no account and no API key. Everything runs on your own server.

= Will it change my content automatically? =
No. Suggestions are never applied until you approve them, and every applied link can be undone with a one-click revert (a full snapshot is kept).

= Does it send my content anywhere? =
No. Relinka does not send your content off-site and does not phone home. All analysis and suggestion generation happen locally on your server.

= Does it make up links or anchors? =
No. It only suggests links to pages that already exist on your site, and every anchor phrase is taken word-for-word from your own content. You review and approve each suggestion — nothing is invented or auto-applied.

= Which page builders are supported? =
Gutenberg (block editor) and the Classic editor are supported. Page-builder posts (Elementor, Divi, WPBakery, Beaver) are detected and protected from card insertion so layouts aren't broken. Link cards are theme-agnostic and styled by the plugin, or you can defer to your theme's own card.

= Is it compatible with my SEO plugin? =
Yes. Relinka focuses on internal links and complements Yoast, Rank Math, SEOPress, The SEO Framework, and All in One SEO. Pages marked noindex in those plugins are excluded.

= Does it work on non-English sites? =
Yes. It suggests links in your content's language and is validated on English and Japanese sites.

= What happens when I uninstall? =
Uninstalling removes the plugin's data — its tables (index, suggestions, application snapshots) and settings — so nothing is left behind.

= I have thousands of posts — will it slow down or time out? =
Indexing and suggestion jobs run in batches with a per-run time budget, so they make progress safely on large sites rather than timing out. For very large sites, run indexing during off-peak hours.

= Does it support multisite? =
Single-site installs are supported. Multisite is not yet specifically tested.

= How much does it cost? =
Relinka is free and fully functional on WordPress.org. A separate Pro add-on (distributed from the author's site) adds AI-assisted suggestions and automation; it is optional and never required.

== Screenshots ==

1. Internal-link health score, orphans, and broken links at a glance.
2. Link suggestions with a one-sentence reason — approve in one click.
3. Natural anchors taken from your own text.
4. One-click undo with a before/after snapshot — nothing changes without you.
5. Broken internal links, found and listed for one-click fixing.
6. Keyword cluster graph of how your topics connect.
7. Settings: theme-agnostic card designs, or use your theme's own.

== Changelog ==

= 0.8.0 =
* Renamed to **Relinka for Internal Linking**.
* Now a fully free, fully functional internal-linking toolkit: link analysis & visualization, keyword cluster graph, internal-link health score, broken-link finder, and relevant link suggestions — all running locally with no account, API key, or external service.
* Suggestions are generated on your own server from your content; nothing is sent off-site.
* Card styles are now enqueued via the standard WordPress style API.
* Hardened REST permission checks on link-data, revert, and clear-suggestions endpoints.

= 0.7.19 =
* Fix: link-card placement is now drift-proof — if a card was added above a pending suggestion, the suggestion re-anchors to the right spot instead of landing a paragraph too high. The preview shows exactly where the card will go.
* Fix: cards are no longer inserted in the middle of a bulleted/numbered list or between a lead-in and the list it introduces; a list at the end of a section is still a valid spot.
* Internal: placement geometry is now shared by suggestion generation, preview, and apply, so all three always agree.
* Pricing: the free monthly AI cap is now 15 (one AI run per article/direction). Non-AI suggestions remain unlimited; Pro lifts the cap.

= 0.7.18 =
* AI: more suggestions per article — the inbound shortlist no longer over-filters, so several genuinely relevant articles can be proposed to link to a page (up to your per-post limit), not just one.
* Cards: when "use your theme's card" is selected, a bare internal link no longer falls back to WordPress's default post-embed box — the theme renders its own card (or a clean link).
* Fix: titles containing apostrophes/quotes now display correctly in the admin (no more "&#8217;").
* Pricing: the free monthly AI limit is enforced consistently (1–30); the unlimited tier is the Pro upgrade.

= 0.7.17 =
* AI: smarter anchors — suggestions now use natural, descriptive multi-word phrases taken from your text, instead of single generic words.
* AI: more relevant keyless (no-API-key) suggestions, with a clearer shared-topic reason for each.
* Improved English-language placement guards and noindex handling for All in One SEO.
* Pricing: the free monthly AI-suggestion allowance is now 30 per month.
* Foundation for an optional Pro tier (unlimited AI). The WordPress.org build remains fully free; Pro is opt-in and never required.

= 0.7.14 =
* New: theme-agnostic link cards — three designs plus an option to use your theme's own card, with a live preview.
* New: internal-link health score (0–100) with one-click fixing of orphaned pages.
* New: keyword cluster graph, now with a smooth, non-blocking layout on large sites.
* Safety: noindex pages are excluded, and page-builder posts (Elementor, Divi, WPBakery, Beaver, etc.) are protected from card insertion.
* Safety: rel / nofollow and open-in-new-tab controls for inserted links.
* AI: opt-in and off by default; clear data-flow disclosure; monthly free-AI usage counter; built-in guide to get a free Google Gemini key.
* AI: automatic retry on rate limits and clearer quota/error messages.
* Performance: faster, lighter indexing via batched embeddings.
* UX: major admin refresh — clearer dashboard, accessible tabs and dialogs, full keyboard support, plain-language labels, and a modern flat/rounded design.

= 0.6.0 =
* Section-aware semantic placement and link distribution.
* Batched, lower-dimension embeddings for faster, lighter indexing.
* Direction filter and refined placement guards.

== Upgrade Notice ==

= 0.8.0 =
Renamed to Relinka for Internal Linking. Now a fully free toolkit that runs entirely on your server — no account, API key, or external service.

= 0.7.19 =
More reliable card placement: suggestions re-anchor correctly after edits and never split a bulleted list. Free monthly AI cap adjusted to 15.

= 0.7.18 =
More suggestions per article, theme-card rendering for bare internal links, and admin title-display fixes.

= 0.7.17 =
Smarter, more natural multi-word anchors and better keyless suggestions. The plugin remains free; an optional Pro tier is now available.

= 0.7.14 =
Theme-agnostic link cards, an internal-link health score with one-click orphan fixing, safer placement (noindex/page-builder aware), and a refreshed, accessible admin UI.

= 0.6.0 =
Improved suggestion quality and faster indexing.
