Skip to content

About

Preview reviewed WordPress plugin patches with permission gates, backups and rollback.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

AI Patch Runner

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.

Why this tool matters

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.

Preview the WordPress interface

Admin overview Reviewed patch workflow
AI Patch Runner admin overview from Andrew's portfolio AI Patch Runner reviewed-patch workflow screenshot

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.

What it demonstrates

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

Workflow

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]
Loading
  1. Inspect the target plugin.
  2. Import a reviewed patch package.
  3. Preview the proposed file changes.
  4. Confirm the target and environment.
  5. Apply only after the safety gates pass.
  6. Keep the generated backup available for rollback.

An example package is available in examples/patch-template.json.

Production safety

Patch applying is blocked on production by default. Production writes require both:

  1. AIPR_ALLOW_PRODUCTION_APPLY set to true in trusted server-side configuration.
  2. 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.

Requirements

  • 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.

Repository structure

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

Verification

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.

Portfolio context

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.

License

GPL-2.0-or-later.

About

Preview reviewed WordPress plugin patches with permission gates, backups and rollback.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages