ZiziCache provides a robust REST API for remote management of database operations, enabling integration with external tools and automation of database maintenance.
Available REST Endpoints
The API includes the following main endpoints:
/optimize-db-tables: Optimization of database tables/optimize-db-tables-batch: Batch optimization for large databases/database-statistics: Detailed database statistics/database-status: Current database status/database-size-history: Database growth history/database-index-recommendations: Index recommendations/cleanup-counts: Counts of cleanable items
API Security
All database operations are protected by:
- CSRF protection: Verification of request authenticity
- Permission callback: Administrator privilege checks
- Parameter validation: Verification of input data
- Rate limiting: Protection against spam requests
Batch Operations
For large databases, the API supports batch processing:
- Configurable batch size: Setting the batch size
- Time limits: Protection against timeouts
- Progress tracking: Monitoring the progress of operations
- Error handling: Robust error processing
Examples of API Usage
Basic examples of API calls:
// Database optimization
POST /wp-json/zizi-cache/v1/optimize-db-tables
// Get statistics
GET /wp-json/zizi-cache/v1/database-statistics
// Batch cleanup
POST /wp-json/zizi-cache/v1/cleanup-counts
{
"options": ["db_post_revisions", "db_transients_expired"]
}
Response Formats
The API returns structured responses with detailed information about the results of operations, errors, and processing statistics.