WordPress Import System - Testing Guide
🎯 Pre-Test System Check
Step 1: Run System Test Command
php artisan waravel:test-import-systemThis will check:
- ✅ Database tables exist
- ✅ Queue tables are set up
- ✅ Service classes can be instantiated
- ✅ Routes are registered
- ✅ Storage permissions are correct
- ✅ Environment variables are set
Expected Result: 90%+ pass rate
Step 2: Setup Queue Tables (if needed)
If queue tables are missing:
php artisan queue:table
php artisan queue:failed-table
php artisan migrateStep 3: Fix Storage Permissions (if needed)
# Create storage link
php artisan storage:link
# Fix permissions (Linux/Mac)
chmod -R 775 storage/
chown -R www-data:www-data storage/
# Windows: Ensure storage/ folder has write permissions🚀 Live Testing Process
Step 1: Start Queue Worker
Terminal 1 (keep this running):
php artisan queue:work --verbose --tries=3 --timeout=3600You should see:
[2024-01-01 12:00:00][0] Processing: ...
[2024-01-01 12:00:00][0] Processed: ...Step 2: Access Import Dashboard
Navigate to:
http://your-site.com/waravel/import/wpExpected: Form with WordPress credentials fields
Step 3: Test WordPress Connection
Enter Test WordPress Site:
- URL:
https://demo.wp-api.org(public test site) - Username:
demo - Password:
demo
- URL:
Click "Fetch Totals"
Expected Result:
- ✅ Totals appear (pages, posts, tags counts)
- ✅ Import options become visible
- ✅ No JavaScript errors in console
Step 4: Test Small Import
Select Import Types:
- ✅ Import Pages (should show count)
- ⬜ Import Posts (uncheck for faster test)
- ⬜ Import Tags (uncheck for faster test)
- ⬜ Import Media (uncheck for faster test)
Click "Start Import"
Expected Results:
- ✅ Job starts immediately
- ✅ Progress bar appears and updates
- ✅ Queue worker shows processing messages
- ✅ Import completes successfully
Step 5: Verify Import Results
Check Pages Dashboard:
http://your-site.com/waravel/pagesVerify:
- ✅ Pages imported with correct titles
- ✅ Content is present
- ✅ Hierarchy preserved (if applicable)
- ✅ No duplicate pages
🔍 Advanced Testing
Test 1: Full Import with Real WordPress Site
Use Your WordPress Site:
- Enter your WordPress credentials
- Select all import types
- Set new domain (optional)
- Start import
Monitor Progress:
- Watch queue worker output
- Check progress in dashboard
- Monitor for errors
Test 2: Pause/Resume Functionality
- Start Large Import
- Click "Pause" during processing
- Verify: Job pauses, worker stops processing
- Click "Resume"
- Verify: Job continues from where it left off
Test 3: Error Handling
- Enter Invalid Credentials
- Try to Start Import
- Verify: Proper error messages displayed
Test 4: Nested Import
- Create Parent Page manually
- Set "Parent Container" to that page ID
- Start Import
- Verify: All imported content is under parent page
🐛 Troubleshooting
Queue Worker Issues
Problem: Worker not processing jobs
# Check if worker is running
ps aux | grep "queue:work"
# Restart worker
php artisan queue:restart
php artisan queue:work --verboseProblem: Jobs failing
# Check failed jobs
php artisan queue:failed
# View specific failure
php artisan queue:failed --id=1
# Retry failed jobs
php artisan queue:retry allImport Issues
Problem: No totals fetched
- Check WordPress credentials
- Verify WordPress REST API is enabled
- Check network connectivity
Problem: Import stuck
- Check queue worker is running
- Check Laravel logs:
tail -f storage/logs/laravel.log - Check database for job status
Problem: Media not downloading
- Check storage permissions
- Verify storage link exists
- Check available disk space
Database Issues
Problem: Foreign key errors
# Check if all migrations ran
php artisan migrate:status
# Run missing migrations
php artisan migrate📊 Success Criteria
✅ Basic Test Success
- [ ] System test passes (90%+)
- [ ] Queue worker starts without errors
- [ ] Dashboard loads correctly
- [ ] Can fetch totals from WordPress
- [ ] Can start and complete small import
- [ ] Imported content appears correctly
✅ Advanced Test Success
- [ ] Full import completes successfully
- [ ] Pause/resume works correctly
- [ ] Error handling works properly
- [ ] Nested import works
- [ ] Domain replacement works
- [ ] Media files download correctly
- [ ] Parent-child relationships preserved
🎉 Next Steps After Successful Testing
Production Setup:
- Configure Redis queues
- Set up Supervisor for workers
- Configure proper logging
Performance Optimization:
- Test with large WordPress sites
- Monitor memory usage
- Optimize worker settings
Documentation:
- Document any site-specific configurations
- Create user guides
- Document troubleshooting steps
🆘 Getting Help
If tests fail:
Check Logs:
bashtail -f storage/logs/laravel.logCheck Queue Status:
bashphp artisan queue:monitor php artisan queue:failedRun System Test Again:
bashphp artisan waravel:test-import-systemCheck Database:
sqlSELECT * FROM waravel_import_jobs ORDER BY created_at DESC LIMIT 5;
Remember: The system is designed to be fault-tolerant. Most issues can be resolved by restarting the queue worker or retrying failed jobs.