30 days free. No credit card. Full access from the moment you connect your site.

Start free trial

v0.0.9 — Feature 041: backup/restore abilities + plugin/theme update

Highlights

Adds eight new abilities to the acrossai-abilities-manager surface — six under FileManager for cross-site backup / restore workflows, plus plugin-update and theme-update that finally let AI clients apply pending WordPress core updates through the Abilities API.

All new abilities enforce manage_options; every mutating ability honours DISALLOW_FILE_MODS via the shared File_Mods_Guard. Zip extraction rejects zip-slip archives (.., absolute path, backslash, or null byte in any entry). Zip uploads are validated for the PK magic signature before finalization.

New FileManager abilities (sub_group: Backups)

  • acrossai-abilities-manager/zip-create — archives a plugin / theme / uploads / mu-plugins / arbitrary ABSPATH-relative path into wp-content/uploads/acrossai-backups/<random>.zip. Returns download URL + SHA-256. Cap: acrossai_abilities_manager_zip_max_bytes (default 512 MB).
  • .../zip-upload — base64, remote-URL, or chunked (session/index/is_final) upload of a zip straight into acrossai-backups/. ≤ 8 MB base64 per chunk, ≤ 64 MB per session (both filterable). Validates PK\x03\x04 magic on finalize. Does NOT touch the media library.
  • .../zip-extract — extracts a zip already on disk (ABSPATH-relative path) or fetched from a URL into the resolved target directory. Every entry is audited for zip-slip BEFORE extraction. Default extraction uses unzip_file(); overwrite: true drops to ZipArchive::extractTo.
  • .../zip-download — fresh URL + size + sha256 + created_at for any zip inside acrossai-backups/ or acrossai-staging/.
  • .../zip-list — paginated listing of managed zips, newest first (1..200 per page).
  • .../zip-delete — idempotent delete inside the managed dirs (deleting a missing file returns success with a note).

New Plugin / Theme lifecycle abilities

  • .../plugin-update — wraps WP core Plugin_Upgrader::bulk_upgrade(). Accepts plugin files (e.g. hello-dolly/hello.php) or bare slugs (resolved via Plugin_Helpers). Requires manage_options + update_plugins.
  • .../theme-update — wraps Theme_Upgrader::bulk_upgrade(). Accepts stylesheets or theme names (resolved via Theme_Helpers). Requires manage_options + update_themes.

Both are idempotent: re-running with no update available reports updated_count: 0 with a clean success envelope.

Shared utilities

  • Backups_Storage — bootstraps acrossai-backups/ + acrossai-staging/ under wp-content/uploads/ with an .htaccess that blocks PHP execution while leaving .zip downloads reachable (so file_url stays fetchable), plus an empty index.php for enumeration defense. Random filenames, realpath() boundary check, SHA-256, listing.
  • Zip_Target_Resolver — maps (target_type, target) to an absolute path via Plugin_Helpers / Theme_Helpers / wp_get_upload_dir() / WPMU_PLUGIN_DIR / ABSPATH-boundary-checked realpath.

New cron + configurable limits

  • acrossai_abilities_manager_zip_upload_sweep_chunks — daily sweep of abandoned chunked-upload sessions from acrossai-staging/. Mirrors the existing Upload_Media sweeper.
  • Filters: acrossai_abilities_manager_zip_max_bytes (512 MB), zip_upload_chunk_max_bytes (8 MB), zip_upload_session_max_bytes (64 MB), zip_upload_session_ttl (1d).

No breaking changes

No changes to existing abilities, REST endpoints, capability requirements, or database schema. Safe upgrade.

Pull requests

  • Feature: #71 — Feature 041 — Backup/restore abilities + plugin/theme update
  • Release: #72 — Release 0.0.9 — bump version + changelog for Feature 041

Keep reading