=== PathCatch – URL Health, Redirects & 404 Monitor ===
Contributors: apexdigitalcompany
Tags: redirects, 404, broken links, redirect manager, sitemap
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 8.1
Stable tag: 1.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Find and fix broken links, 404 errors, and redirect problems: smart redirects, broken-link and sitemap scanning, and a URL Health Score.

== Description ==

PathCatch is the URL-health layer for WordPress. It is not an SEO suite — it keeps
your links, redirects, and crawl paths clean, and rolls everything into a single
URL Health Score so you can see at a glance what needs fixing.

**Redirects**

* Create and manage 301, 302, 307, and 308 redirects with exact, wildcard, and
  regex matching.
* Configurable matching: trailing-slash and case normalization, query-string
  handling, and rule precedence.
* Auto-create a 301 when a published post's slug changes, so old URLs never 404.
* "Redirect intelligence" flags redirect chains and loops, and — as a background
  check — redirects whose destination now returns a 404 or a server error, with
  one-click "flatten chain".
* Import from CSV and `.htaccess`; export to CSV, Apache, or Nginx (as text you
  install yourself — PathCatch never writes to your server config).

**404 monitoring**

* Log WordPress-routed 404s with hit counts, referrers, and bot filtering.
* Turn any logged 404 into a redirect in one click.
* Retention control keeps the log from growing without bound.

**Broken-link & sitemap scanning**

* Scan posts and pages for broken links and images, on demand or on a schedule,
  with an optional email digest.
* Detect and validate your existing sitemap (WordPress core, Yoast, Rank Math,
  AIOSEO) for unreachable or error URLs — PathCatch complements those plugins and
  does not generate a competing sitemap.

**Built to be safe**

* Safe by default and reversible: nothing changes your content or server config
  without you choosing to.
* Hardened: redirect targets are validated against open-redirect abuse, outbound
  link checks are guarded against SSRF, and all admin actions are capability- and
  nonce-protected.

= External services =

PathCatch's link and sitemap scanners make outbound HTTP requests **from your
server** to check whether URLs found in your content and sitemap are reachable.
For internal links these hit your own site; for external links they contact the
third-party sites you link to (just like a visitor's browser would). No data about
your site is sent to any PathCatch-operated service — the plugin has no external
service of its own and does not "phone home".

== Installation ==

1. Upload the `pathcatch` folder to `/wp-content/plugins/`, or install it from
   Plugins → Add New in your dashboard.
2. Activate the plugin through the Plugins screen.
3. Open the **PathCatch** menu in your admin. Redirects and 404 Watch are on by
   default; enable the Link Scanner and Sitemap Health under PathCatch → Settings.

== Frequently Asked Questions ==

= Does this replace my SEO plugin (Yoast, Rank Math, AIOSEO)? =

No. PathCatch is the operational URL-health layer beneath them. It manages
redirects and 404s and *validates* your existing sitemap rather than generating
one, so it works alongside your SEO plugin instead of competing with it.

= Will the redirects slow down my site? =

No. Redirect rules are cached, and a request that doesn't match a rule performs no
extra database query beyond the ones WordPress already runs.

= Does the scanner send my data anywhere? =

No. Scans run on your own server and only request the URLs found in your content
and sitemap to see if they resolve. There is no external PathCatch service.

= Is it multisite compatible? =

Yes. On a network activation the plugin creates its tables for every site, and new
sites are provisioned automatically.

== Screenshots ==

1. PathCatch Settings: redirect matching behavior, auto-redirect on slug change,
   404 retention, and the Link Scanner and Sitemap Health schedules.

== Changelog ==

= 1.0.0 =
* First stable release.
* Fix: exact-match redirect rules whose source contains a query string (e.g.
  "/?p=51") now match only that query, instead of matching every request to the
  same path.

= 0.2.0 =
* New: background redirect destination-health monitoring (detects redirects that
  now land on a 404 or server error) with one-click chain flattening.
* New: Link Scanner — scan posts and pages for broken links and images, on demand
  or on a schedule, with an optional email digest.
* New: Sitemap Health — detect and validate your existing sitemap for unreachable
  or error URLs.
* New: multisite-safe activation, upgrade, and uninstall.
* Hardening and reliability: SSRF-guarded outbound checks (incl. IPv4-mapped IPv6),
  open-redirect validation, a robust background-job queue, and 404-log retention.

= 0.1.0 =
* Initial release: Redirect Center, 404 Watch, redirect chain/loop detection,
  auto-redirect on slug change, CSV/.htaccess import, server-rule export, and the
  URL Health Score.

== Upgrade Notice ==

= 1.0.0 =
First stable release. Fixes exact redirect rules that contain a query string so
they no longer over-match every request to the same path.

= 0.2.0 =
Adds broken-link and sitemap scanning, background redirect destination-health
monitoring, multisite support, and security/reliability hardening.
