<15 min
P0 Rollback Target
22.1. Deployment & Operations Overview
The Deployment & Operations section defines the processes, procedures, and best practices for delivering the CMD Pro plugin to end-users and operating it in production environments. While the Release Strategy focuses on the what and when of releases, this section focuses on the how—the technical execution of deployment, ongoing operations, maintenance, and recovery.
Build
Test
Stage
Deploy
Monitor
Installation
Upgrade
Rollback
Backup & Recovery
Monitoring
Logging
Alerting
22.2. Deployment Principles
| Principle | Description |
| Automation First | All deployment processes should be automated to minimize human error and ensure consistency. |
| Zero Downtime | Deployments should not cause downtime for end-users (where possible). |
| Rollback Capability | Every deployment must have a documented and tested rollback procedure. |
| Phased Rollout | Deployments should be phased to minimize risk and allow for early detection of issues. |
| Monitoring & Observability | All deployments must be monitored for errors, performance degradation, and user impact. |
| Security by Default | All deployment processes must follow security best practices. |
| Documentation | All deployment and operational procedures must be documented and kept up to date. |
22.3. Installation
22.3.1. Installation Methods
| Method | Description | Target Audience | Status |
| CMD Pro ZIP Package | Upload the licensed plugin ZIP through WordPress Admin. | All users | Primary (current) |
| Manual ZIP Upload | Advanced: upload ZIP via plugin uploader. | Advanced users | Supported |
| WordPress Plugin Directory * | Direct installation from WordPress.org (planned). | All users | Future |
| Composer Installation | For managed environments (planned). | Developers, agencies | Planned |
| WP-CLI | Command-line installation (planned). | Developers, DevOps | Planned |
Note: The WordPress Plugin Directory method will be added once a free/Lite version is published on WordPress.org. For now, the primary distribution channel is the licensed ZIP package.
22.3.2. Installation Requirements
| Requirement | Minimum Compatibility | Recommended (Production) |
| WordPress | 6.x | Current stable version |
| PHP | 8.0+ | 8.2+ |
| MySQL / MariaDB | 5.7+ / 10.3+ | MySQL 8.0+ or MariaDB 10.6+ |
| Memory Limit | 64 MB | 128 MB+ |
| Max Execution Time | 30 sec | 60 sec |
| HTTPS | Optional | Required for production |
Minimum compatibility is based on actual testing. PHP 7.4 is end-of-life and is not supported by CMD Pro. Production environments should use PHP 8.2 or later where available.
22.3.3. Installation Process Flow
User Action: Navigate to Plugins → Add New → Upload Plugin → select CMD Pro ZIP → Install Now.
System Action: Extract files to /wp-content/plugins/cmd-pro/, verify integrity, run activation hook, create database tables (wp_cmdp_prices, etc.), set default options, schedule cron jobs.
Verification: Dashboard displays correctly, data is fetched, charts and ticker work.
22.3.4. Installation Checklist
| Check | Status |
| WordPress version verified (≥6.x) | ☐ |
| PHP version verified (≥8.0) | ☐ |
| Plugin ZIP uploaded/installed | ☐ |
| Plugin activated | ☐ |
| Database tables created | ☐ |
| Default options set | ☐ |
22.4. Upgrade Process
22.4.1. Upgrade Methods
| Method | Description | Status |
| WordPress Automatic Update | Fully automated via WordPress update system. | Planned (Enterprise) |
| WP-CLI Update | Command-line update using wp plugin update. | Planned |
| Composer Update | Update via Composer dependency manager. | Planned |
| Manual ZIP Upload | Upload new ZIP via WordPress admin (current). | Supported |
| WordPress Manual Update | Click “Update Now” in admin (if directory version available). | Future |
Automatic updates will be supported via a licensing/update service in future Enterprise releases. Currently, upgrades are performed via manual ZIP upload.
22.4.2. Upgrade Process Flow
- Pre-upgrade: User notified, system checks compatibility, database backup recommended.
- Execution: Files replaced, migration scripts run, options updated, cache cleared.
- Verification: Verify version, dashboard, data integrity.
- Cleanup: Transients cleared, logs updated.
22.4.3. Database Migration Strategy
Roadmap note: Migration entries for future CMD Pro versions represent the planned schema evolution and may change before release.
| Version | Migration | Description | Rollback |
| v4.0 | Initial schema | Create tables: prices, history, alerts, logs, api_cache | Drop tables |
| v4.1 | Schema update | Add metadata JSON field to prices | Remove field |
| v5.0 | Schema update | Add indexes for performance | Remove indexes |
| v6.0 | Schema update | Add alert_type and notification_method fields | Remove fields |
Best practices: Backup first, use transactions, idempotent migrations, track version in options, test on staging.
22.5. Rollback Procedure
22.5.1. Rollback Triggers
| Trigger | Priority | Action |
| Critical Bug (P0/P1) | P0 | Immediate rollback |
| Security Vulnerability | P0 | Immediate rollback |
| Data Corruption | P0 | Immediate rollback |
| Performance Degradation | P1 | Rollback within 4h |
| Compatibility Issue | P1 | Rollback within 24h |
22.5.2. Rollback Process Flow
- Detection: Issue detected via monitoring or user report.
- Pre-rollback: Verify previous version available, database backup ready.
- Execution: Deactivate current, replace files, run database rollback, clear cache, reactivate.
- Verification: Check plugin version, dashboard, data integrity.
- Post-rollback: Log event, notify stakeholders, investigate root cause.
22.5.3. Rollback Time Targets
| Severity | Target Rollback Time |
| P0 – Critical | < 15 minutes |
| P1 – High | < 60 minutes |
| P2 – Medium | < 4 hours |
| P3 – Low | < 24 hours |
Example commands are illustrative. Production rollback procedures must use the tested CMD Pro release package and verified database backup. Do not copy commands directly without adaptation.
# WP-CLI rollback example (illustrative)
wp plugin deactivate cmd-pro
wp plugin delete cmd-pro
wp plugin install cmd-pro –version=4.0.0 # version must be available
wp plugin activate cmd-pro
22.6. Backup Strategy
Operational guidance: Backup schedules and retention periods are recommended deployment practices. Actual backup availability and retention depend on the customer’s hosting and infrastructure configuration.
22.6.1. Backup Components
| Component | Frequency | Retention |
| Database (wp_cmdp_* tables, options) | Daily | 30 days |
| Files (/wp-content/plugins/cmd-pro/) | Daily | 30 days |
| Configuration (settings, API keys) | Daily | 30 days |
| Historical Data (wp_cmdp_history) | Weekly | 1 year |
| Logs (wp_cmdp_logs) | Monthly | 90 days |
22.6.2. Backup Schedule
| Schedule | Components | Retention |
| Daily (Full) | Database, Files, Configuration | 30 days |
| Weekly (Full) | Database, Files, Historical | 1 year |
| Monthly (Archive) | Historical Data | 3 years |
| On-Demand | All components | 90 days |
22.6.3. Backup Commands (illustrative)
# Database backup with WP-CLI (example)
wp db export cmd-pro-backup-$(date +%Y%m%d).sql –tables=wp_cmdp_prices,wp_cmdp_history,wp_cmdp_alerts
# Files backup
tar -czf cmd-pro-files-$(date +%Y%m%d).tar.gz /wp-content/plugins/cmd-pro/
# Credentials should be supplied via environment or WP-CLI config, not hard-coded.
Security: Do not hard-code database credentials in backup scripts. Use environment variables or WP-CLI’s secure configuration.
22.6.4. Backup Verification
- Restore Test: Monthly – test restore from backup.
- Backup Size: Weekly – monitor for anomalies.
- Completion: Daily – verify success.
- Database Integrity: Monthly – run checks on restored backup.
22.7. Monitoring
22.7.1. Monitoring Categories
| Category | What to Monitor | Tools |
| Availability | Dashboard, API, plugin uptime | Uptime monitoring |
| Performance | Load time, API response, cache hit rate | Frontend/backend monitoring |
| Errors | PHP errors, API failures, exception rate | Error tracking |
| Data | Data freshness, integrity, update success | Timestamp comparison, checksums |
| Security | Auth attempts, permission changes, suspicious activity | Security logs, alerts |
| Resources | Memory usage, CPU, disk I/O | Server monitoring |
The summary card reflects 6 Monitoring Categories (Availability, Performance, Errors, Data, Security, Resources).
22.7.2. Key Performance Indicators (KPIs)
| Metric | Target | Alert Threshold |
| Dashboard Load Time | < 2 s | > 3 s |
| API Response Time | < 500 ms | > 1 s |
| Data Freshness | < 5 min | > 15 min |
| API Success Rate | ≥ 99.5% | < 95% |
| Cache Hit Rate | ≥ 90% | < 80% |
| Error Rate | < 0.1% | > 1% |
22.7.3. Monitoring Dashboard (example)
System Status: Operational
Last updated: 2 min ago
Illustrative operational metrics – not live production data.
22.8. Logging
22.8.1. Log Types
| Log Type | Description | Table | Retention |
| System Logs | Plugin initialization, cron jobs, system events | wp_cmdp_logs | 90 days |
| User Logs | User actions, changes, preferences | wp_cmdp_logs | 90 days |
| API Logs | API requests, responses, errors | wp_cmdp_logs | 30 days |
| Error Logs | PHP errors, database errors, exceptions | wp_cmdp_logs | 90 days |
| Data Logs | Price updates, data changes | wp_cmdp_logs | 1 year |
| Security Logs | Authentication attempts, permission changes | wp_cmdp_logs | 1 year |
Note: All log types are stored in a unified table (wp_cmdp_logs) and distinguished using the log_type field.
22.8.2. Log Structure
| Field | Description | Format | Example |
| log_id | Unique identifier | Integer | 12345 |
| log_type | Log category (system, user, api, error, data, security) | VARCHAR(20) | api |
| user_id | WordPress user ID | Integer | 42 |
| action | Action performed | String | price_update |
| entity | Entity affected | String | price |
| entity_id | Entity identifier | String | COTTON |
| details | Action details | JSON | {“old”: 0.795, “new”: 0.809} |
| ip_address | User IP address | String | 192.168.1.1 |
| user_agent | Browser user agent | String | Mozilla/5.0… |
| created_at | Timestamp | DATETIME | 2026-08-13 09:48:00 |
Correction: Added log_type field to distinguish between System, User, API, Error, Data, and Security logs in the unified table.
22.9. Disaster Recovery
22.9.1. Disaster Recovery Tiers
These are internal performance Disaster Recovery Tiers, not contractual SLAs.
| Tier | Description | RTO | RPO |
| Tier 1 | Critical systems (Plugin, Database) | < 4 h | < 1 h |
| Tier 2 | Historical data | < 8 h | < 24 h |
| Tier 3 | Non-critical (Logs, Cache) | < 24 h | < 7 d |
22.9.2. Disaster Recovery Process
- Incident Detection: Monitoring alerts or user reports.
- Response: Team notified, incident logged.
- Recovery Execution: Rollback or restore from backup.
- Service Restoration: Verify, health checks, notify stakeholders.
- Post-Recovery: Document, root cause analysis, preventive measures.
22.9.3. Disaster Recovery Scenarios
| Scenario | Recovery Action | RTO |
| Data Corruption | Restore from latest backup | < 4 h |
| Software Bug | Rollback to previous version | < 1 h |
| Plugin Conflict | Rollback, investigate | < 4 h |
| WordPress Update breakage | Rollback WordPress or plugin | < 4 h |
| Server Failure | Restore on backup server | < 8 h |
22.10. Deployment Pipeline
Developer
Build/CI
Testing
Release Package
Production
Monitoring
Pre-Deployment Checks
- All tests passing
- Code review approved
- Migration scripts tested
- Rollback plan documented
- Monitoring configured
- Stakeholders notified
Deployment Steps
- Switch to maintenance mode (if needed)
- Deploy new files to staging (where available)
- Run database migrations
- Verify staging deployment
- Deploy to production
- Run smoke tests
- Clear cache
- Disable maintenance mode
22.11. Deployment Runbook
📋 DEPLOYMENT RUNBOOK
🔧 Pre-Deployment Checks
- ☐ All tests passing
- ☐ Code review approved
- ☐ Database migration scripts tested
- ☐ Rollback plan documented
- ☐ Monitoring checks configured
- ☐ Stakeholders notified
🚀 Deployment Steps
- 1. Switch to maintenance mode (if needed)
- 2. Deploy new files to staging (where available)
- 3. Run database migrations
- 4. Verify staging deployment
- 5. Deploy to production
- 6. Run smoke tests
- 7. Clear cache
- 8. Disable maintenance mode
☐ Post-Deployment Checks
- ☐ Dashboard loads correctly
- ☐ Data is being fetched
- ☐ Charts are rendering
- ☐ Ticker is functioning
- ☐ No error logs
- ☐ Performance is within operational targets
- ☐ All features verified
- ☐ Stakeholders notified of completion
22.12. Operational Targets
These are internal performance targets, not contractual SLAs. Actual uptime depends on customer infrastructure and third-party services.
| Metric | Target |
| Plugin Uptime | ≥ 99.5% |
| Dashboard Availability | ≥ 99.5% |
| Deployment Success Rate | ≥ 99% |
| Rollback Time (P0) | < 15 minutes |
| Recovery Time Objective (RTO) | < 4 hours |
| Recovery Point Objective (RPO) | < 1 hour |
| Backup Success Rate | ≥ 99.5% |
| Monitoring Coverage | 100% of critical metrics |
22.13. Deployment & Operations Summary Matrix
| Area | Key Components | Responsibility | Frequency |
| Installation | WordPress, Plugin, Configuration | User / Administrator | One-time |
| Upgrade Process | Automated updates, Manual, WP-CLI | Administrator / System | Per release |
| Rollback Procedure | Previous version, Database restore | Administrator | Per issue |
| Backup Strategy | Database, Files, Configuration | System Administrator | Daily |
| Monitoring | Uptime, Performance, Errors | DevOps / QA | Continuous |
| Logging | System, User, API, Security | System Administrator | Continuous |
| Disaster Recovery | Recovery plans, Backups, Drills | DevOps / Management | As needed |
Conclusion: This comprehensive Deployment & Operations framework provides a complete approach to delivering, maintaining, and recovering the CMD Pro plugin in production environments. With 7 deployment principles, 5 documented installation paths (current and planned), and a ≥99.5% operational uptime target, the framework ensures reliability, security, and business continuity for all users.