SSP Documentation
Overview
SSP Backups creates automatic or manual WordPress backups and stores them locally in wp-content/uploads/ssp-backups. You can back up specific components (Database/Plugins/Themes/MU-Plugins/Uploads) or your entire WordPress root. Retention is smart and rolling, or you can keep a fixed newest count. One-click Restore is available for local backups.
Key Features
- Flexible schedules: daily, weekly, monthly at a local time you choose.
- Single searchable timezone input (city/region IDs; DST-aware).
- Smart retention (last 30 days daily/weekly + 12 months monthly) or Keep newest N.
- Manual Run Backup Now, Download/Delete, and Restore (local-only).
What’s Local
- Backups are ZIP archives saved on the site’s filesystem.
- Remote exports are disabled by design.
- Includes best-effort database dump (if checked).
Safety
- Lock files prevent overlapping runs.
- Restore uses maintenance mode and attempts rollback on failure.
- Backup directory is protected via .htaccess and index.php.
Admin Screen
The plugin adds a top-level menu SSP Backups with a single page:
Run & Actions
- Run Backup Now — immediately creates a backup using current settings.
- Per-backup actions: Download, Restore, Delete.
Settings
- Scope: Selected components vs Entire site.
- Retention: Off, Smart (30×/12m), or Keep newest N.
- Timezone: searchable city/region IDs.
- Schedule: Frequency + Time; weekday/month-day controls appear contextually.
Existing Backups
- Table lists File, Date (in your timezone), Size, Contents, Actions.
- “Contents” indicates whether the archive is entire root or a components set.
How It Works
- On activation, the plugin creates wp-content/uploads/ssp-backups and schedules the next run.
- Each run creates ssp-backup-YYYYMMDD-HHMMSS.zip. Depending on scope, it includes selected folders and optionally a database.sql dump.
- After creation, the retention policy may prune older backups.
- Manual Run Now uses the same pipeline and shows a notice with filename and size.
Scope & Components
Selected Components
- Database (SQL dump)
- Plugins, Themes, MU-Plugins, Uploads
- Optionally includes wp-config.php for convenience.
Entire Site
- Copies the WordPress root tree (minus excluded caches/backup directories).
- Database dump is still controlled by the Database checkbox.
Setting | scope = components | entire |
---|---|
Components | components[] in {db,plugins,themes,muplugins,uploads} |
Timezone Picker
The Timezone field is a single searchable input connected to a datalist of IANA region IDs (e.g., America/New_York). This ensures daylight-saving time is handled correctly when scheduling.
- Accepts valid timezone identifiers only.
- Displays a friendly name (e.g., “Eastern Standard Time”).
Scheduling
Frequency & Time
- Daily: runs every day at your selected Time of day.
- Weekly: choose a Day of week and a Time.
- Monthly: choose a Day of month (If a month is shorter, it runs on its last day) and a Time.
Retention
Modes
- Off — keep all backups.
- Smart (30× / 12m) — plus always keep latest:
- With Daily schedule: one per day for last 30 days, and one per month for last 12 months.
- With Weekly schedule: one per week for last 30 days, and one per month for last 12 months.
- With Monthly schedule: the smart option is hidden (not applicable).
- Keep newest N — deletes older ones beyond the limit (1–200).
Grouping Basis
- Grouping uses the backup file modification time (filesystem clock) in your configured timezone.
- Latest backup is always preserved.
Manual Runs & Locks
- Run Backup Now respects your current scope, components, and timezone.
- While a backup is running, a lock file .backup.lock prevents concurrent runs.
- Scheduled runs use the same lock to avoid overlap; if locked, the run is re-scheduled.
Existing Backups
Backups are shown newest first with:
- File — e.g., ssp-backup-20240131-030000.zip
- Date — formatted in your selected timezone.
- Size — human-readable.
- Contents — Entire root vs specific components (Database/Uploads/Plugins/Themes/MU-Plugins).
- Actions — Download, Restore, Delete (with nonces and confirmation prompts).
Restore (Local Backups Only)
Restore extracts the selected ZIP and replaces files within wp-content/(plugins|themes|mu-plugins|uploads). If a database.sql is present, it is imported.
Safety Flow
- Pre-checks: ZipArchive availability, disk space, writability.
- Enters maintenance mode (creates .maintenance) during restoration.
- Keeps a database dump (best-effort) and rolls back files on failure.
Rollback
- On failure, attempts to restore previous directories and import the “before” database dump.
- Maintenance mode is removed after completion (or on shutdown if created by the plugin).
Security & Files
- Backup directory gets a .htaccess to deny direct web access and a blank index.php.
- Only users with manage_options can run, download, delete, or restore.
- All file operations validate paths within the backups directory.
Locks | .backup.lock (backup) and .restore.lock (restore) prevent overlap. |
---|---|
Exclusions | Common cache/backup directories, node_modules, VCS folders, and the current ZIP being written. |
Troubleshooting
“ZipArchive not available”
Install/enable the PHP Zip extension on your host. Without it, creating or restoring ZIPs isn’t possible.
Backups aren’t running on schedule
- Confirm WP-Cron is active; low-traffic sites may benefit from a real system cron hitting wp-cron.php.
- Re-save settings to reschedule the next event (check timezone/time).
“A backup is already in progress”
Wait for the previous run to finish. The plugin uses a lock file to avoid concurrent backups.
Restore failed
- Ensure sufficient free disk space and writable wp-content.
- Check the admin notice for the exact failure (extraction vs DB).
- The plugin attempts rollback; verify your site and try again if needed.
Backups are too large
- Use Selected components and exclude Uploads or large plugins/themes if not needed.
- Consider pruning older media or adding server-side compression tools.
Test / Verification
- Open SSP Backups and set Timezone to your region (e.g., America/New_York).
- Select Selected components with Database + Plugins + Themes. Set schedule to Daily at 03:00.
- In Retention, choose Smart (30× / 12m). Save settings.
- Click Run Backup Now. After it completes, confirm a new ZIP appears with today’s timestamp.
- Use Download to verify the archive opens and contains expected folders / database.sql.
- Create a second backup; confirm retention still keeps both (latest is always kept).
- Optionally, test Restore on a staging site and confirm maintenance mode and completion notice.