A command-line tool for uploading large files to WordPress sites using the Worry-Proof Backup plugin. This tool automatically chunks large files, uploads them in parallel, and triggers the restore process on the server.
- 📦 Chunked Uploads: Automatically splits large files into manageable chunks
- ⚡ Parallel Processing: Uploads multiple chunks concurrently for faster transfers
- 📊 Progress Tracking: Real-time progress bar showing upload status
- 🔄 Auto-Restore: Automatically triggers the unzip/restore process after upload completes
- 🔐 Secure Authentication: Uses Basic Auth with token-based authentication
You can use the tool directly with npx without installing it:
npx github:miketropi/wpb-upload-cli upload --file <path> --site <url> --token <token> [options]npx github:miketropi/wpb-upload-cli upload --file <path> --site <url> --token <token> [options]--file <path>- Path to the file you want to upload--site <url>- WordPress site URL (e.g.,https://example.com)--token <token>- Your WordPress application's credentials in the format"username:application_password"
--chunk-size <mb>- Chunk size in megabytes (default:10)--concurrency <n>- Number of parallel uploads (default:3)
npx github:miketropi/wpb-upload-cli upload \
--file ./backup.zip \
--site https://example.com \
--token "username:application_password"npx github:miketropi/wpb-upload-cli upload \
--file ./large-backup.zip \
--site https://example.com \
--token "username:application_password" \
--chunk-size 20 \
--concurrency 5npx github:miketropi/wpb-upload-cli upload \
--file ./backup.zip \
--site https://example.com \
--token "username:application_password" \
--chunk-size 5 \
--concurrency 2Note: If you've installed the package globally, you can omit
npxand usewpb-upload-clidirectly.
- Chunking: The file is split into chunks based on the specified chunk size
- Upload: Chunks are uploaded in parallel to the WordPress site's REST API endpoint
- Progress: A progress bar shows the upload status in real-time
- Restore: Once all chunks are uploaded, the tool automatically triggers the restore/unzip process on the server
- Completion: The process completes when the server finishes extracting the uploaded file
The tool communicates with the following WordPress REST API endpoints:
POST /wp-json/worry-proof-backup/v1/upload-chunk- Uploads individual chunksPOST /wp-json/worry-proof-backup/v1/restore-start- Initializes the restore processPOST /wp-json/worry-proof-backup/v1/restore-run- Executes the restore process
- 413 Payload Too Large: If you encounter this error, reduce the
--chunk-sizeoption - Upload Failures: The tool will stop and display an error message if any chunk fails to upload
- Network Errors: Connection issues are reported with detailed error messages
- Node.js (ES modules support required)
- WordPress site with Worry-Proof Backup plugin installed
- Valid authentication token for the WordPress site
axios- HTTP client for API requestscommander- CLI frameworkform-data- Form data handling for multipart uploadsp-queue- Promise queue for managing concurrent uploadscli-progress- Progress bar display
ISC