Nexus Sync self-updates
One-click push of WordPress installs to a Nexus-managed staging site
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/gluoksnis/nexus-sync/archive/refs/heads/main.zipShips its own WordPress updater (built-in updater), so new versions show up under Dashboard → Updates.
One-click push from your local WordPress site to a Nexus-managed staging site.
Bundles your wp-content/ (themes, plugins, mu-plugins, optionally uploads) plus a fresh database dump, sends it to your Nexus instance over an authenticated HTTPS upload, and lets the server extract → restore DB → rewrite URLs (wp search-replace handles serialized data correctly) → flush cache.
Why
Maintaining localhost ↔ staging parity by hand is painful. WordPress bakes its absolute site URL into serialized data across wp_options, wp_postmeta, post content, theme settings — a plain sed corrupts it. Plugins like All-in-One WP Migration solve the same problem but route through their own service. Nexus Sync points the same workflow at your infrastructure.
How it works
- Plugin (this repo) runs on your local WP install. Builds a
.tar.gzcontainingmanifest.json+db.sql+wp-content/. - Nexus (the dashboard) receives the upload at
POST /api/sync/upload/{site}, then onPOST /api/sync/apply/{site}does:- Atomically swaps the staging site's
wp-content/ - Restores the DB from the bundle
- Runs
wp search-replacefrom your local URL to the staging URL - Flushes object cache
- Atomically swaps the staging site's
Bundle structure:
manifest.json { "format": "nexus-sync/1", "source_url": "https://my.local",
"include_uploads": true, "wp_version": "6.4.2",
"exported_at": "2026-05-04T18:00:00Z" }
db.sql mysqldump --single-transaction
wp-content/ themes, plugins (minus this one), mu-plugins, optionally uploads
The bundle ships only wp-content/ — root WP files (wp-config.php, salts, .htaccess) on the staging site stay untouched. That separation is intentional: code and content come from local, environment from server.
Requirements
- WordPress 5.8+
- PHP 7.4+
tar,gzip, andmysqldumpavailable onPATH(every realistic local WP dev env: Docker, Local, Laragon, MAMP, WSL, macOS)- A running Nexus instance you have access to, with a personal API token
Install
- Download the latest
.zipfrom the Releases page. - WP Admin → Plugins → Add New → Upload Plugin → choose the
.zip→ Install Now → Activate. - Go to Tools → Nexus Sync.
Configure
- Nexus URL — the base URL of your dashboard, e.g.
https://dev.sour.lt. - API token — generate one at Account → API tokens in the Nexus dashboard. Paste here. (Tokens look like
nxs_…. They're shown once; if you lose it, generate a new one and revoke the old.) - Click Test connection — should report your username + role.
- Click Refresh to load the list of WordPress sites you own.
- Pick a target. Save settings.
- Sync now when you're ready.
Settings
| Field | Default | Notes |
|---|---|---|
| Nexus URL | (empty) | Base URL of your Nexus instance, no trailing slash |
| API token | (empty) | nxs_… bearer token, scoped to one Nexus user |
| Site to sync to | (empty) | One of the WordPress sites you own |
| Include uploads | on | Bundle wp-content/uploads/. Off → staging keeps its own media |
Sync direction
This is push-only for now: local → staging. Pull (staging → local) is a planned Phase 2 feature once we figure out the right way to handle "the editor published a post on staging" conflicts.
Security notes
- The API token is stored as a plain WP option. Anyone with
manage_options(or DB access) on this site can read it. Treat it like any other admin secret. - The token can read or write any site that user owns on Nexus. Revoke it if the laptop is lost.
- Uploads stream to the server over HTTPS via cURL. No file ever lands in
$_FILESor PHP memory. - The
wp search-replaceruns server-side on the staging install — your local DB is never opened by Nexus.
Limits
- Single-shot upload. Bundle must fit in the Nexus instance's
post_max_size(default 256M, bumpable per-site in Site Settings → PHP). A WP install with a heavy uploads dir may exceed this — for now, turn off "Include uploads" or bump the limit. - No progress streaming yet. The "Sync now" UI shows step states but the actual work happens in one HTTPS round-trip server-side. Big bundles take a while.
Troubleshooting
| Symptom | Likely cause |
|---|---|
Empty upload — bundle is likely larger than the server's post_max_size |
Bundle exceeded the staging side's PHP post_max_size. Bump it in Site Settings → PHP, or turn off Include uploads. |
mysqldump failed |
mysqldump not on PATH, or DB credentials in wp-config.php are wrong/changed. Plugin reads DB_USER/DB_PASSWORD/DB_HOST directly. |
tar append failed |
tar not on PATH, or wp-content/ has unreadable files. |
Invalid or expired API token |
Token revoked or never existed. Generate a fresh one in Nexus → Account → API tokens. |
License
GPL-2.0-or-later. See LICENSE.