Supporting engineering project · WordPress/PHP · guarded plugin patching · preview · backup · rollback
Developer profile: Andrew Baeten · GitHub project index
AI Patch Runner is an admin-only WordPress plugin for reviewing structured patch packages before they change an installed plugin. It is designed around controlled inspection, exact previews, backups and rollback rather than blind file replacement.
Editing production plugin files directly can make recovery difficult when a patch is incomplete or targets the wrong version. AI Patch Runner makes the proposed file changes visible before an authorized WordPress administrator applies them, with backup and rollback as explicit parts of the flow.
Example review (staging only): Inspect the sample package, review the target files and exact proposed diff, confirm permission and environment gates, and retain the backup for recovery. This is a maintenance-tool example, not a claim that automated patching of an arbitrary live site is safe.
Inspect the evidence: workflow · production restrictions · runtime checks.
| Admin overview | Reviewed patch workflow |
|---|---|
![]() |
![]() |
Read the AI Patch Runner portfolio case study.
Why this matters: editing plugin files on a live site can cause outages. This tool shows the proposed changes, checks the target and permissions, creates a backup and keeps an explicit recovery path before a patch can be applied.
Screenshots are from a public portfolio case. GitHub CI checks PHP/bootstrap compatibility, not every production patch or rollback outcome.
| Area | Implementation |
|---|---|
| Patch workflow | Import a reviewed JSON patch package, inspect the target and preview exact file changes |
| Safety | Capability checks, multisite restrictions, path validation and bounded patch storage |
| Production guard | Production applies are disabled unless both a trusted server-side constant and the UI setting allow them |
| Recovery | Backups and rollback remain part of the patch workflow |
| Packaging | Dependency-free runtime package with WordPress-native APIs |
| Maintenance | Explicit versioning, changelog and WordPress.org-style metadata |
flowchart LR
A[Reviewed patch package] --> B[Validate target and paths]
B --> C[Exact change preview]
C --> D[Create backup]
D --> E[Environment and production gates]
E --> F[Apply patch]
F --> G[Rollback path retained]
- Inspect the target plugin.
- Import a reviewed patch package.
- Preview the proposed file changes.
- Confirm the target and environment.
- Apply only after the safety gates pass.
- Keep the generated backup available for rollback.
An example package is available in examples/patch-template.json.
Patch applying is blocked on production by default. Production writes require both:
AIPR_ALLOW_PRODUCTION_APPLYset totruein trusted server-side configuration.- The production-apply setting enabled in the WordPress admin UI.
For normal use, keep production applying disabled, validate changes on staging first and retain a rollback path.
- WordPress 6.4+
- PHP 8.0+
- A user with plugin-update privileges
- Multisite: super-admin access for patch-management actions
Current plugin version: 3.1.7. See readme.txt and CHANGELOG.md for release details.
ai-patch-runner.php Plugin bootstrap
includes/ Admin and runtime implementation
examples/ Example structured patch package
assets/ Admin assets
readme.txt WordPress plugin metadata
CHANGELOG.md Release history
uninstall.php Controlled cleanup
The repository now verifies more than PHP syntax. GitHub Actions runs the declared PHP matrix and clean WordPress activation/deactivation checks on the minimum supported WordPress release and WordPress 7.1. This gives reviewers direct runtime evidence that the packaged plugin can load in a clean WordPress environment.
See PHP compatibility for the executable contract.
This repository focuses on guarded maintenance tooling rather than a client-facing feature. It complements the larger WordPress portfolio by showing defensive file operations, environment gates and rollback-oriented engineering.
GPL-2.0-or-later.

