=== Hostious Internal Link Builder Pro ===
Contributors: hostious
Tags: internal links, link building, seo, broken links, orphaned posts
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Internal link suggestions while you write, auto-linking rules, orphaned-post and broken-link reports, click tracking and optional AI (own key).

== Description ==

Hostious Internal Link Builder finds the internal links your site is missing and helps you add them in seconds – from the post editor, from the reports, or automatically through keyword rules. Everything runs on your own server; nothing is sent to Hostious or anyone else.

**What it does**

* **Internal link suggestions** – inbound and outbound suggestions in the post editor and on term pages, with sentence editing, anchor selection and one-click insert. Bulk-approve the strong suggestions with a preview before anything is written.
* **Auto-linking** – keyword rules that link automatically, in bulk or on save, with priorities, limits and restrictions per post type, category and date. CSV import, and JSON export/import of all rules.
* **Orphaned posts** – a report of posts without inbound links and the fastest way to fix them.
* **Broken links** – scheduled checks of internal and external links, with one-click replacement, ignore and (optionally) AI-assisted replacement URLs.
* **Click tracking** – which internal links visitors actually click, per post and per link. Click events can be forwarded to AnalyticsWP.
* **URL changer** – change a URL everywhere on the site, with history and undo.
* **Visual sitemaps** – an interactive map of how your content links together.
* **Domains report** – every external domain you link to, how often, and with which attributes.
* **Target keywords** – from Google Search Console (your own OAuth client), Yoast SEO, Rank Math, All in One SEO, custom lists, and "Searched on site" phrases from Hostious AJAX Search – so suggestions use the words people really search for.
* **Related posts** – a styled related-posts block under the content, automatic or hand picked.
* **AI, optional** – runs on your own OpenAI API key: post summaries, embeddings, AI-powered suggestions, "Fix with AI" for orphaned posts and link coverage, and web-search assisted broken-link repair. Live mode or Batch API, with a cost overview in DKK. No credits, no subscription.
* **Weekly link-health e-mail** – a short summary of broken links, orphaned posts and new suggestions, in Danish or English.
* **Danish and English UI** – switch the plugin screens with one click in the app bar (per user).
* **WP-CLI** – `wp hostious-link status|scan|queue|lang|reset-queue|export|import`.
* **Settings & rules export/import** – save a site profile as JSON and set the next site up from it, from the Maintenance tab or WP-CLI.

**Page-builder support**

Links are found and inserted in the content of Gutenberg, the Classic editor, Breakdance, Elementor, Divi, Oxygen, Beaver Builder, Kadence, Thrive Architect, WPBakery, Bricks, YOOtheme, Enfold, Avada, Cornerstone, Goodlayers, Muffin, Themify and ACF fields.

**Privacy**

The plugin never phones home. There is no licence check, no telemetry, no remote code and no external service other than the ones you connect yourself (your OpenAI key, your Google Search Console client).

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install it from the Plugins screen.
2. Activate it.
3. Go to **Link Builder → Setup** and run the first link scan. On a large site this takes a few minutes; it continues in the background.
4. Optional: add your OpenAI API key under **Settings → AI**, connect Google Search Console under **Settings → Advanced**, and pick a language with the DA | EN switch in the app bar.

If Link Whisper is active, it is deactivated on activation and its data (reports, rules, target keywords, clicks, settings) is taken over – no re-scan needed.

== Frequently Asked Questions ==

= Does it phone home? =

No. The plugin makes no requests to Hostious or any third party on its own. The only outgoing requests are the ones you set up: the OpenAI API with your own key, Google Search Console with your own OAuth client, and the broken-link checker, which fetches the URLs your content links to.

= Do I need an AI subscription? =

No. AI features are optional and use your own OpenAI API key. You pay OpenAI directly; the plugin shows an estimate of the cost per feature.

= Does it work with my page builder? =

Yes for Gutenberg, the Classic editor and the builders listed above. Content stored in post meta (ACF and most builders) is scanned and linked like regular content.

= Will it slow my site down? =

Scans and link checks run in the background in small batches. On the front end the plugin adds one small script for click tracking (which you can turn off) and nothing else.

= Can I move my settings to another site? =

Yes. **Settings → Maintenance → Export settings & rules** downloads a JSON file; import it on the other site. API keys and credentials are never part of the file. The same is available with `wp hostious-link export` and `wp hostious-link import`.

= Is it a fork? =

The linking engine is derived from Link Whisper (GPL-2.0-or-later). Hostious has removed all licensing, telemetry and vendor services and added the features listed above.

== Screenshots ==

1. Dashboard – link health, broken links, orphaned posts and link coverage at a glance.
2. Link suggestions in the post editor with anchor selection and one-click insert.
3. Auto-linking rules.
4. Broken links report.
5. Visual sitemap.
6. Settings with the DA | EN switch and the export/import of settings and rules.

== Changelog ==

= 1.1.4 =
* Security: every action protected by the plugin's nonce now also requires a user who can edit posts, so customers and subscribers cannot trigger them.
* Security: 16 admin actions that had no nonce or capability check (e.g. continuing the inbound link insert, adding links to the ignore list, search and wizard helpers) now require an editing role. Inserting pending links only touches posts and terms the current user may edit.
* Updated: Moment.js 2.30.1 (2.29.2 had a known ReDoS fix in 2.29.4).
* PHP 8.5: removed deprecated curl_close() calls.
* Fixed: opening the click details page without a valid post stopped with a fatal error; it now returns to the click report.
* Tested with WordPress 7.1.

= 1.1.3 =
* Fixed: the broken link report no longer lists placeholder addresses from guides and code examples (example.com, ditdomaene.dk, eksempel.dk, dinshop.dk, firmanavn.com and reserved .test/.example/.invalid names). More can be added with the hilb_placeholder_hosts filter.
* Fixed: a link with an empty, escaped href was saved as a "Link Format Error" without a URL; it is now reported as a link without a URL.

= 1.1.2 =
* Fixed: the WordPress dashboard widget's status badges overlapped the numbers (badge now sits in the row next to the value); the widget got a small title row.

= 1.1.1 =
* Fixed: cron schedule labels were translated before `init`, which triggered WordPress' "translation loading too early" notice on Danish sites when another plugin scheduled an event at load time.
* Fixed: PHP 8.4 deprecation in the bundled token counter (implicit nullable parameter).

= 1.1.0 =
* New: AI cost overview in DKK per feature and per month, with a monthly budget.
* New: live AI mode – suggestions, summaries and embeddings without the OpenAI Batch API.
* New: export and import of settings and auto-link rules as JSON (Settings → Maintenance) and with `wp hostious-link export|import`.
* New: weekly link-health e-mail in Danish or English with a new layout.
* New: internal-link click events are sent to AnalyticsWP when it is installed.
* New: "Searched on site" target-keyword source from Hostious AJAX Search.
* New: Breakdance editor integration – suggestions and link insertion inside the Breakdance builder.
* New: bulk-approve strong suggestions with a preview before insertion.
* New: Domains, Clicks and Sitemaps reports in the new layout.
* Changed: WordPress.org-ready readme, plugin assets and a GPL audit of all bundled libraries.

= 1.0.0 =
* New: Hostious app bar with grouped navigation (Dashboard, Reports, Auto-Linking, Target Keywords, URL Changer, Setup, Settings) and the Hostious design on every screen.
* New: Danish and English with a DA | EN switch per user; full translation of the plugin screens.
* New: takeover of an existing Link Whisper install – same data, no re-scan needed.
* New: Google Search Console connects through your own Google OAuth client (Settings → Advanced); no third-party proxy.
* New: "Fix with AI", AI link suggestions and broken-link repair with web search run directly against OpenAI with your own API key.
* New: WP-CLI commands and a CSV export of a post's links.
* Changed: all licensing, AI credits, subscriptions, vouchers, affiliate hub, telemetry/phone-home, promo popups, tours, support widgets and vendor links removed.
* Changed: settings reorganised into eight tabs (General, Content scope, Domains & URLs, Linking rules, AI, Related posts, Advanced, Maintenance).
* Changed: the plugin is about 60 % smaller (unused libraries, duplicate templates and assets removed); fewer scripts and styles per screen.
* Fixed: external links view used an undefined variable; orphan report stylesheet never loaded (handle collision); menu screen IDs changed when the issue counter was shown; queue debug view on an empty queue.

== Upgrade Notice ==

= 1.1.0 =
Adds settings/rules export-import, live AI mode with a cost overview, the weekly link-health e-mail and Breakdance support. No database changes; existing data and settings are kept.

= 1.0.0 =
First Hostious release. Replaces Link Whisper and takes over its data on activation.
