內容簡介
MksDdn Migrate Content 是一款專業的網站遷移外掛,能將您的網站打包成可預測的 .wpbkp 檔案,確保資料的完整性與安全性,並提供多種匯出模式以滿足不同需求。
【主要功能】
• 三種匯出模式:完整網站、選擇內容、佈景主題匯出
• 大檔案分段傳輸,支持恢復功能
• 用戶合併控制,解決衝突
• 佈景主題匯入模式,選擇替換或合併
• 整合性與安全性,檢查清單與校驗碼
• 匯入前檢查,無需重複上傳檔案
外掛標籤
開發者團隊
📦 歷史版本下載
原文外掛簡介
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 stay predictable.
Why MksDdn Migrate Content?
Three export modes – Full Site (database + uploads/plugins/mu-plugins/themes), Selected Content (multi-select posts/pages/CPTs with or without referenced media), or Theme Export (individual themes as .wpbkp).
Chunked pipeline – large archives stream through REST API endpoints with resume tokens, so multi‑GB transfers survive flaky networks.
User merge control – compare archive vs current users and decide how to merge conflicts.
Theme import mode – when a theme archive is detected, choose replace vs merge before applying changes.
Integrity & safety – .wpbkp archives ship with manifests and checksums; imports verify capabilities, nonces, and disk space before touching data.
Import preflight – unified import is a two-step flow: run preflight (read-only report), then start the real import from the report without uploading the file again (browser uploads are staged server-side between steps).
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/mu-plugins, wp-content/themes with filters to skip VCS/system files.
Chunked upload/download JS client with live progress, auto-resume, and graceful fallback to direct transfer.
Server file import — select backup files from wp-content/uploads/mksddn-mc/imports/ without browser uploads; delete unused server backups from the import UI.
Theme export and import with replace vs merge preview before applying changes.
Export preflight — disk space and memory checks before full-site export starts.
Drag-and-drop .wpbkp / .json uploader with MIME validation and checksum guardrails (file-dropzone.js).
Centralized PluginLogger — dedicated log file with rotation; disable via MKSDDN_MC_DISABLE_LOGGING in wp-config.php.
Architecture
The plugin follows SOLID principles and WordPress Coding Standards with a clean, modular architecture:
Service Container & Dependency Injection
Centralized ServiceContainer manages 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 requests
ImportRequestHandler – delegates to specialized import services (supports unified import via UnifiedImportOrchestrator)
UserMergeRequestHandler – processes user merge operations
ThemePreviewRequestHandler – handles theme preview cancel operations
ChunkRestController – REST API controller for chunked upload/download operations
All handlers implement corresponding interfaces for testability
Admin UI
Top-level Migrate Content menu with Export and Import subpages
Export tabs: Full Site, Selected Content, Theme Export (AdminPageView, views/admin/*)
Unified import form with preflight report, user preview, and theme preview screens
Admin assets: file-dropzone.js, server-file-selector.js, chunk-transfer.js, admin-scripts.js, admin-styles.css
Export & Import Core
ExportHandler — selected content export (slug-based identifiers, media, taxonomies, ACF)
ImportHandler — selected content import (parent-child ordering, slug lookup, Polylang/ACF)
SelectionBuilder, ContentSelection — build export selections from admin input
FullContentExporter, FullContentImporter — full-site archive assembly and restore
FullDatabaseExporter, FullDatabaseImporter, SwapTableNames — streaming database export/import; schema recreate uses a swap table then atomic RENAME
ThemeExporter, ThemeImporter — theme archive export and filesystem apply
OptionsExporter, OptionsImporter, OptionsHelper — WordPress options slices
AttachmentCollector, AttachmentRestorer, AttachmentCollection — media pipeline
ExportPreflight, ExportMemoryHelper — pre-export disk/memory checks and memory budgeting
FilenameBuilder — deterministic archive filenames
Service Layer (Admin)
SelectedContentImportService — handles selected content imports
FullSiteImportService — manages full site imports
ThemeImportService — handles theme archive imports
UnifiedImportOrchestrator — orchestrates unified import with automatic type detection; step 1 is always preflight, step 2 runs the real import using a stored file reference
ImportPreflightService — read-only analysis for unified import preflight
PreflightReportStore — short-lived transient storage for preflight reports and follow-up import handles (staged browser uploads under wp-content/uploads/mksddn-mc/preflight/, or chunk/server identifiers)
ImportTypeDetector — detects import type (full site, selected content, or theme) from archive file
ImportFileValidator — validates uploaded files
ImportPayloadPreparer — prepares import payloads
ServerBackupScanner — scans, validates, and deletes backup files on the server
ResponseHandler — manages redirects and status messages
NotificationService — handles user notifications
ProgressService — tracks operation progress
ErrorHandler, PluginLogger — centralized error handling and file logging
UserDiffBuilder, UserMergeApplier, UserPreviewStore — user merge workflow
ThemePreviewStore (Themes\ThemePreviewStore) — stores pending theme import previews
Support & Maintenance
ImportArtifactCleanup — stages browser uploads into preflight/; after success renames ephemeral archives into imports/ (no second multi-GB copy) and clears chunk job metadata; purges expired preflight files
DeactivationCleanup — clears temporary upload state and service directories when the plugin is deactivated
PostImportMaintenance — cache/rewrite cleanup after full import and emergency purge if the database was partially updated; global flush plus targeted wp_cache_flush_group() when supported; filter mksddn_mc_post_import_object_cache_flush_groups
FullImportMaintenance — file-based runtime lock and early 503 gate while a full-site import is running (admin, CLI, cron exempt; REST blocked unless explicitly allowed)
ImportLock — prevents concurrent import operations
PreflightStagingPath — validates staged preflight file paths
ThemeArchivePathHelper — normalizes theme archive entry paths
DomainReplacer, SiteUrlGuard, FilesystemHelper, MimeTypeHelper
Archive Layer
Packer, Extractor — .wpbkp archive pack/unpack
FullArchivePayload — memory-efficient JSON payload handling
ContentCollector — filesystem content collection for exports
ArchiveValidator, ValidationResult — manifest and checksum validation
Contracts (Interfaces)
All key components implement interfaces:
* ExporterInterface, ImporterInterface
* MediaCollectorInterface, ChunkJobRepositoryInterface
* UserPreviewStoreInterface, ThemePreviewStoreInterface, UserDiffBuilderInterface, UserMergeApplierInterface
* NotificationServiceInterface, ProgressServiceInterface
* ArchiveHandlerInterface, ValidatorInterface
* Request handler interfaces for all handlers
Error Handling
Specialized exceptions: ValidationException, FileOperationException, DatabaseOperationException, ImportException, ExportException
Centralized ErrorHandler for consistent error processing
Proper logging and user-friendly error messages
Validation classes: ArchiveValidator, ImportDataValidator, ExportDataValidator, FileValidator
Performance
BatchLoader for optimized database queries (prevents N+1 problems)
Efficient media collection with batch processing (AttachmentCollector, AttachmentRestorer)
Chunked transfer for large files via REST API (ChunkRestController, ChunkJobRepository)
Memory-efficient streaming for large archives (FullArchivePayload, ExportMemoryHelper)
ContentCollector for filesystem content collection
Streaming FullDatabaseExporter with adaptive batch sizes
Security
All admin operations check current_user_can('manage_options')
Nonce verification for all forms and AJAX requests
REST API endpoints protected with permission callbacks
Input sanitization using WordPress sanitization functions
Output escaping with esc_html(), esc_attr(), esc_url()
File upload validation with MIME type checking
Path traversal protection for server file access and deletion (ServerBackupScanner)
Path traversal protection for archive extraction (full site + theme import)
SiteUrlGuard prevents accidental site URL changes during import
ImportLock prevents concurrent import operations
DomainReplacer safely handles URL replacement during migrations
