README

WordPress backup, migration and restore plugin for internal use.

SL MigrationsCập nhật 21/10/2026

SL Migrations

WordPress backup, migration and restore plugin for internal use.

Version: 1.8.10 License: GPLv2 or later Author: Steven Lam - https://phatdev.net

Features

  • Full-site backup (files + database) packaged into a portable archive (ZIP or DAF) + installer.
  • One-click restore on any compatible WordPress host.
  • Scheduled recurring backups.
  • Remote storage via SFTP / FTP.
  • Disaster Recovery Point - đánh dấu 1 package làm điểm khôi phục nhanh; tạo URL recovery với 1 click, tự động bảo vệ khỏi cron retention purge và delete thủ công.
  • Self-contained: no external license server, no telemetry, no phone-home.

Requirements

  • WordPress 4.9+ (tested up to 7.0)
  • PHP 7.4+ (PHP 8.2 recommended)
  • Single-site activation only (Network: false in the plugin header): activate it on each site; it cannot be network-activated

Storage backends

  • Local - packages stored in wp-content/backups-slm/.
  • FTP / SFTP - upload to a remote SSH/FTP server.
  • Cloud storage (Amazon S3, Dropbox, Google Drive, OneDrive and similar) is not included: those SDKs are removed from this build.

Branding

Visual style follows the TanDoanh Plugins design system:

  • Primary: #1b64f2 (blue)
  • Accent dark: #1349ba
  • Surface: #ffffff on #eef2f7 background
  • Typography: Plus Jakarta Sans / Manrope / system fallback

Activation

wp plugin activate sl-migrations

Or via WP Admin → Plugins → Activate.

Backup output

  • Folder: wp-content/backups-slm/
  • Per package: an archive (*_archive.zip or *_archive.daf, depending on the archive engine) of the full site + a *_installer.php (self-contained restorer).

Restore

Upload the archive (*_archive.zip or *_archive.daf) + *_installer.php to the destination host, then open installer.php in a browser and follow the wizard.

Security note

installer.php, when uploaded to a public web root during restore, is executable by anyone who knows the URL until it self-destructs at the end of the process. Always either:

  • protect the upload folder with HTTP basic auth, or
  • delete installer.php immediately after a successful restore (the wizard offers a cleanup step).

License

GPLv2 - see source headers. Internal-use plugin; not for redistribution.

CSS architecture

Single source of truth: assets/css/slm.css - mọi rule UI plugin sống ở đây. Các file CSS cũ (style.css, slm-overrides.css, modern.css, packages.css, import.css, info-page.css, style-ctrl.css, global_admin_style.css, admin-notifications.css, admin-notices.css) đã được STUB (empty) - giữ lại chỉ để tránh 404 cho các handle wp_register_style cũ.

slm.css dùng CSS @layer để kiểm soát cascade - không cần !important ở code mới:

@layer reset, tokens, base, components, pages, vendor-fix;
Layer Mục đích Thêm rule mới khi?
tokens CSS variables (--slm-*) Đổi màu/spacing/shadow toàn cục
base Typography + form defaults trong .slm-modern Hiếm
components Buttons, cards, tables, badges, pills, modals, toasts, progress Component mới
pages Page-specific overrides Trang mới
vendor-fix Override legacy plugin classes + jstree/select2 Bắt buộc cuối cùng

Quy ước class

  • Mới: prefix slm-* cho mọi class do mình viết (.slm-btn, .slm-card, .slm-pill-complete, …).
  • Legacy (.dup-*, .dpro-*): chỉ chạm khi sửa template cũ; ưu tiên thêm class .slm-* song song thay vì đổi tên legacy.

Khi cần thêm rule mới

  1. Mở assets/css/slm.css
  2. Tìm @layer phù hợp (xem bảng trên)
  3. Thêm rule trong block đó - đừng tạo file CSS mới
  4. KHÔNG dùng !important trừ khi đang ở vendor-fix layer
  5. Dùng CSS variable thay vì hardcode color/spacing (var(--slm-blue) chứ không phải #2563eb)

Khi cần đổi theme color

Edit @layer tokens ở đầu file slm.css. Đổi 1 variable, mọi nơi dùng nó tự update.

Anti-pattern (đừng làm)

  • Lỗi: Tạo file CSS riêng cho 1 component (ví dụ my-feature.css)
  • Lỗi: Inline style="..." trong template PHP (trừ khi tính toán động)
  • Lỗi: Selector quá specific như body[class*="page"] .wrap table.widefat:not(.a):not(.b) ... - dùng class .slm-* đơn giản hơn
  • Lỗi: !important ở layer components hoặc pages