MksDdn Migrate Content - Complete Description
Category: WordPress Plugins • Platform: PHP
MksDdn Migrate Content is a clean-room migration suite that packages your site into deterministic .wpbkp archives. Each bundle contains a manifest, checksum, database segments, media, selected files, and user decisions, so imports are predictable and reversible.
Why MksDdn Migrate Content?
- Dual export modes – choose Full Site (database + uploads/plugins/themes) or Selected Content (multi-select posts/pages/CPTs) with or without referenced media.
- Chunked pipeline – large archives stream through AJAX endpoints with resume tokens, so multi‑GB transfers survive flaky networks.
- Snapshots, history & rollback – every import stores a snapshot, logs metadata, enforces a global job lock, and lets you roll back with one click.
- User merge control – compare archive vs current users, decide how to merge/conflict, and log every change for audit.
- Automation & retention – schedule recurring full-site exports via WP-Cron, cap storage with retention rules, and review run logs in the admin UI.
- Integrity & safety –
.wpbkparchives ship with manifests and checksums; imports verify capabilities, nonces, and disk space before touching data.
Feature Highlights
- Archive format with manifest, checksum, and payload folders (
content.json,media/,options/, filesystem slices). - Media scanner that collects featured images, galleries, attachments referenced inside blocks or shortcodes.
- File-system coverage for
wp-content/uploads,wp-content/plugins,wp-content/themeswith filters to skip VCS/system files. - Chunked upload/download JS client with live progress, auto-resume, and graceful fallback to direct transfer.
- Recovery center showing history, statuses, archive paths, rollback controls, and inline notices when a job lock is active.
- Scheduler UI to enable cron-based backups, tweak recurrence, and enforce “keep last N archives”.
- Custom
.wpbkpdrag-and-drop uploader with checksum guardrails (UI polish deferred to next milestone, functionality already complete).
Architecture
The plugin follows SOLID principles and WordPress Coding Standards with a clean, modular architecture:
Service Container & Dependency Injection
- Centralized
ServiceContainermanages all dependencies - Service Providers (
CoreServiceProvider,AdminServiceProvider,ExportServiceProvider,ImportServiceProvider,ChunkServiceProvider) register services - All dependencies resolved through container, eliminating direct instantiation
- Full support for interface-based dependency injection
Request Handlers
ExportRequestHandler– handles export requestsImportRequestHandler– delegates to specialized import servicesRecoveryRequestHandler– manages snapshots and rollbacksScheduleRequestHandler– handles automation schedulingUserMergeRequestHandler– processes user merge operations- All handlers implement corresponding interfaces for testability
Service Layer
SelectedContentImportService– handles selected content importsFullSiteImportService– manages full site importsImportFileValidator– validates uploaded filesImportPayloadPreparer– prepares import payloadsResponseHandler– manages redirects and status messagesNotificationService– handles user notificationsProgressService– tracks operation progress
Contracts (Interfaces)
All key components implement interfaces:
* ExporterInterface, ImporterInterface
* MediaCollectorInterface, SnapshotManagerInterface
* HistoryRepositoryInterface, ChunkJobRepositoryInterface
* ScheduleManagerInterface, UserPreviewStoreInterface
* NotificationServiceInterface, ProgressServiceInterface
* Request handler interfaces for all handlers
Error Handling
- Specialized exceptions:
ValidationException,FileOperationException,DatabaseOperationException,ImportException,ExportException - Centralized
ErrorHandlerfor consistent error processing - Proper logging and user-friendly error messages
Performance
BatchLoaderfor optimized database queries (prevents N+1 problems)- Efficient media collection with batch processing
- Chunked transfer for large files
- Memory-efficient streaming for large archives
Security
- All admin operations check
current_user_can('manage_options') - Nonce verification for all forms and AJAX requests
- Input sanitization using WordPress sanitization functions
- Output escaping with
esc_html(),esc_attr(),esc_url() - File upload validation with MIME type checking