A manual-only, deterministic WordPress plugin engineering high-reliability content health audits, duplicate detection, and atomic CAS cleanup with zero LLM runtime dependencies.
Content operations in modern newsrooms and digital publications often suffer from link decay, duplicated drafts, and unintended promotional injection from third-party automation tools. Standard search-and-replace scripts or cloud-hosted plugins introduce severe vulnerabilities:
Direct SQL updates without byte-exact CAS overwrite intervening author changes. If MySQL collation is case-insensitive, subtle UTF-8 differences cause silent corruption.
Guardian takes an exact snapshot to post meta before updating. If the backup fails, the update aborts immediately. CAS comparison runs byte-for-byte in binary collation.
Every destructive cleanup operation creates a durable post meta backup containing the exact original post_content and timestamp. If add_post_meta() fails, the operation stops with zero database modification.
Updates use binary-safe collation comparison (WHERE ID = %d AND CAST(post_content AS BINARY) = CAST(%s AS BINARY)). Accents, Unicode case variants, and trailing whitespace differences cannot bypass conflict detection.
During preview and cleanup operations, posts are locked with cryptographic action tokens bound to the specific administrator user ID. Intervening edits trigger an immediate HTTP 409 Conflict.
Run the authorization mock test suite under PHP 8.5:
# Run with all errors reported
C:\PHP-8.5.12\php.exe -d "error_reporting=-1" .\tests\preview-authorization-tests.php
# Expected status: Tests 1–18 PASS (Exit code 0)