Releases: centrevilletech/detour
Release list
Detour 1.4.0 - UI rebrand
Drops the "404" prefix from headings, navigation, form labels, admin-bar item, and email digest titles. The plugin is named Detour, so leading every label with "404" felt like an upstream-fork hangover rather than the product's own voice.
Kept "404" where it is the technically meaningful term in body copy — "404 errors can affect search rankings" still reads naturally, "Detour activations can affect search rankings" does not.
Highlights
- Admin bar: 404 Stats → Detour
- Tab: 404 URLs → Activity
- Sections: 404 Pages Settings → Default Redirect, 404 Images Settings → Missing Image Fallback
- Email subject: 404 Analytics Report → Detour Report
- Page tagline rewritten product-forward
- Plus form labels, empty states, and confirm-delete copy
Already deployed and smoke-tested in production.
Detour 1.3.0 - WordPress coding standards pass
Mechanical formatting pass. No behavior changes. Live site smoke-tested clean.
What changed
Ran phpcbf with WordPress-Extra and Universal rulesets, then a Python pass for things phpcbf can't auto-fix:
- Indentation: spaces to tabs throughout
- Brace placement: K&R same-line for control structures
- Paren and bracket interior spacing per WP convention
- Yoda conditions: 70 swaps (
$x === 'foo'becomes'foo' === $x) - Strict comparisons: 36 loose
==/!=flipped to===/!==where the constant side is a literal - Trailing whitespace, file-end newlines, quote style normalization
About 4,800 sniff violations cleaned across the six PHP files.
What was deliberately not touched
These need per-call human judgment, not a regex sweep, so I left them for follow-up:
- Output escaping at point of output (
esc_html/esc_attr/esc_url) - Nonce verification on admin reads
$wpdb->prepare()for table-prefix interpolation (mostly safe by design but each call still flags)WP_Filesystemmigration for the.htaccesswritererror_log()calls retained for genuine error paths
The remaining ~290 PHPCS flags are almost entirely those four categories; reviewing them is a meaningful security pass that will likely happen alongside the wp.org submission feedback loop.
Detour 1.2.0 - WordPress.org submission prep
Internal refactor release. No new features, but every PHP identifier in the plugin now lives under a unified detour_ / Detour_ / DETOUR_ prefix instead of the four legacy prefixes inherited from the upstream fork. Adds a wp.org-compliant readme.txt. Smoke-tested in production.
What's new
- Unified PHP identifier prefix on every function, class, and constant
- New file names:
detour-fixes.php,detour-rules.php(renamed from the legacycentct-*names) - New
readme.txtin WordPress.org Plugin Directory format with sections for Description, Installation, FAQ, Screenshots, Changelog, and Upgrade Notice - One-time legacy-cron cleanup so existing installs upgrading from 1.1 reschedule their email digests under the new hook names
Drop-in compatibility
All stored data names are unchanged so existing installs upgrade in place:
- Tables:
{$prefix}redirects_404,{$prefix}detour_rules - Option keys:
p404_redirect_options,options-404-redirect-group,P404_email_update,centct_p404_schema_version,centct_p404_rules_schema_version, ... - Option-array sub-keys:
p404_status,p404_redirect_to,p404_redirect_type,p404_execlude_media, ...
Existing rules, log rows, schedule preferences, and notification settings all carry over.
Why
WordPress.org reviewers ask that all PHP identifiers be uniquely prefixed with the plugin's unique handle, to avoid collisions with other plugins. The legacy p404_* and P404REDIRECT_* prefixes were generic enough to be a likely review hold-up. This release puts that behind us.
Detour 1.1.0 - Per-URL rules + bloat purge
The "Pro" version of the upstream plugin advertised two features over the free one: per-URL redirect destinations, and choosing 301 vs 302 per rule. Detour 1.1.0 ships both of those, plus 307, 308, and 410 Gone, plus prefix and regex matching, all under GPL with zero telemetry.
What's new
- Per-URL rule engine with three match types
- Exact match by
BINARY(16)MD5 hash (single-row indexed lookup) - Prefix match with optional
{path}placeholder for substituting the unmatched tail into the destination (e.g./old-blog/→/blog/{path}) - Regex match with first-rule-wins evaluation, auto-wraps user input in
~...~delimiters if none supplied
- Exact match by
- Five status codes: 301, 302, 307, 308, 410 Gone. The OP in this thread is correct that 410 is the SEO-correct response for permanently deleted pages, and that's a feature even upstream's Pro version does not appear to offer
- Site-wide fallback runs only when no rule matches - the existing global redirect target is unchanged
- Promote-to-rule button on every row of the 404 URLs log: one click to pre-fill the rule modal with the broken URL
- Object-cache-backed lookups: prefix and regex rule lists cached for 5 minutes with a versioned bust on every rule write, so high-volume 404 traffic costs at most one indexed query
Bloat purge
While I had the plugin open I removed everything that was dead, noisy, or sketchy. Net: 215 lines shorter (functions.php 64 KB → 54 KB) plus the new rule engine.
- Empty "dismiss this message" admin-row notice and its three companion functions
- Entire parallel cron-scheduling implementation that was never wired up
- Fake-data referrer fallback that fabricated "Google Search / Direct Access" rows when the referrer column was missing (the column always exists in our schema)
- A
data_bind()method oncf_dropdownthat ran raw SQL through a$mysqlglobal that does not exist in WordPress - Twelve
error_log()"operation succeeded" calls that polluted production PHP error logs - A duplicate
add_action('admin_enqueue_scripts', ...)registration - A
.htaccessre-read on every admin pageview, now throttled to once per 24 hours via a transient
Drop-in upgrade
Existing installs upgrade in place. The migration runs once on plugins_loaded, creates {$prefix}detour_rules, and short-circuits cheaply on every subsequent load via an option flag. The pre-existing {$prefix}redirects_404 table and all its data are untouched.
License
GPL-2.0-or-later. No telemetry, no affiliate links, no upgrade nags, no backlink injection. Forked from All 404 Redirect to Homepage by wp-buy.
Detour 1.0.0
Initial release.
Detour catches every 404 on your WordPress site and routes lost visitors to a destination that converts. Built for high-traffic sites where sloppy 404 logging would otherwise drag the admin panel to a crawl.
Features
- 301 or 302 redirects to any URL, configurable per site
- Sortable hit history (URL, hit count, last seen) that stays fast past 1M rows
- Per-IP and referrer deduplication so a single bot run does not flood your stats
- Weekly email digests with top broken URLs and trend analysis
- Image fallback for missing
.gif/.jpg/.pngrequests - Admin-bar widget with today / yesterday / month / total redirect counts
Engineering notes
BINARY(16)generated URL hash column with its own BTREE index for fixed-width equality lookups- Dedicated index on
countso admin "sort by hits" is a 10-row index lookup instead of a full-table filesort - Removed the duplicate prefix index that was wasting writes in the upstream schema
- Idempotent activation migration; safe to re-activate
Heritage
Forked from All 404 Redirect to Homepage by wp-buy under GPL-2.0-or-later. See README for the full list of changes from upstream, including the schema overhaul, the removal of bundled commercial JavaScript that was being redistributed without a license, and the rebrand.
Requirements
- WordPress 5.0+
- PHP 7.4+ (tested through PHP 8.3)
- MySQL 5.7+ / MariaDB 10.5+