Because cats have 9 lives, but servers don't - so they need backup-restore! Complete backup solution with S3/MinIO support. - Full WordPress backup (files + database) - S3 / MinIO / S3-compatible storage backends - Scheduled automatic backups - Disaster recovery / one-click restore - Backup integrity validation - Cat-themed admin interface Includes build.sh and .distignore for WordPress-installable release ZIPs.
6.6 KiB
6.6 KiB
Testing Guide - TigerStyle Life9
🧪 Testing the Complete Plugin
Quick Installation Test
-
Copy plugin to WordPress:
# From project directory cp -r /home/rpm/wp-robbie/src/tigerstyle-life9 /path/to/wordpress/wp-content/plugins/ -
Build frontend assets (optional - fallbacks work):
cd /path/to/wordpress/wp-content/plugins/tigerstyle-life9 npm install npm run build -
Activate in WordPress:
- Go to WordPress admin → Plugins
- Find "TigerStyle Life9"
- Click "Activate"
-
Access the interface:
- New menu "TigerStyle Life9" appears in WordPress admin
- Visit submenu items: Dashboard, Create Backup, Restore, Settings
🎯 Manual Testing Checklist
Installation & Activation
- Plugin activates without errors
- Database tables created successfully
- Backup directory created with proper permissions
- Admin menu appears correctly
- No PHP errors in debug log
Security Features
- Non-admin users cannot access backup functions
- Nonce verification works on all AJAX requests
- Path validation prevents directory traversal
- File uploads are properly sanitized
- Rate limiting prevents abuse
Backup Creation Interface
- Backup page loads with all components
- Alpine.js reactivity works (checkboxes, progress bars)
- Form validation prevents invalid submissions
- Encryption password strength meter functions
- File browser component works (if applicable)
- Progress tracking displays correctly
Settings Interface
- All settings sections load
- Form validation works for each setting
- Settings save successfully
- Storage backend configurations work
- System information displays correctly
Restore Interface
- Multi-step wizard navigation works
- File upload handling functions
- Backup validation works
- Restore options display correctly
- Warning messages appear appropriately
🔧 Functional Testing
Test Backup Creation
# Test basic backup (if WordPress is accessible)
curl -X POST "http://your-site.local/wp-json/tigerstyle-life9/v1/backup" \
-H "Content-Type: application/json" \
-H "X-WP-Nonce: YOUR_NONCE" \
-d '{
"include_files": true,
"include_database": true,
"encryption": {
"enabled": true,
"password": "test123"
}
}'
Test File Scanner
// In WordPress admin or via WP-CLI
$scanner = new TigerStyle_Life9_File_Scanner();
$files = $scanner->scan_directory(ABSPATH, [
'exclude_patterns' => ['*.log', 'cache/*']
]);
var_dump(count($files)); // Should return file count
Test Encryption
// Test encryption functionality
$encryption = new TigerStyle_Life9_Encryption();
$test_data = "Hello, secure world!";
$encrypted = $encryption->encrypt($test_data, "password123");
$decrypted = $encryption->decrypt($encrypted, "password123");
echo ($test_data === $decrypted) ? "✅ Encryption works" : "❌ Encryption failed";
🛡️ Security Testing
Path Traversal Test
// Should return false
$security = new TigerStyle_Life9_Security();
$result = $security->validate_path("../../wp-config.php", ABSPATH);
var_dump($result); // Should be false
SQL Injection Prevention
// All database queries should use prepared statements
// Check that no direct SQL concatenation exists
grep -r "SELECT.*\$" includes/ # Should return no results
grep -r "\$wpdb->query.*\$" includes/ # Should return no results
XSS Prevention Test
- Check that all output uses
esc_html(),esc_attr(),esc_url() - Verify Alpine.js uses
x-textinstead ofx-htmlfor user data - Test form inputs with malicious scripts
🚀 Performance Testing
Memory Usage
// Test backup memory consumption
$initial_memory = memory_get_usage();
$backup_engine = new TigerStyle_Life9_Backup_Engine(tigerstyle_life9());
// ... perform backup operations
$peak_memory = memory_get_peak_usage();
echo "Memory used: " . ($peak_memory - $initial_memory) . " bytes";
Large File Handling
- Test with files > 100MB
- Test with directories containing 10,000+ files
- Verify progress tracking accuracy
- Check timeout handling
🌐 Browser Testing
Supported Browsers
- Chrome 90+
- Firefox 88+
- Safari 14+
- Edge 90+
Mobile Responsiveness
- Interface works on mobile devices
- Touch interactions function properly
- Progress bars scale correctly
- Forms are mobile-friendly
🔍 Error Scenarios
Test Error Handling
-
Insufficient disk space:
# Fill up disk space and test backup creation dd if=/dev/zero of=/tmp/fillup bs=1M count=1000 -
Permission errors:
# Remove write permissions and test chmod 444 /path/to/backup/directory -
Database connection failure:
// Temporarily break DB connection and test -
Network interruption:
# Test with network disabled for cloud storage
📊 Testing Results Template
## Test Results - [Date]
### Environment
- **WordPress Version**: 6.3.0
- **PHP Version**: 8.1.0
- **Server**: Apache/Nginx
- **Database**: MySQL 8.0
### Test Summary
- **Total Tests**: 50
- **Passed**: 48
- **Failed**: 2
- **Skipped**: 0
### Failed Tests
1. **Backup Progress Tracking**: Progress bar stutters on large files
2. **Mobile Interface**: Settings page scrolling issue on iOS Safari
### Performance Metrics
- **Backup Creation**: 2.3 seconds (500MB site)
- **Database Export**: 0.8 seconds (100 tables)
- **File Scanning**: 1.1 seconds (5000 files)
- **Memory Usage**: Peak 128MB during backup
### Security Verification
- ✅ All XCloner vulnerabilities addressed
- ✅ No path traversal possible
- ✅ All SQL queries use prepared statements
- ✅ Proper nonce verification
- ✅ Rate limiting functional
🏭 Production Testing
Staging Environment
- Deploy to staging WordPress site
- Test with real data (full site backup/restore)
- Verify cloud storage integration works
- Test scheduled backups run correctly
- Validate email notifications are sent
Load Testing
# Test concurrent backup requests
for i in {1..5}; do
curl -X POST "http://your-site.local/wp-json/tigerstyle-life9/v1/backup" &
done
🚨 Emergency Testing
Disaster Recovery
- Create backup of production site
- Simulate site corruption (rename wp-config.php)
- Restore from backup using plugin
- Verify site functionality post-restore
- Document recovery time
Testing is critical for security and reliability! 🧪✅