SL Migrations
WordPress backup, migration and restore plugin for internal use.
Version: 1.8.6 License: GPLv2 or later Author: Steven Lam — https://phatdev.net
Features
- Full-site backup (files + database) packaged into a portable zip + 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 6.4)
- PHP 5.6.20+ (PHP 7.4+ recommended)
- Single-site only (
Network: falsein plugin header)
Storage backends
- Local — packages stored in
wp-content/backups-slm/. - FTP / SFTP — upload to a remote SSH/FTP server.
Branding
Visual style follows the TanDoanh Plugins design system:
- Primary:
#1b64f2(blue) - Accent dark:
#1349ba - Surface:
#ffffffon#eef2f7background - 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: a
*_archive.zip(full site) + a*_installer.php(self-contained restorer).
Restore
Upload *_archive.zip + *_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.phpimmediately 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
- Mở assets/css/slm.css
- Tìm
@layerphù hợp (xem bảng trên) - Thêm rule trong block đó — đừng tạo file CSS mới
- KHÔNG dùng
!importanttrừ khi đang ởvendor-fixlayer - 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)
- ❌ Tạo file CSS riêng cho 1 component (ví dụ
my-feature.css) - ❌ Inline
style="..."trong template PHP (trừ khi tính toán động) - ❌ Selector quá specific như
body[class*="page"] .wrap table.widefat:not(.a):not(.b) ...— dùng class.slm-*đơn giản hơn - ❌
!importantở layercomponentshoặcpages