Scheduled full-site backups of a WordPress site, the database plus the wp-content folder, streamed to Cloudflare R2 or any S3-compatible bucket as one .tar.gz. The work is split into short ticks that resume after a PHP time limit or a crash, old backups are pruned by age, and a failure emails the admin. No bundled SDK and no Composer dependencies: the AWS Signature V4 signer and the multipart uploader are built in.
mysqldump) and the wp-content files in one streaming .tar.gz with a manifest.json.<prefix><host>/.wp-content can be typed in.wp-config.php.Restoring from a backup is not implemented. Download the archive and restore it by hand.
A backup is a state machine: init, dump the database, archive the files, upload, finalize. Each tick works for 20 seconds, saves its cursor and spawns the next tick through WP-Cron and a loopback request. One worker holds an atomic lock with a heartbeat; a worker that stops beating is taken over. The tar archive grows by one gzip member per tick, and the size after each flushed tick is recorded so a killed tick can be cut off cleanly. Large tables are read by primary key, so a table with millions of rows costs the same per batch from the first row to the last. Every S3 request is retried three times on a timeout, a 5xx or a 429.
wp-content plus the database, under uploads/, while a backup runsUpdates are self-hosted: the plugin reads its Update URI header and checks https://websqu.ad/updates/ws-r2-backup.json. New versions show up in the standard WordPress updates screen.
wp-cron.php). A site with DISABLE_WP_CRON and no system cron never gets past the first tick.ws_r2_backup_time_budget (seconds per tick, 20), ws_r2_backup_stale_threshold, ws_r2_backup_max_lifetime (2 hours).wp eval-file wp-content/plugins/ws-r2-backup/tools/cleanup-stuck-backups.php (WP-CLI only).% characters corrupted in every database dump; a failed query passing as an empty table; slow OFFSET paging on big tables; binary values; a file that grows while archived breaking the entries after it; a killed first tick corrupting the archive; unchecked writes on a full disk; excluded paths sweeping sibling folders; a non-atomic worker lock that could let two workers write one archive; activation not scheduling the backup; sites sharing a bucket seeing each other's archives. Added: S3 retries, input validation, an unreadable-secret notice, cleanup on deactivate and uninstall, self-hosted updates.websquad — brandsquad OÜ, Estonia. Support: [email protected]