WP-CLI Commands
Vimeify provides WP-CLI commands for managing sync operations from the command line.
Available Commands
All Vimeify CLI commands are under the wp vimeify sync namespace.
Metadata Sync
Sync video metadata from Vimeo to WordPress.
# Run metadata sync
wp vimeify sync metadata
# Reset and start from beginning
wp vimeify sync metadata --freshWhat it does:
- Fetches video metadata from Vimeo API (100 videos per page)
- Updates existing videos or creates new ones (based on sync settings)
- Syncs: title, description, duration, dimensions, thumbnails, embed links
- Updates post dates to match Vimeo upload dates
Options:
--fresh- Reset sync state and start from page 1
Status Sync
Check for deleted videos and remove them from WordPress.
# Run status sync
wp vimeify sync status
# Reset and start from beginning
wp vimeify sync status --freshWhat it does:
- Checks if local videos still exist on Vimeo
- Deletes local videos that return 404 from Vimeo
- Processes videos incrementally based on API quota
Options:
--fresh- Reset sync state and restart from position 0
Run All Syncs
Run both metadata and status sync in sequence.
# Run all sync operations
wp vimeify sync all
# Reset both and start fresh
wp vimeify sync all --freshWhat it does:
- Runs metadata sync first
- Then runs status sync
- Reports results for both operations
Sync Status Info
Display information about sync state and scheduled actions.
wp vimeify sync infoOutput includes:
- Scheduled Actions (next run time for each action)
- Metadata Sync State (current page, total pages, progress %)
- Status Sync State (current position, last synced time)
- API calls remaining
- Sync behavior mode (existing_only or create_all)
Example output:
=== Vimeify Sync Status ===
Scheduled Actions:
- Metadata Sync (every 10 minutes): in 9 minutes (2025-11-23 11:55:49)
- Status Sync (every 20 minutes): in 3 minutes (2025-11-23 11:49:39)
- Cleanup Files (hourly): in 60 minutes (2025-11-23 12:46:53)
Metadata Sync State:
- Page: 1 / 5 (20%)
- API calls remaining: 249
Status Sync State:
- Position: 142 / 500 (28.4%)
- Last synced: 17 minutes ago
Sync Behavior:
- Mode: Update existing videos onlyUse Cases
Manual Sync After Bulk Upload
If you uploaded many videos directly to Vimeo:
# Start a fresh metadata sync to import all videos
wp vimeify sync metadata --freshDebugging Sync Issues
Check sync status to see where it's stuck:
wp vimeify sync infoReset and retry:
wp vimeify sync all --freshAutomated Scripts
Include in deployment or maintenance scripts:
#!/bin/bash
# deployment-script.sh
# Run sync after deployment
wp vimeify sync metadata
# Check status
wp vimeify sync infoCron Jobs
While Vimeify uses Action Scheduler automatically, you can also trigger manually:
# In crontab
0 */6 * * * /usr/local/bin/wp vimeify sync all --path=/var/www/htmlTechnical Details
Pagination
Metadata Sync:
- Processes 100 videos per page (one Vimeo API call)
- Saves state after each page
- Resumes from last page on next run
- Resets to page 1 when complete
Status Sync:
- Loads all local videos into memory
- Processes one video at a time (one API call per video)
- Saves position after each video
- Respects API quota (stops at 3 remaining calls)
- Resets to position 0 when complete
API Quota Management
Commands automatically respect Vimeo API rate limits:
- Stops when API calls remaining ≤ 3
- Saves current position/page
- Resumes on next run
- Logs quota information
Sync Behavior Setting
The sync behavior is controlled by the admin setting:
- Update existing videos only (
existing_only): Only syncs metadata for videos already in WordPress - Sync all videos from Vimeo (
create_all): Creates new video posts for all Vimeo videos
This applies to both manual CLI commands and automatic background sync.
Command Reference
| Command | Description | Options |
|---|---|---|
wp vimeify sync metadata | Sync video metadata from Vimeo | --fresh |
wp vimeify sync status | Check for deleted videos | --fresh |
wp vimeify sync all | Run both sync operations | --fresh |
wp vimeify sync info | Show sync status and stats | None |
Exit Codes
0- Success1- Error (check output for details)
Logging
All sync operations are logged to:
wp-content/uploads/vimeify/cron.logMonitor logs in real-time:
tail -f wp-content/uploads/vimeify/cron.logExamples
Full Resync
# Reset both syncs and run from scratch
wp vimeify sync all --fresh
# Watch progress
watch -n 5 'wp vimeify sync info'Integration with CI/CD
# .github/workflows/deploy.yml
- name: Sync Vimeo Videos
run: |
wp vimeify sync metadata --path=/var/www/html
wp vimeify sync info --path=/var/www/htmlMaintenance Mode
# Stop automatic sync (via Action Scheduler admin)
# Run manual sync
wp vimeify sync all
# Check everything is synced
wp vimeify sync infoRelated
- Automatic Sync - Background sync with Action Scheduler
- API Reference - PHP API for sync operations
- Hooks & Filters - Customize sync behavior