=== Site Diagnostics and Redirects ===
Contributors: bostondeveloper
Tags: redirect, broken links, crawl, seo, link checker
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 2.5.4
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Crawl diagnostics, regex redirects with hit tracking, a 404 monitor with one-click fixes, auto-redirects on permalink changes, and CSV import/export.

== Description ==

Site Diagnostics and Redirects watches two things other plugins treat separately: your redirects and your crawl health. Everything in this package works out of the box - there are no locked features, no trial periods, and no required external accounts.

* Redirect governance: stores redirect rules, then analyzes them for conflicts (duplicate sources), loops (A->B->A), chains (3+ hops, with hop count and final target), and invalid rules (missing slash, self-redirect, bad status code). One click collapses every chain so each source points straight at its final target. Conflicted sources are excluded from analysis until you resolve them.
* Crawl diagnostics: on demand, loopback-crawls your published posts and pages, builds a status histogram, and lists broken URLs (4xx/5xx), orphan pages (no internal link points to them), and redirecting URLs.
* Redirects actually serve on the front end, after chain collapse, so a chain never costs your visitors extra hops.
* Regex redirects: mark any rule as a regular expression and use $1-style backreferences in the target, so one rule can move an entire section (e.g. /blog/(\d+) -> /posts/$1).
* Hit telemetry: every rule shows its hit count and last-hit date, so stale rules are easy to retire.
* 404 monitor: every miss is logged with referrer, count, and last-seen, and each row has a one-click "redirect it" action.
* 404 pattern suggestions: groups similar 404s into one regex rule you can apply with a click.
* Permalink guard: rename a published post or page and the plugin automatically adds a 301 from the old URL.
* Scheduled crawl: a weekly or daily WP-Cron crawl compares against the previous run and raises a dashboard notice (and optional email to a recipient you choose) when NEW broken URLs appear.
* External link checks: bounded, cached HEAD checks on the outbound links found in your latest crawl (up to 20 per run).
* Import/export: Redirection-compatible CSV plus JSON, both ways, with a diff preview before any import is written.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install through the Plugins screen.
2. Activate Site Diagnostics and Redirects.
3. Open Site Diagnostics and Redirects in the admin sidebar.

== Frequently Asked Questions ==

= Does it crawl external sites? =
No. It loopback-crawls your own published content, which is the crawl you are responsible for. The external link check only HEAD-requests the outbound URLs already found on your own pages.

= Is any feature locked behind an account or license? =
No. Every feature in this package is fully unlocked.

= What happens to a conflicted redirect? =
Both copies are flagged and the pair is excluded from chain/loop analysis until you delete one.

== Changelog ==

= 2.5.4 =
* Renamed to Site Diagnostics and Redirects per the wordpress.org review (new slug and text domain site-diagnostics-and-redirects).

= 2.5.3 =
* Renamed to BostonDeveloper SEO Crawl Compass (new slug and text domain).
* Every included local feature is now fully unlocked: daily crawl cadence, custom alert recipient, import diff preview, 404 pattern suggestions, and external link checks all work out of the box.
* Screen styles moved out of inline markup into an enqueued stylesheet.
* Import textarea input is sanitized before parsing.
* Unique prefixes (crawlcompass_) on all hooks, functions, and classes.
* Requires PHP 8.0.

= 2.4.0 =
* Regex redirects with $1-style backreferences, validated on save.
* Hit telemetry per rule (hits + last hit) in the rules table.
* 404 monitor with referrer/count/last-seen and one-click redirect creation.
* Automatic old->new 301 when a published slug changes.
* Weekly scheduled crawl with new-broken-URL dashboard notice and optional admin email.
* CSV (Redirection-compatible) and JSON import/export.
* Subdirectory-install safe matching; Plugin Check clean; tested on WordPress 7.1.

= 2.3.1 =
* Redirect governance: conflict, loop, chain, and invalid-rule analysis; one-click chain collapse.
* Crawl diagnostics: status histogram, broken/orphan/redirecting reports.
* Front-end redirect serving with collapsed chains.
