Implements automatic creation of required plugin pages (Community Login, Trainer Registration, Trainer Dashboard) upon plugin activation. This addresses E2E test failures caused by missing pages in the test environment. - Adds activation hook in `hvac-community-events.php` to call `hvac_ce_create_required_pages`. - The callback function checks for existing pages by slug and creates them using `wp_insert_post` if missing. Includes debug logging. Also fixes issues identified during E2E test debugging: - Corrects fatal error in `includes/community/class-login-handler.php` by replacing undefined constant `HVAC_COMMUNITY_EVENTS_PATH` with `HVAC_CE_PLUGIN_DIR`. - Updates `tests/e2e/tests/login.spec.ts` to use the correct selector `#wp-submit` for the login form submit button instead of `button[type="submit"]`. Documentation updates: - Adds `docs/automatic-page-creation-plan.md`. - Updates `README.md` regarding automatic page creation. - Updates Memory Bank files (`decisionLog.md`, `progress.md`, `activeContext.md`). Note: Activation hook logging did not appear during WP-CLI activation, requiring further investigation if page creation issues persist. E2E test confirmation pending.
3.9 KiB
3.9 KiB
Deployment Guide
This guide covers deploying the HVAC Trainer Network Events plugin to development and production environments.
Quick Start
# Deploy to development
./Users/ben/dev/upskill-event-manager/wordpress-dev/deploy.sh --config deploy-config.sh
# Deploy and run tests
./Users/ben/dev/upskill-event-manager/wordpress-dev/deploy.sh --config deploy-config.sh --run-tests
# Deploy to production
./Users/ben/dev/upskill-event-manager/wordpress-dev/deploy.sh --config deploy-config-production.sh
Plugin Dependencies
The HVAC Trainer Network Events plugin requires the following plugins:
- The Events Calendar (6.10.2 or higher)
- The Events Calendar Pro (7.4.2 or higher)
- Event Tickets (5.19.3 or higher)
- Event Tickets Plus (6.2.0 or higher)
- The Events Calendar: Community Events (latest version)
- Spectra Pro (2.0.0 or higher)
- Premium Starter Templates (4.4.14 or higher)
- Essential Blocks (5.3.2 or higher)
Important Notes:
- Plugin versions are managed separately from deployment
- Do not update plugins as part of deployment or testing
- Plugin updates should be tested separately in a staging environment
- Use the plugin management system of your hosting environment for updates
Configuration Files
Development Configuration
File: deploy-config.sh
REMOTE_HOST="upskill_wordpress"
REMOTE_USER="root"
WP_PATH="/var/www/html/"
PLUGIN_SLUG="network-events"
WP_CLI_PATH="wp"
PURGE_BREEZE_CACHE=false
USE_ROOT=true
Production Configuration
File: deploy-config-production.sh
- Contains production-specific settings
- Includes additional security measures
- Requires SSH key configuration
Deployment Process
-
Pre-deployment Checks
- Verify dependencies
- Run tests
- Check file permissions
-
Deployment Steps
- Package plugin files
- Transfer to target environment
- Update WordPress configuration
- Clear caches
-
Post-deployment Verification
- Check plugin activation
- Verify functionality
- Monitor error logs
Development Environment
Setup
# Start development environment
cd /Users/ben/dev/upskill-event-manager/wordpress-dev
./Users/ben/dev/upskill-event-manager/wordpress-dev/manage-env.sh start
# Stop development environment
./Users/ben/dev/upskill-event-manager/wordpress-dev/manage-env.sh stop
# Reset development environment
./Users/ben/dev/upskill-event-manager/wordpress-dev/manage-env.sh reset
Access Points
- WordPress site: http://localhost:8080
- WordPress admin: http://localhost:8080/wp-admin
- phpMyAdmin: http://localhost:8081
Production Environment
Requirements
- SSH access to production server
- WordPress admin credentials
- Appropriate file permissions
Deployment Steps
- Configure SSH access
- Update production configuration
- Run deployment script
- Verify deployment
Troubleshooting
Common Issues
-
Permission Errors
# Fix permissions ./Users/ben/dev/upskill-event-manager/manage-env.sh fix-permissions -
Cache Issues
# Clear WordPress cache wp cache flush -
Plugin Activation Issues
# Check plugin status wp plugin list
Rollback Procedure
If deployment fails:
- Restore from backup
- Revert plugin files
- Clear caches
- Verify functionality
Maintenance
Regular Tasks
- Update dependencies
- Run tests
- Monitor error logs
- Backup data
Backup Management
# Create backup
./Users/ben/dev/upskill-event-manager/wordpress-dev/manage-env.sh backup
# Restore from backup
./Users/ben/dev/upskill-event-manager/wordpress-dev/manage-env.sh restore
Security Considerations
-
Configuration Security
- Use environment variables
- Secure sensitive data
- Restrict file permissions
-
Access Control
- Limit SSH access
- Use strong passwords
- Enable two-factor authentication
-
Monitoring
- Check error logs
- Monitor file changes
- Track plugin activity