=== Pirajki Auto Linker ===
Contributors: pirajki
Tags: internal links, seo, auto linking, interlinking, content
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.1
Stable tag: 1.0.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically add smart internal links to every post — improving SEO, time-on-site, and crawlability with zero manual effort.

== Description ==

**Pirajki Auto Linker** scans your post content and automatically inserts relevant internal links based on post titles, slugs, and custom keyword rules — so every new post immediately benefits from a strong internal linking structure.

= Why Internal Links Matter =

Internal linking is one of the highest-impact on-page SEO tactics. It passes link equity between pages, helps search engines discover and understand your content, and keeps readers engaged longer. Done manually, it's tedious. Pirajki Auto Linker does it automatically.

= Free Features =

* **DOM-Safe Processing** — Links are inserted using DOMDocument, never breaking existing markup, images, or shortcodes
* **Skips Protected Zones** — Never links inside `<a>`, `<code>`, `<pre>`, `<script>`, or `<style>` blocks
* **Title + Slug Matching** — Matches both post titles and slug-derived phrases for maximum coverage
* **One Link Per URL** — Prevents the same destination appearing twice in the same post
* **Max Links Per Post** — Set a per-post link cap (1–100) to keep content natural
* **Excluded URLs** — Paste any URLs you never want linked to
* **Pre-Generate Cache** — Optionally pre-cache linked content to serve at full speed
* **_blank with rel="noopener noreferrer"** — Fully safe external-tab behaviour
* **Enabled Post Types** — Choose which post types auto-linking runs on
* **Clear Cache** — One-click cache clear from the settings page
* **Translation Ready** — Full .pot file included

= Pro Features =

* **Custom Keyword → URL Map** — Link any phrase to any URL, independent of post slugs
* **Max Links Unlimited** — Remove the 10-link cap
* **nofollow / sponsored rel** — Add rel attributes per your link policy
* **Link Inside Headings** — Optionally include H1–H6 in linking scope
* **Case-Sensitive Matching** — Match keywords exactly as typed
* **Bulk Generation** — Re-process all posts in batches with a progress bar
* **Link Click Analytics** — Track which auto-links get clicked *(coming soon)*

[Get Pro →](https://webwithwordpress.com/pirajki-auto-linker-pro)

== Installation ==

1. Upload the `pirajki-auto-linker` folder to `/wp-content/plugins/`
2. Activate through **Plugins** in your WordPress admin
3. Go to **Pirajki Auto Linker → Settings** and choose your post types
4. Save — auto-linking is active immediately

== Frequently Asked Questions ==

= Will it break my existing links? =
No. The engine uses PHP's DOMDocument to work on text nodes only, leaving all existing HTML — including any links you've already added manually — completely untouched.

= Does it link inside shortcode output? =
The `the_content` filter runs after shortcodes are expanded, so shortcode output is processed. Code inside `[code]` or `[pre]` shortcodes that render `<code>`/`<pre>` HTML is skipped automatically.

= What is the Pre-Generate Cache option? =
When enabled, linked content is saved to post meta the first time a page is viewed (or when bulk generation runs). Subsequent views serve the cached version instantly, avoiding any per-request processing overhead.

= How do I exclude a page from being linked to? =
Paste the full URL of that page into **Settings → Excluded URLs** (one per line) and save. The change takes effect immediately.

= Does it work with page builders like Elementor / Divi? =
Yes, as long as the page builder outputs content through the standard `the_content` filter. Most page builders do.

= Is the Pro license per-site or unlimited? =
Pro licenses are per-site. Volume packs are available on the Pro purchase page.

== Screenshots ==

1. Settings page — clean, clearly labelled options
2. Bulk generation page with live progress bar
3. Pro upgrade page with feature comparison table

== External Services ==

This plugin optionally connects to a license verification service when you enter a license key on the Settings page. This only applies to purchases made separately — the plugin is fully functional without any license key.

**License Server (yogiraj.co.in)**
When a license key is activated, renewed, or verified, the plugin sends:
* Your license key
* Your site URL (home_url())

This data is sent to: `https://yogiraj.co.in/wp-json/pirajki-licenses/v1/verify`

No personal user data is collected or transmitted. License verification only occurs when an admin manually activates, deactivates, or the plugin performs a periodic recheck.

* Terms of Service: https://www.yogiraj.co.in/terms
* Privacy Policy: https://www.yogiraj.co.in/privacy

== Changelog ==

= 2.0.0 =
* Rewrote linking engine using DOMDocument — completely DOM-safe, never breaks markup
* Added Custom Keyword Map (Pro), nofollow/sponsored rel (Pro), case-sensitive mode (Pro)
* Added Bulk Generation with AJAX progress (Pro)
* Added one-click Clear All Cache button
* Added proper nonce verification on all AJAX endpoints
* Added post-map transient caching to eliminate per-request `get_posts(-1)` queries
* Fixed: links were inserted inside existing `<a>` tags
* Fixed: links were inserted inside `<code>` and `<pre>` blocks
* Fixed: settings page emitting raw `<tr>` HTML outside a `<table>`
* Fixed: AJAX handler lacked nonce verification
* Fixed: `parse_url` replaced with `wp_parse_url`
* Fixed: `_e()` replaced with `esc_html_e()` throughout

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 2.0.0 =
Major rewrite. Existing cache will be cleared automatically on first save after updating.
