Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

refactor(wordpress): relocate frontend into the extension

Juan Denis5d8160dc73b3
diff --git a/builtin-extensions/serverkit-wordpress/frontend/WordPressSshImport.jsx b/builtin-extensions/serverkit-wordpress/frontend/WordPressSshImport.jsx
index 16518a69..e5ad2418 100644
--- a/builtin-extensions/serverkit-wordpress/frontend/WordPressSshImport.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/WordPressSshImport.jsx
@@ -8,15 +8,10 @@
// 3. Import — enqueues the pull-import job and polls its step log.
//
// After sync this file lives at frontend/src/plugins/serverkit-wordpress/, so
-// shared pieces are imported through the host's `@/` alias like core pages do.
+// shared pieces come from the serverkit-sdk surface like other extensions.
import { useEffect, useRef, useState } from 'react';
import { Link } from 'react-router-dom';
-import api from '@/services/api';
-import Spinner from '@/components/Spinner';
-import { useToast } from '@/contexts/ToastContext';
-import { Button } from '@/components/ui/button';
-import { Input } from '@/components/ui/input';
-import { Label } from '@/components/ui/label';
+import { api, Spinner, useToast, Button, Input, Label } from 'serverkit-sdk';
const POLL_MS = 2500;
diff --git a/frontend/src/components/wordpress/ActivityFeed.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/ActivityFeed.jsx
similarity index 93%
rename from frontend/src/components/wordpress/ActivityFeed.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/ActivityFeed.jsx
index 1b6ea718..6be25a8a 100644
--- a/frontend/src/components/wordpress/ActivityFeed.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/ActivityFeed.jsx
@@ -1,11 +1,11 @@
import { useState, useEffect } from 'react';
import { ArrowUpRight, ArrowDownLeft, Database, GitBranch, Lock, Unlock, Trash2, Play, Square, RefreshCw, Camera, AlertCircle } from 'lucide-react';
-import wordpressApi from '../../services/wordpress';
-import { formatRelativeTime } from '@/utils/time';
-import { Button } from '@/components/ui/button';
-import { Badge } from '@/components/ui/badge';
-import { Skeleton } from '@/components/Skeleton';
-import SkeletonBoundary from '@/components/SkeletonBoundary';
+import wordpressApi from '@/services/wordpress';
+import { formatRelativeTime } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Badge } from 'serverkit-sdk';
+import { Skeleton } from 'serverkit-sdk';
+import { SkeletonBoundary } from 'serverkit-sdk';
const ACTION_ICONS = {
create: Play,
diff --git a/frontend/src/components/wordpress/AttachDomainModal.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/AttachDomainModal.jsx
similarity index 94%
rename from frontend/src/components/wordpress/AttachDomainModal.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/AttachDomainModal.jsx
index 9e34b417..a12e5a85 100644
--- a/frontend/src/components/wordpress/AttachDomainModal.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/AttachDomainModal.jsx
@@ -1,12 +1,12 @@
import { useState } from 'react';
import { Globe, AlertTriangle, CheckCircle2 } from 'lucide-react';
-import Modal from '@/components/Modal';
-import { Button } from '@/components/ui/button';
-import { Input } from '@/components/ui/input';
-import { Label } from '@/components/ui/label';
-import { Switch } from '@/components/ui/switch';
-import wordpressApi from '../../services/wordpress';
-import { useToast } from '../../contexts/ToastContext';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { Switch } from 'serverkit-sdk';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
// Attach a user-owned custom domain to a site: auto-create the DNS A record (or
// show the exact record to add manually), optional HTTPS, then migrate the site
diff --git a/frontend/src/components/wordpress/AutoSyncScheduleModal.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/AutoSyncScheduleModal.jsx
similarity index 96%
rename from frontend/src/components/wordpress/AutoSyncScheduleModal.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/AutoSyncScheduleModal.jsx
index ee53f23b..5a5488f4 100644
--- a/frontend/src/components/wordpress/AutoSyncScheduleModal.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/AutoSyncScheduleModal.jsx
@@ -1,11 +1,11 @@
import { useState, useEffect } from 'react';
import { RefreshCw } from 'lucide-react';
-import Spinner from '../Spinner';
-import Modal from '../Modal';
-import { Button } from '@/components/ui/button';
-import { Input } from '@/components/ui/input';
-import { Label } from '@/components/ui/label';
-import { Switch } from '@/components/ui/switch';
+import { Spinner } from 'serverkit-sdk';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { Switch } from 'serverkit-sdk';
const SCHEDULE_PRESETS = [
{ label: 'Daily at 3 AM', value: '0 3 * * *' },
diff --git a/frontend/src/components/wordpress/BasicAuthModal.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/BasicAuthModal.jsx
similarity index 97%
rename from frontend/src/components/wordpress/BasicAuthModal.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/BasicAuthModal.jsx
index 236737fc..07c366f9 100644
--- a/frontend/src/components/wordpress/BasicAuthModal.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/BasicAuthModal.jsx
@@ -1,9 +1,9 @@
import { useState, useEffect } from 'react';
import { Shield, Copy, Check, AlertTriangle } from 'lucide-react';
-import Spinner from '../Spinner';
-import Modal from '../Modal';
-import { Button } from '@/components/ui/button';
-import { Switch } from '@/components/ui/switch';
+import { Spinner } from 'serverkit-sdk';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Switch } from 'serverkit-sdk';
const BasicAuthModal = ({ environment, prodId, onClose, api }) => {
const [loading, setLoading] = useState(true);
diff --git a/frontend/src/components/wordpress/BulkActionsBar.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/BulkActionsBar.jsx
similarity index 98%
rename from frontend/src/components/wordpress/BulkActionsBar.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/BulkActionsBar.jsx
index 8ec417ed..3fc66b9b 100644
--- a/frontend/src/components/wordpress/BulkActionsBar.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/BulkActionsBar.jsx
@@ -1,7 +1,7 @@
import { useState } from 'react';
import { Square, Play, RefreshCw, ArrowDownLeft, X } from 'lucide-react';
-import Spinner from '../Spinner';
-import { Button } from '@/components/ui/button';
+import { Spinner } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
const BulkActionsBar = ({ selectedIds, environments, prodId, onClear, onExecute, api }) => {
const [executing, setExecuting] = useState(false);
diff --git a/frontend/src/components/wordpress/ChangeUrlModal.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/ChangeUrlModal.jsx
similarity index 95%
rename from frontend/src/components/wordpress/ChangeUrlModal.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/ChangeUrlModal.jsx
index 94d35c90..3affb176 100644
--- a/frontend/src/components/wordpress/ChangeUrlModal.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/ChangeUrlModal.jsx
@@ -1,12 +1,12 @@
import { useState, useEffect } from 'react';
import { Globe, AlertTriangle, ArrowRight } from 'lucide-react';
-import Modal from '@/components/Modal';
-import { Button } from '@/components/ui/button';
-import { Input } from '@/components/ui/input';
-import { Label } from '@/components/ui/label';
-import { Switch } from '@/components/ui/switch';
-import wordpressApi from '../../services/wordpress';
-import { useToast } from '../../contexts/ToastContext';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { Switch } from 'serverkit-sdk';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
// Change a WordPress site's URL safely: a debounced dry-run preview of the DB
// rewrite, then a backed-up, serialization-safe apply (WP-CLI search-replace)
diff --git a/frontend/src/components/wordpress/CommitList.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/CommitList.jsx
similarity index 97%
rename from frontend/src/components/wordpress/CommitList.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/CommitList.jsx
index 98b12fee..a3eed021 100644
--- a/frontend/src/components/wordpress/CommitList.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/CommitList.jsx
@@ -1,11 +1,11 @@
import { useState } from 'react';
import { GitCommit, Rocket, Copy, CheckCircle, ExternalLink } from 'lucide-react';
-import Modal from '../Modal';
-import { Button } from '@/components/ui/button';
-import { Input } from '@/components/ui/input';
-import { Label } from '@/components/ui/label';
-import { detectProvider } from '../git/GitProviders';
-import EmptyState from '../EmptyState';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { detectProvider } from '@/components/git/GitProviders';
+import { EmptyState } from 'serverkit-sdk';
// Build a web URL to a commit on the host from the clone URL + sha so the log is
// clickable. Handles https + scp-style ssh remotes and Bitbucket's /commits path.
diff --git a/frontend/src/components/wordpress/CompareView.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/CompareView.jsx
similarity index 98%
rename from frontend/src/components/wordpress/CompareView.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/CompareView.jsx
index 3575b9e2..78cac4c3 100644
--- a/frontend/src/components/wordpress/CompareView.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/CompareView.jsx
@@ -1,9 +1,9 @@
import { useState, useEffect } from 'react';
import { GitCompare, Check, X, Minus, RefreshCw } from 'lucide-react';
-import wordpressApi from '../../services/wordpress';
-import Spinner from '../Spinner';
-import Modal from '../Modal';
-import { Button } from '@/components/ui/button';
+import wordpressApi from '@/services/wordpress';
+import { Spinner } from 'serverkit-sdk';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
const CompareView = ({ projectId, envA, envB, onClose }) => {
const [comparison, setComparison] = useState(null);
diff --git a/frontend/src/components/wordpress/ContainerLogs.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/ContainerLogs.jsx
similarity index 97%
rename from frontend/src/components/wordpress/ContainerLogs.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/ContainerLogs.jsx
index 501e3212..927a87ac 100644
--- a/frontend/src/components/wordpress/ContainerLogs.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/ContainerLogs.jsx
@@ -1,8 +1,8 @@
import { useState, useEffect, useRef } from 'react';
import { Terminal, X, Download } from 'lucide-react';
-import wordpressApi from '../../services/wordpress';
-import { Button } from '@/components/ui/button';
-import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
+import wordpressApi from '@/services/wordpress';
+import { Button } from 'serverkit-sdk';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from 'serverkit-sdk';
const ContainerLogs = ({ projectId, envId, onClose }) => {
const [logs, setLogs] = useState([]);
diff --git a/frontend/src/components/wordpress/DiskUsageBar.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/DiskUsageBar.jsx
similarity index 98%
rename from frontend/src/components/wordpress/DiskUsageBar.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/DiskUsageBar.jsx
index ed5e3cf5..f824b683 100644
--- a/frontend/src/components/wordpress/DiskUsageBar.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/DiskUsageBar.jsx
@@ -1,5 +1,5 @@
import { HardDrive } from 'lucide-react';
-import { formatBytes } from '@/utils/formatBytes';
+import { formatBytes } from 'serverkit-sdk';
const REFERENCE_THRESHOLD = 10 * 1024 * 1024 * 1024; // 10 GB reference
diff --git a/frontend/src/components/wordpress/EnvironmentCard.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/EnvironmentCard.jsx
similarity index 99%
rename from frontend/src/components/wordpress/EnvironmentCard.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/EnvironmentCard.jsx
index b64f3dc2..28a7348f 100644
--- a/frontend/src/components/wordpress/EnvironmentCard.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/EnvironmentCard.jsx
@@ -1,7 +1,7 @@
import { useState } from 'react';
import { ExternalLink, RefreshCw, Trash2, GitBranch, Clock, AlertTriangle, Calendar, FileText } from 'lucide-react';
-import { ConfirmDialog } from '../ConfirmDialog';
-import { Pill, EnvTag } from '../ds';
+import { ConfirmDialog } from 'serverkit-sdk';
+import { Pill, EnvTag } from 'serverkit-sdk';
const EnvironmentCard = ({ environment, productionUrl, onSync, onDelete, onViewLogs, isProduction = false }) => {
const [syncing, setSyncing] = useState(false);
diff --git a/frontend/src/components/wordpress/EnvironmentStatusBadge.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/EnvironmentStatusBadge.jsx
similarity index 100%
rename from frontend/src/components/wordpress/EnvironmentStatusBadge.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/EnvironmentStatusBadge.jsx
diff --git a/frontend/src/components/wordpress/GitConnectForm.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/GitConnectForm.jsx
similarity index 92%
rename from frontend/src/components/wordpress/GitConnectForm.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/GitConnectForm.jsx
index a690a5c7..e544d288 100644
--- a/frontend/src/components/wordpress/GitConnectForm.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/GitConnectForm.jsx
@@ -1,7 +1,7 @@
// WordPress-flavored wrapper over the shared RepoConnectForm: same form, just
// pre-dressed with the WordPress intro copy and the wp-content tracked-path
// defaults. The reusable component lives in components/git/RepoConnectForm.jsx.
-import RepoConnectForm from '../git/RepoConnectForm';
+import RepoConnectForm from '@/components/git/RepoConnectForm';
const GitConnectForm = (props) => (
<RepoConnectForm
diff --git a/frontend/src/components/wordpress/HealthStatusPanel.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/HealthStatusPanel.jsx
similarity index 98%
rename from frontend/src/components/wordpress/HealthStatusPanel.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/HealthStatusPanel.jsx
index e8bff62c..1256dc49 100644
--- a/frontend/src/components/wordpress/HealthStatusPanel.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/HealthStatusPanel.jsx
@@ -1,7 +1,7 @@
import { useState, useEffect, useRef } from 'react';
import { Activity, RefreshCw, CheckCircle, AlertTriangle, XCircle, HelpCircle } from 'lucide-react';
-import Spinner from '../Spinner';
-import { Button } from '@/components/ui/button';
+import { Spinner } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
const STATUS_CONFIG = {
healthy: { icon: CheckCircle, color: 'green', label: 'Healthy' },
diff --git a/frontend/src/components/wordpress/PipelineView.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/PipelineView.jsx
similarity index 99%
rename from frontend/src/components/wordpress/PipelineView.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/PipelineView.jsx
index 55f20428..fe2fe7a7 100644
--- a/frontend/src/components/wordpress/PipelineView.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/PipelineView.jsx
@@ -8,9 +8,9 @@ import {
import EnvironmentStatusBadge from './EnvironmentStatusBadge';
import { HealthDot } from './HealthStatusPanel';
import DiskUsageBar from './DiskUsageBar';
-import { Button } from '@/components/ui/button';
-import { Checkbox } from '@/components/ui/checkbox';
-import { formatRelativeTime } from '@/utils/time';
+import { Button } from 'serverkit-sdk';
+import { Checkbox } from 'serverkit-sdk';
+import { formatRelativeTime } from 'serverkit-sdk';
const PipelineView = ({
pipeline,
diff --git a/frontend/src/components/wordpress/PromoteModal.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/PromoteModal.jsx
similarity index 97%
rename from frontend/src/components/wordpress/PromoteModal.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/PromoteModal.jsx
index 5340f74a..bebaabb3 100644
--- a/frontend/src/components/wordpress/PromoteModal.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/PromoteModal.jsx
@@ -1,13 +1,13 @@
import { useState, useEffect } from 'react';
import { ArrowRight, Shield } from 'lucide-react';
-import wordpressApi from '../../services/wordpress';
-import Spinner from '../Spinner';
-import Modal from '../Modal';
-import { Button } from '@/components/ui/button';
-import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
-import { Checkbox } from '@/components/ui/checkbox';
-import { Label } from '@/components/ui/label';
-import { Input } from '@/components/ui/input';
+import wordpressApi from '@/services/wordpress';
+import { Spinner } from 'serverkit-sdk';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from 'serverkit-sdk';
+import { Checkbox } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
const PromoteModal = ({ sourceEnv, targetEnv, onClose, onPromote }) => {
const [promotionType, setPromotionType] = useState('code');
diff --git a/frontend/src/components/wordpress/ResourceLimitsModal.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/ResourceLimitsModal.jsx
similarity index 96%
rename from frontend/src/components/wordpress/ResourceLimitsModal.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/ResourceLimitsModal.jsx
index 6adfb4f6..db45e39d 100644
--- a/frontend/src/components/wordpress/ResourceLimitsModal.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/ResourceLimitsModal.jsx
@@ -1,10 +1,10 @@
import { useState } from 'react';
import { HardDrive, AlertTriangle } from 'lucide-react';
-import Spinner from '../Spinner';
-import Modal from '../Modal';
-import { Button } from '@/components/ui/button';
-import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
-import { Label } from '@/components/ui/label';
+import { Spinner } from 'serverkit-sdk';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
const PRESETS = {
low: { memory: '256M', cpus: '0.25', db_memory: '256M', db_cpus: '0.25' },
diff --git a/frontend/src/components/wordpress/SanitizationProfileForm.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/SanitizationProfileForm.jsx
similarity index 97%
rename from frontend/src/components/wordpress/SanitizationProfileForm.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/SanitizationProfileForm.jsx
index 45ce3141..4d98702c 100644
--- a/frontend/src/components/wordpress/SanitizationProfileForm.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/SanitizationProfileForm.jsx
@@ -1,12 +1,12 @@
import { useState, useEffect } from 'react';
import { Shield, Plus, Trash2, Star, Edit3, Save } from 'lucide-react';
-import wordpressApi from '../../services/wordpress';
-import Spinner from '../Spinner';
-import Modal from '../Modal';
-import { Button } from '@/components/ui/button';
-import { Input } from '@/components/ui/input';
-import { Label } from '@/components/ui/label';
-import { Checkbox } from '@/components/ui/checkbox';
+import wordpressApi from '@/services/wordpress';
+import { Spinner } from 'serverkit-sdk';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { Checkbox } from 'serverkit-sdk';
const SanitizationProfileForm = ({ onClose, onProfilesChange }) => {
const [profiles, setProfiles] = useState([]);
diff --git a/frontend/src/components/wordpress/SnapshotTable.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/SnapshotTable.jsx
similarity index 98%
rename from frontend/src/components/wordpress/SnapshotTable.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/SnapshotTable.jsx
index 4f2b90b9..4a046e23 100644
--- a/frontend/src/components/wordpress/SnapshotTable.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/SnapshotTable.jsx
@@ -1,8 +1,8 @@
import { useState } from 'react';
import { Download, RotateCcw, Trash2, GitCommit, Tag } from 'lucide-react';
-import { ConfirmDialog } from '../ConfirmDialog';
-import { formatBytes } from '@/utils/formatBytes';
-import EmptyState from '../EmptyState';
+import { ConfirmDialog } from 'serverkit-sdk';
+import { formatBytes } from 'serverkit-sdk';
+import { EmptyState } from 'serverkit-sdk';
const SnapshotTable = ({ snapshots, onRestore, onDelete, loading = false }) => {
const [actionLoading, setActionLoading] = useState({});
diff --git a/frontend/src/components/wordpress/SyncModal.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/SyncModal.jsx
similarity index 96%
rename from frontend/src/components/wordpress/SyncModal.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/SyncModal.jsx
index 4094f907..8628ef26 100644
--- a/frontend/src/components/wordpress/SyncModal.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/SyncModal.jsx
@@ -1,13 +1,13 @@
import { useState, useEffect } from 'react';
import { ArrowDownLeft, Shield } from 'lucide-react';
-import wordpressApi from '../../services/wordpress';
-import Spinner from '../Spinner';
-import Modal from '../Modal';
-import { Button } from '@/components/ui/button';
-import { Input } from '@/components/ui/input';
-import { Label } from '@/components/ui/label';
-import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
-import { Checkbox } from '@/components/ui/checkbox';
+import wordpressApi from '@/services/wordpress';
+import { Spinner } from 'serverkit-sdk';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from 'serverkit-sdk';
+import { Checkbox } from 'serverkit-sdk';
const SyncModal = ({ environment, productionName, onClose, onSync }) => {
const [syncType, setSyncType] = useState('database');
diff --git a/frontend/src/components/wordpress/WordPressSiteCard.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/WordPressSiteCard.jsx
similarity index 98%
rename from frontend/src/components/wordpress/WordPressSiteCard.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/WordPressSiteCard.jsx
index b149aa30..edda8060 100644
--- a/frontend/src/components/wordpress/WordPressSiteCard.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/WordPressSiteCard.jsx
@@ -1,8 +1,8 @@
import { useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { ExternalLink, Settings, Copy, Trash2 } from 'lucide-react';
-import { ConfirmDialog } from '../ConfirmDialog';
-import { Button } from '@/components/ui/button';
+import { ConfirmDialog } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
const WordPressSiteCard = ({ site, onDelete }) => {
const navigate = useNavigate();
diff --git a/frontend/src/components/wordpress/WpCliTerminal.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/WpCliTerminal.jsx
similarity index 97%
rename from frontend/src/components/wordpress/WpCliTerminal.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/WpCliTerminal.jsx
index f7aac279..0bd0354f 100644
--- a/frontend/src/components/wordpress/WpCliTerminal.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/WpCliTerminal.jsx
@@ -1,9 +1,9 @@
import { useState, useRef, useEffect } from 'react';
import { Play, Clock } from 'lucide-react';
-import Spinner from '../Spinner';
-import Modal from '../Modal';
-import { Button } from '@/components/ui/button';
-import { Input } from '@/components/ui/input';
+import { Spinner } from 'serverkit-sdk';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
const QUICK_COMMANDS = [
{ label: 'Plugin List', command: 'wp plugin list --format=table' },
diff --git a/frontend/src/components/wordpress/detail/AnalyticsTab.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/AnalyticsTab.jsx
similarity index 97%
rename from frontend/src/components/wordpress/detail/AnalyticsTab.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/AnalyticsTab.jsx
index 21652a78..6e27835a 100644
--- a/frontend/src/components/wordpress/detail/AnalyticsTab.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/AnalyticsTab.jsx
@@ -2,11 +2,11 @@ import React, { useState, useEffect } from 'react';
import { Link } from 'react-router-dom';
import { ResponsiveContainer, AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip } from 'recharts';
import { BarChart3, Globe, HardDrive, AlertTriangle, Activity, FileText, LineChart, ExternalLink } from 'lucide-react';
-import wordpressApi from '../../../services/wordpress';
-import api from '../../../services/api';
-import { useToast } from '../../../contexts/ToastContext';
-import { MetricCard, SegControl } from '../../ds';
-import SkeletonBoundary from '../../SkeletonBoundary';
+import wordpressApi from '@/services/wordpress';
+import { api } from 'serverkit-sdk';
+import { useToast } from 'serverkit-sdk';
+import { MetricCard, SegControl } from 'serverkit-sdk';
+import { SkeletonBoundary } from 'serverkit-sdk';
import { OverviewGridSkeleton, ANALYTICS_PERIODS } from './wpDetailShared';
// Analytics Tab — per-site traffic + error analytics (#25), parsed on-demand from
diff --git a/frontend/src/components/wordpress/detail/BackupsTab.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/BackupsTab.jsx
similarity index 86%
rename from frontend/src/components/wordpress/detail/BackupsTab.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/BackupsTab.jsx
index f40a3fe4..deb1d422 100644
--- a/frontend/src/components/wordpress/detail/BackupsTab.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/BackupsTab.jsx
@@ -1,4 +1,4 @@
-import ProtectionPanel from '../../backups/ProtectionPanel';
+import ProtectionPanel from '@/components/backups/ProtectionPanel';
// Backups Tab
// Backups tab — now the shared Protection panel (scheduled backups, cost,
diff --git a/frontend/src/components/wordpress/detail/DatabaseTab.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/DatabaseTab.jsx
similarity index 94%
rename from frontend/src/components/wordpress/detail/DatabaseTab.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/DatabaseTab.jsx
index 532c6ad1..08b70438 100644
--- a/frontend/src/components/wordpress/detail/DatabaseTab.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/DatabaseTab.jsx
@@ -1,14 +1,14 @@
import { useState, useEffect } from 'react';
import { Database, Plus } from 'lucide-react';
-import wordpressApi from '../../../services/wordpress';
-import { useToast } from '../../../contexts/ToastContext';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
import { SnapshotTable } from '../index';
-import { ErrorState } from '../../ErrorBoundary';
-import Modal from '@/components/Modal';
-import { Button } from '@/components/ui/button';
-import { Input } from '@/components/ui/input';
-import { Label } from '@/components/ui/label';
-import { Textarea } from '@/components/ui/textarea';
+import { ErrorState } from '@/components/ErrorBoundary';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { Textarea } from 'serverkit-sdk';
// Database Tab
const DatabaseTab = ({ siteId, site }) => {
diff --git a/frontend/src/components/wordpress/detail/EnvironmentsTab.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/EnvironmentsTab.jsx
similarity index 96%
rename from frontend/src/components/wordpress/detail/EnvironmentsTab.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/EnvironmentsTab.jsx
index 4450fe92..e0e281a4 100644
--- a/frontend/src/components/wordpress/detail/EnvironmentsTab.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/EnvironmentsTab.jsx
@@ -1,14 +1,14 @@
import { useState, useEffect } from 'react';
import { Plus } from 'lucide-react';
-import wordpressApi from '../../../services/wordpress';
-import { useToast } from '../../../contexts/ToastContext';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
import { EnvironmentCard } from '../index';
-import { ErrorState } from '../../ErrorBoundary';
-import Modal from '@/components/Modal';
-import { Button } from '@/components/ui/button';
-import { Input } from '@/components/ui/input';
-import { Label } from '@/components/ui/label';
-import SkeletonBoundary from '../../SkeletonBoundary';
+import { ErrorState } from '@/components/ErrorBoundary';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { SkeletonBoundary } from 'serverkit-sdk';
import { EnvironmentCardSkeleton } from './wpDetailShared';
// Environments Tab
diff --git a/frontend/src/components/wordpress/detail/GitTab.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/GitTab.jsx
similarity index 93%
rename from frontend/src/components/wordpress/detail/GitTab.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/GitTab.jsx
index 0675fd83..d34af5d7 100644
--- a/frontend/src/components/wordpress/detail/GitTab.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/GitTab.jsx
@@ -1,11 +1,11 @@
import { useState, useEffect } from 'react';
import { RefreshCw } from 'lucide-react';
-import wordpressApi from '../../../services/wordpress';
-import { useToast } from '../../../contexts/ToastContext';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
import { GitConnectForm, CommitList } from '../index';
-import { ErrorState } from '../../ErrorBoundary';
-import { Button } from '@/components/ui/button';
-import SkeletonBoundary from '../../SkeletonBoundary';
+import { ErrorState } from '@/components/ErrorBoundary';
+import { Button } from 'serverkit-sdk';
+import { SkeletonBoundary } from 'serverkit-sdk';
// Git Tab
const GitTab = ({ siteId, site, onUpdate }) => {
diff --git a/frontend/src/components/wordpress/detail/OverviewTab.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/OverviewTab.jsx
similarity index 99%
rename from frontend/src/components/wordpress/detail/OverviewTab.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/OverviewTab.jsx
index b50d4a84..1ad169ab 100644
--- a/frontend/src/components/wordpress/detail/OverviewTab.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/OverviewTab.jsx
@@ -1,10 +1,10 @@
import { useState, useEffect } from 'react';
import { ResponsiveContainer, AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip } from 'recharts';
import { ExternalLink, Settings, RefreshCw, Plus, Database, Trash2, Replace, ShieldCheck, Zap, Activity, BarChart3, AlertTriangle, HardDrive } from 'lucide-react';
-import wordpressApi from '../../../services/wordpress';
-import { useToast } from '../../../contexts/ToastContext';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
import ActivityFeed from '../ActivityFeed';
-import { MetricCard } from '../../ds';
+import { MetricCard } from 'serverkit-sdk';
import { CreateEnvironmentModal } from './EnvironmentsTab';
import { SearchReplaceModal } from './SettingsTab';
diff --git a/frontend/src/components/wordpress/detail/PhpTab.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/PhpTab.jsx
similarity index 96%
rename from frontend/src/components/wordpress/detail/PhpTab.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/PhpTab.jsx
index 8cfcfee9..10fb0785 100644
--- a/frontend/src/components/wordpress/detail/PhpTab.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/PhpTab.jsx
@@ -1,10 +1,10 @@
import React, { useState, useEffect } from 'react';
-import wordpressApi from '../../../services/wordpress';
-import { useToast } from '../../../contexts/ToastContext';
-import { Button } from '@/components/ui/button';
-import { Input } from '@/components/ui/input';
-import { Label } from '@/components/ui/label';
-import SkeletonBoundary from '../../SkeletonBoundary';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { SkeletonBoundary } from 'serverkit-sdk';
import { OverviewGridSkeleton, PHP_LIMIT_LABELS } from './wpDetailShared';
// PHP Tab — live PHP version + ini limits for the Docker (apache/mod_php) site.
diff --git a/frontend/src/components/wordpress/detail/PluginsTab.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/PluginsTab.jsx
similarity index 95%
rename from frontend/src/components/wordpress/detail/PluginsTab.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/PluginsTab.jsx
index c529eeef..aec9ba50 100644
--- a/frontend/src/components/wordpress/detail/PluginsTab.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/PluginsTab.jsx
@@ -1,14 +1,14 @@
import { useState, useEffect } from 'react';
import { Package, Download } from 'lucide-react';
-import wordpressApi from '../../../services/wordpress';
-import { useToast } from '../../../contexts/ToastContext';
-import { ErrorState } from '../../ErrorBoundary';
-import EmptyState from '../../EmptyState';
-import { ServiceTile } from '../../ds';
-import { Button } from '@/components/ui/button';
-import { Input } from '@/components/ui/input';
-import { Switch } from '@/components/ui/switch';
-import SkeletonBoundary from '../../SkeletonBoundary';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import { ErrorState } from '@/components/ErrorBoundary';
+import { EmptyState } from 'serverkit-sdk';
+import { ServiceTile } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Switch } from 'serverkit-sdk';
+import { SkeletonBoundary } from 'serverkit-sdk';
import { ListItemSkeleton } from './wpDetailShared';
// Plugins Tab
diff --git a/frontend/src/components/wordpress/detail/ReportsTab.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/ReportsTab.jsx
similarity index 98%
rename from frontend/src/components/wordpress/detail/ReportsTab.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/ReportsTab.jsx
index c7e08c49..4e2b329f 100644
--- a/frontend/src/components/wordpress/detail/ReportsTab.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/ReportsTab.jsx
@@ -1,12 +1,12 @@
import React, { useState, useEffect } from 'react';
import { ResponsiveContainer, AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip } from 'recharts';
import { Printer, Download, Trash2 } from 'lucide-react';
-import wordpressApi from '../../../services/wordpress';
-import { useToast } from '../../../contexts/ToastContext';
-import { useConfirm } from '../../../hooks/useConfirm';
-import { Pill } from '../../ds';
-import { Button } from '@/components/ui/button';
-import SkeletonBoundary from '../../SkeletonBoundary';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import { useConfirm } from 'serverkit-sdk';
+import { Pill } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { SkeletonBoundary } from 'serverkit-sdk';
import { OverviewGridSkeleton } from './wpDetailShared';
// Reports Tab — monthly client reports (#33 agency slice). Aggregates the
diff --git a/frontend/src/components/wordpress/detail/SecurityTab.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/SecurityTab.jsx
similarity index 98%
rename from frontend/src/components/wordpress/detail/SecurityTab.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/SecurityTab.jsx
index f12a28b3..dea63841 100644
--- a/frontend/src/components/wordpress/detail/SecurityTab.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/SecurityTab.jsx
@@ -1,9 +1,9 @@
import React, { useState, useEffect } from 'react';
-import wordpressApi from '../../../services/wordpress';
-import { useToast } from '../../../contexts/ToastContext';
-import { Pill, ScoreGauge } from '../../ds';
-import { Button } from '@/components/ui/button';
-import SkeletonBoundary from '../../SkeletonBoundary';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import { Pill, ScoreGauge } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { SkeletonBoundary } from 'serverkit-sdk';
import { OverviewGridSkeleton } from './wpDetailShared';
// Security Tab — per-site security depth (#30): file-integrity verification,
diff --git a/frontend/src/components/wordpress/detail/SettingsTab.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/SettingsTab.jsx
similarity index 97%
rename from frontend/src/components/wordpress/detail/SettingsTab.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/SettingsTab.jsx
index 49928300..5b543050 100644
--- a/frontend/src/components/wordpress/detail/SettingsTab.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/SettingsTab.jsx
@@ -1,14 +1,14 @@
import { useState } from 'react';
import { useParams, useNavigate } from 'react-router-dom';
import { Plus, Globe, Copy, Settings, RefreshCw, Archive, GitBranch, Lock, Shield, ShieldCheck, ShieldAlert, FileBarChart, Trash2 } from 'lucide-react';
-import wordpressApi from '../../../services/wordpress';
-import { useToast } from '../../../contexts/ToastContext';
-import { useConfirm } from '../../../hooks/useConfirm';
-import { DangerZone } from '../../DangerZone';
-import Modal from '@/components/Modal';
-import { Button } from '@/components/ui/button';
-import { Input } from '@/components/ui/input';
-import { Label } from '@/components/ui/label';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import { useConfirm } from 'serverkit-sdk';
+import { DangerZone } from '@/components/DangerZone';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
import { SiteSSLPanel } from './wpDetailShared';
import PhpTab from './PhpTab';
import UpdatesTab from './UpdatesTab';
diff --git a/frontend/src/components/wordpress/detail/ThemesTab.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/ThemesTab.jsx
similarity index 95%
rename from frontend/src/components/wordpress/detail/ThemesTab.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/ThemesTab.jsx
index 441f0952..c2d67667 100644
--- a/frontend/src/components/wordpress/detail/ThemesTab.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/ThemesTab.jsx
@@ -1,13 +1,13 @@
import { useState, useEffect } from 'react';
import { Palette } from 'lucide-react';
-import wordpressApi from '../../../services/wordpress';
-import { useToast } from '../../../contexts/ToastContext';
-import { ErrorState } from '../../ErrorBoundary';
-import EmptyState from '../../EmptyState';
-import { Pill } from '../../ds';
-import { Button } from '@/components/ui/button';
-import { Input } from '@/components/ui/input';
-import SkeletonBoundary from '../../SkeletonBoundary';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import { ErrorState } from '@/components/ErrorBoundary';
+import { EmptyState } from 'serverkit-sdk';
+import { Pill } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { SkeletonBoundary } from 'serverkit-sdk';
import { ListItemSkeleton } from './wpDetailShared';
// Themes Tab
diff --git a/frontend/src/components/wordpress/detail/UpdatesTab.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/UpdatesTab.jsx
similarity index 95%
rename from frontend/src/components/wordpress/detail/UpdatesTab.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/UpdatesTab.jsx
index be50996f..79febcb4 100644
--- a/frontend/src/components/wordpress/detail/UpdatesTab.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/UpdatesTab.jsx
@@ -1,11 +1,11 @@
import React, { useState, useEffect } from 'react';
-import wordpressApi from '../../../services/wordpress';
-import { useToast } from '../../../contexts/ToastContext';
-import { Pill } from '../../ds';
-import { Button } from '@/components/ui/button';
-import { Input } from '@/components/ui/input';
-import { Label } from '@/components/ui/label';
-import SkeletonBoundary from '../../SkeletonBoundary';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import { Pill } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { SkeletonBoundary } from 'serverkit-sdk';
import { OverviewGridSkeleton, UPDATE_SCHEDULES } from './wpDetailShared';
// Updates Tab — safe update manager (#29): snapshot -> update -> health-check ->
diff --git a/frontend/src/components/wordpress/detail/UptimeTab.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/UptimeTab.jsx
similarity index 95%
rename from frontend/src/components/wordpress/detail/UptimeTab.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/UptimeTab.jsx
index 19342c2d..a3f59202 100644
--- a/frontend/src/components/wordpress/detail/UptimeTab.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/UptimeTab.jsx
@@ -1,12 +1,12 @@
import React, { useState, useEffect } from 'react';
import { Activity } from 'lucide-react';
-import wordpressApi from '../../../services/wordpress';
-import { useToast } from '../../../contexts/ToastContext';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
import { HealthDot } from '../HealthStatusPanel';
-import { MetricCard } from '../../ds';
-import { Button } from '@/components/ui/button';
-import { Label } from '@/components/ui/label';
-import SkeletonBoundary from '../../SkeletonBoundary';
+import { MetricCard } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { SkeletonBoundary } from 'serverkit-sdk';
import { OverviewGridSkeleton } from './wpDetailShared';
// Uptime Tab — per-site health + uptime % via a bound status-page component (#26).
diff --git a/frontend/src/components/wordpress/detail/VulnerabilitiesTab.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/VulnerabilitiesTab.jsx
similarity index 96%
rename from frontend/src/components/wordpress/detail/VulnerabilitiesTab.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/VulnerabilitiesTab.jsx
index 49e9a985..d4983ef2 100644
--- a/frontend/src/components/wordpress/detail/VulnerabilitiesTab.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/VulnerabilitiesTab.jsx
@@ -1,10 +1,10 @@
import React, { useState, useEffect } from 'react';
import { AlertTriangle } from 'lucide-react';
-import wordpressApi from '../../../services/wordpress';
-import { useToast } from '../../../contexts/ToastContext';
-import { KpiBand, MetricCard } from '../../ds';
-import { Button } from '@/components/ui/button';
-import SkeletonBoundary from '../../SkeletonBoundary';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import { KpiBand, MetricCard } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { SkeletonBoundary } from 'serverkit-sdk';
import { OverviewGridSkeleton } from './wpDetailShared';
// Vulnerabilities Tab — cross-references plugin/theme/core versions against the
diff --git a/frontend/src/components/wordpress/detail/wpDetailShared.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/wpDetailShared.jsx
similarity index 98%
rename from frontend/src/components/wordpress/detail/wpDetailShared.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/wpDetailShared.jsx
index b90c9d4b..c7c6ef5f 100644
--- a/frontend/src/components/wordpress/detail/wpDetailShared.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/detail/wpDetailShared.jsx
@@ -1,13 +1,13 @@
import { useState, useEffect } from 'react';
import { Link } from 'react-router-dom';
import { ChevronDown, Check, Lock, Globe, Shield, CircleCheck, CircleX } from 'lucide-react';
-import api from '../../../services/api';
-import wordpressApi from '../../../services/wordpress';
-import { useToast } from '../../../contexts/ToastContext';
-import { Pill } from '../../ds';
-import { Button } from '@/components/ui/button';
-import { Input } from '@/components/ui/input';
-import { Label } from '@/components/ui/label';
+import { api } from 'serverkit-sdk';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import { Pill } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
// Detail Page Skeleton for initial loading
// Mirrors the real page chrome (top bar, identity, repo pill, tabs) and the
diff --git a/frontend/src/components/wordpress/index.js b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/index.js
similarity index 100%
rename from frontend/src/components/wordpress/index.js
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/index.js
diff --git a/frontend/src/components/wordpress/wordpressTabs.jsx b/builtin-extensions/serverkit-wordpress/frontend/components/wordpress/wordpressTabs.jsx
similarity index 100%
rename from frontend/src/components/wordpress/wordpressTabs.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/components/wordpress/wordpressTabs.jsx
diff --git a/builtin-extensions/serverkit-wordpress/frontend/index.jsx b/builtin-extensions/serverkit-wordpress/frontend/index.jsx
index b6defac9..6d7b0486 100644
--- a/builtin-extensions/serverkit-wordpress/frontend/index.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/index.jsx
@@ -1,12 +1,20 @@
-// WordPress UI, contributed through the extension system. The full WordPress
-// backend (the /api/v1/wordpress* blueprints + services) lives in this
-// extension's backend/; the page components stay in the host pages/ dir and are
-// re-used here (same re-export pattern as serverkit-git/email/workflows) so
-// their many relative imports keep resolving.
-//
-// After sync this file lives at frontend/src/plugins/serverkit-wordpress/ so the
-// relative imports resolve against the host's src/ tree.
+// WordPress UI, contributed through the extension system. Both halves now
+// live in this extension: the backend (the /api/v1/wordpress* blueprints +
+// services) under backend/, and the full frontend (5 pages + the
+// components/wordpress tree + styles/) here — moved out of the host's pages/
+// and styles/ in plan 52 Phase 4. After `sync-builtin-frontends.mjs` this
+// tree is baked at frontend/src/plugins/serverkit-wordpress/, where the host
+// build compiles it (the @/ alias imports that remain resolve there; the
+// runtime-ESM conversion that drops them is Phase 5).
//
+// Styles ship with the extension: the three SCSS entries below are compiled
+// by the host build through this module graph (they import the host's
+// variables partial via a sync-safe relative path), replacing the former
+// main.scss partials.
+import './styles/wordpress.scss';
+import './styles/wordpress-pipeline.scss';
+import './styles/wordpress-plugin-library.scss';
+
// The WordPress surface is a tab group + full-bleed detail pages. Contributed
// routes are flat (there's no way to contribute a shared TabGroupLayout parent
// inside the dashboard), so we contribute ONE splat route (`wordpress/*`) and
@@ -15,14 +23,14 @@
// over the three list pages; full-bleed detail/pipeline routes as siblings;
// the legacy /wordpress/projects → /wordpress/pipelines deprecation redirects).
import { Routes, Route, Navigate, useParams } from 'react-router-dom';
+import { TabGroupLayout } from 'serverkit-sdk';
-import TabGroupLayout from '../../layouts/TabGroupLayout';
-import { WORDPRESS_TABS } from '../../components/wordpress/wordpressTabs';
-import WordPress from '../../pages/WordPress';
-import WordPressPluginLibrary from '../../pages/WordPressPluginLibrary';
-import WordPressProjects from '../../pages/WordPressProjects';
-import WordPressProject from '../../pages/WordPressProject';
-import WordPressDetail from '../../pages/WordPressDetail';
+import { WORDPRESS_TABS } from './components/wordpress/wordpressTabs';
+import WordPress from './pages/WordPress';
+import WordPressPluginLibrary from './pages/WordPressPluginLibrary';
+import WordPressProjects from './pages/WordPressProjects';
+import WordPressProject from './pages/WordPressProject';
+import WordPressDetail from './pages/WordPressDetail';
import WordPressSshImport from './WordPressSshImport';
// "WordPress Projects" was renamed to "Pipelines" (§2 unification). Forward old
diff --git a/frontend/src/pages/WordPress.jsx b/builtin-extensions/serverkit-wordpress/frontend/pages/WordPress.jsx
similarity index 98%
rename from frontend/src/pages/WordPress.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/pages/WordPress.jsx
index 7c4adc5c..e47fffb5 100644
--- a/frontend/src/pages/WordPress.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/pages/WordPress.jsx
@@ -1,19 +1,19 @@
import { useState, useEffect } from 'react';
import { useNavigate } from 'react-router-dom';
-import wordpressApi from '../services/wordpress';
-import { useToast } from '../contexts/ToastContext';
-import ResourceAdvisory from '../components/ResourceAdvisory';
-import Spinner from '../components/Spinner';
-import ResourceListPage from '../components/layouts/ResourceListPage';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import ResourceAdvisory from '@/components/ResourceAdvisory';
+import { Spinner } from 'serverkit-sdk';
+import ResourceListPage from '@/components/layouts/ResourceListPage';
import { Globe, ChevronRight } from 'lucide-react';
-import { Pill, ServiceTile, Drawer } from '@/components/ds';
-import { useTopbarActions } from '@/hooks/useTopbarActions';
-import Modal from '@/components/Modal';
-import { Button } from '@/components/ui/button';
-import { Input } from '@/components/ui/input';
-import { Label } from '@/components/ui/label';
-import { Checkbox } from '@/components/ui/checkbox';
-import SkeletonBoundary from '@/components/SkeletonBoundary';
+import { Pill, ServiceTile, Drawer } from 'serverkit-sdk';
+import { useTopbarActions } from 'serverkit-sdk';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { Checkbox } from 'serverkit-sdk';
+import { SkeletonBoundary } from 'serverkit-sdk';
// Mirror the backend slug rule (a-z, 0-9, single dashes) so the create modal can
// preview the exact <slug>.<base> host the site will be published at.
diff --git a/frontend/src/pages/WordPressDetail.jsx b/builtin-extensions/serverkit-wordpress/frontend/pages/WordPressDetail.jsx
similarity index 96%
rename from frontend/src/pages/WordPressDetail.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/pages/WordPressDetail.jsx
index f5141a4b..c2781bdb 100644
--- a/frontend/src/pages/WordPressDetail.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/pages/WordPressDetail.jsx
@@ -1,21 +1,21 @@
import { useState, useEffect } from 'react';
import { useParams, useNavigate, Link } from 'react-router-dom';
import { Settings, Database, GitBranch, Package, Palette, FolderOpen, FileText, Lock, Activity, Globe, BarChart3, LayoutDashboard, Layers } from 'lucide-react';
-import useTabParam from '../hooks/useTabParam';
-import wordpressApi from '../services/wordpress';
-import { useToast } from '../contexts/ToastContext';
-import { useLogsDrawer } from '../contexts/LogsDrawerContext';
+import { useTabParam } from 'serverkit-sdk';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import { useLogsDrawer } from '@/contexts/LogsDrawerContext';
import ChangeUrlModal from '../components/wordpress/ChangeUrlModal';
import AttachDomainModal from '../components/wordpress/AttachDomainModal';
-import { Pill, EnvTag, PageTopbar } from '../components/ds';
-import { ErrorBoundary } from '../components/ErrorBoundary';
-import EmptyState from '../components/EmptyState';
-import PluginSlot from '../components/PluginSlot';
-import SkeletonBoundary from '../components/SkeletonBoundary';
-import Modal from '@/components/Modal';
-import { Button } from '@/components/ui/button';
-import { Input } from '@/components/ui/input';
-import { Label } from '@/components/ui/label';
+import { Pill, EnvTag, PageTopbar } from 'serverkit-sdk';
+import { ErrorBoundary } from '@/components/ErrorBoundary';
+import { EmptyState } from 'serverkit-sdk';
+import PluginSlot from '@/components/PluginSlot';
+import { SkeletonBoundary } from 'serverkit-sdk';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
import {
DetailPageSkeleton,
EnvSwitcher,
diff --git a/frontend/src/pages/WordPressPluginLibrary.jsx b/builtin-extensions/serverkit-wordpress/frontend/pages/WordPressPluginLibrary.jsx
similarity index 96%
rename from frontend/src/pages/WordPressPluginLibrary.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/pages/WordPressPluginLibrary.jsx
index 9a8e5d8b..4ddd4a5b 100644
--- a/frontend/src/pages/WordPressPluginLibrary.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/pages/WordPressPluginLibrary.jsx
@@ -1,17 +1,17 @@
import { useState, useEffect } from 'react';
import { Package, RefreshCw, Download, Trash2, Github, FolderGit2, Pencil, Server } from 'lucide-react';
-import wordpressApi from '../services/wordpress';
-import { useToast } from '../contexts/ToastContext';
-import { useAuth } from '../contexts/AuthContext';
-import EmptyState from '../components/EmptyState';
-import Spinner from '../components/Spinner';
-import Modal from '@/components/Modal';
-import { Pill, ServiceTile } from '@/components/ds';
-import { useTopbarActions } from '@/hooks/useTopbarActions';
-import { Button } from '@/components/ui/button';
-import { Input } from '@/components/ui/input';
-import { Label } from '@/components/ui/label';
-import { Switch } from '@/components/ui/switch';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import { useAuth } from 'serverkit-sdk';
+import { EmptyState } from 'serverkit-sdk';
+import { Spinner } from 'serverkit-sdk';
+import { Modal } from 'serverkit-sdk';
+import { Pill, ServiceTile } from 'serverkit-sdk';
+import { useTopbarActions } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { Switch } from 'serverkit-sdk';
const EMPTY_FORM = { source_type: 'github', source_url: '', slug: '', branch: 'main' };
diff --git a/frontend/src/pages/WordPressProject.jsx b/builtin-extensions/serverkit-wordpress/frontend/pages/WordPressProject.jsx
similarity index 98%
rename from frontend/src/pages/WordPressProject.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/pages/WordPressProject.jsx
index 8d1c8332..39cf9169 100644
--- a/frontend/src/pages/WordPressProject.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/pages/WordPressProject.jsx
@@ -1,9 +1,9 @@
import { useState, useEffect, useCallback, useRef } from 'react';
import { useParams, useNavigate, Link } from 'react-router-dom';
import { Plus, ExternalLink, RefreshCw, GitBranch, Search, Shield, Activity, Settings, ArrowRight, RotateCcw } from 'lucide-react';
-import useTabParam from '../hooks/useTabParam';
-import wordpressApi from '../services/wordpress';
-import { useToast } from '../contexts/ToastContext';
+import { useTabParam } from 'serverkit-sdk';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
import {
PipelineView,
PromoteModal,
@@ -19,15 +19,15 @@ import {
AutoSyncScheduleModal,
BulkActionsBar,
} from '../components/wordpress';
-import { ConfirmDialog } from '../components/ConfirmDialog';
-import Modal from '@/components/Modal';
-import Spinner from '../components/Spinner';
-import EmptyState from '../components/EmptyState';
+import { ConfirmDialog } from 'serverkit-sdk';
+import { Modal } from 'serverkit-sdk';
+import { Spinner } from 'serverkit-sdk';
+import { EmptyState } from 'serverkit-sdk';
import { FolderGit2 } from 'lucide-react';
import { io } from 'socket.io-client';
-import { Button } from '@/components/ui/button';
-import { Input } from '@/components/ui/input';
-import { Label } from '@/components/ui/label';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
const SOCKET_URL = import.meta.env.VITE_API_URL?.replace('/api/v1', '') || window.location.origin;
diff --git a/frontend/src/pages/WordPressProjects.jsx b/builtin-extensions/serverkit-wordpress/frontend/pages/WordPressProjects.jsx
similarity index 96%
rename from frontend/src/pages/WordPressProjects.jsx
rename to builtin-extensions/serverkit-wordpress/frontend/pages/WordPressProjects.jsx
index 62937dc2..9eaf353d 100644
--- a/frontend/src/pages/WordPressProjects.jsx
+++ b/builtin-extensions/serverkit-wordpress/frontend/pages/WordPressProjects.jsx
@@ -1,10 +1,10 @@
import { useState, useEffect } from 'react';
import { useNavigate } from 'react-router-dom';
import { GitBranch, Layers } from 'lucide-react';
-import wordpressApi from '../services/wordpress';
-import { useToast } from '../contexts/ToastContext';
-import ResourceListPage from '../components/layouts/ResourceListPage';
-import { Pill, ServiceTile, EnvTag } from '@/components/ds';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import ResourceListPage from '@/components/layouts/ResourceListPage';
+import { Pill, ServiceTile, EnvTag } from 'serverkit-sdk';
// Environment badges, in promotion order — production is always present, the
// rest only when the project actually has them.
diff --git a/frontend/src/styles/pages/_wordpress-pipeline.scss b/builtin-extensions/serverkit-wordpress/frontend/styles/wordpress-pipeline.scss
similarity index 99%
rename from frontend/src/styles/pages/_wordpress-pipeline.scss
rename to builtin-extensions/serverkit-wordpress/frontend/styles/wordpress-pipeline.scss
index 0556e509..3daeede8 100644
--- a/frontend/src/styles/pages/_wordpress-pipeline.scss
+++ b/builtin-extensions/serverkit-wordpress/frontend/styles/wordpress-pipeline.scss
@@ -1,3 +1,9 @@
+// Compiled through the extension's module graph (imported by index.jsx).
+// The host's design-token partial is imported via a sync-safe relative
+// path — the baked copy lives at frontend/src/plugins/serverkit-wordpress/,
+// so this resolves to frontend/src/styles/_variables.scss.
+@import '../../../styles/variables';
+
// ============================================
// WORDPRESS PIPELINE STYLES
// ============================================
diff --git a/frontend/src/styles/pages/_wordpress-plugin-library.scss b/builtin-extensions/serverkit-wordpress/frontend/styles/wordpress-plugin-library.scss
similarity index 92%
rename from frontend/src/styles/pages/_wordpress-plugin-library.scss
rename to builtin-extensions/serverkit-wordpress/frontend/styles/wordpress-plugin-library.scss
index 5eceeafc..40940ff6 100644
--- a/frontend/src/styles/pages/_wordpress-plugin-library.scss
+++ b/builtin-extensions/serverkit-wordpress/frontend/styles/wordpress-plugin-library.scss
@@ -1,3 +1,9 @@
+// Compiled through the extension's module graph (imported by index.jsx).
+// The host's design-token partial is imported via a sync-safe relative
+// path — the baked copy lives at frontend/src/plugins/serverkit-wordpress/,
+// so this resolves to frontend/src/styles/_variables.scss.
+@import '../../../styles/variables';
+
// WordPress Global Plugin Library page.
.wp-plugin-library {
diff --git a/frontend/src/styles/pages/_wordpress.scss b/builtin-extensions/serverkit-wordpress/frontend/styles/wordpress.scss
similarity index 99%
rename from frontend/src/styles/pages/_wordpress.scss
rename to builtin-extensions/serverkit-wordpress/frontend/styles/wordpress.scss
index 4fc40dfd..a3fb3b97 100644
--- a/frontend/src/styles/pages/_wordpress.scss
+++ b/builtin-extensions/serverkit-wordpress/frontend/styles/wordpress.scss
@@ -1,3 +1,9 @@
+// Compiled through the extension's module graph (imported by index.jsx).
+// The host's design-token partial is imported via a sync-safe relative
+// path — the baked copy lives at frontend/src/plugins/serverkit-wordpress/,
+// so this resolves to frontend/src/styles/_variables.scss.
+@import '../../../styles/variables';
+
// ============================================
// WORDPRESS PAGE STYLES
// ============================================
diff --git a/frontend/src/plugins/serverkit-wordpress/WordPressSshImport.jsx b/frontend/src/plugins/serverkit-wordpress/WordPressSshImport.jsx
index 16518a69..e5ad2418 100644
--- a/frontend/src/plugins/serverkit-wordpress/WordPressSshImport.jsx
+++ b/frontend/src/plugins/serverkit-wordpress/WordPressSshImport.jsx
@@ -8,15 +8,10 @@
// 3. Import — enqueues the pull-import job and polls its step log.
//
// After sync this file lives at frontend/src/plugins/serverkit-wordpress/, so
-// shared pieces are imported through the host's `@/` alias like core pages do.
+// shared pieces come from the serverkit-sdk surface like other extensions.
import { useEffect, useRef, useState } from 'react';
import { Link } from 'react-router-dom';
-import api from '@/services/api';
-import Spinner from '@/components/Spinner';
-import { useToast } from '@/contexts/ToastContext';
-import { Button } from '@/components/ui/button';
-import { Input } from '@/components/ui/input';
-import { Label } from '@/components/ui/label';
+import { api, Spinner, useToast, Button, Input, Label } from 'serverkit-sdk';
const POLL_MS = 2500;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/ActivityFeed.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/ActivityFeed.jsx
new file mode 100644
index 00000000..6be25a8a
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/ActivityFeed.jsx
@@ -0,0 +1,130 @@
+import { useState, useEffect } from 'react';
+import { ArrowUpRight, ArrowDownLeft, Database, GitBranch, Lock, Unlock, Trash2, Play, Square, RefreshCw, Camera, AlertCircle } from 'lucide-react';
+import wordpressApi from '@/services/wordpress';
+import { formatRelativeTime } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Badge } from 'serverkit-sdk';
+import { Skeleton } from 'serverkit-sdk';
+import { SkeletonBoundary } from 'serverkit-sdk';
+
+const ACTION_ICONS = {
+ create: Play,
+ deploy: GitBranch,
+ promote: ArrowUpRight,
+ sync: ArrowDownLeft,
+ lock: Lock,
+ unlock: Unlock,
+ destroy: Trash2,
+ snapshot_created: Camera,
+ snapshot_restored: Database,
+ started: Play,
+ stopped: Square,
+ restarted: RefreshCw
+};
+
+const ACTION_BADGE_VARIANTS = {
+ create: 'success',
+ deploy: 'info',
+ promote: 'default',
+ sync: 'info',
+ lock: 'warning',
+ unlock: 'secondary',
+ destroy: 'destructive',
+ snapshot_created: 'info',
+ snapshot_restored: 'warning',
+ started: 'success',
+ stopped: 'secondary',
+ restarted: 'info'
+};
+
+const ActivityFeed = ({ projectId, envId, limit = 20, compact = false }) => {
+ const [activities, setActivities] = useState([]);
+ const [loading, setLoading] = useState(true);
+ const [total, setTotal] = useState(0);
+
+ useEffect(() => {
+ loadActivities();
+ }, [projectId, envId]);
+
+ async function loadActivities() {
+ setLoading(true);
+ try {
+ const params = { limit };
+ if (envId) params.env_id = envId;
+ const data = await wordpressApi.getProjectActivity(projectId, params);
+ setActivities(data.activities || []);
+ setTotal(data.total || 0);
+ } catch (err) {
+ console.error('Failed to load activities:', err);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ const feedSkeleton = (
+ <>
+ {[1, 2, 3].map(i => (
+ <div key={i} className="activity-item-skeleton">
+ <Skeleton variant="circle" width={32} height={32} />
+ <div className="skeleton-stack">
+ <Skeleton variant="line" width="60%" />
+ <Skeleton variant="line" width="40%" />
+ </div>
+ </div>
+ ))}
+ </>
+ );
+
+ if (!loading && activities.length === 0) {
+ return (
+ <div className="activity-feed-empty">
+ <p>No activity recorded yet.</p>
+ </div>
+ );
+ }
+
+ return (
+ <SkeletonBoundary
+ className={`activity-feed ${compact ? 'compact' : ''}`.trim()}
+ loading={loading}
+ skeleton={feedSkeleton}
+ >
+ {activities.length > 0 && activities.map(activity => {
+ const Icon = ACTION_ICONS[activity.action] || AlertCircle;
+ const colorClass = ACTION_BADGE_VARIANTS[activity.action] || 'secondary';
+
+ return (
+ <div key={activity.id} className="activity-item">
+ <div className={`activity-icon ${colorClass}`}>
+ <Icon size={14} />
+ </div>
+ <div className="activity-content">
+ <span className="activity-description">
+ {activity.description || `${activity.action} performed`}
+ </span>
+ {activity.status === 'failed' && activity.error_message && (
+ <span className="activity-error">{activity.error_message}</span>
+ )}
+ </div>
+ <div className="activity-meta">
+ <span className="activity-time">{formatRelativeTime(activity.created_at)}</span>
+ {activity.status === 'failed' && (
+ <Badge variant="destructive">Failed</Badge>
+ )}
+ {activity.status === 'running' && (
+ <Badge variant="info">Running</Badge>
+ )}
+ </div>
+ </div>
+ );
+ })}
+ {total > activities.length && !compact && (
+ <Button variant="ghost" size="sm" className="activity-load-more" onClick={loadActivities}>
+ Load more
+ </Button>
+ )}
+ </SkeletonBoundary>
+ );
+};
+
+export default ActivityFeed;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/AttachDomainModal.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/AttachDomainModal.jsx
new file mode 100644
index 00000000..a12e5a85
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/AttachDomainModal.jsx
@@ -0,0 +1,130 @@
+import { useState } from 'react';
+import { Globe, AlertTriangle, CheckCircle2 } from 'lucide-react';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { Switch } from 'serverkit-sdk';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+
+// Attach a user-owned custom domain to a site: auto-create the DNS A record (or
+// show the exact record to add manually), optional HTTPS, then migrate the site
+// URL to it via the URL-swap tool. Shows the result inline so a manual DNS
+// record can be read/copied.
+export default function AttachDomainModal({ site, onClose, onChanged }) {
+ const toast = useToast();
+ const [domain, setDomain] = useState('');
+ const [issueSsl, setIssueSsl] = useState(false);
+ const [attaching, setAttaching] = useState(false);
+ const [result, setResult] = useState(null);
+
+ const valid = /^[a-z0-9.-]+\.[a-z]{2,}$/i.test(domain.trim());
+
+ async function handleAttach(e) {
+ e?.preventDefault();
+ if (!valid || attaching) return;
+ setAttaching(true);
+ toast.info('Attaching domain — creating DNS and moving the site…', { duration: 5000 });
+ try {
+ const res = await wordpressApi.attachDomain(site.id, { domain: domain.trim(), issueSsl });
+ if (res.success) {
+ setResult(res);
+ if (res.dns?.created) toast.success(`DNS A record created via ${res.dns.provider}`);
+ else toast.warning('Domain attached — add the DNS record shown to finish.', { duration: 7000 });
+ onChanged?.();
+ } else {
+ toast.error(res.error || 'Failed to attach domain');
+ }
+ } catch (err) {
+ toast.error(err.message || 'Failed to attach domain');
+ } finally {
+ setAttaching(false);
+ }
+ }
+
+ const rec = result?.dns?.record;
+
+ return (
+ <Modal open onClose={() => !attaching && onClose()} title={<><Globe size={18} /> Add Custom Domain</>}>
+ {!result ? (
+ <form onSubmit={handleAttach}>
+ <div className="wp-url-swap">
+ <div className="wp-url-swap__warning">
+ <AlertTriangle size={18} aria-hidden="true" />
+ <span>
+ Points a domain you own at this site. If a connected DNS provider
+ manages it, the A record is created automatically — otherwise
+ you&apos;ll get the exact record to add. The site URL is then
+ migrated to the domain (serialization-safe).
+ </span>
+ </div>
+
+ <div className="form-group">
+ <Label htmlFor="wp-domain">Domain</Label>
+ <Input
+ id="wp-domain"
+ type="text"
+ value={domain}
+ onChange={(e) => setDomain(e.target.value)}
+ placeholder="example.com"
+ disabled={attaching}
+ autoFocus
+ />
+ <span className="form-hint">A domain or subdomain you control, without http://</span>
+ </div>
+
+ <label className="wp-url-swap__keep">
+ <Switch checked={issueSsl} onCheckedChange={setIssueSsl} disabled={attaching} />
+ <span>
+ Set up HTTPS now
+ <small>Requests a Let&apos;s Encrypt certificate. Needs DNS to already resolve to this server.</small>
+ </span>
+ </label>
+ </div>
+
+ <div className="modal-actions">
+ <Button type="button" variant="outline" onClick={onClose} disabled={attaching}>Cancel</Button>
+ <Button type="submit" disabled={!valid || attaching}>
+ {attaching ? 'Attaching…' : 'Attach Domain'}
+ </Button>
+ </div>
+ </form>
+ ) : (
+ <>
+ <div className="wp-url-swap">
+ <div className="wp-url-swap__result">
+ <CheckCircle2 size={18} aria-hidden="true" />
+ <span>Site is now at <code>{result.url}</code></span>
+ </div>
+
+ {result.dns?.created ? (
+ <div className="form-hint">
+ DNS A record created automatically via {result.dns.provider}
+ {result.dns.zone ? ` (zone ${result.dns.zone})` : ''}.
+ </div>
+ ) : (
+ <div className="wp-url-swap__dns-manual">
+ <strong>Add this DNS record to finish:</strong>
+ {rec?.value ? (
+ <code className="wp-url-swap__record">
+ {rec.type}&nbsp;&nbsp;{rec.name}&nbsp;→&nbsp;{rec.value}
+ </code>
+ ) : (
+ <div className="form-hint">{result.dns?.message}</div>
+ )}
+ </div>
+ )}
+
+ {result.warning && (
+ <div className="wp-url-swap__preview-error">{result.warning}</div>
+ )}
+ </div>
+ <div className="modal-actions">
+ <Button type="button" onClick={onClose}>Done</Button>
+ </div>
+ </>
+ )}
+ </Modal>
+ );
+}
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/AutoSyncScheduleModal.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/AutoSyncScheduleModal.jsx
new file mode 100644
index 00000000..5a5488f4
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/AutoSyncScheduleModal.jsx
@@ -0,0 +1,181 @@
+import { useState, useEffect } from 'react';
+import { RefreshCw } from 'lucide-react';
+import { Spinner } from 'serverkit-sdk';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { Switch } from 'serverkit-sdk';
+
+const SCHEDULE_PRESETS = [
+ { label: 'Daily at 3 AM', value: '0 3 * * *' },
+ { label: 'Weekly Sunday 3 AM', value: '0 3 * * 0' },
+ { label: 'Every 6 hours', value: '0 */6 * * *' },
+ { label: 'Every 12 hours', value: '0 */12 * * *' },
+ { label: 'Custom', value: 'custom' },
+];
+
+const AutoSyncScheduleModal = ({ environment, prodId, onClose, api }) => {
+ const [loading, setLoading] = useState(true);
+ const [saving, setSaving] = useState(false);
+ const [enabled, setEnabled] = useState(false);
+ const [schedule, setSchedule] = useState('0 3 * * *');
+ const [selectedPreset, setSelectedPreset] = useState('0 3 * * *');
+ const [customCron, setCustomCron] = useState('');
+ const [nextRuns, setNextRuns] = useState([]);
+
+ useEffect(() => {
+ loadSchedule();
+ }, []);
+
+ async function loadSchedule() {
+ setLoading(true);
+ try {
+ const data = await api.getAutoSyncSchedule(prodId, environment.id);
+ setEnabled(data.enabled || false);
+ if (data.schedule) {
+ const matchingPreset = SCHEDULE_PRESETS.find(p => p.value === data.schedule);
+ if (matchingPreset) {
+ setSelectedPreset(data.schedule);
+ } else {
+ setSelectedPreset('custom');
+ setCustomCron(data.schedule);
+ }
+ setSchedule(data.schedule);
+ }
+ setNextRuns(data.next_runs || []);
+ } catch {
+ // Default values already set
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ function handlePresetChange(value) {
+ setSelectedPreset(value);
+ if (value !== 'custom') {
+ setSchedule(value);
+ }
+ }
+
+ function handleCustomCronChange(value) {
+ setCustomCron(value);
+ setSchedule(value);
+ }
+
+ async function handleSave() {
+ setSaving(true);
+ try {
+ const finalSchedule = selectedPreset === 'custom' ? customCron : selectedPreset;
+ await api.updateAutoSyncSchedule(prodId, environment.id, {
+ enabled,
+ schedule: finalSchedule,
+ });
+ onClose();
+ } catch (err) {
+ console.error('Failed to save auto-sync schedule:', err);
+ } finally {
+ setSaving(false);
+ }
+ }
+
+ function formatDateTime(iso) {
+ if (!iso) return '';
+ const d = new Date(iso);
+ return d.toLocaleString();
+ }
+
+ const envName = environment?.name || 'Environment';
+
+ return (
+ <Modal open={true} onClose={onClose} title="Auto-Sync Schedule" className="auto-sync-modal">
+ {loading ? (
+ <div className="auto-sync-loading">
+ <Spinner size="sm" />
+ <span>Loading schedule...</span>
+ </div>
+ ) : (
+ <div className="auto-sync-body">
+ <div className="auto-sync-env-name">{envName}</div>
+
+ <div className="auto-sync-toggle">
+ <label className="auto-sync-toggle-label">
+ <span>Enable Auto-Sync from Production</span>
+ <Switch checked={enabled} onCheckedChange={setEnabled} />
+ </label>
+ <p className="auto-sync-description">
+ Automatically sync this environment from production on a schedule.
+ </p>
+ </div>
+
+ {enabled && (
+ <>
+ <div className="form-group">
+ <Label>Schedule</Label>
+ <div className="auto-sync-presets">
+ {SCHEDULE_PRESETS.map(preset => (
+ <label key={preset.value} className="radio-label">
+ <input
+ type="radio"
+ name="schedule-preset"
+ checked={selectedPreset === preset.value}
+ onChange={() => handlePresetChange(preset.value)}
+ />
+ <span className="radio-content">
+ <strong>{preset.label}</strong>
+ {preset.value !== 'custom' && (
+ <span className="auto-sync-cron-display">{preset.value}</span>
+ )}
+ </span>
+ </label>
+ ))}
+ </div>
+ </div>
+
+ {selectedPreset === 'custom' && (
+ <div className="form-group">
+ <Label>Custom Cron Expression</Label>
+ <Input
+ type="text"
+ value={customCron}
+ onChange={e => handleCustomCronChange(e.target.value)}
+ placeholder="0 3 * * *"
+ className="auto-sync-cron-input"
+ />
+ <span className="form-hint">
+ Format: minute hour day-of-month month day-of-week
+ </span>
+ </div>
+ )}
+
+ {nextRuns.length > 0 && (
+ <div className="auto-sync-next-runs">
+ <h5>Next Scheduled Runs</h5>
+ <ul>
+ {nextRuns.map((run, i) => (
+ <li key={i}>
+ <RefreshCw size={10} />
+ <span>{formatDateTime(run)}</span>
+ </li>
+ ))}
+ </ul>
+ </div>
+ )}
+ </>
+ )}
+ </div>
+ )}
+
+ <div className="modal-actions">
+ <Button variant="outline" onClick={onClose} disabled={saving}>
+ Cancel
+ </Button>
+ <Button onClick={handleSave} disabled={saving || loading}>
+ {saving ? <><Spinner size="sm" /> Saving...</> : 'Save Schedule'}
+ </Button>
+ </div>
+ </Modal>
+ );
+};
+
+export default AutoSyncScheduleModal;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/BasicAuthModal.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/BasicAuthModal.jsx
new file mode 100644
index 00000000..07c366f9
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/BasicAuthModal.jsx
@@ -0,0 +1,156 @@
+import { useState, useEffect } from 'react';
+import { Shield, Copy, Check, AlertTriangle } from 'lucide-react';
+import { Spinner } from 'serverkit-sdk';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Switch } from 'serverkit-sdk';
+
+const BasicAuthModal = ({ environment, prodId, onClose, api }) => {
+ const [loading, setLoading] = useState(true);
+ const [status, setStatus] = useState({ enabled: false, username: null });
+ const [credentials, setCredentials] = useState(null);
+ const [toggling, setToggling] = useState(false);
+ const [copied, setCopied] = useState(null);
+
+ useEffect(() => {
+ loadStatus();
+ }, []);
+
+ async function loadStatus() {
+ setLoading(true);
+ try {
+ const data = await api.getBasicAuthStatus(prodId, environment.id);
+ setStatus(data);
+ } catch {
+ setStatus({ enabled: false, username: null });
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ async function handleEnable() {
+ setToggling(true);
+ try {
+ const data = await api.enableBasicAuth(prodId, environment.id);
+ if (data.success) {
+ setStatus({ enabled: true, username: data.username });
+ setCredentials({ username: data.username, password: data.password });
+ }
+ } catch (err) {
+ console.error('Failed to enable basic auth:', err);
+ } finally {
+ setToggling(false);
+ }
+ }
+
+ async function handleDisable() {
+ setToggling(true);
+ try {
+ const data = await api.disableBasicAuth(prodId, environment.id);
+ if (data.success) {
+ setStatus({ enabled: false, username: null });
+ setCredentials(null);
+ }
+ } catch (err) {
+ console.error('Failed to disable basic auth:', err);
+ } finally {
+ setToggling(false);
+ }
+ }
+
+ function copyToClipboard(text, field) {
+ navigator.clipboard.writeText(text);
+ setCopied(field);
+ setTimeout(() => setCopied(null), 2000);
+ }
+
+ const envName = environment?.name || 'Environment';
+
+ return (
+ <Modal open={true} onClose={onClose} title="Basic Auth" className="basic-auth-modal">
+ <div className="basic-auth-body">
+ <div className="basic-auth-env-name">{envName}</div>
+
+ {loading ? (
+ <div className="basic-auth-loading">
+ <Spinner size="sm" />
+ <span>Loading status...</span>
+ </div>
+ ) : (
+ <>
+ <div className="basic-auth-toggle">
+ <label className="basic-auth-toggle-label">
+ <span>HTTP Basic Authentication</span>
+ <Switch
+ checked={status.enabled}
+ onCheckedChange={status.enabled ? handleDisable : handleEnable}
+ disabled={toggling}
+ />
+ </label>
+ <p className="basic-auth-description">
+ Adds password protection to the site. Visitors must enter credentials to access any page.
+ </p>
+ </div>
+
+ {status.enabled && status.username && !credentials && (
+ <div className="basic-auth-current">
+ <div className="basic-auth-field">
+ <label>Username</label>
+ <div className="basic-auth-value">
+ <code>{status.username}</code>
+ </div>
+ </div>
+ <p className="basic-auth-hint">
+ Password was shown when Basic Auth was first enabled. Disable and re-enable to generate new credentials.
+ </p>
+ </div>
+ )}
+
+ {credentials && (
+ <div className="basic-auth-credentials">
+ <div className="alert alert-warning">
+ <AlertTriangle size={14} />
+ <span>Save these credentials now. The password will not be shown again.</span>
+ </div>
+ <div className="basic-auth-field">
+ <label>Username</label>
+ <div className="basic-auth-value">
+ <code>{credentials.username}</code>
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={() => copyToClipboard(credentials.username, 'user')}
+ >
+ {copied === 'user' ? <Check size={12} /> : <Copy size={12} />}
+ </Button>
+ </div>
+ </div>
+ <div className="basic-auth-field">
+ <label>Password</label>
+ <div className="basic-auth-value">
+ <code>{credentials.password}</code>
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={() => copyToClipboard(credentials.password, 'pass')}
+ >
+ {copied === 'pass' ? <Check size={12} /> : <Copy size={12} />}
+ </Button>
+ </div>
+ </div>
+ </div>
+ )}
+ </>
+ )}
+ </div>
+
+ <div className="modal-actions">
+ <Button variant="outline" onClick={onClose}>
+ Close
+ </Button>
+ </div>
+ </Modal>
+ );
+};
+
+export default BasicAuthModal;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/BulkActionsBar.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/BulkActionsBar.jsx
new file mode 100644
index 00000000..3fc66b9b
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/BulkActionsBar.jsx
@@ -0,0 +1,123 @@
+import { useState } from 'react';
+import { Square, Play, RefreshCw, ArrowDownLeft, X } from 'lucide-react';
+import { Spinner } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+
+const BulkActionsBar = ({ selectedIds, environments, prodId, onClear, onExecute, api }) => {
+ const [executing, setExecuting] = useState(false);
+ const [confirmAction, setConfirmAction] = useState(null);
+
+ if (!selectedIds || selectedIds.length === 0) return null;
+
+ const selectedNames = selectedIds.map(id => {
+ const env = environments.find(e => e.id === id);
+ return env?.name || `#${id}`;
+ });
+
+ async function handleAction(action) {
+ if (action === 'stop' || action === 'sync') {
+ setConfirmAction(action);
+ return;
+ }
+ await executeAction(action);
+ }
+
+ async function executeAction(action) {
+ setExecuting(true);
+ setConfirmAction(null);
+ try {
+ await onExecute(action, selectedIds);
+ } finally {
+ setExecuting(false);
+ }
+ }
+
+ return (
+ <div className="bulk-actions-bar">
+ {confirmAction ? (
+ <div className="bulk-actions-confirm">
+ <span>
+ {confirmAction === 'stop' && `Stop ${selectedIds.length} environment(s)?`}
+ {confirmAction === 'sync' && `Sync ${selectedIds.length} environment(s) from production?`}
+ </span>
+ <Button
+ size="sm"
+ onClick={() => executeAction(confirmAction)}
+ disabled={executing}
+ >
+ {executing ? <Spinner size="sm" /> : 'Confirm'}
+ </Button>
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={() => setConfirmAction(null)}
+ disabled={executing}
+ >
+ Cancel
+ </Button>
+ </div>
+ ) : (
+ <>
+ <div className="bulk-actions-info">
+ <span className="bulk-actions-count">{selectedIds.length}</span>
+ <span>selected</span>
+ </div>
+
+ <div className="bulk-actions-buttons">
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={() => handleAction('start')}
+ disabled={executing}
+ title="Start Selected"
+ >
+ <Play size={12} />
+ Start
+ </Button>
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={() => handleAction('stop')}
+ disabled={executing}
+ title="Stop Selected"
+ >
+ <Square size={12} />
+ Stop
+ </Button>
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={() => handleAction('restart')}
+ disabled={executing}
+ title="Restart Selected"
+ >
+ <RefreshCw size={12} />
+ Restart
+ </Button>
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={() => handleAction('sync')}
+ disabled={executing}
+ title="Sync from Production"
+ >
+ <ArrowDownLeft size={12} />
+ Sync from Prod
+ </Button>
+ </div>
+
+ <Button
+ variant="ghost"
+ size="icon"
+ className="bulk-actions-clear"
+ onClick={onClear}
+ >
+ <X size={12} />
+ </Button>
+ </>
+ )}
+ </div>
+ );
+};
+
+export default BulkActionsBar;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/ChangeUrlModal.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/ChangeUrlModal.jsx
new file mode 100644
index 00000000..3affb176
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/ChangeUrlModal.jsx
@@ -0,0 +1,146 @@
+import { useState, useEffect } from 'react';
+import { Globe, AlertTriangle, ArrowRight } from 'lucide-react';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { Switch } from 'serverkit-sdk';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+
+// Change a WordPress site's URL safely: a debounced dry-run preview of the DB
+// rewrite, then a backed-up, serialization-safe apply (WP-CLI search-replace)
+// on confirm. The backend re-points the Domain row + nginx vhost afterwards.
+export default function ChangeUrlModal({ site, onClose, onChanged }) {
+ const toast = useToast();
+ const currentUrl = site.url || '';
+ const [newUrl, setNewUrl] = useState(currentUrl);
+ const [keepOld, setKeepOld] = useState(true);
+ const [preview, setPreview] = useState(null);
+ const [previewing, setPreviewing] = useState(false);
+ const [applying, setApplying] = useState(false);
+
+ const target = newUrl.trim();
+ const dirty = target && target !== currentUrl;
+
+ // Debounced dry-run preview whenever the target URL settles.
+ useEffect(() => {
+ if (!dirty) { setPreview(null); return undefined; }
+ let cancelled = false;
+ setPreviewing(true);
+ const timer = setTimeout(async () => {
+ try {
+ const res = await wordpressApi.previewUrlChange(site.id, target);
+ if (!cancelled) setPreview(res);
+ } catch (err) {
+ if (!cancelled) setPreview({ success: false, error: err.message || 'Preview failed' });
+ } finally {
+ if (!cancelled) setPreviewing(false);
+ }
+ }, 500);
+ return () => { cancelled = true; clearTimeout(timer); };
+ }, [target, dirty, site.id]);
+
+ async function handleApply(e) {
+ e?.preventDefault();
+ if (!dirty || applying) return;
+ setApplying(true);
+ toast.info('Changing site URL — backing up and rewriting the database…', { duration: 5000 });
+ try {
+ const res = await wordpressApi.changeUrl(site.id, target, keepOld);
+ if (res.success) {
+ toast.success(`Site URL changed to ${res.new_url} (${res.replacements} replacement${res.replacements === 1 ? '' : 's'})`);
+ if (res.warning) toast.warning(res.warning, { duration: 7000 });
+ onChanged?.();
+ onClose();
+ } else {
+ toast.error(res.error || 'Failed to change URL');
+ }
+ } catch (err) {
+ toast.error(err.message || 'Failed to change URL');
+ } finally {
+ setApplying(false);
+ }
+ }
+
+ return (
+ <Modal open onClose={() => !applying && onClose()} title={<><Globe size={18} /> Change Site URL</>} size="lg">
+ <form onSubmit={handleApply}>
+ <div className="wp-url-swap">
+ <div className="wp-url-swap__warning">
+ <AlertTriangle size={18} aria-hidden="true" />
+ <span>
+ This rewrites every reference to the site URL across the database
+ (posts, options, serialized data) with a serialization-safe
+ search-replace. A database backup is taken first and restored
+ automatically if anything fails.
+ </span>
+ </div>
+
+ <div className="wp-url-swap__fromto">
+ <code>{currentUrl || '—'}</code>
+ <ArrowRight size={15} aria-hidden="true" />
+ <code className={dirty ? 'is-new' : ''}>{target || '—'}</code>
+ </div>
+
+ <div className="form-group">
+ <Label htmlFor="wp-new-url">New URL</Label>
+ <Input
+ id="wp-new-url"
+ type="text"
+ value={newUrl}
+ onChange={(e) => setNewUrl(e.target.value)}
+ placeholder="https://example.com"
+ disabled={applying}
+ autoFocus
+ />
+ <span className="form-hint">
+ Include http:// or https://. Point this hostname&apos;s DNS at the server first.
+ </span>
+ </div>
+
+ <label className="wp-url-swap__keep">
+ <Switch checked={keepOld} onCheckedChange={setKeepOld} disabled={applying} />
+ <span>
+ Keep the old address working
+ <small>The previous host keeps resolving; WordPress 301-redirects it to the new URL.</small>
+ </span>
+ </label>
+
+ {dirty && (
+ <div className="wp-url-swap__preview">
+ {previewing && <span className="form-hint">Previewing changes…</span>}
+ {!previewing && preview?.success && (
+ <>
+ <div className="wp-url-swap__preview-total">
+ {preview.total} database replacement{preview.total === 1 ? '' : 's'} will be made
+ </div>
+ <ul className="wp-url-swap__preview-pairs">
+ {preview.pairs.map((p, i) => (
+ <li key={i}>
+ <code>{p.search}</code>
+ <ArrowRight size={12} aria-hidden="true" />
+ <code>{p.replace}</code>
+ <span className="wp-url-swap__count">{p.replacements}</span>
+ </li>
+ ))}
+ </ul>
+ </>
+ )}
+ {!previewing && preview && !preview.success && (
+ <div className="wp-url-swap__preview-error">{preview.error}</div>
+ )}
+ </div>
+ )}
+ </div>
+
+ <div className="modal-actions">
+ <Button type="button" variant="outline" onClick={onClose} disabled={applying}>Cancel</Button>
+ <Button type="submit" disabled={!dirty || applying}>
+ {applying ? 'Changing…' : 'Change URL'}
+ </Button>
+ </div>
+ </form>
+ </Modal>
+ );
+}
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/CommitList.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/CommitList.jsx
new file mode 100644
index 00000000..a3eed021
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/CommitList.jsx
@@ -0,0 +1,220 @@
+import { useState } from 'react';
+import { GitCommit, Rocket, Copy, CheckCircle, ExternalLink } from 'lucide-react';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { detectProvider } from '@/components/git/GitProviders';
+import { EmptyState } from 'serverkit-sdk';
+
+// Build a web URL to a commit on the host from the clone URL + sha so the log is
+// clickable. Handles https + scp-style ssh remotes and Bitbucket's /commits path.
+function commitUrl(repoUrl, sha) {
+ if (!repoUrl || !sha) return null;
+ let base = repoUrl.trim().replace(/\.git$/i, '');
+ const ssh = base.match(/^git@([^:]+):(.+)$/);
+ if (ssh) base = `https://${ssh[1]}/${ssh[2]}`;
+ if (!/^https?:\/\//i.test(base)) return null;
+ const seg = detectProvider(repoUrl)?.key === 'bitbucket' ? 'commits' : 'commit';
+ return `${base}/${seg}/${sha}`;
+}
+
+const CommitList = ({ commits, currentCommit, onDeploy, onCreateDev, loading = false, repoUrl }) => {
+ const [actionLoading, setActionLoading] = useState({});
+ const [showDevModal, setShowDevModal] = useState(null);
+
+ function formatDate(dateString) {
+ if (!dateString) return '-';
+ const date = new Date(dateString);
+ const now = new Date();
+ const diffMs = now - date;
+ const diffHours = Math.floor(diffMs / (1000 * 60 * 60));
+ const diffDays = Math.floor(diffHours / 24);
+
+ if (diffHours < 1) return 'Just now';
+ if (diffHours < 24) return `${diffHours}h ago`;
+ if (diffDays < 7) return `${diffDays}d ago`;
+ return date.toLocaleDateString();
+ }
+
+ async function handleDeploy(commit) {
+ if (!confirm(`Deploy commit ${commit.sha.substring(0, 7)} to production?`)) {
+ return;
+ }
+ setActionLoading(prev => ({ ...prev, [`deploy-${commit.sha}`]: true }));
+ try {
+ await onDeploy?.({ commit_sha: commit.sha });
+ } finally {
+ setActionLoading(prev => ({ ...prev, [`deploy-${commit.sha}`]: false }));
+ }
+ }
+
+ async function handleCreateDev(commit, config) {
+ setActionLoading(prev => ({ ...prev, [`dev-${commit.sha}`]: true }));
+ try {
+ await onCreateDev?.({
+ commit_sha: commit.sha,
+ config
+ });
+ setShowDevModal(null);
+ } finally {
+ setActionLoading(prev => ({ ...prev, [`dev-${commit.sha}`]: false }));
+ }
+ }
+
+ if (loading) {
+ return <EmptyState loading title="Loading commits..." />;
+ }
+
+ if (!commits || commits.length === 0) {
+ return (
+ <div className="empty-state-small">
+ <p>No commits found.</p>
+ <p className="hint">Push changes to your repository to see commits here.</p>
+ </div>
+ );
+ }
+
+ return (
+ <div className="commit-list">
+ {commits.map(commit => {
+ const isCurrent = currentCommit === commit.sha;
+ const isDeploying = actionLoading[`deploy-${commit.sha}`];
+ const isCreatingDev = actionLoading[`dev-${commit.sha}`];
+
+ return (
+ <div key={commit.sha} className={`commit-item ${isCurrent ? 'current' : ''}`}>
+ <div className="commit-icon">
+ {isCurrent ? (
+ <CheckCircle size={16} className="current-icon" />
+ ) : (
+ <GitCommit size={16} />
+ )}
+ </div>
+
+ <div className="commit-info">
+ <div className="commit-header">
+ {commitUrl(repoUrl, commit.sha) ? (
+ <a
+ className="commit-sha mono commit-sha--link"
+ href={commitUrl(repoUrl, commit.sha)}
+ target="_blank"
+ rel="noopener noreferrer"
+ title="View this commit on the remote"
+ >
+ {commit.sha.substring(0, 7)}
+ <ExternalLink size={11} />
+ </a>
+ ) : (
+ <span className="commit-sha mono">{commit.sha.substring(0, 7)}</span>
+ )}
+ {isCurrent && <span className="current-badge">Deployed</span>}
+ <span className="commit-date">{formatDate(commit.date)}</span>
+ </div>
+ <p className="commit-message">{commit.message}</p>
+ {commit.author && (
+ <span className="commit-author">{commit.author}</span>
+ )}
+ </div>
+
+ <div className="commit-actions">
+ {!isCurrent && (
+ <Button
+ size="sm"
+ onClick={() => handleDeploy(commit)}
+ disabled={isDeploying}
+ title="Deploy this commit"
+ >
+ <Rocket size={12} />
+ {isDeploying ? 'Deploying...' : 'Deploy'}
+ </Button>
+ )}
+ <Button
+ variant="outline"
+ size="sm"
+ onClick={() => setShowDevModal(commit)}
+ disabled={isCreatingDev}
+ title="Create dev environment from this commit"
+ >
+ <Copy size={12} />
+ {isCreatingDev ? 'Creating...' : 'Create Dev'}
+ </Button>
+ </div>
+ </div>
+ );
+ })}
+
+ {showDevModal && (
+ <CreateDevModal
+ commit={showDevModal}
+ onClose={() => setShowDevModal(null)}
+ onCreate={(config) => handleCreateDev(showDevModal, config)}
+ loading={actionLoading[`dev-${showDevModal.sha}`]}
+ />
+ )}
+ </div>
+ );
+};
+
+const CreateDevModal = ({ commit, onClose, onCreate, loading }) => {
+ const [formData, setFormData] = useState({
+ name: `dev-${commit.sha.substring(0, 7)}`,
+ domain: ''
+ });
+
+ function handleChange(e) {
+ const { name, value } = e.target;
+ setFormData(prev => ({ ...prev, [name]: value }));
+ }
+
+ function handleSubmit(e) {
+ e.preventDefault();
+ onCreate(formData);
+ }
+
+ return (
+ <Modal open={true} onClose={onClose} title="Create Dev Environment">
+ <p className="hint">
+ Create a development environment with code from commit{' '}
+ <code>{commit.sha.substring(0, 7)}</code>
+ </p>
+ <p className="commit-message-preview">&ldquo;{commit.message}&rdquo;</p>
+
+ <form onSubmit={handleSubmit}>
+ <div className="form-group">
+ <Label>Environment Name</Label>
+ <Input
+ type="text"
+ name="name"
+ value={formData.name}
+ onChange={handleChange}
+ placeholder="dev-abc1234"
+ />
+ </div>
+
+ <div className="form-group">
+ <Label>Domain (optional)</Label>
+ <Input
+ type="text"
+ name="domain"
+ value={formData.domain}
+ onChange={handleChange}
+ placeholder="dev.example.com"
+ />
+ <span className="form-hint">Leave empty to auto-generate</span>
+ </div>
+
+ <div className="modal-actions">
+ <Button type="button" variant="outline" onClick={onClose}>
+ Cancel
+ </Button>
+ <Button type="submit" disabled={loading}>
+ {loading ? 'Creating...' : 'Create Environment'}
+ </Button>
+ </div>
+ </form>
+ </Modal>
+ );
+};
+
+export default CommitList;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/CompareView.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/CompareView.jsx
new file mode 100644
index 00000000..78cac4c3
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/CompareView.jsx
@@ -0,0 +1,215 @@
+import { useState, useEffect } from 'react';
+import { GitCompare, Check, X, Minus, RefreshCw } from 'lucide-react';
+import wordpressApi from '@/services/wordpress';
+import { Spinner } from 'serverkit-sdk';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+
+const CompareView = ({ projectId, envA, envB, onClose }) => {
+ const [comparison, setComparison] = useState(null);
+ const [loading, setLoading] = useState(true);
+ const [error, setError] = useState(null);
+
+ useEffect(() => {
+ loadComparison();
+ }, [envA?.id, envB?.id]);
+
+ async function loadComparison() {
+ if (!envA?.id || !envB?.id) return;
+
+ setLoading(true);
+ setError(null);
+ try {
+ const data = await wordpressApi.compareEnvironments(projectId, envA.id, envB.id);
+ setComparison(data);
+ } catch (err) {
+ setError(err.message || 'Failed to compare environments');
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ const envAType = envA?.environment_type || 'production';
+ const envBType = envB?.environment_type || 'development';
+
+ return (
+ <Modal open={true} onClose={onClose} title="Compare Environments" size="xl">
+ <div className="compare-header">
+ <div className={`compare-env-pill ${envAType}`}>
+ <span className="compare-env-type">{envAType}</span>
+ <span className="compare-env-name">{envA?.name || 'Environment A'}</span>
+ </div>
+ <GitCompare size={16} className="compare-vs-icon" />
+ <div className={`compare-env-pill ${envBType}`}>
+ <span className="compare-env-type">{envBType}</span>
+ <span className="compare-env-name">{envB?.name || 'Environment B'}</span>
+ </div>
+ <Button variant="ghost" size="sm" onClick={loadComparison} disabled={loading}>
+ <RefreshCw size={14} />
+ </Button>
+ </div>
+
+ <div className="compare-body">
+ {loading && (
+ <div className="compare-loading">
+ <Spinner size="md" />
+ <span>Comparing environments...</span>
+ </div>
+ )}
+
+ {error && (
+ <div className="alert alert-danger">
+ <p>{error}</p>
+ <Button size="sm" onClick={loadComparison}>
+ Retry
+ </Button>
+ </div>
+ )}
+
+ {!loading && !error && comparison && (
+ <>
+ {/* Version Comparison */}
+ <CompareSection title="Versions">
+ <CompareRow
+ label="WordPress"
+ valueA={comparison.env_a?.wp_version}
+ valueB={comparison.env_b?.wp_version}
+ />
+ <CompareRow
+ label="PHP"
+ valueA={comparison.env_a?.php_version}
+ valueB={comparison.env_b?.php_version}
+ />
+ <CompareRow
+ label="Active Theme"
+ valueA={comparison.env_a?.active_theme}
+ valueB={comparison.env_b?.active_theme}
+ />
+ </CompareSection>
+
+ {/* Plugins Comparison */}
+ {comparison.plugins && (
+ <CompareSection
+ title="Plugins"
+ summary={getPluginSummary(comparison.plugins)}
+ >
+ {comparison.plugins.map(plugin => (
+ <CompareRow
+ key={plugin.name}
+ label={plugin.name}
+ valueA={plugin.version_a || (plugin.in_a ? 'Installed' : null)}
+ valueB={plugin.version_b || (plugin.in_b ? 'Installed' : null)}
+ status={plugin.status}
+ />
+ ))}
+ {comparison.plugins.length === 0 && (
+ <div className="compare-empty-row">No plugin data available</div>
+ )}
+ </CompareSection>
+ )}
+
+ {/* Themes Comparison */}
+ {comparison.themes && (
+ <CompareSection
+ title="Themes"
+ summary={getThemeSummary(comparison.themes)}
+ >
+ {comparison.themes.map(theme => (
+ <CompareRow
+ key={theme.name}
+ label={theme.name}
+ valueA={theme.version_a || (theme.in_a ? 'Installed' : null)}
+ valueB={theme.version_b || (theme.in_b ? 'Installed' : null)}
+ status={theme.status}
+ />
+ ))}
+ {comparison.themes.length === 0 && (
+ <div className="compare-empty-row">No theme data available</div>
+ )}
+ </CompareSection>
+ )}
+ </>
+ )}
+ </div>
+
+ <div className="modal-actions">
+ <Button variant="outline" onClick={onClose}>Close</Button>
+ </div>
+ </Modal>
+ );
+};
+
+const CompareSection = ({ title, summary, children }) => (
+ <div className="compare-section">
+ <div className="compare-section-header">
+ <h4>{title}</h4>
+ {summary && <span className="compare-section-summary">{summary}</span>}
+ </div>
+ <div className="compare-table">
+ {children}
+ </div>
+ </div>
+);
+
+const CompareRow = ({ label, valueA, valueB, status }) => {
+ const match = valueA === valueB && valueA != null;
+ const onlyA = valueA && !valueB;
+ const onlyB = !valueA && valueB;
+ const different = valueA && valueB && valueA !== valueB;
+
+ let statusClass = 'match';
+ let StatusIcon = Check;
+ if (different || status === 'different') {
+ statusClass = 'different';
+ StatusIcon = X;
+ } else if (onlyA || status === 'only_a') {
+ statusClass = 'only-a';
+ StatusIcon = Minus;
+ } else if (onlyB || status === 'only_b') {
+ statusClass = 'only-b';
+ StatusIcon = Minus;
+ }
+
+ return (
+ <div className={`compare-row ${statusClass}`}>
+ <div className="compare-row-label">
+ <StatusIcon size={12} className="compare-row-icon" />
+ {label}
+ </div>
+ <div className="compare-row-value-a">
+ {valueA || <span className="compare-na">--</span>}
+ </div>
+ <div className="compare-row-value-b">
+ {valueB || <span className="compare-na">--</span>}
+ </div>
+ </div>
+ );
+};
+
+function getPluginSummary(plugins) {
+ const match = plugins.filter(p => p.status === 'match').length;
+ const diff = plugins.filter(p => p.status === 'different').length;
+ const onlyA = plugins.filter(p => p.status === 'only_a').length;
+ const onlyB = plugins.filter(p => p.status === 'only_b').length;
+ const parts = [];
+ if (match) parts.push(`${match} matching`);
+ if (diff) parts.push(`${diff} different`);
+ if (onlyA) parts.push(`${onlyA} only in A`);
+ if (onlyB) parts.push(`${onlyB} only in B`);
+ return parts.join(', ');
+}
+
+function getThemeSummary(themes) {
+ const match = themes.filter(t => t.status === 'match').length;
+ const diff = themes.filter(t => t.status === 'different').length;
+ const onlyA = themes.filter(t => t.status === 'only_a').length;
+ const onlyB = themes.filter(t => t.status === 'only_b').length;
+ const parts = [];
+ if (match) parts.push(`${match} matching`);
+ if (diff) parts.push(`${diff} different`);
+ if (onlyA) parts.push(`${onlyA} only in A`);
+ if (onlyB) parts.push(`${onlyB} only in B`);
+ return parts.join(', ');
+}
+
+export default CompareView;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/ContainerLogs.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/ContainerLogs.jsx
new file mode 100644
index 00000000..927a87ac
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/ContainerLogs.jsx
@@ -0,0 +1,132 @@
+import { useState, useEffect, useRef } from 'react';
+import { Terminal, X, Download } from 'lucide-react';
+import wordpressApi from '@/services/wordpress';
+import { Button } from 'serverkit-sdk';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from 'serverkit-sdk';
+
+const ContainerLogs = ({ projectId, envId, onClose }) => {
+ const [logs, setLogs] = useState([]);
+ const [loading, setLoading] = useState(true);
+ const [service, setService] = useState('wordpress');
+ const [lines, setLines] = useState(100);
+ const [autoScroll, setAutoScroll] = useState(true);
+ const logsEndRef = useRef(null);
+ const containerRef = useRef(null);
+
+ useEffect(() => {
+ loadLogs();
+ }, [projectId, envId, service, lines]);
+
+ useEffect(() => {
+ if (autoScroll && logsEndRef.current) {
+ logsEndRef.current.scrollIntoView({ behavior: 'smooth' });
+ }
+ }, [logs, autoScroll]);
+
+ async function loadLogs() {
+ setLoading(true);
+ try {
+ const data = await wordpressApi.getEnvironmentLogs(projectId, envId, { service, lines });
+ setLogs(data.logs || []);
+ } catch (err) {
+ console.error('Failed to load logs:', err);
+ setLogs([`Error loading logs: ${err.message}`]);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ function handleScroll() {
+ if (!containerRef.current) return;
+ const { scrollTop, scrollHeight, clientHeight } = containerRef.current;
+ setAutoScroll(scrollHeight - scrollTop - clientHeight < 50);
+ }
+
+ function handleDownload() {
+ const text = logs.join('\n');
+ const blob = new Blob([text], { type: 'text/plain' });
+ const url = URL.createObjectURL(blob);
+ const a = document.createElement('a');
+ a.href = url;
+ a.download = `env-${envId}-${service}-logs.txt`;
+ a.click();
+ URL.revokeObjectURL(url);
+ }
+
+ return (
+ <div className="container-logs-panel">
+ <div className="container-logs-header">
+ <div className="container-logs-title">
+ <span className="container-logs-ico">
+ <Terminal size={15} />
+ </span>
+ <div className="container-logs-titles">
+ <span>Container Logs</span>
+ <span className="container-logs-sub">env-{envId} · {service}</span>
+ </div>
+ </div>
+ <div className="container-logs-controls">
+ <Select value={service} onValueChange={setService}>
+ <SelectTrigger className="logs-service-select">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="wordpress">WordPress</SelectItem>
+ <SelectItem value="db">MySQL</SelectItem>
+ </SelectContent>
+ </Select>
+ <Select value={String(lines)} onValueChange={(v) => setLines(Number(v))}>
+ <SelectTrigger className="logs-lines-select">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="50">50 lines</SelectItem>
+ <SelectItem value="100">100 lines</SelectItem>
+ <SelectItem value="500">500 lines</SelectItem>
+ </SelectContent>
+ </Select>
+ <Button variant="ghost" size="sm" onClick={loadLogs} title="Refresh">
+ <RefreshIcon />
+ </Button>
+ <Button variant="ghost" size="sm" onClick={handleDownload} title="Download">
+ <Download size={14} />
+ </Button>
+ {onClose && (
+ <Button variant="ghost" size="sm" onClick={onClose}>
+ <X size={14} />
+ </Button>
+ )}
+ </div>
+ </div>
+ <div
+ className="container-logs-body"
+ ref={containerRef}
+ onScroll={handleScroll}
+ >
+ {loading ? (
+ <div className="logs-loading">Loading logs...</div>
+ ) : logs.length === 0 ? (
+ <div className="logs-empty">No logs available.</div>
+ ) : (
+ <pre className="logs-content">
+ {logs.map((line, i) => (
+ <div key={i} className="log-line">{line}</div>
+ ))}
+ <div ref={logsEndRef} />
+ </pre>
+ )}
+ </div>
+ </div>
+ );
+};
+
+function RefreshIcon() {
+ return (
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
+ <polyline points="23 4 23 10 17 10" />
+ <path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10" />
+ </svg>
+ );
+}
+
+export default ContainerLogs;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/DiskUsageBar.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/DiskUsageBar.jsx
new file mode 100644
index 00000000..f824b683
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/DiskUsageBar.jsx
@@ -0,0 +1,78 @@
+import { HardDrive } from 'lucide-react';
+import { formatBytes } from 'serverkit-sdk';
+
+const REFERENCE_THRESHOLD = 10 * 1024 * 1024 * 1024; // 10 GB reference
+
+const DiskUsageBar = ({ usage, showBreakdown = true, compact = false }) => {
+ if (!usage) return null;
+
+ const total = usage.total || 0;
+ const wordpress = usage.wordpress || 0;
+ const mysql = usage.mysql || 0;
+ const snapshots = usage.snapshots || 0;
+
+ const percent = REFERENCE_THRESHOLD > 0
+ ? Math.min((total / REFERENCE_THRESHOLD) * 100, 100)
+ : 0;
+
+ const wpPercent = total > 0 ? (wordpress / total) * percent : 0;
+ const dbPercent = total > 0 ? (mysql / total) * percent : 0;
+ const snapPercent = total > 0 ? (snapshots / total) * percent : 0;
+
+ const colorClass = percent < 70 ? 'green' : percent < 90 ? 'yellow' : 'red';
+
+ if (compact) {
+ return (
+ <div className="disk-usage-compact" title={`Disk: ${formatBytes(total)}`}>
+ <HardDrive size={10} />
+ <span className="disk-usage-compact-text">{formatBytes(total)}</span>
+ </div>
+ );
+ }
+
+ return (
+ <div className="disk-usage-bar-container">
+ <div className="disk-usage-header">
+ <HardDrive size={14} />
+ <span className="disk-usage-total">{formatBytes(total)}</span>
+ </div>
+
+ <div className="disk-usage-bar">
+ <div
+ className={`disk-usage-segment wordpress ${colorClass}`}
+ style={{ width: `${wpPercent}%` }}
+ title={`WordPress: ${formatBytes(wordpress)}`}
+ />
+ <div
+ className="disk-usage-segment mysql"
+ style={{ width: `${dbPercent}%` }}
+ title={`MySQL: ${formatBytes(mysql)}`}
+ />
+ <div
+ className="disk-usage-segment snapshots"
+ style={{ width: `${snapPercent}%` }}
+ title={`Snapshots: ${formatBytes(snapshots)}`}
+ />
+ </div>
+
+ {showBreakdown && (
+ <div className="disk-usage-legend">
+ <div className="disk-usage-legend-item">
+ <span className="disk-usage-legend-dot wordpress" />
+ <span>WordPress {formatBytes(wordpress)}</span>
+ </div>
+ <div className="disk-usage-legend-item">
+ <span className="disk-usage-legend-dot mysql" />
+ <span>MySQL {formatBytes(mysql)}</span>
+ </div>
+ <div className="disk-usage-legend-item">
+ <span className="disk-usage-legend-dot snapshots" />
+ <span>Snapshots {formatBytes(snapshots)}</span>
+ </div>
+ </div>
+ )}
+ </div>
+ );
+};
+
+export default DiskUsageBar;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/EnvironmentCard.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/EnvironmentCard.jsx
new file mode 100644
index 00000000..28a7348f
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/EnvironmentCard.jsx
@@ -0,0 +1,232 @@
+import { useState } from 'react';
+import { ExternalLink, RefreshCw, Trash2, GitBranch, Clock, AlertTriangle, Calendar, FileText } from 'lucide-react';
+import { ConfirmDialog } from 'serverkit-sdk';
+import { Pill, EnvTag } from 'serverkit-sdk';
+
+const EnvironmentCard = ({ environment, productionUrl, onSync, onDelete, onViewLogs, isProduction = false }) => {
+ const [syncing, setSyncing] = useState(false);
+ const [deleting, setDeleting] = useState(false);
+ const [showSyncConfirm, setShowSyncConfirm] = useState(false);
+ const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);
+
+ const isRunning = environment.status === 'running';
+ const envType = environment.type || environment.environment_type || (isProduction ? 'production' : 'development');
+
+ // Helper functions
+ function formatDate(dateString) {
+ if (!dateString) return null;
+ return new Date(dateString).toLocaleDateString();
+ }
+
+ function formatRelativeTime(dateString) {
+ if (!dateString) return null;
+ const date = new Date(dateString);
+ const now = new Date();
+ const diffMs = now - date;
+ const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));
+
+ if (diffDays === 0) return 'Today';
+ if (diffDays === 1) return 'Yesterday';
+ if (diffDays < 7) return `${diffDays} days ago`;
+ if (diffDays < 30) return `${Math.floor(diffDays / 7)} week(s) ago`;
+ return `${Math.floor(diffDays / 30)} month(s) ago`;
+ }
+
+ function isStale() {
+ if (!environment.last_sync || isProduction) return false;
+ const lastSync = new Date(environment.last_sync);
+ const now = new Date();
+ const diffDays = Math.floor((now - lastSync) / (1000 * 60 * 60 * 24));
+ return diffDays > 7; // Consider stale if not synced in 7 days
+ }
+
+ function formatSchedule(schedule) {
+ if (!schedule) return null;
+ const scheduleMap = {
+ '0 3 * * 0': 'Weekly (Sunday 3am)',
+ '0 3 * * *': 'Daily (3am)',
+ '0 0 * * 0': 'Weekly (Sunday midnight)',
+ '0 0 * * *': 'Daily (midnight)'
+ };
+ return scheduleMap[schedule] || schedule;
+ }
+
+ const stale = isStale();
+
+ async function handleSync() {
+ setShowSyncConfirm(false);
+ setSyncing(true);
+ try {
+ await onSync?.(environment.id);
+ } finally {
+ setSyncing(false);
+ }
+ }
+
+ async function handleDelete() {
+ setShowDeleteConfirm(false);
+ setDeleting(true);
+ try {
+ await onDelete?.(environment.id);
+ } finally {
+ setDeleting(false);
+ }
+ }
+
+ function handleVisit() {
+ if (environment.url) {
+ window.open(environment.url, '_blank');
+ }
+ }
+
+ const envTagLabel = envType === 'production' ? 'PROD'
+ : envType === 'staging' ? 'STAGING'
+ : envType === 'multidev' ? 'MULTIDEV'
+ : 'DEV';
+
+ return (
+ <div className={`wp-env-card ${isProduction ? 'production' : ''} ${stale ? 'stale' : ''}`}>
+ <div className="wp-env-header">
+ <div className="wp-env-info">
+ <EnvTag env={envTagLabel} />
+ <h4 className="wp-env-name">{environment.name}</h4>
+ </div>
+ <div className="wp-env-status-group">
+ {stale && (
+ <span className="wp-env-stale-badge" title="Environment hasn't been synced in over 7 days">
+ <AlertTriangle size={12} />
+ Stale
+ </span>
+ )}
+ <Pill kind={isRunning ? 'green' : 'gray'}>{isRunning ? 'Running' : 'Stopped'}</Pill>
+ </div>
+ </div>
+
+ <div className="wp-env-body">
+ {environment.url && (
+ <div className="wp-env-url">
+ <a href={environment.url} target="_blank" rel="noopener noreferrer">
+ {environment.url}
+ </a>
+ </div>
+ )}
+
+ <div className="wp-env-meta">
+ {environment.db_name && (
+ <div className="wp-env-meta-item">
+ <span className="meta-label">Database</span>
+ <span className="meta-value mono">{environment.db_name}</span>
+ </div>
+ )}
+ {environment.commit_sha && (
+ <div className="wp-env-meta-item">
+ <span className="meta-label">
+ <GitBranch size={12} /> Commit
+ </span>
+ <span className="meta-value mono">{environment.commit_sha.substring(0, 7)}</span>
+ </div>
+ )}
+ {!isProduction && environment.last_sync && (
+ <div className="wp-env-meta-item">
+ <span className="meta-label">
+ <Clock size={12} /> Last Sync
+ </span>
+ <span className={`meta-value ${stale ? 'text-warning' : ''}`}>
+ {formatRelativeTime(environment.last_sync)}
+ </span>
+ </div>
+ )}
+ {!isProduction && environment.sync_schedule && (
+ <div className="wp-env-meta-item">
+ <span className="meta-label">
+ <Calendar size={12} /> Schedule
+ </span>
+ <span className="meta-value">
+ {formatSchedule(environment.sync_schedule)}
+ </span>
+ </div>
+ )}
+ </div>
+ </div>
+
+ <div className="wp-env-footer">
+ <button type="button"
+ className="btn btn-ghost btn-sm"
+ onClick={handleVisit}
+ disabled={!environment.url}
+ >
+ <ExternalLink size={14} />
+ Visit
+ </button>
+
+ {!isProduction && (
+ <>
+ <button type="button"
+ className="btn btn-ghost btn-sm"
+ onClick={() => setShowSyncConfirm(true)}
+ disabled={syncing || !productionUrl}
+ title="Sync from production"
+ >
+ <RefreshCw size={14} className={syncing ? 'spinning' : ''} />
+ {syncing ? 'Syncing...' : 'Sync'}
+ </button>
+ {onViewLogs && (
+ <button type="button"
+ className="btn btn-ghost btn-sm"
+ onClick={() => onViewLogs?.(environment.id)}
+ title="View sync logs"
+ >
+ <FileText size={14} />
+ Logs
+ </button>
+ )}
+ <button type="button"
+ className="btn btn-ghost btn-sm btn-danger"
+ onClick={() => setShowDeleteConfirm(true)}
+ disabled={deleting}
+ >
+ <Trash2 size={14} />
+ {deleting ? 'Deleting...' : 'Delete'}
+ </button>
+ </>
+ )}
+ </div>
+
+ <ConfirmDialog
+ isOpen={showSyncConfirm}
+ title="Sync from Production"
+ message={`Sync "${environment.name}" from production?`}
+ details={
+ <ul>
+ <li><strong>Warning:</strong> This will overwrite the current database</li>
+ <li>All data in this environment will be replaced with production data</li>
+ <li>URLs will be automatically updated for this environment</li>
+ </ul>
+ }
+ confirmText="Sync Now"
+ variant="warning"
+ onConfirm={handleSync}
+ onCancel={() => setShowSyncConfirm(false)}
+ />
+
+ <ConfirmDialog
+ isOpen={showDeleteConfirm}
+ title={`Delete ${envType.charAt(0).toUpperCase() + envType.slice(1)} Environment`}
+ message={`Are you sure you want to delete "${environment.name}"?`}
+ details={
+ <ul>
+ <li>All environment files will be permanently deleted</li>
+ <li>Database <code>{environment.db_name || 'associated database'}</code> will be removed</li>
+ <li>This action cannot be undone</li>
+ </ul>
+ }
+ confirmText="Delete Environment"
+ variant="danger"
+ onConfirm={handleDelete}
+ onCancel={() => setShowDeleteConfirm(false)}
+ />
+ </div>
+ );
+};
+
+export default EnvironmentCard;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/EnvironmentStatusBadge.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/EnvironmentStatusBadge.jsx
new file mode 100644
index 00000000..6b4c5289
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/EnvironmentStatusBadge.jsx
@@ -0,0 +1,33 @@
+import { Lock } from 'lucide-react';
+
+const EnvironmentStatusBadge = ({ type, status, isLocked }) => {
+ function getTypeBadgeClass() {
+ switch (type) {
+ case 'production': return 'env-production';
+ case 'staging': return 'env-staging';
+ case 'multidev': return 'env-multidev';
+ default: return 'env-development';
+ }
+ }
+
+ const isRunning = status === 'running';
+
+ return (
+ <div className="env-status-badge-group">
+ <span className={`wp-env-badge ${getTypeBadgeClass()}`}>
+ {type?.toUpperCase() || 'DEV'}
+ </span>
+ {isLocked && (
+ <span className="env-locked-badge" title="Environment is locked">
+ <Lock size={10} />
+ </span>
+ )}
+ <span className={`wp-env-status ${isRunning ? 'running' : 'stopped'}`}>
+ <span className="status-dot" />
+ {isRunning ? 'Running' : 'Stopped'}
+ </span>
+ </div>
+ );
+};
+
+export default EnvironmentStatusBadge;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/GitConnectForm.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/GitConnectForm.jsx
new file mode 100644
index 00000000..e544d288
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/GitConnectForm.jsx
@@ -0,0 +1,21 @@
+// WordPress-flavored wrapper over the shared RepoConnectForm: same form, just
+// pre-dressed with the WordPress intro copy and the wp-content tracked-path
+// defaults. The reusable component lives in components/git/RepoConnectForm.jsx.
+import RepoConnectForm from '@/components/git/RepoConnectForm';
+
+const GitConnectForm = (props) => (
+ <RepoConnectForm
+ {...props}
+ idPrefix="wp"
+ intro={{
+ title: 'Connect a Git repository',
+ subtitle: 'Manage themes and plugins for this site with version control — push to deploy.',
+ }}
+ showPaths
+ defaultPaths={['wp-content/themes', 'wp-content/plugins']}
+ pathsLabel="Tracked paths"
+ pathsHint="Paths relative to the WordPress root that should be tracked."
+ />
+);
+
+export default GitConnectForm;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/HealthStatusPanel.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/HealthStatusPanel.jsx
new file mode 100644
index 00000000..1256dc49
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/HealthStatusPanel.jsx
@@ -0,0 +1,137 @@
+import { useState, useEffect, useRef } from 'react';
+import { Activity, RefreshCw, CheckCircle, AlertTriangle, XCircle, HelpCircle } from 'lucide-react';
+import { Spinner } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+
+const STATUS_CONFIG = {
+ healthy: { icon: CheckCircle, color: 'green', label: 'Healthy' },
+ degraded: { icon: AlertTriangle, color: 'yellow', label: 'Degraded' },
+ unhealthy: { icon: XCircle, color: 'red', label: 'Unhealthy' },
+ unknown: { icon: HelpCircle, color: 'gray', label: 'Unknown' },
+};
+
+const HealthDot = ({ status, size = 8 }) => {
+ const colorMap = {
+ healthy: 'var(--green, #3ddc97)',
+ degraded: 'var(--amber, #f5b945)',
+ unhealthy: 'var(--red, #fb6f6f)',
+ unknown: 'var(--text-faint, #646b7a)',
+ };
+
+ return (
+ <span
+ className={`health-dot health-dot-${status}`}
+ style={{
+ width: size,
+ height: size,
+ borderRadius: '50%',
+ display: 'inline-block',
+ backgroundColor: colorMap[status] || colorMap.unknown,
+ }}
+ title={STATUS_CONFIG[status]?.label || 'Unknown'}
+ />
+ );
+};
+
+const HealthStatusPanel = ({ projectId, environments, api, compact = false }) => {
+ const [healthData, setHealthData] = useState({});
+ const [loading, setLoading] = useState(true);
+ const intervalRef = useRef(null);
+
+ useEffect(() => {
+ loadHealth();
+
+ // Auto-refresh every 30 seconds
+ intervalRef.current = setInterval(loadHealth, 30000);
+
+ return () => {
+ if (intervalRef.current) clearInterval(intervalRef.current);
+ };
+ }, [projectId]);
+
+ async function loadHealth() {
+ try {
+ const data = await api.getProjectHealth(projectId);
+ if (data.success) {
+ setHealthData(data.environments || {});
+ }
+ } catch {
+ // Silently fail - health checks are optional
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ if (compact) {
+ return null; // Dots are rendered directly via HealthDot export
+ }
+
+ if (loading) {
+ return (
+ <div className="health-status-panel">
+ <div className="health-panel-loading">
+ <Spinner size="sm" />
+ <span>Checking health...</span>
+ </div>
+ </div>
+ );
+ }
+
+ return (
+ <div className="health-status-panel">
+ <div className="health-panel-header">
+ <h4>
+ <Activity size={16} />
+ Environment Health
+ </h4>
+ <Button variant="ghost" size="sm" onClick={loadHealth}>
+ <RefreshCw size={12} />
+ Refresh
+ </Button>
+ </div>
+
+ <div className="health-panel-grid">
+ {Object.entries(healthData).map(([envId, data]) => {
+ const env = environments?.find(e => String(e.id) === String(envId));
+ const envName = env?.name || `Environment ${envId}`;
+ const overall = data?.overall_status || 'unknown';
+ const checks = data?.checks || {};
+
+ return (
+ <div key={envId} className="health-panel-env">
+ <div className="health-panel-env-header">
+ <HealthDot status={overall} size={10} />
+ <span className="health-panel-env-name">{envName}</span>
+ <span className={`health-panel-overall health-${overall}`}>
+ {STATUS_CONFIG[overall]?.label || 'Unknown'}
+ </span>
+ </div>
+ <div className="health-panel-checks">
+ {Object.entries(checks).map(([checkName, checkData]) => (
+ <div key={checkName} className="health-panel-check">
+ <HealthDot status={checkData.status} size={6} />
+ <span className="health-panel-check-name">
+ {checkName.charAt(0).toUpperCase() + checkName.slice(1)}
+ </span>
+ <span className="health-panel-check-msg">
+ {checkData.message}
+ </span>
+ </div>
+ ))}
+ </div>
+ </div>
+ );
+ })}
+ </div>
+
+ {Object.keys(healthData).length === 0 && (
+ <div className="health-panel-empty">
+ No health data available
+ </div>
+ )}
+ </div>
+ );
+};
+
+export { HealthDot };
+export default HealthStatusPanel;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/PipelineView.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/PipelineView.jsx
new file mode 100644
index 00000000..fe2fe7a7
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/PipelineView.jsx
@@ -0,0 +1,589 @@
+import { useState } from 'react';
+import {
+ ExternalLink, Play, Square, RefreshCw, ArrowRight,
+ ArrowDownLeft, Lock, Unlock, FileText, Trash2, MoreVertical,
+ GitBranch, Plus, GitCompare, Cpu, Shield, Terminal, Clock,
+ HardDrive, Settings
+} from 'lucide-react';
+import EnvironmentStatusBadge from './EnvironmentStatusBadge';
+import { HealthDot } from './HealthStatusPanel';
+import DiskUsageBar from './DiskUsageBar';
+import { Button } from 'serverkit-sdk';
+import { Checkbox } from 'serverkit-sdk';
+import { formatRelativeTime } from 'serverkit-sdk';
+
+const PipelineView = ({
+ pipeline,
+ onPromote,
+ onSync,
+ onStart,
+ onStop,
+ onRestart,
+ onDelete,
+ onLock,
+ onUnlock,
+ onViewLogs,
+ onCreateMultidev,
+ onCompare,
+ onResourceLimits,
+ onBasicAuth,
+ onWpCli,
+ onAutoSync,
+ onHealthCheck,
+ operationInProgress,
+ healthData,
+ diskUsageData,
+ bulkSelected,
+ onBulkToggle,
+}) => {
+ if (!pipeline) return null;
+
+ const { production, environments = [] } = pipeline;
+ const devEnv = environments.find(e => e.environment_type === 'development');
+ const stagingEnv = environments.find(e => e.environment_type === 'staging');
+ const multidevEnvs = environments.filter(e => e.environment_type === 'multidev');
+
+ return (
+ <div className="pipeline-view">
+ <div className="pipeline-row">
+ {/* Development */}
+ {devEnv ? (
+ <PipelineCard
+ env={devEnv}
+ onStart={onStart}
+ onStop={onStop}
+ onRestart={onRestart}
+ onDelete={onDelete}
+ onLock={onLock}
+ onUnlock={onUnlock}
+ onViewLogs={onViewLogs}
+ onResourceLimits={onResourceLimits}
+ onBasicAuth={onBasicAuth}
+ onWpCli={onWpCli}
+ onAutoSync={onAutoSync}
+ onHealthCheck={onHealthCheck}
+ operationInProgress={operationInProgress}
+ healthStatus={healthData?.[devEnv.id]?.overall_status}
+ diskUsage={diskUsageData?.[devEnv.id]?.usage}
+ bulkSelected={bulkSelected?.includes(devEnv.id)}
+ onBulkToggle={onBulkToggle}
+ />
+ ) : (
+ <EmptySlot type="development" />
+ )}
+
+ {/* Arrow: Dev -> Staging (Promote) */}
+ <PipelineArrow
+ label="Promote"
+ direction="forward"
+ disabled={!devEnv || !stagingEnv}
+ onClick={() => devEnv && stagingEnv && onPromote?.(devEnv, stagingEnv)}
+ />
+
+ {/* Staging */}
+ {stagingEnv ? (
+ <PipelineCard
+ env={stagingEnv}
+ onStart={onStart}
+ onStop={onStop}
+ onRestart={onRestart}
+ onDelete={onDelete}
+ onLock={onLock}
+ onUnlock={onUnlock}
+ onViewLogs={onViewLogs}
+ onResourceLimits={onResourceLimits}
+ onBasicAuth={onBasicAuth}
+ onWpCli={onWpCli}
+ onAutoSync={onAutoSync}
+ onHealthCheck={onHealthCheck}
+ operationInProgress={operationInProgress}
+ healthStatus={healthData?.[stagingEnv.id]?.overall_status}
+ diskUsage={diskUsageData?.[stagingEnv.id]?.usage}
+ bulkSelected={bulkSelected?.includes(stagingEnv.id)}
+ onBulkToggle={onBulkToggle}
+ />
+ ) : (
+ <EmptySlot type="staging" />
+ )}
+
+ {/* Arrow: Staging -> Production (Promote) */}
+ <PipelineArrow
+ label="Promote"
+ direction="forward"
+ disabled={!stagingEnv}
+ onClick={() => stagingEnv && production && onPromote?.(stagingEnv, production)}
+ />
+
+ {/* Production */}
+ {production && (
+ <PipelineCard
+ env={production}
+ isProduction
+ onStart={onStart}
+ onStop={onStop}
+ onRestart={onRestart}
+ onLock={onLock}
+ onUnlock={onUnlock}
+ onViewLogs={onViewLogs}
+ onResourceLimits={onResourceLimits}
+ onBasicAuth={onBasicAuth}
+ onWpCli={onWpCli}
+ onHealthCheck={onHealthCheck}
+ operationInProgress={operationInProgress}
+ healthStatus={healthData?.[production.id]?.overall_status}
+ diskUsage={diskUsageData?.[production.id]?.usage}
+ />
+ )}
+ </div>
+
+ {/* Sync arrows (below, reversed) */}
+ <div className="pipeline-sync-row">
+ {devEnv && (
+ <div className="pipeline-sync-action">
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={() => onSync?.(devEnv)}
+ title="Pull production data into development"
+ >
+ <ArrowDownLeft size={14} />
+ Pull from Prod
+ </Button>
+ </div>
+ )}
+ {stagingEnv && (
+ <div className="pipeline-sync-action">
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={() => onSync?.(stagingEnv)}
+ title="Pull production data into staging"
+ >
+ <ArrowDownLeft size={14} />
+ Pull from Prod
+ </Button>
+ </div>
+ )}
+ </div>
+
+ {/* Compare row */}
+ {onCompare && (devEnv || stagingEnv) && production && (
+ <div className="pipeline-compare-row">
+ {devEnv && (
+ <Button
+ variant="ghost"
+ size="sm"
+ className="pipeline-compare-btn"
+ onClick={() => onCompare(devEnv, production)}
+ title="Compare development vs production"
+ >
+ <GitCompare size={14} />
+ Compare vs Prod
+ </Button>
+ )}
+ {stagingEnv && (
+ <Button
+ variant="ghost"
+ size="sm"
+ className="pipeline-compare-btn"
+ onClick={() => onCompare(stagingEnv, production)}
+ title="Compare staging vs production"
+ >
+ <GitCompare size={14} />
+ Compare vs Prod
+ </Button>
+ )}
+ {devEnv && stagingEnv && (
+ <Button
+ variant="ghost"
+ size="sm"
+ className="pipeline-compare-btn"
+ onClick={() => onCompare(devEnv, stagingEnv)}
+ title="Compare development vs staging"
+ >
+ <GitCompare size={14} />
+ Dev vs Staging
+ </Button>
+ )}
+ </div>
+ )}
+
+ {/* Multidev section */}
+ <div className="pipeline-multidev-section">
+ <div className="pipeline-section-header">
+ <h4 className="pipeline-section-title">
+ <GitBranch size={16} />
+ Multidev Environments
+ {multidevEnvs.length > 0 && (
+ <span className="pipeline-section-count">{multidevEnvs.length}</span>
+ )}
+ </h4>
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={onCreateMultidev}
+ >
+ <Plus size={14} />
+ New Multidev
+ </Button>
+ </div>
+ {multidevEnvs.length > 0 ? (
+ <div className="pipeline-multidev-grid">
+ {multidevEnvs.map(env => (
+ <MultidevCard
+ key={env.id}
+ env={env}
+ onStart={onStart}
+ onStop={onStop}
+ onRestart={onRestart}
+ onDelete={onDelete}
+ onPromote={onPromote}
+ onSync={onSync}
+ onLock={onLock}
+ onUnlock={onUnlock}
+ onViewLogs={onViewLogs}
+ devEnv={devEnv}
+ stagingEnv={stagingEnv}
+ production={production}
+ />
+ ))}
+ </div>
+ ) : (
+ <div className="pipeline-multidev-empty">
+ <GitBranch size={24} />
+ <p>No multidev environments yet</p>
+ <span>Create branch-based environments for feature development and testing</span>
+ <Button size="sm" onClick={onCreateMultidev}>
+ <Plus size={14} />
+ Create Multidev
+ </Button>
+ </div>
+ )}
+ </div>
+ </div>
+ );
+};
+
+const PipelineCard = ({
+ env,
+ isProduction = false,
+ onStart,
+ onStop,
+ onRestart,
+ onDelete,
+ onLock,
+ onUnlock,
+ onViewLogs,
+ onResourceLimits,
+ onBasicAuth,
+ onWpCli,
+ onAutoSync,
+ onHealthCheck,
+ operationInProgress,
+ healthStatus,
+ diskUsage,
+ bulkSelected,
+ onBulkToggle,
+}) => {
+ const [showMenu, setShowMenu] = useState(false);
+ const isRunning = env.status === 'running' || env.application?.status === 'running';
+ const envType = env.environment_type || (isProduction ? 'production' : 'development');
+ const domain = env.application?.domains?.[0] || env.url || '';
+
+ return (
+ <div className={`pipeline-card ${isProduction ? 'production' : ''} ${env.is_locked ? 'locked' : ''}`}>
+ <div className="pipeline-card-header">
+ {onBulkToggle && !isProduction && (
+ <Checkbox
+ className="pipeline-card-checkbox"
+ checked={bulkSelected || false}
+ onCheckedChange={() => onBulkToggle(env.id)}
+ />
+ )}
+ <EnvironmentStatusBadge
+ type={envType}
+ status={isRunning ? 'running' : 'stopped'}
+ isLocked={env.is_locked}
+ />
+ {healthStatus && (
+ <HealthDot status={healthStatus} size={8} />
+ )}
+ <div className="pipeline-card-menu-wrapper">
+ <Button
+ variant="ghost"
+ size="sm"
+ className="pipeline-card-menu-btn"
+ onClick={() => setShowMenu(!showMenu)}
+ >
+ <MoreVertical size={14} />
+ </Button>
+ {showMenu && (
+ <div className="pipeline-card-menu" onMouseLeave={() => setShowMenu(false)}>
+ {isRunning ? (
+ <>
+ <button type="button" onClick={() => { onStop?.(env); setShowMenu(false); }}>
+ <Square size={12} /> Stop
+ </button>
+ <button type="button" onClick={() => { onRestart?.(env); setShowMenu(false); }}>
+ <RefreshCw size={12} /> Restart
+ </button>
+ </>
+ ) : (
+ <button type="button" onClick={() => { onStart?.(env); setShowMenu(false); }}>
+ <Play size={12} /> Start
+ </button>
+ )}
+ <button type="button" onClick={() => { onViewLogs?.(env); setShowMenu(false); }}>
+ <FileText size={12} /> Logs
+ </button>
+ <div className="pipeline-card-menu-divider" />
+ <button type="button" onClick={() => { onResourceLimits?.(env); setShowMenu(false); }}>
+ <Cpu size={12} /> Resources
+ </button>
+ <button type="button" onClick={() => { onBasicAuth?.(env); setShowMenu(false); }}>
+ <Shield size={12} /> Basic Auth
+ </button>
+ <button type="button" onClick={() => { onWpCli?.(env); setShowMenu(false); }}>
+ <Terminal size={12} /> WP-CLI
+ </button>
+ {!isProduction && onAutoSync && (
+ <button type="button" onClick={() => { onAutoSync?.(env); setShowMenu(false); }}>
+ <Clock size={12} /> Auto-Sync
+ </button>
+ )}
+ <div className="pipeline-card-menu-divider" />
+ {env.is_locked ? (
+ <button type="button" onClick={() => { onUnlock?.(env); setShowMenu(false); }}>
+ <Unlock size={12} /> Unlock
+ </button>
+ ) : (
+ <button type="button" onClick={() => { onLock?.(env); setShowMenu(false); }}>
+ <Lock size={12} /> Lock
+ </button>
+ )}
+ {!isProduction && (
+ <button type="button" className="danger" onClick={() => { onDelete?.(env); setShowMenu(false); }}>
+ <Trash2 size={12} /> Delete
+ </button>
+ )}
+ </div>
+ )}
+ </div>
+ </div>
+
+ <div className="pipeline-card-body">
+ <h4 className="pipeline-card-name">{env.name}</h4>
+ {domain && (
+ <a
+ href={domain.startsWith('http') ? domain : `https://${domain}`}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="pipeline-card-domain"
+ >
+ {domain}
+ </a>
+ )}
+ <div className="pipeline-card-meta">
+ {env.wp_version && (
+ <span className="pipeline-meta-item">v{env.wp_version}</span>
+ )}
+ {env.last_sync && !isProduction && (
+ <span className="pipeline-meta-item">
+ Synced {formatRelativeTime(env.last_sync)}
+ </span>
+ )}
+ {diskUsage && (
+ <DiskUsageBar usage={diskUsage} compact />
+ )}
+ </div>
+ </div>
+
+ <div className="pipeline-card-footer">
+ {domain && (
+ <a
+ href={domain.startsWith('http') ? domain : `https://${domain}`}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="btn btn-ghost btn-sm"
+ >
+ <ExternalLink size={12} /> Visit
+ </a>
+ )}
+ <Button variant="ghost" size="sm" onClick={() => onViewLogs?.(env)}>
+ <FileText size={12} /> Logs
+ </Button>
+ </div>
+
+ {env.is_locked && env.locked_reason && (
+ <div className="alert alert-warning">
+ <Lock size={10} />
+ <span>{env.locked_reason}</span>
+ </div>
+ )}
+ </div>
+ );
+};
+
+const PipelineArrow = ({ label, direction, disabled, onClick }) => {
+ return (
+ <div className={`pipeline-arrow ${disabled ? 'disabled' : ''}`}>
+ <button type="button"
+ className="pipeline-arrow-btn"
+ onClick={onClick}
+ disabled={disabled}
+ title={disabled ? 'Environment not available' : label}
+ >
+ <ArrowRight size={16} />
+ <span className="pipeline-arrow-label">{label}</span>
+ </button>
+ </div>
+ );
+};
+
+const EmptySlot = ({ type }) => {
+ return (
+ <div className="pipeline-card empty">
+ <div className="pipeline-empty-content">
+ <span className={`wp-env-badge env-${type}`}>
+ {type.toUpperCase()}
+ </span>
+ <p>No {type} environment</p>
+ </div>
+ </div>
+ );
+};
+
+const MultidevCard = ({
+ env, onStart, onStop, onRestart, onDelete, onPromote,
+ onSync, onLock, onUnlock, onViewLogs,
+ devEnv, stagingEnv, production
+}) => {
+ const [showMenu, setShowMenu] = useState(false);
+ const isRunning = env.status === 'running' || env.application?.status === 'running';
+ const domain = env.application?.domains?.[0] || env.url || '';
+
+ const promoteTarget = devEnv || stagingEnv || production;
+
+ return (
+ <div className={`multidev-card ${env.is_locked ? 'locked' : ''}`}>
+ <div className="multidev-card-header">
+ <div className="multidev-card-header-left">
+ <span className="wp-env-badge env-multidev">MULTIDEV</span>
+ <span className={`wp-env-status ${isRunning ? 'running' : 'stopped'}`}>
+ <span className="status-dot" />
+ {isRunning ? 'Running' : 'Stopped'}
+ </span>
+ {env.is_locked && (
+ <Lock size={12} className="multidev-lock-icon" />
+ )}
+ </div>
+ <div className="multidev-card-menu-wrapper">
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={() => setShowMenu(!showMenu)}
+ >
+ <MoreVertical size={14} />
+ </Button>
+ {showMenu && (
+ <div className="pipeline-card-menu" onMouseLeave={() => setShowMenu(false)}>
+ {isRunning ? (
+ <>
+ <button type="button" onClick={() => { onStop?.(env); setShowMenu(false); }}>
+ <Square size={12} /> Stop
+ </button>
+ <button type="button" onClick={() => { onRestart?.(env); setShowMenu(false); }}>
+ <RefreshCw size={12} /> Restart
+ </button>
+ </>
+ ) : (
+ <button type="button" onClick={() => { onStart?.(env); setShowMenu(false); }}>
+ <Play size={12} /> Start
+ </button>
+ )}
+ <button type="button" onClick={() => { onSync?.(env); setShowMenu(false); }}>
+ <ArrowDownLeft size={12} /> Sync from Prod
+ </button>
+ <button type="button" onClick={() => { onViewLogs?.(env); setShowMenu(false); }}>
+ <FileText size={12} /> Logs
+ </button>
+ {env.is_locked ? (
+ <button type="button" onClick={() => { onUnlock?.(env); setShowMenu(false); }}>
+ <Unlock size={12} /> Unlock
+ </button>
+ ) : (
+ <button type="button" onClick={() => { onLock?.(env); setShowMenu(false); }}>
+ <Lock size={12} /> Lock
+ </button>
+ )}
+ <button type="button" className="danger" onClick={() => { onDelete?.(env); setShowMenu(false); }}>
+ <Trash2 size={12} /> Delete
+ </button>
+ </div>
+ )}
+ </div>
+ </div>
+ <div className="multidev-card-body">
+ <h5 className="multidev-card-name">{env.name}</h5>
+ {env.multidev_branch && (
+ <span className="multidev-branch">
+ <GitBranch size={12} />
+ {env.multidev_branch}
+ </span>
+ )}
+ {domain && (
+ <a
+ href={domain.startsWith('http') ? domain : `https://${domain}`}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="multidev-domain"
+ >
+ {domain}
+ </a>
+ )}
+ <div className="multidev-card-meta">
+ {env.created_at && (
+ <span className="multidev-meta-item">
+ Created {formatRelativeTime(env.created_at)}
+ </span>
+ )}
+ </div>
+ </div>
+ <div className="multidev-card-footer">
+ {domain && (
+ <a
+ href={domain.startsWith('http') ? domain : `https://${domain}`}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="btn btn-ghost btn-sm"
+ >
+ <ExternalLink size={12} /> Visit
+ </a>
+ )}
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={() => promoteTarget && onPromote?.(env, promoteTarget)}
+ disabled={!promoteTarget}
+ title={promoteTarget ? `Promote to ${promoteTarget.environment_type || 'production'}` : 'No target environment'}
+ >
+ <ArrowRight size={12} /> Promote
+ </Button>
+ <Button variant="ghost" size="icon" onClick={() => onViewLogs?.(env)}>
+ <FileText size={12} />
+ </Button>
+ <Button variant="destructive" size="icon" onClick={() => onDelete?.(env)}>
+ <Trash2 size={12} />
+ </Button>
+ </div>
+ {env.is_locked && env.locked_reason && (
+ <div className="alert alert-warning">
+ <Lock size={10} />
+ <span>{env.locked_reason}</span>
+ </div>
+ )}
+ </div>
+ );
+};
+
+export default PipelineView;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/PromoteModal.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/PromoteModal.jsx
new file mode 100644
index 00000000..bebaabb3
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/PromoteModal.jsx
@@ -0,0 +1,270 @@
+import { useState, useEffect } from 'react';
+import { ArrowRight, Shield } from 'lucide-react';
+import wordpressApi from '@/services/wordpress';
+import { Spinner } from 'serverkit-sdk';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from 'serverkit-sdk';
+import { Checkbox } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+
+const PromoteModal = ({ sourceEnv, targetEnv, onClose, onPromote }) => {
+ const [promotionType, setPromotionType] = useState('code');
+ const [config, setConfig] = useState({
+ include_plugins: true,
+ include_themes: true,
+ include_mu_plugins: true,
+ include_uploads: false,
+ backup_target_first: true,
+ sanitize: false,
+ sanitization_profile_id: '',
+ exclude_tables: '',
+ truncate_tables: ''
+ });
+ const [loading, setLoading] = useState(false);
+ const [profiles, setProfiles] = useState([]);
+
+ useEffect(() => {
+ loadProfiles();
+ }, []);
+
+ async function loadProfiles() {
+ try {
+ const data = await wordpressApi.getSanitizationProfiles();
+ setProfiles(data.profiles || []);
+ const defaultProfile = (data.profiles || []).find(p => p.is_default);
+ if (defaultProfile) {
+ setConfig(prev => ({ ...prev, sanitization_profile_id: String(defaultProfile.id) }));
+ }
+ } catch {
+ setProfiles([]);
+ }
+ }
+
+ async function handleSubmit(e) {
+ e.preventDefault();
+ setLoading(true);
+ try {
+ const submitConfig = { ...config };
+ if (submitConfig.sanitization_profile_id) {
+ submitConfig.sanitization_profile_id = Number(submitConfig.sanitization_profile_id);
+ } else {
+ delete submitConfig.sanitization_profile_id;
+ }
+ const toList = (s) => (s || '').split(',').map(t => t.trim()).filter(Boolean);
+ submitConfig.exclude_tables = toList(config.exclude_tables);
+ submitConfig.truncate_tables = toList(config.truncate_tables);
+ await onPromote({
+ source_env_id: sourceEnv.id,
+ target_env_id: targetEnv.id,
+ type: promotionType,
+ config: submitConfig
+ });
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ function handleConfigChange(key, value) {
+ setConfig(prev => ({ ...prev, [key]: value }));
+ }
+
+ const sourceType = sourceEnv.environment_type || 'development';
+ const targetType = targetEnv.environment_type || 'staging';
+
+ return (
+ <Modal open={true} onClose={onClose} title="Promote Environment" size="lg">
+ <form onSubmit={handleSubmit}>
+ <div className="promote-direction">
+ <div className={`promote-env-pill ${sourceType}`}>
+ <span className="promote-env-type">{sourceType}</span>
+ <span className="promote-env-name">{sourceEnv.name}</span>
+ </div>
+ <ArrowRight size={20} className="promote-arrow" />
+ <div className={`promote-env-pill ${targetType}`}>
+ <span className="promote-env-type">{targetType}</span>
+ <span className="promote-env-name">{targetEnv.name}</span>
+ </div>
+ </div>
+
+ <div className="form-group">
+ <Label>Promotion Type</Label>
+ <div className="radio-group">
+ <label className="radio-label">
+ <input
+ type="radio"
+ name="promotionType"
+ value="code"
+ checked={promotionType === 'code'}
+ onChange={e => setPromotionType(e.target.value)}
+ />
+ <div className="radio-content">
+ <strong>Code Only</strong>
+ <span>Sync themes, plugins, and mu-plugins via rsync</span>
+ </div>
+ </label>
+ <label className="radio-label">
+ <input
+ type="radio"
+ name="promotionType"
+ value="database"
+ checked={promotionType === 'database'}
+ onChange={e => setPromotionType(e.target.value)}
+ />
+ <div className="radio-content">
+ <strong>Database Only</strong>
+ <span>Export, transform, and import database</span>
+ </div>
+ </label>
+ <label className="radio-label">
+ <input
+ type="radio"
+ name="promotionType"
+ value="full"
+ checked={promotionType === 'full'}
+ onChange={e => setPromotionType(e.target.value)}
+ />
+ <div className="radio-content">
+ <strong>Full (Code + Database)</strong>
+ <span>Complete environment promotion</span>
+ </div>
+ </label>
+ </div>
+ </div>
+
+ {(promotionType === 'code' || promotionType === 'full') && (
+ <div className="form-group">
+ <Label>Code Options</Label>
+ <div className="checkbox-group">
+ <label className="checkbox-label">
+ <Checkbox
+ checked={config.include_plugins}
+ onCheckedChange={v => handleConfigChange('include_plugins', v)}
+ />
+ <span>Include plugins</span>
+ </label>
+ <label className="checkbox-label">
+ <Checkbox
+ checked={config.include_themes}
+ onCheckedChange={v => handleConfigChange('include_themes', v)}
+ />
+ <span>Include themes</span>
+ </label>
+ <label className="checkbox-label">
+ <Checkbox
+ checked={config.include_mu_plugins}
+ onCheckedChange={v => handleConfigChange('include_mu_plugins', v)}
+ />
+ <span>Include mu-plugins</span>
+ </label>
+ <label className="checkbox-label">
+ <Checkbox
+ checked={config.include_uploads}
+ onCheckedChange={v => handleConfigChange('include_uploads', v)}
+ />
+ <span>Include uploads (media files)</span>
+ </label>
+ </div>
+ </div>
+ )}
+
+ {(promotionType === 'database' || promotionType === 'full') && (
+ <>
+ <div className="form-group">
+ <label className="checkbox-label">
+ <Checkbox
+ checked={config.sanitize}
+ onCheckedChange={v => handleConfigChange('sanitize', v)}
+ />
+ <span>Sanitize database during promotion</span>
+ </label>
+ </div>
+
+ {config.sanitize && profiles.length > 0 && (
+ <div className="form-group">
+ <Label>
+ <Shield size={14} style={{ marginRight: 4, verticalAlign: -2 }} />
+ Sanitization Profile
+ </Label>
+ <Select
+ value={config.sanitization_profile_id}
+ onValueChange={v => handleConfigChange('sanitization_profile_id', v)}
+ >
+ <SelectTrigger>
+ <SelectValue placeholder="Manual configuration" />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="">Manual configuration</SelectItem>
+ {profiles.map(p => (
+ <SelectItem key={p.id} value={String(p.id)}>
+ {p.name}{p.is_default ? ' (default)' : ''}{p.is_builtin ? '' : ' (custom)'}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ {config.sanitization_profile_id && (
+ <span className="form-hint">
+ {profiles.find(p => String(p.id) === config.sanitization_profile_id)?.description || ''}
+ </span>
+ )}
+ </div>
+ )}
+
+ <div className="form-group">
+ <Label>Exclude tables (optional)</Label>
+ <Input
+ value={config.exclude_tables}
+ onChange={e => handleConfigChange('exclude_tables', e.target.value)}
+ placeholder="e.g. wp_statistics, wp_actionscheduler_logs"
+ />
+ <span className="form-hint">Comma-separated table names to omit from the promotion entirely.</span>
+ </div>
+ <div className="form-group">
+ <Label>Truncate tables (optional)</Label>
+ <Input
+ value={config.truncate_tables}
+ onChange={e => handleConfigChange('truncate_tables', e.target.value)}
+ placeholder="e.g. wp_sessions, wp_woocommerce_log"
+ />
+ <span className="form-hint">Comma-separated tables to keep but empty (structure promoted, rows dropped).</span>
+ </div>
+ </>
+ )}
+
+ <div className="form-group">
+ <label className="checkbox-label">
+ <Checkbox
+ checked={config.backup_target_first}
+ onCheckedChange={v => handleConfigChange('backup_target_first', v)}
+ />
+ <span>Create snapshot of target before promoting</span>
+ </label>
+ <span className="form-hint">Recommended. Allows rollback if something goes wrong.</span>
+ </div>
+
+ {targetType === 'production' && (
+ <div className="alert alert-warning">
+ <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
+ <path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" />
+ <line x1="12" y1="9" x2="12" y2="13" />
+ <line x1="12" y1="17" x2="12.01" y2="17" />
+ </svg>
+ <span>You are promoting to <strong>production</strong>. This will affect the live site.</span>
+ </div>
+ )}
+
+ <div className="modal-actions">
+ <Button type="button" variant="outline" onClick={onClose} disabled={loading}>
+ Cancel
+ </Button>
+ <Button type="submit" disabled={loading}>
+ {loading ? <><Spinner size="sm" /> Promoting...</> : 'Promote'}
+ </Button>
+ </div>
+ </form>
+ </Modal>
+ );
+};
+
+export default PromoteModal;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/ResourceLimitsModal.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/ResourceLimitsModal.jsx
new file mode 100644
index 00000000..db45e39d
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/ResourceLimitsModal.jsx
@@ -0,0 +1,152 @@
+import { useState } from 'react';
+import { HardDrive, AlertTriangle } from 'lucide-react';
+import { Spinner } from 'serverkit-sdk';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+
+const PRESETS = {
+ low: { memory: '256M', cpus: '0.25', db_memory: '256M', db_cpus: '0.25' },
+ standard: { memory: '512M', cpus: '1.0', db_memory: '384M', db_cpus: '0.5' },
+ high: { memory: '2G', cpus: '2.0', db_memory: '1G', db_cpus: '1.0' },
+};
+
+const MEMORY_OPTIONS = ['256M', '384M', '512M', '768M', '1G', '1.5G', '2G'];
+const CPU_OPTIONS = ['0.25', '0.5', '1.0', '1.5', '2.0'];
+
+const ResourceLimitsModal = ({ environment, currentLimits, onClose, onApply }) => {
+ const [limits, setLimits] = useState({
+ memory: currentLimits?.memory || '512M',
+ cpus: currentLimits?.cpus || '1.0',
+ db_memory: currentLimits?.db_memory || '384M',
+ db_cpus: currentLimits?.db_cpus || '0.5',
+ });
+ const [loading, setLoading] = useState(false);
+
+ function applyPreset(preset) {
+ setLimits({ ...PRESETS[preset] });
+ }
+
+ function handleChange(key, value) {
+ setLimits(prev => ({ ...prev, [key]: value }));
+ }
+
+ async function handleSubmit(e) {
+ e.preventDefault();
+ setLoading(true);
+ try {
+ await onApply(limits);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ const envName = environment?.name || 'Environment';
+
+ return (
+ <Modal open={true} onClose={onClose} title="Resource Limits" className="resource-limits-modal">
+ <form onSubmit={handleSubmit}>
+ <div className="resource-limits-env-name">{envName}</div>
+
+ <div className="resource-limits-presets">
+ <span className="resource-limits-presets-label">Presets:</span>
+ {Object.entries(PRESETS).map(([key]) => (
+ <Button
+ key={key}
+ type="button"
+ variant="ghost"
+ size="sm"
+ className="resource-preset-btn"
+ onClick={() => applyPreset(key)}
+ >
+ {key.charAt(0).toUpperCase() + key.slice(1)}
+ </Button>
+ ))}
+ </div>
+
+ <div className="resource-limits-section">
+ <h4>
+ <HardDrive size={14} />
+ WordPress Container
+ </h4>
+ <div className="resource-limits-row">
+ <Label>Memory</Label>
+ <Select value={limits.memory} onValueChange={v => handleChange('memory', v)}>
+ <SelectTrigger>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {MEMORY_OPTIONS.map(opt => (
+ <SelectItem key={opt} value={opt}>{opt}</SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </div>
+ <div className="resource-limits-row">
+ <Label>CPU Cores</Label>
+ <Select value={limits.cpus} onValueChange={v => handleChange('cpus', v)}>
+ <SelectTrigger>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {CPU_OPTIONS.map(opt => (
+ <SelectItem key={opt} value={opt}>{opt}</SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </div>
+ </div>
+
+ <div className="resource-limits-section">
+ <h4>
+ <HardDrive size={14} />
+ Database Container
+ </h4>
+ <div className="resource-limits-row">
+ <Label>Memory</Label>
+ <Select value={limits.db_memory} onValueChange={v => handleChange('db_memory', v)}>
+ <SelectTrigger>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {MEMORY_OPTIONS.filter((_, i) => i < 5).map(opt => (
+ <SelectItem key={opt} value={opt}>{opt}</SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </div>
+ <div className="resource-limits-row">
+ <Label>CPU Cores</Label>
+ <Select value={limits.db_cpus} onValueChange={v => handleChange('db_cpus', v)}>
+ <SelectTrigger>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {CPU_OPTIONS.filter((_, i) => i < 4).map(opt => (
+ <SelectItem key={opt} value={opt}>{opt}</SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </div>
+ </div>
+
+ <div className="alert alert-warning">
+ <AlertTriangle size={14} />
+ <span>Applying resource limits will restart the environment containers.</span>
+ </div>
+
+ <div className="modal-actions">
+ <Button type="button" variant="outline" onClick={onClose} disabled={loading}>
+ Cancel
+ </Button>
+ <Button type="submit" disabled={loading}>
+ {loading ? <><Spinner size="sm" /> Applying...</> : 'Apply Limits'}
+ </Button>
+ </div>
+ </form>
+ </Modal>
+ );
+};
+
+export default ResourceLimitsModal;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/SanitizationProfileForm.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/SanitizationProfileForm.jsx
new file mode 100644
index 00000000..4d98702c
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/SanitizationProfileForm.jsx
@@ -0,0 +1,327 @@
+import { useState, useEffect } from 'react';
+import { Shield, Plus, Trash2, Star, Edit3, Save } from 'lucide-react';
+import wordpressApi from '@/services/wordpress';
+import { Spinner } from 'serverkit-sdk';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { Checkbox } from 'serverkit-sdk';
+
+const SanitizationProfileForm = ({ onClose, onProfilesChange }) => {
+ const [profiles, setProfiles] = useState([]);
+ const [loading, setLoading] = useState(true);
+ const [editingProfile, setEditingProfile] = useState(null);
+ const [showCreateForm, setShowCreateForm] = useState(false);
+
+ useEffect(() => {
+ loadProfiles();
+ }, []);
+
+ async function loadProfiles() {
+ setLoading(true);
+ try {
+ const data = await wordpressApi.getSanitizationProfiles();
+ setProfiles(data.profiles || []);
+ } catch {
+ setProfiles([]);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ async function handleDelete(profileId) {
+ try {
+ await wordpressApi.deleteSanitizationProfile(profileId);
+ setProfiles(prev => prev.filter(p => p.id !== profileId));
+ onProfilesChange?.();
+ } catch {
+ // handled silently
+ }
+ }
+
+ async function handleSetDefault(profileId) {
+ try {
+ await wordpressApi.updateSanitizationProfile(profileId, { is_default: true });
+ setProfiles(prev => prev.map(p => ({
+ ...p,
+ is_default: p.id === profileId
+ })));
+ onProfilesChange?.();
+ } catch {
+ // handled silently
+ }
+ }
+
+ async function handleSaveProfile(profileData) {
+ try {
+ if (editingProfile) {
+ const result = await wordpressApi.updateSanitizationProfile(
+ editingProfile.id,
+ profileData
+ );
+ setProfiles(prev => prev.map(p =>
+ p.id === editingProfile.id ? result.profile : p
+ ));
+ } else {
+ const result = await wordpressApi.createSanitizationProfile(profileData);
+ setProfiles(prev => [...prev, result.profile]);
+ }
+ setEditingProfile(null);
+ setShowCreateForm(false);
+ onProfilesChange?.();
+ } catch {
+ // handled silently
+ }
+ }
+
+ return (
+ <Modal open={true} onClose={onClose} title="Sanitization Profiles" size="lg">
+ <div className="sanitization-profiles-body">
+ {loading ? (
+ <div className="sanitization-loading">
+ <Spinner size="md" />
+ </div>
+ ) : (
+ <>
+ <div className="sanitization-profile-list">
+ {profiles.map(profile => (
+ <ProfileCard
+ key={profile.id}
+ profile={profile}
+ onEdit={() => { setEditingProfile(profile); setShowCreateForm(false); }}
+ onDelete={() => handleDelete(profile.id)}
+ onSetDefault={() => handleSetDefault(profile.id)}
+ />
+ ))}
+ </div>
+
+ {!showCreateForm && !editingProfile && (
+ <Button
+ size="sm"
+ className="sanitization-add-btn"
+ onClick={() => setShowCreateForm(true)}
+ >
+ <Plus size={14} />
+ Create Custom Profile
+ </Button>
+ )}
+
+ {(showCreateForm || editingProfile) && (
+ <ProfileEditor
+ profile={editingProfile}
+ onSave={handleSaveProfile}
+ onCancel={() => { setEditingProfile(null); setShowCreateForm(false); }}
+ />
+ )}
+ </>
+ )}
+ </div>
+
+ <div className="modal-actions">
+ <Button variant="outline" onClick={onClose}>Close</Button>
+ </div>
+ </Modal>
+ );
+};
+
+const ProfileCard = ({ profile, onEdit, onDelete, onSetDefault }) => (
+ <div className={`sanitization-profile-card ${profile.is_default ? 'default' : ''}`}>
+ <div className="sanitization-profile-card-header">
+ <div className="sanitization-profile-card-title">
+ <h5>{profile.name}</h5>
+ {profile.is_builtin && <span className="sanitization-tag builtin">Built-in</span>}
+ {profile.is_default && <span className="sanitization-tag default">Default</span>}
+ </div>
+ <div className="sanitization-profile-card-actions">
+ {!profile.is_default && (
+ <Button variant="ghost" size="sm" onClick={onSetDefault} title="Set as default">
+ <Star size={12} />
+ </Button>
+ )}
+ <Button variant="ghost" size="sm" onClick={onEdit} title="Edit">
+ <Edit3 size={12} />
+ </Button>
+ {!profile.is_builtin && (
+ <Button variant="ghost" size="sm" onClick={onDelete} title="Delete">
+ <Trash2 size={12} />
+ </Button>
+ )}
+ </div>
+ </div>
+ {profile.description && (
+ <p className="sanitization-profile-desc">{profile.description}</p>
+ )}
+ <div className="sanitization-profile-rules">
+ <ProfileRuleTags config={profile.config} />
+ </div>
+ </div>
+);
+
+const ProfileRuleTags = ({ config }) => {
+ const tags = [];
+ if (config.anonymize_emails) tags.push('Anonymize emails');
+ if (config.anonymize_names) tags.push('Anonymize names');
+ if (config.reset_passwords) tags.push('Reset passwords');
+ if (config.strip_payment_data) tags.push('Strip payments');
+ if (config.remove_transients) tags.push('Clear transients');
+ if (config.truncate_tables?.length > 0) tags.push(`Truncate ${config.truncate_tables.length} tables`);
+ if (config.exclude_tables?.length > 0) tags.push(`Exclude ${config.exclude_tables.length} tables`);
+ if (config.custom_search_replace && Object.keys(config.custom_search_replace).length > 0) {
+ tags.push(`${Object.keys(config.custom_search_replace).length} replacements`);
+ }
+
+ return (
+ <div className="sanitization-rule-tags">
+ {tags.map(tag => (
+ <span key={tag} className="sanitization-rule-tag">{tag}</span>
+ ))}
+ {tags.length === 0 && (
+ <span className="sanitization-rule-tag empty">No rules configured</span>
+ )}
+ </div>
+ );
+};
+
+const ProfileEditor = ({ profile, onSave, onCancel }) => {
+ const [name, setName] = useState(profile?.name || '');
+ const [description, setDescription] = useState(profile?.description || '');
+ const [config, setConfig] = useState(profile?.config || {
+ anonymize_emails: false,
+ anonymize_names: false,
+ reset_passwords: false,
+ truncate_tables: [],
+ exclude_tables: [],
+ strip_payment_data: false,
+ remove_transients: false,
+ custom_search_replace: {},
+ });
+ const [truncateInput, setTruncateInput] = useState(
+ (profile?.config?.truncate_tables || []).join(', ')
+ );
+ const [excludeInput, setExcludeInput] = useState(
+ (profile?.config?.exclude_tables || []).join(', ')
+ );
+ const [saving, setSaving] = useState(false);
+
+ function handleConfigToggle(key) {
+ setConfig(prev => ({ ...prev, [key]: !prev[key] }));
+ }
+
+ async function handleSubmit(e) {
+ e.preventDefault();
+ setSaving(true);
+ try {
+ const finalConfig = {
+ ...config,
+ truncate_tables: truncateInput.split(',').map(s => s.trim()).filter(Boolean),
+ exclude_tables: excludeInput.split(',').map(s => s.trim()).filter(Boolean),
+ };
+ await onSave({ name, description, config: finalConfig });
+ } finally {
+ setSaving(false);
+ }
+ }
+
+ return (
+ <form className="sanitization-editor" onSubmit={handleSubmit}>
+ <h4>{profile ? 'Edit Profile' : 'Create Profile'}</h4>
+
+ <div className="form-group">
+ <Label>Profile Name *</Label>
+ <Input
+ type="text"
+ value={name}
+ onChange={e => setName(e.target.value)}
+ placeholder="My Custom Profile"
+ required
+ disabled={profile?.is_builtin}
+ />
+ </div>
+
+ <div className="form-group">
+ <Label>Description</Label>
+ <Input
+ type="text"
+ value={description}
+ onChange={e => setDescription(e.target.value)}
+ placeholder="What this profile does..."
+ />
+ </div>
+
+ <div className="form-group">
+ <Label>Data Sanitization</Label>
+ <div className="checkbox-group">
+ <label className="checkbox-label">
+ <Checkbox
+ checked={config.anonymize_emails || false}
+ onCheckedChange={() => handleConfigToggle('anonymize_emails')}
+ />
+ <span>Anonymize email addresses</span>
+ </label>
+ <label className="checkbox-label">
+ <Checkbox
+ checked={config.anonymize_names || false}
+ onCheckedChange={() => handleConfigToggle('anonymize_names')}
+ />
+ <span>Anonymize user names</span>
+ </label>
+ <label className="checkbox-label">
+ <Checkbox
+ checked={config.reset_passwords || false}
+ onCheckedChange={() => handleConfigToggle('reset_passwords')}
+ />
+ <span>Reset all passwords</span>
+ </label>
+ <label className="checkbox-label">
+ <Checkbox
+ checked={config.strip_payment_data || false}
+ onCheckedChange={() => handleConfigToggle('strip_payment_data')}
+ />
+ <span>Strip WooCommerce payment data</span>
+ </label>
+ <label className="checkbox-label">
+ <Checkbox
+ checked={config.remove_transients || false}
+ onCheckedChange={() => handleConfigToggle('remove_transients')}
+ />
+ <span>Remove transients</span>
+ </label>
+ </div>
+ </div>
+
+ <div className="form-group">
+ <Label>Truncate Tables (comma-separated)</Label>
+ <Input
+ type="text"
+ value={truncateInput}
+ onChange={e => setTruncateInput(e.target.value)}
+ placeholder="actionscheduler_actions, actionscheduler_logs"
+ />
+ <span className="form-hint">Tables to empty (structure preserved, data removed)</span>
+ </div>
+
+ <div className="form-group">
+ <Label>Exclude Tables (comma-separated)</Label>
+ <Input
+ type="text"
+ value={excludeInput}
+ onChange={e => setExcludeInput(e.target.value)}
+ placeholder="wp_users, wp_usermeta"
+ />
+ <span className="form-hint">Tables to skip during sync/promote</span>
+ </div>
+
+ <div className="sanitization-editor-actions">
+ <Button type="button" variant="outline" size="sm" onClick={onCancel}>
+ Cancel
+ </Button>
+ <Button type="submit" size="sm" disabled={saving || !name.trim()}>
+ {saving ? <><Spinner size="sm" /> Saving...</> : <><Save size={14} /> Save Profile</>}
+ </Button>
+ </div>
+ </form>
+ );
+};
+
+export default SanitizationProfileForm;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/SnapshotTable.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/SnapshotTable.jsx
new file mode 100644
index 00000000..4a046e23
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/SnapshotTable.jsx
@@ -0,0 +1,163 @@
+import { useState } from 'react';
+import { Download, RotateCcw, Trash2, GitCommit, Tag } from 'lucide-react';
+import { ConfirmDialog } from 'serverkit-sdk';
+import { formatBytes } from 'serverkit-sdk';
+import { EmptyState } from 'serverkit-sdk';
+
+const SnapshotTable = ({ snapshots, onRestore, onDelete, loading = false }) => {
+ const [actionLoading, setActionLoading] = useState({});
+ const [confirmRestore, setConfirmRestore] = useState(null);
+ const [confirmDelete, setConfirmDelete] = useState(null);
+
+ function formatDate(dateString) {
+ if (!dateString) return '-';
+ return new Date(dateString).toLocaleString();
+ }
+
+ async function handleRestore(snapshot) {
+ setConfirmRestore(null);
+ setActionLoading(prev => ({ ...prev, [`restore-${snapshot.id}`]: true }));
+ try {
+ await onRestore?.(snapshot.id);
+ } finally {
+ setActionLoading(prev => ({ ...prev, [`restore-${snapshot.id}`]: false }));
+ }
+ }
+
+ async function handleDelete(snapshot) {
+ setConfirmDelete(null);
+ setActionLoading(prev => ({ ...prev, [`delete-${snapshot.id}`]: true }));
+ try {
+ await onDelete?.(snapshot.id);
+ } finally {
+ setActionLoading(prev => ({ ...prev, [`delete-${snapshot.id}`]: false }));
+ }
+ }
+
+ if (loading) {
+ return <EmptyState loading title="Loading snapshots..." />;
+ }
+
+ if (!snapshots || snapshots.length === 0) {
+ return (
+ <div className="empty-state-small">
+ <p>No database snapshots yet.</p>
+ <p className="hint">Create a snapshot to backup your database.</p>
+ </div>
+ );
+ }
+
+ return (
+ <div className="wp-table-card">
+ <table className="sk-dtable wp-snapshot-table">
+ <thead>
+ <tr>
+ <th>Snapshot</th>
+ <th>Size</th>
+ <th>Created</th>
+ <th>Git Context</th>
+ <th className="wp-th-right">Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ {snapshots.map(snapshot => (
+ <tr key={snapshot.id}>
+ <td>
+ <div className="snapshot-name-cell">
+ <span className="snapshot-name">{snapshot.name}</span>
+ {snapshot.tag && (
+ <span className="snapshot-tag">
+ <Tag size={10} /> {snapshot.tag}
+ </span>
+ )}
+ {snapshot.description && (
+ <span className="snapshot-desc">{snapshot.description}</span>
+ )}
+ </div>
+ </td>
+ <td>
+ <span className="mono">{formatBytes(snapshot.size_bytes)}</span>
+ {snapshot.compressed && (
+ <span className="compressed-badge" title="Compressed">gz</span>
+ )}
+ </td>
+ <td><span className="snapshot-date">{formatDate(snapshot.created_at)}</span></td>
+ <td>
+ {snapshot.commit_sha ? (
+ <div className="git-context">
+ <GitCommit size={12} />
+ <span className="mono git-context-sha">{snapshot.commit_sha.substring(0, 7)}</span>
+ {snapshot.commit_message && (
+ <span className="commit-msg" title={snapshot.commit_message}>
+ {snapshot.commit_message.substring(0, 30)}
+ {snapshot.commit_message.length > 30 && '...'}
+ </span>
+ )}
+ </div>
+ ) : (
+ <span className="text-muted">-</span>
+ )}
+ </td>
+ <td className="wp-cell-actions">
+ <button type="button"
+ className="wp-row-action"
+ title="Restore"
+ onClick={() => setConfirmRestore(snapshot)}
+ disabled={actionLoading[`restore-${snapshot.id}`]}
+ >
+ <RotateCcw size={14} />
+ </button>
+ <button type="button"
+ className="wp-row-action wp-row-action--danger"
+ title="Delete"
+ onClick={() => setConfirmDelete(snapshot)}
+ disabled={actionLoading[`delete-${snapshot.id}`]}
+ >
+ <Trash2 size={14} />
+ </button>
+ </td>
+ </tr>
+ ))}
+ </tbody>
+ </table>
+
+ <ConfirmDialog
+ isOpen={!!confirmRestore}
+ title="Restore Database Snapshot"
+ message={`Restore database from "${confirmRestore?.name}"?`}
+ details={
+ <ul>
+ <li><strong>Warning:</strong> This will overwrite your current database</li>
+ <li>Snapshot size: <code>{formatBytes(confirmRestore?.size_bytes)}</code></li>
+ <li>Created: {formatDate(confirmRestore?.created_at)}</li>
+ {confirmRestore?.commit_sha && (
+ <li>Git commit: <code>{confirmRestore.commit_sha.substring(0, 7)}</code></li>
+ )}
+ </ul>
+ }
+ confirmText="Restore Snapshot"
+ variant="warning"
+ onConfirm={() => handleRestore(confirmRestore)}
+ onCancel={() => setConfirmRestore(null)}
+ />
+
+ <ConfirmDialog
+ isOpen={!!confirmDelete}
+ title="Delete Snapshot"
+ message={`Delete snapshot "${confirmDelete?.name}"?`}
+ details={
+ <ul>
+ <li>This snapshot will be permanently deleted</li>
+ <li>This action cannot be undone</li>
+ </ul>
+ }
+ confirmText="Delete Snapshot"
+ variant="danger"
+ onConfirm={() => handleDelete(confirmDelete)}
+ onCancel={() => setConfirmDelete(null)}
+ />
+ </div>
+ );
+};
+
+export default SnapshotTable;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/SyncModal.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/SyncModal.jsx
new file mode 100644
index 00000000..8628ef26
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/SyncModal.jsx
@@ -0,0 +1,221 @@
+import { useState, useEffect } from 'react';
+import { ArrowDownLeft, Shield } from 'lucide-react';
+import wordpressApi from '@/services/wordpress';
+import { Spinner } from 'serverkit-sdk';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from 'serverkit-sdk';
+import { Checkbox } from 'serverkit-sdk';
+
+const SyncModal = ({ environment, productionName, onClose, onSync }) => {
+ const [syncType, setSyncType] = useState('database');
+ const [config, setConfig] = useState({
+ sanitize: false,
+ truncate_tables: '',
+ exclude_tables: '',
+ sanitization_profile_id: ''
+ });
+ const [loading, setLoading] = useState(false);
+ const [profiles, setProfiles] = useState([]);
+
+ useEffect(() => {
+ loadProfiles();
+ }, []);
+
+ async function loadProfiles() {
+ try {
+ const data = await wordpressApi.getSanitizationProfiles();
+ setProfiles(data.profiles || []);
+ const defaultProfile = (data.profiles || []).find(p => p.is_default);
+ if (defaultProfile) {
+ setConfig(prev => ({
+ ...prev,
+ sanitization_profile_id: String(defaultProfile.id),
+ sanitize: true
+ }));
+ }
+ } catch {
+ setProfiles([]);
+ }
+ }
+
+ async function handleSubmit(e) {
+ e.preventDefault();
+ setLoading(true);
+ try {
+ await onSync({
+ type: syncType,
+ sanitize: config.sanitize,
+ sanitization_profile_id: config.sanitization_profile_id
+ ? Number(config.sanitization_profile_id) : null,
+ truncate_tables: config.truncate_tables
+ ? config.truncate_tables.split(',').map(s => s.trim()).filter(Boolean)
+ : [],
+ exclude_tables: config.exclude_tables
+ ? config.exclude_tables.split(',').map(s => s.trim()).filter(Boolean)
+ : []
+ });
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ function handleConfigChange(key, value) {
+ setConfig(prev => ({ ...prev, [key]: value }));
+ }
+
+ const envType = environment.environment_type || 'development';
+
+ return (
+ <Modal open={true} onClose={onClose} title="Sync from Production">
+ <form onSubmit={handleSubmit}>
+ <div className="sync-direction">
+ <div className="promote-env-pill production">
+ <span className="promote-env-type">Production</span>
+ <span className="promote-env-name">{productionName}</span>
+ </div>
+ <ArrowDownLeft size={20} className="promote-arrow" />
+ <div className={`promote-env-pill ${envType}`}>
+ <span className="promote-env-type">{envType}</span>
+ <span className="promote-env-name">{environment.name}</span>
+ </div>
+ </div>
+
+ <div className="form-group">
+ <Label>Sync Type</Label>
+ <div className="radio-group">
+ <label className="radio-label">
+ <input
+ type="radio"
+ name="syncType"
+ value="database"
+ checked={syncType === 'database'}
+ onChange={e => setSyncType(e.target.value)}
+ />
+ <div className="radio-content">
+ <strong>Database Only</strong>
+ <span>Pull production database into this environment</span>
+ </div>
+ </label>
+ <label className="radio-label">
+ <input
+ type="radio"
+ name="syncType"
+ value="files"
+ checked={syncType === 'files'}
+ onChange={e => setSyncType(e.target.value)}
+ />
+ <div className="radio-content">
+ <strong>Files Only</strong>
+ <span>Pull production files (wp-content) into this environment</span>
+ </div>
+ </label>
+ <label className="radio-label">
+ <input
+ type="radio"
+ name="syncType"
+ value="full"
+ checked={syncType === 'full'}
+ onChange={e => setSyncType(e.target.value)}
+ />
+ <div className="radio-content">
+ <strong>Full Sync</strong>
+ <span>Pull both database and files from production</span>
+ </div>
+ </label>
+ </div>
+ </div>
+
+ {(syncType === 'database' || syncType === 'full') && (
+ <>
+ <div className="form-group">
+ <label className="checkbox-label">
+ <Checkbox
+ checked={config.sanitize}
+ onCheckedChange={v => handleConfigChange('sanitize', v)}
+ />
+ <span>Sanitize data (anonymize emails, reset passwords)</span>
+ </label>
+ </div>
+
+ {config.sanitize && profiles.length > 0 && (
+ <div className="form-group">
+ <Label>
+ <Shield size={14} style={{ marginRight: 4, verticalAlign: -2 }} />
+ Sanitization Profile
+ </Label>
+ <Select
+ value={config.sanitization_profile_id}
+ onValueChange={v => handleConfigChange('sanitization_profile_id', v)}
+ >
+ <SelectTrigger>
+ <SelectValue placeholder="Manual configuration" />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="">Manual configuration</SelectItem>
+ {profiles.map(p => (
+ <SelectItem key={p.id} value={String(p.id)}>
+ {p.name}{p.is_default ? ' (default)' : ''}{p.is_builtin ? '' : ' (custom)'}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ {config.sanitization_profile_id && (
+ <span className="form-hint">
+ {profiles.find(p => String(p.id) === config.sanitization_profile_id)?.description || ''}
+ </span>
+ )}
+ </div>
+ )}
+
+ <div className="form-group">
+ <Label>Exclude Tables (comma-separated, optional)</Label>
+ <Input
+ type="text"
+ value={config.exclude_tables}
+ onChange={e => handleConfigChange('exclude_tables', e.target.value)}
+ placeholder="wp_users, wp_usermeta"
+ />
+ <span className="form-hint">Tables to skip during sync</span>
+ </div>
+
+ <div className="form-group">
+ <Label>Truncate Tables (comma-separated, optional)</Label>
+ <Input
+ type="text"
+ value={config.truncate_tables}
+ onChange={e => handleConfigChange('truncate_tables', e.target.value)}
+ placeholder="wp_actionscheduler_actions, wp_actionscheduler_logs"
+ />
+ <span className="form-hint">Tables to empty (structure kept, data removed)</span>
+ </div>
+ </>
+ )}
+
+ <div className="sync-warning">
+ <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
+ <circle cx="12" cy="12" r="10" />
+ <path d="M12 8v4M12 16h.01" />
+ </svg>
+ <div>
+ <strong>This will overwrite data</strong>
+ <p>The current {syncType === 'files' ? 'files' : syncType === 'database' ? 'database' : 'database and files'} in this environment will be replaced with production data. A snapshot will be created before syncing.</p>
+ </div>
+ </div>
+
+ <div className="modal-actions">
+ <Button type="button" variant="outline" onClick={onClose} disabled={loading}>
+ Cancel
+ </Button>
+ <Button type="submit" disabled={loading}>
+ {loading ? <><Spinner size="sm" /> Syncing...</> : 'Sync Now'}
+ </Button>
+ </div>
+ </form>
+ </Modal>
+ );
+};
+
+export default SyncModal;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/WordPressSiteCard.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/WordPressSiteCard.jsx
new file mode 100644
index 00000000..edda8060
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/WordPressSiteCard.jsx
@@ -0,0 +1,154 @@
+import { useState } from 'react';
+import { useNavigate } from 'react-router-dom';
+import { ExternalLink, Settings, Copy, Trash2 } from 'lucide-react';
+import { ConfirmDialog } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+
+const WordPressSiteCard = ({ site, onDelete }) => {
+ const navigate = useNavigate();
+ const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);
+ const isRunning = site.status === 'running';
+
+ function getEnvironmentCount() {
+ return site.environments?.length || 0;
+ }
+
+ function handleVisitSite(e) {
+ e.stopPropagation();
+ if (site.url) {
+ window.open(site.url, '_blank');
+ }
+ }
+
+ function handleOpenDashboard(e) {
+ e.stopPropagation();
+ if (site.url) {
+ window.open(`${site.url}/wp-admin`, '_blank');
+ }
+ }
+
+ function handleManage() {
+ navigate(`/wordpress/${site.id}`);
+ }
+
+ function handleDelete(e) {
+ e.stopPropagation();
+ setShowDeleteConfirm(true);
+ }
+
+ function confirmDelete() {
+ setShowDeleteConfirm(false);
+ onDelete?.(site.id);
+ }
+
+ return (
+ <div className="wp-site-card" onClick={handleManage}>
+ <div className="wp-site-card-header">
+ <div className="wp-site-icon">
+ <svg viewBox="0 0 24 24" width="24" height="24" fill="currentColor">
+ <path d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2zm0 19.542c-5.261 0-9.542-4.281-9.542-9.542S6.739 2.458 12 2.458 21.542 6.739 21.542 12 17.261 21.542 12 21.542z"/>
+ </svg>
+ </div>
+ <div className="wp-site-info">
+ <h3 className="wp-site-name">{site.name}</h3>
+ {site.url && (
+ <span className="wp-site-url">{site.url}</span>
+ )}
+ </div>
+ <span className={`wp-site-status ${isRunning ? 'running' : 'stopped'}`}>
+ <span className="status-dot" />
+ {isRunning ? 'Running' : 'Stopped'}
+ </span>
+ </div>
+
+ <div className="wp-site-card-body">
+ <div className="wp-site-meta">
+ <div className="wp-site-meta-item">
+ <span className="meta-label">Version</span>
+ <span className="meta-value">{site.wp_version || 'Unknown'}</span>
+ </div>
+ <div className="wp-site-meta-item">
+ <span className="meta-label">Environments</span>
+ <span className="meta-value">{getEnvironmentCount() + 1}</span>
+ </div>
+ {site.git_repo_url && (
+ <div className="wp-site-meta-item">
+ <span className="meta-label">Git</span>
+ <span className="meta-value git-connected">Connected</span>
+ </div>
+ )}
+ </div>
+
+ {site.is_production && (
+ <span className="wp-site-badge production">Production</span>
+ )}
+ {!site.is_production && site.production_site_id && (
+ <span className="wp-site-badge development">Development</span>
+ )}
+ </div>
+
+ <div className="wp-site-card-footer">
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={handleVisitSite}
+ disabled={!site.url}
+ title="Visit Site"
+ >
+ <ExternalLink size={14} />
+ Visit
+ </Button>
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={handleOpenDashboard}
+ disabled={!site.url}
+ title="Open Dashboard"
+ >
+ <Settings size={14} />
+ Dashboard
+ </Button>
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={handleManage}
+ title="Manage Site"
+ >
+ <Copy size={14} />
+ Manage
+ </Button>
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={handleDelete}
+ title="Delete Site"
+ className="text-destructive hover:text-destructive"
+ >
+ <Trash2 size={14} />
+ </Button>
+ </div>
+
+ <ConfirmDialog
+ isOpen={showDeleteConfirm}
+ title="Delete WordPress Site"
+ message={`Are you sure you want to delete "${site.name}"? This action cannot be undone.`}
+ details={
+ <ul>
+ <li>All site files will be permanently deleted</li>
+ <li>Database <code>{site.db_name || 'associated database'}</code> will be removed</li>
+ {site.environments?.length > 0 && (
+ <li>{site.environments.length} linked environment(s) will also be deleted</li>
+ )}
+ </ul>
+ }
+ confirmText="Delete Site"
+ variant="danger"
+ requireConfirmation={site.name}
+ onConfirm={confirmDelete}
+ onCancel={() => setShowDeleteConfirm(false)}
+ />
+ </div>
+ );
+};
+
+export default WordPressSiteCard;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/WpCliTerminal.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/WpCliTerminal.jsx
new file mode 100644
index 00000000..0bd0354f
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/WpCliTerminal.jsx
@@ -0,0 +1,192 @@
+import { useState, useRef, useEffect } from 'react';
+import { Play, Clock } from 'lucide-react';
+import { Spinner } from 'serverkit-sdk';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+
+const QUICK_COMMANDS = [
+ { label: 'Plugin List', command: 'wp plugin list --format=table' },
+ { label: 'Cache Flush', command: 'wp cache flush' },
+ { label: 'DB Check', command: 'wp db check' },
+ { label: 'Site URL', command: 'wp option get siteurl' },
+];
+
+const HISTORY_KEY = 'wp_cli_history';
+const MAX_HISTORY = 50;
+
+const WpCliTerminal = ({ environment, prodId, onClose, api }) => {
+ const [command, setCommand] = useState('');
+ const [output, setOutput] = useState([]);
+ const [executing, setExecuting] = useState(false);
+ const [showHistory, setShowHistory] = useState(false);
+ const [historyIndex, setHistoryIndex] = useState(-1);
+
+ const inputRef = useRef(null);
+ const outputRef = useRef(null);
+
+ const history = JSON.parse(localStorage.getItem(HISTORY_KEY) || '[]');
+
+ useEffect(() => {
+ inputRef.current?.focus();
+ }, []);
+
+ useEffect(() => {
+ if (outputRef.current) {
+ outputRef.current.scrollTop = outputRef.current.scrollHeight;
+ }
+ }, [output]);
+
+ function saveToHistory(cmd) {
+ const updated = [cmd, ...history.filter(h => h !== cmd)].slice(0, MAX_HISTORY);
+ localStorage.setItem(HISTORY_KEY, JSON.stringify(updated));
+ }
+
+ async function executeCommand(cmd) {
+ if (!cmd.trim()) return;
+
+ const cmdStr = cmd.trim();
+ setCommand('');
+ setExecuting(true);
+ saveToHistory(cmdStr);
+ setHistoryIndex(-1);
+
+ setOutput(prev => [...prev, { type: 'command', text: cmdStr }]);
+
+ try {
+ const result = await api.executeWpCli(prodId, environment.id, cmdStr);
+ if (result.success) {
+ setOutput(prev => [...prev, { type: 'output', text: result.output || '(no output)' }]);
+ } else {
+ setOutput(prev => [...prev, { type: 'error', text: result.error || 'Command failed' }]);
+ }
+ } catch (err) {
+ setOutput(prev => [...prev, { type: 'error', text: err.message || 'Execution failed' }]);
+ } finally {
+ setExecuting(false);
+ inputRef.current?.focus();
+ }
+ }
+
+ function handleKeyDown(e) {
+ if (e.key === 'Enter' && !executing) {
+ executeCommand(command);
+ } else if (e.key === 'ArrowUp') {
+ e.preventDefault();
+ if (history.length > 0) {
+ const newIndex = Math.min(historyIndex + 1, history.length - 1);
+ setHistoryIndex(newIndex);
+ setCommand(history[newIndex]);
+ }
+ } else if (e.key === 'ArrowDown') {
+ e.preventDefault();
+ if (historyIndex > 0) {
+ const newIndex = historyIndex - 1;
+ setHistoryIndex(newIndex);
+ setCommand(history[newIndex]);
+ } else {
+ setHistoryIndex(-1);
+ setCommand('');
+ }
+ }
+ }
+
+ const envName = environment?.name || 'Environment';
+
+ return (
+ <Modal open={true} onClose={onClose} title={`WP-CLI - ${envName}`} className="wpcli-terminal-modal">
+ <div className="wpcli-quick-actions">
+ {QUICK_COMMANDS.map(qc => (
+ <Button
+ key={qc.command}
+ variant="ghost"
+ size="sm"
+ onClick={() => executeCommand(qc.command)}
+ disabled={executing}
+ >
+ {qc.label}
+ </Button>
+ ))}
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={() => setShowHistory(!showHistory)}
+ title="Command history"
+ >
+ <Clock size={12} />
+ </Button>
+ </div>
+
+ {showHistory && history.length > 0 && (
+ <div className="wpcli-history">
+ {history.slice(0, 10).map((cmd, i) => (
+ <button type="button"
+ key={i}
+ className="wpcli-history-item"
+ onClick={() => {
+ setCommand(cmd);
+ setShowHistory(false);
+ inputRef.current?.focus();
+ }}
+ >
+ <code>{cmd}</code>
+ </button>
+ ))}
+ </div>
+ )}
+
+ <div className="wpcli-output" ref={outputRef}>
+ {output.length === 0 && (
+ <div className="wpcli-output-empty">
+ Enter a WP-CLI command below or use the quick actions above.
+ </div>
+ )}
+ {output.map((entry, i) => (
+ <div key={i} className={`wpcli-output-entry ${entry.type}`}>
+ {entry.type === 'command' && (
+ <div className="wpcli-output-command">
+ <span className="wpcli-prompt">$</span>
+ <code>{entry.text}</code>
+ </div>
+ )}
+ {entry.type === 'output' && (
+ <pre className="wpcli-output-text">{entry.text}</pre>
+ )}
+ {entry.type === 'error' && (
+ <pre className="wpcli-output-error">{entry.text}</pre>
+ )}
+ </div>
+ ))}
+ {executing && (
+ <div className="wpcli-executing">
+ <Spinner size="sm" />
+ <span>Executing...</span>
+ </div>
+ )}
+ </div>
+
+ <div className="wpcli-input-row">
+ <span className="wpcli-prompt">$</span>
+ <Input
+ ref={inputRef}
+ type="text"
+ value={command}
+ onChange={e => setCommand(e.target.value)}
+ onKeyDown={handleKeyDown}
+ placeholder="wp plugin list --format=table"
+ disabled={executing}
+ className="wpcli-input"
+ />
+ <Button
+ size="sm"
+ onClick={() => executeCommand(command)}
+ disabled={executing || !command.trim()}
+ >
+ <Play size={12} />
+ </Button>
+ </div>
+ </Modal>
+ );
+};
+
+export default WpCliTerminal;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/AnalyticsTab.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/AnalyticsTab.jsx
new file mode 100644
index 00000000..6e27835a
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/AnalyticsTab.jsx
@@ -0,0 +1,189 @@
+import React, { useState, useEffect } from 'react';
+import { Link } from 'react-router-dom';
+import { ResponsiveContainer, AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip } from 'recharts';
+import { BarChart3, Globe, HardDrive, AlertTriangle, Activity, FileText, LineChart, ExternalLink } from 'lucide-react';
+import wordpressApi from '@/services/wordpress';
+import { api } from 'serverkit-sdk';
+import { useToast } from 'serverkit-sdk';
+import { MetricCard, SegControl } from 'serverkit-sdk';
+import { SkeletonBoundary } from 'serverkit-sdk';
+import { OverviewGridSkeleton, ANALYTICS_PERIODS } from './wpDetailShared';
+
+// Analytics Tab — per-site traffic + error analytics (#25), parsed on-demand from
+// the apache container access log. PHP fatals, response time, and cache hit ratio
+// are not in the default access log (deferred to #30 / #22-#23).
+const AnalyticsTab = ({ siteId }) => {
+ const toast = useToast();
+ const [data, setData] = useState(null);
+ const [loading, setLoading] = useState(true);
+ const [hours, setHours] = useState(24);
+ // Feature-detect the serverkit-analytics extension so we can point users at
+ // the persistent, privacy-first dashboard when it's installed. The on-demand
+ // access-log view below stays as a complementary, always-available source.
+ const [analyticsExt, setAnalyticsExt] = useState(false);
+
+ useEffect(() => {
+ let alive = true;
+ api.getInstalledPlugins('active')
+ .then((res) => {
+ if (!alive) return;
+ const on = (res?.plugins || []).some(
+ (p) => p.slug === 'serverkit-analytics' && p.status === 'active');
+ setAnalyticsExt(on);
+ })
+ .catch(() => { /* extension absent — silently keep the log view */ });
+ return () => { alive = false; };
+ }, []);
+
+ const load = React.useCallback(async () => {
+ setLoading(true);
+ try {
+ const res = await wordpressApi.getSiteAnalytics(siteId, hours);
+ setData(res);
+ } catch (err) {
+ toast.error(err.message || 'Failed to load analytics');
+ } finally {
+ setLoading(false);
+ }
+ }, [siteId, hours, toast]);
+
+ useEffect(() => { load(); }, [load]);
+
+ if (loading) return <SkeletonBoundary loading skeleton={<OverviewGridSkeleton panels={3} />} />;
+
+ const fmtHour = (iso) => {
+ const d = new Date(iso);
+ return hours <= 24
+ ? d.toLocaleTimeString([], { hour: '2-digit', hour12: false })
+ : d.toLocaleDateString([], { month: 'short', day: 'numeric' });
+ };
+ const clip = (p) => (p && p.length > 48 ? `${p.slice(0, 48)}…` : p);
+ const clipMsg = (m) => (m && m.length > 80 ? `${m.slice(0, 80)}…` : m);
+ const s = data?.status || {};
+ const phpErr = data?.php_errors;
+
+ return (
+ <div className="app-overview-grid">
+ <div className="app-overview-left">
+ {analyticsExt && (
+ <div className="wp-analytics-banner">
+ <LineChart size={16} />
+ <div className="wp-analytics-banner__text">
+ <strong>Analytics is installed.</strong>
+ <span> Add this site there for persistent, cookieless visitor tracking with a full dashboard. The view below is parsed on demand from access logs.</span>
+ </div>
+ <Link to="/analytics/sites" className="wp-analytics-banner__link">
+ Open Analytics <ExternalLink size={13} />
+ </Link>
+ </div>
+ )}
+ <div className="wp-analytics-head">
+ <h3 className="wp-eyebrow">Traffic · {hours <= 24 ? 'last 24 hours' : 'last 7 days'}</h3>
+ <SegControl
+ options={ANALYTICS_PERIODS.map(p => ({ value: p.hours, label: p.label }))}
+ value={hours}
+ onChange={setHours}
+ />
+ </div>
+ {data?.note && <p className="hint">{data.note}</p>}
+ <div className="wp-kpis">
+ <MetricCard icon={<BarChart3 size={16} />} tone="accent" value={(data?.requests ?? 0).toLocaleString()} label="Requests" />
+ <MetricCard icon={<Globe size={16} />} tone="cyan" value={(data?.unique_visitors ?? 0).toLocaleString()} label="Unique visitors" />
+ <MetricCard icon={<HardDrive size={16} />} tone="violet" value={data?.bytes_human || '0 B'} label="Bandwidth" />
+ <MetricCard icon={<AlertTriangle size={16} />} tone={(data?.error_rate ?? 0) > 5 ? 'red' : 'amber'} value={`${data?.error_rate ?? 0}%`} label="Error rate" />
+ <MetricCard icon={<Activity size={16} />} tone="green" value={`${data?.bot_pct ?? 0}%`} label="Bot traffic" />
+ <MetricCard icon={<FileText size={16} />} tone="red" value={(data?.not_found ?? 0).toLocaleString()} label="404s" />
+ </div>
+
+ <div className="app-panel">
+ <div className="app-panel-header">Requests over time</div>
+ <div className="app-panel-body">
+ <ResponsiveContainer width="100%" height={220}>
+ <AreaChart data={data?.series || []} margin={{ top: 8, right: 8, left: -16, bottom: 0 }}>
+ <defs>
+ <linearGradient id="wpReq" x1="0" y1="0" x2="0" y2="1">
+ <stop offset="5%" stopColor="#6d7cff" stopOpacity={0.35} />
+ <stop offset="95%" stopColor="#6d7cff" stopOpacity={0} />
+ </linearGradient>
+ <linearGradient id="wpErr" x1="0" y1="0" x2="0" y2="1">
+ <stop offset="5%" stopColor="#fb6f6f" stopOpacity={0.35} />
+ <stop offset="95%" stopColor="#fb6f6f" stopOpacity={0} />
+ </linearGradient>
+ </defs>
+ <CartesianGrid strokeDasharray="3 3" stroke="#888" strokeOpacity={0.15} />
+ <XAxis dataKey="hour" tickFormatter={fmtHour} tick={{ fontSize: 11, fill: '#888' }} minTickGap={24} axisLine={false} tickLine={false} />
+ <YAxis allowDecimals={false} tick={{ fontSize: 11, fill: '#888' }} width={36} axisLine={false} tickLine={false} />
+ <Tooltip labelFormatter={fmtHour} />
+ <Area type="monotone" dataKey="requests" name="Requests" stroke="#8b93ff" fill="url(#wpReq)" strokeWidth={2} />
+ <Area type="monotone" dataKey="errors" name="Errors" stroke="#fb6f6f" fill="url(#wpErr)" strokeWidth={2} />
+ </AreaChart>
+ </ResponsiveContainer>
+ </div>
+ </div>
+
+ <div className="app-panel">
+ <div className="app-panel-header">Status codes</div>
+ <div className="app-panel-body">
+ <div className="app-info-grid">
+ <div className="app-info-item"><span className="app-info-label">2xx</span><span className="app-info-value">{(s['2xx'] ?? 0).toLocaleString()}</span></div>
+ <div className="app-info-item"><span className="app-info-label">3xx</span><span className="app-info-value">{(s['3xx'] ?? 0).toLocaleString()}</span></div>
+ <div className="app-info-item"><span className="app-info-label">4xx</span><span className="app-info-value">{(s['4xx'] ?? 0).toLocaleString()}</span></div>
+ <div className="app-info-item"><span className="app-info-label">5xx</span><span className="app-info-value">{(s['5xx'] ?? 0).toLocaleString()}</span></div>
+ </div>
+ </div>
+ </div>
+
+ {data?.top_paths?.length > 0 && (
+ <div className="app-panel">
+ <div className="app-panel-header">Top URLs</div>
+ <div className="app-panel-body">
+ <div className="app-info-grid">
+ {data.top_paths.map((row, i) => (
+ <div className="app-info-item" key={i}>
+ <span className="app-info-label" title={row.path}>{clip(row.path)}</span>
+ <span className="app-info-value">{row.count.toLocaleString()}</span>
+ </div>
+ ))}
+ </div>
+ <p className="hint">Read live from the container access log; response-time metrics are not captured by the default log.</p>
+ </div>
+ </div>
+ )}
+
+ {phpErr && (
+ <div className="app-panel">
+ <div className="app-panel-header">PHP errors</div>
+ <div className="app-panel-body">
+ {!phpErr.available ? (
+ <p className="hint">{phpErr.note || 'PHP error logging is off.'}</p>
+ ) : (
+ <>
+ <div className="app-info-grid">
+ <div className="app-info-item"><span className="app-info-label">Fatal</span><span className="app-info-value">{(phpErr.counts?.fatal ?? 0).toLocaleString()}</span></div>
+ <div className="app-info-item"><span className="app-info-label">Warning</span><span className="app-info-value">{(phpErr.counts?.warning ?? 0).toLocaleString()}</span></div>
+ <div className="app-info-item"><span className="app-info-label">Notice</span><span className="app-info-value">{(phpErr.counts?.notice ?? 0).toLocaleString()}</span></div>
+ <div className="app-info-item"><span className="app-info-label">Deprecated</span><span className="app-info-value">{(phpErr.counts?.deprecated ?? 0).toLocaleString()}</span></div>
+ </div>
+ {phpErr.recent?.length > 0 ? (
+ <div className="app-info-grid">
+ {phpErr.recent.map((e, i) => (
+ <div className="app-info-item" key={i}>
+ <span className="app-info-label" title={e.message}>{e.level}: {clipMsg(e.message)}</span>
+ <span className="app-info-value">{e.time}</span>
+ </div>
+ ))}
+ </div>
+ ) : (
+ <p className="hint">{phpErr.note || 'No PHP errors recorded.'}</p>
+ )}
+ </>
+ )}
+ </div>
+ </div>
+ )}
+ </div>
+ </div>
+ );
+};
+
+export default AnalyticsTab;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/BackupsTab.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/BackupsTab.jsx
new file mode 100644
index 00000000..deb1d422
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/BackupsTab.jsx
@@ -0,0 +1,16 @@
+import ProtectionPanel from '@/components/backups/ProtectionPanel';
+
+// Backups Tab
+// Backups tab — now the shared Protection panel (scheduled backups, cost,
+// one-click restore). Renders for both the top-level "Backups" tab and the
+// Settings → Backups section.
+const BackupsTab = ({ siteId, site }) => (
+ <ProtectionPanel
+ targetType="wordpress_site"
+ targetId={siteId}
+ targetName={site?.name}
+ showMaintenanceModeOption
+ />
+);
+
+export default BackupsTab;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/DatabaseTab.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/DatabaseTab.jsx
new file mode 100644
index 00000000..08b70438
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/DatabaseTab.jsx
@@ -0,0 +1,217 @@
+import { useState, useEffect } from 'react';
+import { Database, Plus } from 'lucide-react';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import { SnapshotTable } from '../index';
+import { ErrorState } from '@/components/ErrorBoundary';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { Textarea } from 'serverkit-sdk';
+
+// Database Tab
+const DatabaseTab = ({ siteId, site }) => {
+ const toast = useToast();
+ const [snapshots, setSnapshots] = useState([]);
+ const [loading, setLoading] = useState(true);
+ const [error, setError] = useState(null);
+ const [showCreateModal, setShowCreateModal] = useState(false);
+
+ useEffect(() => {
+ loadSnapshots();
+ }, [siteId]);
+
+ async function loadSnapshots() {
+ setLoading(true);
+ setError(null);
+ try {
+ const data = await wordpressApi.getSnapshots(siteId);
+ setSnapshots(data.snapshots || []);
+ } catch (err) {
+ console.error('Failed to load snapshots:', err);
+ setError(err);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ async function handleCreateSnapshot(data) {
+ toast.info('Creating snapshot...', { duration: 3000 });
+ try {
+ await wordpressApi.createSnapshot(siteId, data);
+ toast.success('Snapshot created successfully');
+ loadSnapshots();
+ setShowCreateModal(false);
+ } catch (err) {
+ toast.error(err.message || 'Failed to create snapshot');
+ }
+ }
+
+ async function handleRestore(snapId) {
+ toast.info('Restoring database... This may take a moment.', { duration: 5000 });
+ try {
+ await wordpressApi.restoreSnapshot(siteId, snapId);
+ toast.success('Database restored from snapshot');
+ } catch (err) {
+ toast.error(err.message || 'Failed to restore snapshot');
+ }
+ }
+
+ async function handleDelete(snapId) {
+ try {
+ await wordpressApi.deleteSnapshot(siteId, snapId);
+ toast.success('Snapshot deleted');
+ loadSnapshots();
+ } catch (err) {
+ toast.error(err.message || 'Failed to delete snapshot');
+ }
+ }
+
+ if (error) {
+ return (
+ <ErrorState
+ title="Failed to load snapshots"
+ error={error}
+ onRetry={loadSnapshots}
+ />
+ );
+ }
+
+ return (
+ <div className="database-tab">
+ {/* Database Connection Info */}
+ <div className="app-panel">
+ <div className="app-panel-header">
+ <Database size={16} />
+ Database Connection
+ </div>
+ <div className="app-panel-body">
+ <div className="app-info-grid">
+ <div className="app-info-item">
+ <span className="app-info-label">Database Name</span>
+ <span className="app-info-value mono">{site?.db_name || 'wordpress'}</span>
+ </div>
+ <div className="app-info-item">
+ <span className="app-info-label">Database User</span>
+ <span className="app-info-value mono">{site?.db_user || 'wordpress'}</span>
+ </div>
+ <div className="app-info-item">
+ <span className="app-info-label">Database Host</span>
+ <span className="app-info-value mono">{site?.db_host || 'db'}</span>
+ </div>
+ <div className="app-info-item">
+ <span className="app-info-label">Table Prefix</span>
+ <span className="app-info-value mono">{site?.db_prefix || 'wp_'}</span>
+ </div>
+ <div className="app-info-item">
+ <span className="app-info-label">Container</span>
+ <span className="app-info-value mono">{site?.compose_project_name ? `${site.compose_project_name}-db` : '-'}</span>
+ </div>
+ <div className="app-info-item">
+ <span className="app-info-label">Engine</span>
+ <span className="app-info-value">MySQL 8.0</span>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ {/* Snapshots */}
+ <div className="section-header mt-6">
+ <h3>Database Snapshots</h3>
+ <Button onClick={() => setShowCreateModal(true)}>
+ <Plus size={14} /> Create Snapshot
+ </Button>
+ </div>
+
+ <SnapshotTable
+ snapshots={snapshots}
+ loading={loading}
+ onRestore={handleRestore}
+ onDelete={handleDelete}
+ />
+
+ {showCreateModal && (
+ <CreateSnapshotModal
+ onClose={() => setShowCreateModal(false)}
+ onCreate={handleCreateSnapshot}
+ />
+ )}
+ </div>
+ );
+};
+
+// Create Snapshot Modal
+const CreateSnapshotModal = ({ onClose, onCreate }) => {
+ const [formData, setFormData] = useState({
+ name: `Snapshot ${new Date().toLocaleDateString()}`,
+ description: '',
+ tag: ''
+ });
+ const [loading, setLoading] = useState(false);
+
+ function handleChange(e) {
+ const { name, value } = e.target;
+ setFormData(prev => ({ ...prev, [name]: value }));
+ }
+
+ async function handleSubmit(e) {
+ e.preventDefault();
+ setLoading(true);
+ try {
+ await onCreate(formData);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ return (
+ <Modal open onClose={onClose} title="Create Snapshot">
+ <form onSubmit={handleSubmit}>
+ <div className="form-group">
+ <Label>Snapshot Name *</Label>
+ <Input
+ type="text"
+ name="name"
+ value={formData.name}
+ onChange={handleChange}
+ required
+ />
+ </div>
+
+ <div className="form-group">
+ <Label>Description</Label>
+ <Textarea
+ name="description"
+ value={formData.description}
+ onChange={handleChange}
+ placeholder="Optional description..."
+ rows={3}
+ />
+ </div>
+
+ <div className="form-group">
+ <Label>Tag</Label>
+ <Input
+ type="text"
+ name="tag"
+ value={formData.tag}
+ onChange={handleChange}
+ placeholder="e.g., v1.0.0, before-update"
+ />
+ </div>
+
+ <div className="modal-actions">
+ <Button type="button" variant="outline" onClick={onClose}>
+ Cancel
+ </Button>
+ <Button type="submit" disabled={loading}>
+ {loading ? 'Creating...' : 'Create Snapshot'}
+ </Button>
+ </div>
+ </form>
+ </Modal>
+ );
+};
+
+export default DatabaseTab;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/EnvironmentsTab.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/EnvironmentsTab.jsx
new file mode 100644
index 00000000..e0e281a4
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/EnvironmentsTab.jsx
@@ -0,0 +1,311 @@
+import { useState, useEffect } from 'react';
+import { Plus } from 'lucide-react';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import { EnvironmentCard } from '../index';
+import { ErrorState } from '@/components/ErrorBoundary';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { SkeletonBoundary } from 'serverkit-sdk';
+import { EnvironmentCardSkeleton } from './wpDetailShared';
+
+// Environments Tab
+const EnvironmentsTab = ({ siteId, site, onUpdate }) => {
+ const toast = useToast();
+ const [environments, setEnvironments] = useState([]);
+ const [loading, setLoading] = useState(true);
+ const [error, setError] = useState(null);
+ const [showCreateModal, setShowCreateModal] = useState(false);
+
+ useEffect(() => {
+ loadEnvironments();
+ }, [siteId]);
+
+ async function loadEnvironments() {
+ setLoading(true);
+ setError(null);
+ try {
+ const data = await wordpressApi.getEnvironments(siteId);
+ setEnvironments(data.environments || []);
+ } catch (err) {
+ console.error('Failed to load environments:', err);
+ setError(err);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ async function handleCreateEnvironment(data) {
+ toast.info('Creating environment... This may take a moment.', { duration: 5000 });
+ try {
+ await wordpressApi.createEnvironment(siteId, data);
+ toast.success('Environment created successfully');
+ loadEnvironments();
+ setShowCreateModal(false);
+ } catch (err) {
+ toast.error(err.message || 'Failed to create environment');
+ }
+ }
+
+ async function handleSync(envId) {
+ toast.info('Syncing from production...', { duration: 3000 });
+ try {
+ await wordpressApi.syncEnvironment(siteId, { environment_id: envId });
+ toast.success('Environment synced from production');
+ loadEnvironments();
+ } catch (err) {
+ toast.error(err.message || 'Failed to sync environment');
+ }
+ }
+
+ async function handleDelete(envId) {
+ toast.info('Deleting environment...', { duration: 2000 });
+ try {
+ await wordpressApi.deleteEnvironment(siteId, envId);
+ toast.success('Environment deleted');
+ loadEnvironments();
+ } catch (err) {
+ toast.error(err.message || 'Failed to delete environment');
+ }
+ }
+
+ if (loading) {
+ return (
+ <SkeletonBoundary loading skeleton={(
+ <div className="environments-tab">
+ <div className="section-header">
+ <div className="skeleton" style={{ width: 120, height: 24 }} />
+ <div className="skeleton" style={{ width: 160, height: 36, borderRadius: 6 }} />
+ </div>
+ <div className="environments-grid">
+ <EnvironmentCardSkeleton />
+ <EnvironmentCardSkeleton />
+ </div>
+ </div>
+ )} />
+ );
+ }
+
+ if (error) {
+ return (
+ <ErrorState
+ title="Failed to load environments"
+ error={error}
+ onRetry={loadEnvironments}
+ />
+ );
+ }
+
+ // Filter out production from the environments list (it's shown separately)
+ const childEnvs = environments.filter(e => e.id !== site.id && !e.is_production);
+ const hasStaging = childEnvs.some(e => e.environment_type === 'staging');
+ const hasDev = childEnvs.some(e => e.environment_type === 'development');
+ const canCreateMore = site.is_production && (!hasStaging || !hasDev);
+
+ return (
+ <div className="environments-tab">
+ <div className="section-header">
+ <h3>Environments</h3>
+ {canCreateMore && (
+ <Button onClick={() => setShowCreateModal(true)}>
+ <Plus size={14} /> Create Environment
+ </Button>
+ )}
+ </div>
+
+ <div className="environments-grid">
+ {/* Production environment (the current site) */}
+ <EnvironmentCard
+ environment={{
+ id: site.id,
+ name: site.name,
+ url: site.url,
+ status: site.status,
+ db_name: site.db_name,
+ type: 'production'
+ }}
+ isProduction={true}
+ />
+
+ {/* Dev/staging environments */}
+ {childEnvs.map(env => (
+ <EnvironmentCard
+ key={env.id}
+ environment={env}
+ productionUrl={site.url}
+ onSync={handleSync}
+ onDelete={handleDelete}
+ />
+ ))}
+
+ {/* Add-environment tile — sits inline next to the existing
+ environments instead of a full-width "empty" block. */}
+ {canCreateMore && (
+ <button
+ type="button"
+ className="wp-env-add-tile"
+ onClick={() => setShowCreateModal(true)}
+ >
+ <span className="wp-env-add-tile__icon"><Plus size={22} /></span>
+ <span className="wp-env-add-tile__title">Create environment</span>
+ <span className="wp-env-add-tile__hint">
+ {childEnvs.length === 0
+ ? 'Spin up a dev or staging copy to test changes safely before deploying to production.'
+ : 'Add another dev or staging copy.'}
+ </span>
+ </button>
+ )}
+ </div>
+
+ {showCreateModal && (
+ <CreateEnvironmentModal
+ onClose={() => setShowCreateModal(false)}
+ onCreate={handleCreateEnvironment}
+ productionDomain={site.url}
+ hasStaging={hasStaging}
+ hasDev={hasDev}
+ />
+ )}
+ </div>
+ );
+};
+
+// Create Environment Modal
+export const CreateEnvironmentModal = ({ onClose, onCreate, productionDomain, hasStaging = false, hasDev = false }) => {
+ // Default to whichever type is still available
+ const defaultType = !hasDev ? 'development' : !hasStaging ? 'staging' : 'development';
+ const [formData, setFormData] = useState({
+ type: defaultType,
+ name: '',
+ domain: '',
+ cloneDb: true,
+ syncSchedule: ''
+ });
+ const [loading, setLoading] = useState(false);
+
+ // Generate suggested domain based on production domain
+ function getSuggestedDomain() {
+ if (!productionDomain) return '';
+ try {
+ const url = new URL(productionDomain);
+ const prefix = formData.type === 'staging' ? 'staging' : 'dev';
+ return `${prefix}.${url.hostname}`;
+ } catch {
+ return '';
+ }
+ }
+
+ const suggestedDomain = getSuggestedDomain();
+ const displayDomain = formData.domain || suggestedDomain;
+
+ function handleChange(e) {
+ const { name, value, type, checked } = e.target;
+ setFormData(prev => ({
+ ...prev,
+ [name]: type === 'checkbox' ? checked : value
+ }));
+ }
+
+ async function handleSubmit(e) {
+ e.preventDefault();
+ setLoading(true);
+ try {
+ await onCreate({
+ type: formData.type,
+ name: formData.name,
+ domain: formData.domain || suggestedDomain,
+ clone_db: formData.cloneDb,
+ sync_schedule: formData.syncSchedule || null
+ });
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ return (
+ <Modal open onClose={onClose} title="Create Environment">
+ <form onSubmit={handleSubmit}>
+ <div className="form-group">
+ <Label>Environment Type</Label>
+ <select name="type" value={formData.type} onChange={handleChange}>
+ {!hasDev && <option value="development">Development</option>}
+ {!hasStaging && <option value="staging">Staging</option>}
+ </select>
+ </div>
+
+ <div className="form-group">
+ <Label>Environment Name *</Label>
+ <Input
+ type="text"
+ name="name"
+ value={formData.name}
+ onChange={handleChange}
+ placeholder="My Site Dev"
+ required
+ />
+ </div>
+
+ <div className="form-group">
+ <Label>Domain</Label>
+ <Input
+ type="text"
+ name="domain"
+ value={formData.domain}
+ onChange={handleChange}
+ placeholder={suggestedDomain || 'dev.example.com'}
+ />
+ {suggestedDomain && !formData.domain && (
+ <span className="form-hint form-hint-domain">
+ Will use: <code>{suggestedDomain}</code>
+ </span>
+ )}
+ {!suggestedDomain && !formData.domain && (
+ <span className="form-hint">Enter a domain or leave empty to auto-generate</span>
+ )}
+ </div>
+
+ {displayDomain && (
+ <div className="env-preview-url">
+ <span className="preview-label">Environment URL:</span>
+ <span className="preview-url">https://{displayDomain}</span>
+ </div>
+ )}
+
+ <div className="form-group">
+ <label className="checkbox-label">
+ <input
+ type="checkbox"
+ name="cloneDb"
+ checked={formData.cloneDb}
+ onChange={handleChange}
+ />
+ <span>Clone production database</span>
+ </label>
+ </div>
+
+ <div className="form-group">
+ <Label>Sync Schedule (optional)</Label>
+ <select name="syncSchedule" value={formData.syncSchedule} onChange={handleChange}>
+ <option value="">No automatic sync</option>
+ <option value="0 3 * * 0">Weekly (Sunday 3am)</option>
+ <option value="0 3 * * *">Daily (3am)</option>
+ </select>
+ <span className="form-hint">Automatically sync database from production</span>
+ </div>
+
+ <div className="modal-actions">
+ <Button type="button" variant="outline" onClick={onClose}>
+ Cancel
+ </Button>
+ <Button type="submit" disabled={loading}>
+ {loading ? 'Creating...' : 'Create Environment'}
+ </Button>
+ </div>
+ </form>
+ </Modal>
+ );
+};
+
+export default EnvironmentsTab;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/GitTab.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/GitTab.jsx
new file mode 100644
index 00000000..d34af5d7
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/GitTab.jsx
@@ -0,0 +1,130 @@
+import { useState, useEffect } from 'react';
+import { RefreshCw } from 'lucide-react';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import { GitConnectForm, CommitList } from '../index';
+import { ErrorState } from '@/components/ErrorBoundary';
+import { Button } from 'serverkit-sdk';
+import { SkeletonBoundary } from 'serverkit-sdk';
+
+// Git Tab
+const GitTab = ({ siteId, site, onUpdate }) => {
+ const toast = useToast();
+ const [gitStatus, setGitStatus] = useState(null);
+ const [commits, setCommits] = useState([]);
+ const [loading, setLoading] = useState(true);
+ const [error, setError] = useState(null);
+
+ useEffect(() => {
+ loadGitData();
+ }, [siteId]);
+
+ async function loadGitData() {
+ setLoading(true);
+ setError(null);
+ try {
+ const statusData = await wordpressApi.getGitStatus(siteId);
+ setGitStatus(statusData);
+
+ if (statusData.connected) {
+ const commitsData = await wordpressApi.getCommits(siteId);
+ setCommits(commitsData.commits || []);
+ }
+ } catch (err) {
+ console.error('Failed to load git data:', err);
+ setError(err);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ async function handleConnect(data) {
+ await wordpressApi.connectRepo(siteId, data);
+ toast.success('Repository connected');
+ loadGitData();
+ onUpdate?.();
+ }
+
+ async function handleDisconnect() {
+ await wordpressApi.disconnectRepo(siteId);
+ toast.success('Repository disconnected');
+ loadGitData();
+ onUpdate?.();
+ }
+
+ async function handleDeploy(data) {
+ try {
+ await wordpressApi.deployCommit(siteId, data);
+ toast.success('Deployment completed');
+ loadGitData();
+ onUpdate?.();
+ } catch (err) {
+ toast.error(err.message || 'Deployment failed');
+ }
+ }
+
+ async function handleCreateDev(data) {
+ try {
+ await wordpressApi.createDevFromCommit(siteId, data);
+ toast.success('Development environment created');
+ } catch (err) {
+ toast.error(err.message || 'Failed to create environment');
+ }
+ }
+
+ if (loading) {
+ return (
+ <SkeletonBoundary loading skeleton={(
+ <div className="git-tab">
+ <div className="git-connect git-connect--card">
+ <div className="skeleton" style={{ width: 200, height: 24, marginBottom: 16 }} />
+ <div className="skeleton" style={{ height: 44, borderRadius: 6, marginBottom: 12 }} />
+ <div className="skeleton" style={{ height: 44, borderRadius: 6, marginBottom: 12 }} />
+ <div className="skeleton" style={{ width: 140, height: 36, borderRadius: 6 }} />
+ </div>
+ </div>
+ )} />
+ );
+ }
+
+ if (error) {
+ return (
+ <ErrorState
+ title="Failed to load Git information"
+ error={error}
+ onRetry={loadGitData}
+ />
+ );
+ }
+
+ return (
+ <div className="git-tab">
+ <GitConnectForm
+ gitStatus={gitStatus}
+ onConnect={handleConnect}
+ onDisconnect={handleDisconnect}
+ />
+
+ {gitStatus?.connected && (
+ <div className="git-commits-section">
+ <div className="section-header">
+ <h3>Recent Commits</h3>
+ <Button variant="outline" size="sm" onClick={loadGitData}>
+ <RefreshCw size={14} /> Refresh
+ </Button>
+ </div>
+
+ <CommitList
+ commits={commits}
+ currentCommit={site.last_deploy_commit}
+ onDeploy={handleDeploy}
+ onCreateDev={handleCreateDev}
+ repoUrl={gitStatus?.repo_url}
+ />
+ </div>
+ )}
+ </div>
+ );
+};
+
+export default GitTab;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/OverviewTab.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/OverviewTab.jsx
new file mode 100644
index 00000000..1ad169ab
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/OverviewTab.jsx
@@ -0,0 +1,400 @@
+import { useState, useEffect } from 'react';
+import { ResponsiveContainer, AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip } from 'recharts';
+import { ExternalLink, Settings, RefreshCw, Plus, Database, Trash2, Replace, ShieldCheck, Zap, Activity, BarChart3, AlertTriangle, HardDrive } from 'lucide-react';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import ActivityFeed from '../ActivityFeed';
+import { MetricCard } from 'serverkit-sdk';
+import { CreateEnvironmentModal } from './EnvironmentsTab';
+import { SearchReplaceModal } from './SettingsTab';
+
+// Overview Tab
+const OverviewTab = ({ site, onUpdate }) => {
+ const toast = useToast();
+ const [creatingSnapshot, setCreatingSnapshot] = useState(false);
+ const [showEnvModal, setShowEnvModal] = useState(false);
+ const [syncingAll, setSyncingAll] = useState(false);
+ const [flushingCache, setFlushingCache] = useState(false);
+ const [hardening, setHardening] = useState(false);
+ const [pageCacheActive, setPageCacheActive] = useState(false);
+ const [togglingPageCache, setTogglingPageCache] = useState(false);
+ const [objectCache, setObjectCache] = useState(null);
+ const [togglingCache, setTogglingCache] = useState(false);
+ const [showSearchReplace, setShowSearchReplace] = useState(false);
+ const [analytics, setAnalytics] = useState(null);
+ const [uptime, setUptime] = useState(null);
+
+ // Overview KPI + traffic data: uptime (status page) + analytics (access log).
+ // Both can be slow or unconfigured, so treat as best-effort (null → "—").
+ useEffect(() => {
+ let cancelled = false;
+ (async () => {
+ const [analyticsRes, statusRes] = await Promise.all([
+ wordpressApi.getSiteAnalytics(site.id, 168).catch(() => null),
+ wordpressApi.getSiteStatusPage(site.id).catch(() => null),
+ ]);
+ if (cancelled) return;
+ setAnalytics(analyticsRes);
+ setUptime(statusRes?.component || null);
+ })();
+ return () => { cancelled = true; };
+ }, [site.id]);
+
+ async function handleQuickSnapshot() {
+ setCreatingSnapshot(true);
+ toast.info('Creating snapshot...', { duration: 2000 });
+ try {
+ await wordpressApi.createSnapshot(site.id, {
+ name: `Quick Snapshot ${new Date().toLocaleDateString()}`,
+ tag: 'quick',
+ description: 'Created from Overview quick action'
+ });
+ toast.success('Snapshot created successfully');
+ } catch (err) {
+ toast.error(err.message || 'Failed to create snapshot');
+ } finally {
+ setCreatingSnapshot(false);
+ }
+ }
+
+ async function handleSyncAll() {
+ if (!site.environments?.length) return;
+ setSyncingAll(true);
+ toast.info(`Syncing ${site.environments.length} environment(s)...`, { duration: 3000 });
+ try {
+ // Sync each environment sequentially
+ for (let i = 0; i < site.environments.length; i++) {
+ const env = site.environments[i];
+ await wordpressApi.syncEnvironment(site.id, { environment_id: env.id });
+ }
+ toast.success(`Synced ${site.environments.length} environment(s) from production`);
+ onUpdate?.();
+ } catch (err) {
+ toast.error(err.message || 'Failed to sync environments');
+ } finally {
+ setSyncingAll(false);
+ }
+ }
+
+ async function handleCreateEnvironment(data) {
+ toast.info('Creating environment... This may take a moment.', { duration: 5000 });
+ try {
+ await wordpressApi.createEnvironment(site.id, data);
+ toast.success('Environment created successfully');
+ setShowEnvModal(false);
+ onUpdate?.();
+ } catch (err) {
+ toast.error(err.message || 'Failed to create environment');
+ }
+ }
+
+ useEffect(() => {
+ let active = true;
+ wordpressApi.getPageCache(site.id)
+ .then(r => { if (active) setPageCacheActive(Boolean(r?.active)); })
+ .catch(() => { /* best-effort; control just shows Enable */ });
+ wordpressApi.getObjectCacheStatus(site.id)
+ .then(s => { if (active) setObjectCache(s); })
+ .catch(() => {});
+ return () => { active = false; };
+ }, [site.id]);
+
+ async function handleTogglePageCache() {
+ setTogglingPageCache(true);
+ const enabling = !pageCacheActive;
+ toast.info(enabling ? 'Enabling page cache...' : 'Disabling page cache...', { duration: 4000 });
+ try {
+ const res = enabling
+ ? await wordpressApi.enablePageCache(site.id)
+ : await wordpressApi.disablePageCache(site.id);
+ if (res.success === false) {
+ toast.error(res.error || 'Page cache change failed');
+ } else {
+ toast.success(res.message || (enabling ? 'Page cache enabled' : 'Page cache disabled'));
+ setPageCacheActive(enabling);
+ }
+ } catch (err) {
+ toast.error(err.message || 'Page cache change failed');
+ } finally {
+ setTogglingPageCache(false);
+ }
+ }
+
+ async function handleToggleObjectCache() {
+ setTogglingCache(true);
+ const enabling = !objectCache?.enabled;
+ toast.info(enabling ? 'Enabling Redis object cache...' : 'Disabling object cache...', { duration: 4000 });
+ try {
+ const res = enabling
+ ? await wordpressApi.enableObjectCache(site.id)
+ : await wordpressApi.disableObjectCache(site.id);
+ if (res.success === false) {
+ toast.error(res.error || 'Object cache change failed');
+ } else {
+ toast.success(res.message || (enabling ? 'Object cache enabled' : 'Object cache disabled'));
+ const fresh = await wordpressApi.getObjectCacheStatus(site.id).catch(() => null);
+ if (fresh) setObjectCache(fresh);
+ }
+ } catch (err) {
+ toast.error(err.message || 'Object cache change failed');
+ } finally {
+ setTogglingCache(false);
+ }
+ }
+
+ async function handleFlushCache() {
+ setFlushingCache(true);
+ toast.info('Flushing cache...', { duration: 2000 });
+ try {
+ const res = await wordpressApi.flushCache(site.id);
+ toast.success(res.message || 'Cache flushed');
+ } catch (err) {
+ toast.error(err.message || 'Failed to flush cache');
+ } finally {
+ setFlushingCache(false);
+ }
+ }
+
+ async function handleHarden() {
+ if (!window.confirm('Apply security hardening? This disables file editing, the XML-RPC endpoint, forces SSL on wp-admin, tightens file permissions, and regenerates security keys (logs users out).')) {
+ return;
+ }
+ setHardening(true);
+ toast.info('Applying security hardening...', { duration: 4000 });
+ try {
+ const res = await wordpressApi.harden(site.id);
+ toast.success(res.message || 'Security hardening applied');
+ } catch (err) {
+ toast.error(err.message || 'Failed to harden site');
+ } finally {
+ setHardening(false);
+ }
+ }
+
+ async function handleSearchReplace(data) {
+ // data = { search, replace, dry_run }
+ toast.info(data.dry_run ? 'Running search-replace preview...' : 'Running search-replace...', { duration: 3000 });
+ try {
+ const res = await wordpressApi.searchReplace(site.id, data);
+ if (res.success === false) {
+ toast.error(res.error || res.message || 'Search-replace failed');
+ return;
+ }
+ toast.success(data.dry_run ? 'Dry run complete - no changes written' : 'Search-replace complete');
+ if (!data.dry_run) setShowSearchReplace(false);
+ } catch (err) {
+ toast.error(err.message || 'Search-replace failed');
+ }
+ }
+
+ // ---- Overview KPI + Site-info derivations (real data, honest fallbacks) ----
+ const compactNum = (n) => {
+ if (n == null) return '—';
+ if (n >= 1e6) return `${(n / 1e6).toFixed(1)}M`;
+ if (n >= 1e3) return `${(n / 1e3).toFixed(1)}k`;
+ return `${n}`;
+ };
+ const [diskVal, diskUnit] = (site.disk_usage_human || '').split(' ');
+ const trafficSeries = analytics?.series || [];
+ const fmtTrafficTick = (iso) => new Date(iso).toLocaleDateString([], { month: 'short', day: 'numeric' });
+
+ return (
+ <div className="wp-overview">
+ {/* KPI row — deliberately NON-redundant: status + version already live
+ in the page header, so the tiles surface uptime, traffic, error
+ rate, and storage instead. */}
+ <div className="wp-kpis">
+ <MetricCard
+ tone="green"
+ icon={<Activity size={16} />}
+ value={uptime?.uptime_30d != null ? uptime.uptime_30d.toFixed(2) : '—'}
+ unit={uptime?.uptime_30d != null ? '%' : undefined}
+ label="Uptime (30d)"
+ />
+ <MetricCard
+ tone="accent"
+ icon={<BarChart3 size={16} />}
+ value={analytics ? compactNum(analytics.unique_visitors ?? 0) : '—'}
+ label="Visitors (7d)"
+ />
+ <MetricCard
+ tone={(analytics?.error_rate ?? 0) > 5 ? 'red' : 'amber'}
+ icon={<AlertTriangle size={16} />}
+ value={analytics ? `${analytics.error_rate ?? 0}` : '—'}
+ unit={analytics ? '%' : undefined}
+ label="Error rate (7d)"
+ />
+ <MetricCard
+ tone="cyan"
+ icon={<HardDrive size={16} />}
+ value={diskVal || '—'}
+ unit={diskUnit || undefined}
+ label="Disk used"
+ />
+ </div>
+
+ <div className="wp-overview-main">
+ <div className="app-panel">
+ <div className="app-panel-header">Quick Actions</div>
+ <div className="app-panel-body">
+ <div className="quick-actions-grid">
+ {site.url && (
+ <>
+ <a
+ href={site.url}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="quick-action-btn"
+ >
+ <ExternalLink size={16} />
+ Visit Site
+ </a>
+ <a
+ href={`${site.url}/wp-admin`}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="quick-action-btn"
+ >
+ <Settings size={16} />
+ WP Admin
+ </a>
+ </>
+ )}
+ {site.is_production && (site.environments || []).length < 2 && (
+ <button type="button"
+ className="quick-action-btn"
+ onClick={() => setShowEnvModal(true)}
+ >
+ <Plus size={16} />
+ Create Environment
+ </button>
+ )}
+ <button type="button"
+ className="quick-action-btn"
+ onClick={handleQuickSnapshot}
+ disabled={creatingSnapshot}
+ >
+ <Database size={16} />
+ {creatingSnapshot ? 'Creating...' : 'Create Snapshot'}
+ </button>
+ {site.environments?.length > 0 && (
+ <button type="button"
+ className="quick-action-btn"
+ onClick={handleSyncAll}
+ disabled={syncingAll}
+ >
+ <RefreshCw size={16} className={syncingAll ? 'spinning' : ''} />
+ {syncingAll ? 'Syncing...' : 'Sync All Envs'}
+ </button>
+ )}
+ <button type="button"
+ className="quick-action-btn"
+ onClick={handleFlushCache}
+ disabled={flushingCache}
+ >
+ <Trash2 size={16} />
+ {flushingCache ? 'Flushing...' : 'Purge Cache'}
+ </button>
+ <button type="button"
+ className="quick-action-btn"
+ onClick={handleTogglePageCache}
+ disabled={togglingPageCache}
+ title={pageCacheActive ? 'Full-page cache is active' : 'Enable a full-page cache for this site'}
+ >
+ <Zap size={16} />
+ {togglingPageCache
+ ? 'Working...'
+ : (pageCacheActive ? 'Page Cache: On' : 'Enable Page Cache')}
+ </button>
+ <button type="button"
+ className="quick-action-btn"
+ onClick={() => setShowSearchReplace(true)}
+ >
+ <Replace size={16} />
+ Search &amp; Replace
+ </button>
+ <button type="button"
+ className="quick-action-btn"
+ onClick={handleHarden}
+ disabled={hardening}
+ >
+ <ShieldCheck size={16} />
+ {hardening ? 'Hardening...' : 'Harden'}
+ </button>
+ <button type="button"
+ className="quick-action-btn"
+ onClick={handleToggleObjectCache}
+ disabled={togglingCache}
+ title={objectCache?.enabled ? 'Redis object cache is active' : 'Enable a Redis object cache for this site'}
+ >
+ <Database size={16} />
+ {togglingCache
+ ? (objectCache?.enabled ? 'Disabling...' : 'Enabling...')
+ : (objectCache?.enabled ? 'Object Cache: On' : 'Enable Object Cache')}
+ </button>
+ </div>
+ </div>
+ </div>
+
+ <div className="app-panel wp-traffic-panel">
+ <div className="app-panel-header">
+ Traffic
+ <span className="wp-panel-sub">Last 7 days · unique visits</span>
+ </div>
+ <div className="app-panel-body">
+ {trafficSeries.length > 0 ? (
+ <ResponsiveContainer width="100%" height={250}>
+ <AreaChart data={trafficSeries} margin={{ top: 8, right: 8, left: 0, bottom: 0 }}>
+ <defs>
+ <linearGradient id="wpOvVisits" x1="0" y1="0" x2="0" y2="1">
+ <stop offset="5%" stopColor="#6d7cff" stopOpacity={0.35} />
+ <stop offset="95%" stopColor="#6d7cff" stopOpacity={0} />
+ </linearGradient>
+ </defs>
+ <CartesianGrid strokeDasharray="3 3" stroke="#888" strokeOpacity={0.15} />
+ <XAxis dataKey="hour" tickFormatter={fmtTrafficTick} tick={{ fontSize: 11, fill: '#888' }} minTickGap={28} axisLine={false} tickLine={false} />
+ <YAxis allowDecimals={false} tickFormatter={(v) => (v >= 1000 ? `${(v / 1000).toFixed(0)}k` : `${v}`)} tick={{ fontSize: 11, fill: '#888' }} width={34} axisLine={false} tickLine={false} />
+ <Tooltip labelFormatter={fmtTrafficTick} />
+ <Area type="monotone" dataKey="requests" name="Visits" stroke="#8b93ff" fill="url(#wpOvVisits)" strokeWidth={2} />
+ </AreaChart>
+ </ResponsiveContainer>
+ ) : (
+ <p className="hint">No traffic recorded for this period yet — it&apos;s parsed from the site&apos;s access log.</p>
+ )}
+ </div>
+ </div>
+ </div>
+
+ <div className="app-panel wp-activity-panel">
+ <div className="app-panel-header">Recent activity</div>
+ <div className="app-panel-body">
+ <ActivityFeed projectId={site.id} limit={6} />
+ </div>
+ </div>
+
+ {showEnvModal && (() => {
+ const envs = site.environments || [];
+ const modalHasStaging = envs.some(e => e.environment_type === 'staging');
+ const modalHasDev = envs.some(e => e.environment_type === 'development');
+ return (
+ <CreateEnvironmentModal
+ onClose={() => setShowEnvModal(false)}
+ onCreate={handleCreateEnvironment}
+ productionDomain={site.url}
+ hasStaging={modalHasStaging}
+ hasDev={modalHasDev}
+ />
+ );
+ })()}
+
+ {showSearchReplace && (
+ <SearchReplaceModal
+ onClose={() => setShowSearchReplace(false)}
+ onSubmit={handleSearchReplace}
+ />
+ )}
+ </div>
+ );
+};
+
+export default OverviewTab;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/PhpTab.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/PhpTab.jsx
new file mode 100644
index 00000000..10fb0785
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/PhpTab.jsx
@@ -0,0 +1,161 @@
+import React, { useState, useEffect } from 'react';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { SkeletonBoundary } from 'serverkit-sdk';
+import { OverviewGridSkeleton, PHP_LIMIT_LABELS } from './wpDetailShared';
+
+// PHP Tab — live PHP version + ini limits for the Docker (apache/mod_php) site.
+// Version is the image tag; switching recreates the container (volumes persist).
+// Limits are written as a durable conf.d drop-in (bind-mounted), editable below.
+const PhpTab = ({ siteId }) => {
+ const toast = useToast();
+ const [php, setPhp] = useState(null);
+ const [loading, setLoading] = useState(true);
+ const [switching, setSwitching] = useState(false);
+ const [form, setForm] = useState({});
+ const [saving, setSaving] = useState(false);
+
+ const load = React.useCallback(async () => {
+ setLoading(true);
+ try {
+ const data = await wordpressApi.getPhpInfo(siteId);
+ const info = data.php || data;
+ setPhp(info);
+ // Seed the edit form from live values for the editable directives.
+ const lim = info?.limits || {};
+ const seed = {};
+ (info?.editable_limits || []).forEach(k => { seed[k] = lim[k] || ''; });
+ setForm(seed);
+ } catch (err) {
+ toast.error(err.message || 'Failed to load PHP info');
+ } finally {
+ setLoading(false);
+ }
+ }, [siteId, toast]);
+
+ useEffect(() => { load(); }, [load]);
+
+ async function handleSwitch(version) {
+ if (!window.confirm(`Switch this site to PHP ${version}? This pulls the wordpress:php${version}-apache image and recreates the container (brief downtime; database and files are preserved).`)) return;
+ setSwitching(true);
+ toast.info(`Switching to PHP ${version}...`, { duration: 4000 });
+ try {
+ const res = await wordpressApi.setPhpVersion(siteId, version);
+ if (res.success === false) { toast.error(res.error || 'Failed to switch PHP version'); return; }
+ toast.success(res.message || `Switched to PHP ${version}`);
+ await load();
+ } catch (err) {
+ toast.error(err.message || 'Failed to switch PHP version');
+ } finally {
+ setSwitching(false);
+ }
+ }
+
+ async function handleSaveLimits() {
+ // Send only the directives that changed from the live value (partial update).
+ const live = php?.limits || {};
+ const changed = {};
+ Object.entries(form).forEach(([k, v]) => {
+ const val = (v ?? '').toString().trim();
+ if (val && val !== (live[k] || '')) changed[k] = val;
+ });
+ if (Object.keys(changed).length === 0) { toast.info('No changes to save'); return; }
+ if (!window.confirm('Apply these PHP limits? The container reloads (brief downtime; database and files are preserved).')) return;
+ setSaving(true);
+ try {
+ const res = await wordpressApi.setPhpLimits(siteId, changed);
+ if (res.success === false) { toast.error(res.error || 'Failed to update PHP limits'); return; }
+ toast.success(res.message || 'PHP limits updated');
+ await load();
+ } catch (err) {
+ toast.error(err.message || 'Failed to update PHP limits');
+ } finally {
+ setSaving(false);
+ }
+ }
+
+ if (loading) return <SkeletonBoundary loading skeleton={<OverviewGridSkeleton panels={2} />} />;
+
+ const limits = php?.limits || {};
+ const current = php?.php_version || 'Unknown';
+ const versions = php?.available_versions || [];
+ const editableKeys = php?.editable_limits || [];
+
+ return (
+ <div className="app-overview-grid">
+ <div className="app-overview-left">
+ <div className="app-panel">
+ <div className="app-panel-header">PHP</div>
+ <div className="app-panel-body">
+ <div className="app-info-grid">
+ <div className="app-info-item">
+ <span className="app-info-label">PHP Version</span>
+ <span className="app-info-value">{current}</span>
+ </div>
+ <div className="app-info-item">
+ <span className="app-info-label">Memory Limit</span>
+ <span className="app-info-value">{limits.memory_limit || '-'}</span>
+ </div>
+ <div className="app-info-item">
+ <span className="app-info-label">Upload Max Filesize</span>
+ <span className="app-info-value">{limits.upload_max_filesize || '-'}</span>
+ </div>
+ <div className="app-info-item">
+ <span className="app-info-label">Post Max Size</span>
+ <span className="app-info-value">{limits.post_max_size || '-'}</span>
+ </div>
+ <div className="app-info-item">
+ <span className="app-info-label">Max Execution Time</span>
+ <span className="app-info-value">{limits.max_execution_time || '-'}</span>
+ </div>
+ <div className="app-info-item">
+ <span className="app-info-label">Max Input Time</span>
+ <span className="app-info-value">{limits.max_input_time || '-'}</span>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ {versions.length > 0 && (
+ <div className="app-panel">
+ <div className="app-panel-header">Change PHP Version</div>
+ <div className="app-panel-body">
+ <p className="hint">Switching rebuilds the container from the official wordpress php-apache image. The database and uploaded files are preserved.</p>
+ <div className="app-detail-actions">
+ {versions.map(v => (
+ <Button key={v} variant="outline" size="sm" disabled={switching || current.startsWith(v)} onClick={() => handleSwitch(v)}>
+ {current.startsWith(v) ? `PHP ${v} (current)` : `PHP ${v}`}
+ </Button>
+ ))}
+ </div>
+ </div>
+ </div>
+ )}
+
+ {editableKeys.length > 0 && (
+ <div className="app-panel">
+ <div className="app-panel-header">Edit PHP Limits</div>
+ <div className="app-panel-body">
+ <p className="hint">Saved as a durable conf.d drop-in bind-mounted into the container, so limits survive a container recreate. Saving reloads the container (brief downtime).</p>
+ {editableKeys.map(k => (
+ <div className="form-group" key={k}>
+ <Label>{PHP_LIMIT_LABELS[k] || k}</Label>
+ <Input value={form[k] ?? ''} placeholder={limits[k] || ''} disabled={saving}
+ onChange={e => setForm(f => ({ ...f, [k]: e.target.value }))} />
+ </div>
+ ))}
+ <div className="app-detail-actions">
+ <Button size="sm" onClick={handleSaveLimits} disabled={saving}>{saving ? 'Saving…' : 'Save limits'}</Button>
+ </div>
+ </div>
+ </div>
+ )}
+ </div>
+ </div>
+ );
+};
+
+export default PhpTab;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/PluginsTab.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/PluginsTab.jsx
new file mode 100644
index 00000000..aec9ba50
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/PluginsTab.jsx
@@ -0,0 +1,255 @@
+import { useState, useEffect } from 'react';
+import { Package, Download } from 'lucide-react';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import { ErrorState } from '@/components/ErrorBoundary';
+import { EmptyState } from 'serverkit-sdk';
+import { ServiceTile } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Switch } from 'serverkit-sdk';
+import { SkeletonBoundary } from 'serverkit-sdk';
+import { ListItemSkeleton } from './wpDetailShared';
+
+// Plugins Tab
+const PluginsTab = ({ siteId }) => {
+ const toast = useToast();
+ const [plugins, setPlugins] = useState([]);
+ const [loading, setLoading] = useState(true);
+ const [error, setError] = useState(null);
+ const [installing, setInstalling] = useState(false);
+ const [updating, setUpdating] = useState(null); // plugin name being updated, or 'all'
+ const [newPlugin, setNewPlugin] = useState('');
+ const [toggling, setToggling] = useState(null); // plugin name being activated/deactivated
+ // Map of slug -> managed metadata (installed/library version, update_available).
+ const [managed, setManaged] = useState({});
+
+ useEffect(() => {
+ loadPlugins();
+ }, [siteId]);
+
+ async function loadPlugins() {
+ setLoading(true);
+ setError(null);
+ try {
+ const data = await wordpressApi.getPlugins(siteId);
+ setPlugins(data.plugins || []);
+ loadManaged();
+ } catch (err) {
+ console.error('Failed to load plugins:', err);
+ setError(err);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ // Which installed plugins are library-managed. Best-effort: a scan first so the
+ // mapping reflects the live site, then read it back keyed by slug.
+ async function loadManaged() {
+ try {
+ await wordpressApi.scanManagedPlugins(siteId);
+ const data = await wordpressApi.getManagedPlugins(siteId);
+ const map = {};
+ (data.managed || []).forEach(m => { map[m.slug] = m; });
+ setManaged(map);
+ } catch {
+ // Library layer is optional — never block the plugins list on it.
+ setManaged({});
+ }
+ }
+
+ async function handleLibraryUpdate(slug) {
+ const m = managed[slug];
+ if (!m) return;
+ setUpdating(slug);
+ toast.info(`Updating ${slug} from library…`, { duration: 4000 });
+ try {
+ const res = await wordpressApi.installLibraryPluginOnSite(m.plugin_id, siteId, m.status === 'active');
+ if (res.success === false) { toast.error(res.error || 'Library update failed'); return; }
+ toast.success(`${slug} updated to library version`);
+ loadPlugins();
+ } catch (err) {
+ toast.error(err.message || 'Library update failed');
+ } finally {
+ setUpdating(null);
+ }
+ }
+
+ async function handleInstall(e) {
+ e.preventDefault();
+ if (!newPlugin.trim()) return;
+
+ setInstalling(true);
+ try {
+ await wordpressApi.installPlugin(siteId, { slug: newPlugin.trim() });
+ toast.success('Plugin installed successfully');
+ setNewPlugin('');
+ loadPlugins();
+ } catch (err) {
+ toast.error(err.message || 'Failed to install plugin');
+ } finally {
+ setInstalling(false);
+ }
+ }
+
+ async function handleUpdate(pluginName) {
+ setUpdating(pluginName || 'all');
+ toast.info(pluginName ? `Updating ${pluginName}...` : 'Updating all plugins...', { duration: 4000 });
+ try {
+ const res = await wordpressApi.updatePlugins(siteId, pluginName ? [pluginName] : undefined);
+ if (res.success === false) {
+ toast.error(res.error || 'Plugin update failed');
+ return;
+ }
+ toast.success(res.message || 'Plugins updated');
+ loadPlugins();
+ } catch (err) {
+ toast.error(err.message || 'Plugin update failed');
+ } finally {
+ setUpdating(null);
+ }
+ }
+
+ async function handleToggle(plugin) {
+ const activating = plugin.status !== 'active';
+ setToggling(plugin.name);
+ try {
+ const res = activating
+ ? await wordpressApi.activatePlugin(siteId, plugin.name)
+ : await wordpressApi.deactivatePlugin(siteId, plugin.name);
+ if (res && res.success === false) {
+ toast.error(res.error || `Failed to ${activating ? 'activate' : 'deactivate'} ${plugin.name}`);
+ return;
+ }
+ toast.success(`${plugin.title || plugin.name} ${activating ? 'activated' : 'deactivated'}`);
+ loadPlugins();
+ } catch (err) {
+ toast.error(err.message || `Failed to ${activating ? 'activate' : 'deactivate'} plugin`);
+ } finally {
+ setToggling(null);
+ }
+ }
+
+ if (loading) {
+ return (
+ <SkeletonBoundary loading skeleton={(
+ <div className="plugins-tab">
+ <div className="section-header">
+ <div className="skeleton" style={{ width: 80, height: 24 }} />
+ </div>
+ <div className="skeleton" style={{ height: 44, borderRadius: 6, marginBottom: 16 }} />
+ <div className="plugins-list">
+ <ListItemSkeleton />
+ <ListItemSkeleton />
+ <ListItemSkeleton />
+ </div>
+ </div>
+ )} />
+ );
+ }
+
+ if (error) {
+ return (
+ <ErrorState
+ title="Failed to load plugins"
+ error={error}
+ onRetry={loadPlugins}
+ />
+ );
+ }
+
+ return (
+ <div className="plugins-tab">
+ <div className="section-header">
+ <h3>Plugins</h3>
+ </div>
+
+ <form className="install-form" onSubmit={handleInstall}>
+ <Input
+ type="text"
+ value={newPlugin}
+ onChange={(e) => setNewPlugin(e.target.value)}
+ placeholder="Plugin slug (e.g., akismet, woocommerce)"
+ />
+ <Button type="submit" disabled={installing}>
+ {installing ? 'Installing...' : 'Install Plugin'}
+ </Button>
+ </form>
+
+ {plugins.some(p => p.update === 'available') && (
+ <div className="bulk-update-bar">
+ <span>{plugins.filter(p => p.update === 'available').length} plugin update(s) available</span>
+ <Button
+ variant="outline"
+ size="sm"
+ onClick={() => handleUpdate(null)}
+ disabled={updating !== null}
+ >
+ {updating === 'all' ? 'Updating...' : 'Update all'}
+ </Button>
+ </div>
+ )}
+
+ {plugins.length === 0 ? (
+ <EmptyState icon={Package} title="No plugins installed" description="Install a plugin by entering its slug above." />
+ ) : (
+ <div className="wp-asset-grid">
+ {plugins.map(plugin => {
+ const isActive = plugin.status === 'active';
+ const mgd = managed[plugin.name];
+ return (
+ <div className={`wp-asset-card ${isActive ? 'is-active' : ''}`} key={plugin.name}>
+ <ServiceTile name={plugin.title || plugin.name} size={42} />
+ <div className="wp-asset-card__body">
+ <div className="wp-asset-card__name">
+ {plugin.title || plugin.name}
+ {mgd && <span className="wp-managed-pill">Managed</span>}
+ </div>
+ <div className="wp-asset-card__sub">{plugin.name}</div>
+ <div className="wp-asset-card__foot">
+ <span className="wp-asset-card__ver">v{plugin.version}</span>
+ {mgd && mgd.update_available ? (
+ <button
+ type="button"
+ className="wp-update-flag wp-update-flag--library"
+ onClick={() => handleLibraryUpdate(plugin.name)}
+ disabled={updating !== null}
+ title={`Library has v${mgd.library_version}`}
+ >
+ <Download size={11} />
+ {updating === plugin.name ? 'Updating…' : `Update from library ${mgd.library_version}`}
+ </button>
+ ) : plugin.update === 'available' && (
+ <button
+ type="button"
+ className="wp-update-flag"
+ onClick={() => handleUpdate(plugin.name)}
+ disabled={updating !== null}
+ >
+ <Download size={11} />
+ {updating === plugin.name ? 'Updating…' : `Update${plugin.update_version ? ` ${plugin.update_version}` : ''}`}
+ </button>
+ )}
+ </div>
+ </div>
+ <div className="wp-asset-card__toggle">
+ <Switch
+ checked={isActive}
+ disabled={toggling === plugin.name}
+ onCheckedChange={() => handleToggle(plugin)}
+ aria-label={isActive ? `Deactivate ${plugin.name}` : `Activate ${plugin.name}`}
+ />
+ <span className={`wp-asset-card__state ${isActive ? 'is-on' : ''}`}>
+ {isActive ? 'Active' : 'Inactive'}
+ </span>
+ </div>
+ </div>
+ );
+ })}
+ </div>
+ )}
+ </div>
+ );
+};
+
+export default PluginsTab;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/ReportsTab.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/ReportsTab.jsx
new file mode 100644
index 00000000..4e2b329f
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/ReportsTab.jsx
@@ -0,0 +1,361 @@
+import React, { useState, useEffect } from 'react';
+import { ResponsiveContainer, AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip } from 'recharts';
+import { Printer, Download, Trash2 } from 'lucide-react';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import { useConfirm } from 'serverkit-sdk';
+import { Pill } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { SkeletonBoundary } from 'serverkit-sdk';
+import { OverviewGridSkeleton } from './wpDetailShared';
+
+// Reports Tab — monthly client reports (#33 agency slice). Aggregates the
+// per-site signals that already accrue (uptime/incidents #26, update runs #29,
+// backups, vulnerability posture #28) into a persisted, printable monthly report.
+const ReportsTab = ({ siteId }) => {
+ const toast = useToast();
+ const { confirm } = useConfirm();
+ const [reports, setReports] = useState([]);
+ const [selectedId, setSelectedId] = useState(null);
+ const [loading, setLoading] = useState(true);
+ const [busy, setBusy] = useState(false);
+
+ // Last 12 months (current first) as {value:'YYYY-MM', label, year, month}.
+ const monthOptions = React.useMemo(() => {
+ const opts = [];
+ const d = new Date();
+ d.setDate(1);
+ for (let i = 0; i < 12; i++) {
+ const year = d.getFullYear();
+ const month = d.getMonth() + 1;
+ opts.push({
+ value: `${year}-${String(month).padStart(2, '0')}`,
+ label: d.toLocaleString([], { month: 'long', year: 'numeric' }),
+ year, month,
+ });
+ d.setMonth(d.getMonth() - 1);
+ }
+ return opts;
+ }, []);
+ const [genMonth, setGenMonth] = useState(monthOptions[0].value);
+
+ const load = React.useCallback(async (preferLabel) => {
+ try {
+ const res = await wordpressApi.getReports(siteId);
+ const list = res.reports || [];
+ setReports(list);
+ setSelectedId(prev => {
+ if (preferLabel) {
+ const match = list.find(r => r.period_label === preferLabel);
+ if (match) return match.id;
+ }
+ if (prev && list.some(r => r.id === prev)) return prev;
+ return list.length ? list[0].id : null;
+ });
+ } catch (err) {
+ toast.error(err.message || 'Failed to load reports');
+ } finally {
+ setLoading(false);
+ }
+ }, [siteId, toast]);
+
+ useEffect(() => { load(); }, [load]);
+
+ async function handleGenerate() {
+ const opt = monthOptions.find(o => o.value === genMonth) || monthOptions[0];
+ setBusy(true);
+ try {
+ // The API client throws on a non-2xx (e.g. the future-month guard's 400),
+ // so a resolved call means success; failures surface via catch.
+ await wordpressApi.generateReport(siteId, { year: opt.year, month: opt.month });
+ toast.success(`Report generated for ${opt.label}`);
+ await load(opt.value);
+ } catch (err) {
+ toast.error(err.message || 'Failed to generate report');
+ } finally {
+ setBusy(false);
+ }
+ }
+
+ async function handleDelete(report) {
+ const ok = await confirm({
+ title: 'Delete report',
+ message: `Delete the report for ${report.data?.period?.month_name || report.period_label}? This cannot be undone.`,
+ confirmText: 'Delete',
+ variant: 'danger',
+ });
+ if (!ok) return;
+ try {
+ await wordpressApi.deleteReport(siteId, report.id);
+ toast.success('Report deleted');
+ await load();
+ } catch (err) {
+ toast.error(err.message || 'Failed to delete report');
+ }
+ }
+
+ function handleDownload(report) {
+ const blob = new Blob([JSON.stringify(report.data, null, 2)], { type: 'application/json' });
+ const url = URL.createObjectURL(blob);
+ const a = document.createElement('a');
+ a.href = url;
+ a.download = `wp-report-${siteId}-${report.period_label}.json`;
+ a.click();
+ URL.revokeObjectURL(url);
+ }
+
+ function handlePrint() {
+ document.body.classList.add('wp-report-printing');
+ // Clean up on whichever signal fires first: `afterprint` (most engines) or
+ // the window regaining focus when the dialog closes (fallback for webviews
+ // that don't dispatch afterprint). cleanup is idempotent.
+ const cleanup = () => {
+ document.body.classList.remove('wp-report-printing');
+ window.removeEventListener('afterprint', cleanup);
+ window.removeEventListener('focus', cleanup);
+ };
+ window.addEventListener('afterprint', cleanup);
+ window.addEventListener('focus', cleanup, { once: true });
+ window.print();
+ }
+
+ if (loading) return <SkeletonBoundary loading skeleton={<OverviewGridSkeleton panels={2} />} />;
+
+ const selected = reports.find(r => r.id === selectedId) || null;
+
+ return (
+ <div className="app-overview-grid">
+ <div className="app-overview-left">
+ <div className="app-panel wp-report-no-print">
+ <div className="app-panel-header">Generate monthly report</div>
+ <div className="app-panel-body">
+ <p className="hint">Snapshots this site&apos;s uptime, incidents, update runs, backups, and current security posture for a calendar month into a printable client report.</p>
+ <div className="app-detail-actions">
+ <select value={genMonth} onChange={e => setGenMonth(e.target.value)} disabled={busy}>
+ {monthOptions.map(o => <option key={o.value} value={o.value}>{o.label}</option>)}
+ </select>
+ <Button size="sm" onClick={handleGenerate} disabled={busy}>
+ {busy ? 'Generating…' : 'Generate'}
+ </Button>
+ </div>
+ {reports.length > 0 && (
+ <div className="app-detail-actions wp-report-month-list">
+ {reports.map(r => (
+ <Button
+ key={r.id}
+ variant={r.id === selectedId ? 'default' : 'outline'}
+ size="sm"
+ onClick={() => setSelectedId(r.id)}
+ >
+ {r.data?.period?.month_name || r.period_label}
+ </Button>
+ ))}
+ </div>
+ )}
+ </div>
+ </div>
+
+ {!selected ? (
+ <div className="app-panel wp-report-no-print">
+ <div className="app-panel-body">
+ <p className="hint">No reports yet — pick a month above and click Generate.</p>
+ </div>
+ </div>
+ ) : (
+ <ReportView report={selected} onPrint={handlePrint} onDownload={() => handleDownload(selected)} onDelete={() => handleDelete(selected)} />
+ )}
+ </div>
+ </div>
+ );
+};
+
+// The printable rendering of a single monthly report. Wrapped in
+// .wp-report-printable so the print stylesheet can isolate it from the app chrome.
+const ReportView = ({ report, onPrint, onDownload, onDelete }) => {
+ const d = report.data || {};
+ const period = d.period || {};
+ const site = d.site || {};
+ const uptime = d.uptime || {};
+ const updates = d.updates || {};
+ const backups = d.backups || {};
+ const vulns = d.vulnerabilities || {};
+ const health = d.health || {};
+ const sev = vulns.by_severity || {};
+ const sevTone = (s) => ({ critical: 'red', high: 'red', medium: 'amber', low: 'cyan' }[s] || 'gray');
+ const impactTone = (i) => ({ critical: 'red', major: 'red', minor: 'amber' }[i] || 'gray');
+ const fmt = (iso) => (iso ? new Date(iso).toLocaleString() : '—');
+ const fmtDay = (key) => {
+ if (!key) return '';
+ const parts = key.split('-');
+ return parts.length === 3 ? Number(parts[2]).toString() : key;
+ };
+ const dailyHasData = (d.uptime_daily || []).some(x => x.percent !== null);
+
+ return (
+ <div className="wp-report-printable">
+ <div className="app-panel">
+ <div className="app-panel-header">
+ Report — {period.month_name || report.period_label}
+ <span className="wp-report-actions wp-report-no-print">
+ <Button variant="outline" size="sm" onClick={onPrint}><Printer size={14} /> Print</Button>
+ <Button variant="outline" size="sm" onClick={onDownload}><Download size={14} /> JSON</Button>
+ <Button variant="outline" size="sm" onClick={onDelete}><Trash2 size={14} /> Delete</Button>
+ </span>
+ </div>
+ <div className="app-panel-body">
+ <div className="app-info-grid">
+ <div className="app-info-item"><span className="app-info-label">Site</span><span className="app-info-value">{site.name || '—'}</span></div>
+ {site.client && <div className="app-info-item"><span className="app-info-label">Client</span><span className="app-info-value">{site.client}</span></div>}
+ <div className="app-info-item"><span className="app-info-label">URL</span><span className="app-info-value">{site.url ? <a href={site.url} target="_blank" rel="noopener noreferrer">{site.url}</a> : '—'}</span></div>
+ <div className="app-info-item"><span className="app-info-label">WordPress</span><span className="app-info-value">{site.wp_version || '—'}{site.multisite ? ' · multisite' : ''}</span></div>
+ <div className="app-info-item"><span className="app-info-label">Generated</span><span className="app-info-value">{fmt(d.generated_at)}</span></div>
+ </div>
+ </div>
+ </div>
+
+ <div className="app-panel">
+ <div className="app-panel-header">Summary</div>
+ <div className="app-panel-body">
+ <div className="app-info-grid">
+ <div className="app-info-item"><span className="app-info-label">Uptime</span><span className="app-info-value">{uptime.percent !== null && uptime.percent !== undefined ? `${uptime.percent}%` : 'N/A'}</span></div>
+ <div className="app-info-item"><span className="app-info-label">Incidents</span><span className="app-info-value">{d.incident_count ?? 0}</span></div>
+ <div className="app-info-item"><span className="app-info-label">Update runs</span><span className="app-info-value">{updates.total_runs ?? 0}</span></div>
+ <div className="app-info-item"><span className="app-info-label">Components updated</span><span className="app-info-value">{updates.components_updated ?? 0}</span></div>
+ <div className="app-info-item"><span className="app-info-label">Backups</span><span className="app-info-value">{backups.count ?? 0}{backups.count ? ` · ${backups.total_bytes_human}` : ''}</span></div>
+ <div className="app-info-item"><span className="app-info-label">Open vulnerabilities</span><span className="app-info-value">{vulns.total ?? 0}</span></div>
+ <div className="app-info-item"><span className="app-info-label">Current health</span><span className="app-info-value">{health.status || 'unknown'}</span></div>
+ <div className="app-info-item"><span className="app-info-label">Disk usage</span><span className="app-info-value">{health.disk_usage_human || '—'}</span></div>
+ </div>
+ {(updates.rolled_back > 0 || updates.failed > 0) && (
+ <div className="app-detail-actions">
+ {updates.completed > 0 && <Pill kind="green">{updates.completed} completed</Pill>}
+ {updates.rolled_back > 0 && <Pill kind="amber">{updates.rolled_back} rolled back</Pill>}
+ {updates.failed > 0 && <Pill kind="red">{updates.failed} failed</Pill>}
+ </div>
+ )}
+ </div>
+ </div>
+
+ {uptime.bound && dailyHasData && (
+ <div className="app-panel">
+ <div className="app-panel-header">Daily uptime</div>
+ <div className="app-panel-body">
+ <ResponsiveContainer width="100%" height={200}>
+ <AreaChart data={d.uptime_daily || []} margin={{ top: 8, right: 8, left: -16, bottom: 0 }}>
+ <defs>
+ <linearGradient id="wpUptime" x1="0" y1="0" x2="0" y2="1">
+ <stop offset="5%" stopColor="#3ddc97" stopOpacity={0.35} />
+ <stop offset="95%" stopColor="#3ddc97" stopOpacity={0} />
+ </linearGradient>
+ </defs>
+ <CartesianGrid strokeDasharray="3 3" stroke="#888" strokeOpacity={0.15} />
+ <XAxis dataKey="date" tickFormatter={fmtDay} tick={{ fontSize: 11, fill: '#888' }} minTickGap={16} axisLine={false} tickLine={false} />
+ <YAxis domain={[0, 100]} tick={{ fontSize: 11, fill: '#888' }} width={36} axisLine={false} tickLine={false} />
+ <Tooltip formatter={(v) => (v === null ? 'no data' : `${v}%`)} />
+ <Area connectNulls type="monotone" dataKey="percent" name="Uptime %" stroke="#3ddc97" fill="url(#wpUptime)" strokeWidth={2} />
+ </AreaChart>
+ </ResponsiveContainer>
+ <p className="hint">Uptime recomputed from recorded health-check samples ({uptime.samples} this month). Rolling 30-day: {uptime.rolling_30d ?? '—'}%.</p>
+ </div>
+ </div>
+ )}
+
+ {(d.incidents || []).length > 0 && (
+ <div className="app-panel">
+ <div className="app-panel-header">Incidents</div>
+ <div className="app-panel-body">
+ {d.incidents.map(inc => (
+ <div className="wp-run-row" key={inc.id}>
+ <div className="wp-run-row-head">
+ <Pill kind={impactTone(inc.impact)}>{inc.impact}</Pill>
+ <strong>{inc.title}</strong>
+ </div>
+ <span className="form-hint">
+ {fmt(inc.created_at)} → {inc.ongoing ? 'ongoing' : fmt(inc.resolved_at)} · {inc.duration_minutes} min · {inc.status}
+ </span>
+ </div>
+ ))}
+ </div>
+ </div>
+ )}
+
+ {(updates.runs || []).length > 0 && (
+ <div className="app-panel">
+ <div className="app-panel-header">Update runs</div>
+ <div className="app-panel-body">
+ {updates.runs.map(r => {
+ const n = (r.updated || []).length;
+ const kind = ({ completed: 'green', rolled_back: 'amber', failed: 'red', running: 'cyan' }[r.status] || 'gray');
+ return (
+ <div className="wp-run-row" key={r.id}>
+ <div className="wp-run-row-head">
+ <Pill kind={kind}>{r.status.replace('_', ' ')}</Pill>
+ <span className="wp-run-row-meta">{fmt(r.started_at)} · {r.trigger}</span>
+ </div>
+ <span className="form-hint">
+ {n === 0 ? 'No components needed updating' : `${n} component${n === 1 ? '' : 's'} updated`}
+ {r.rolled_back ? ' · auto-rolled back' : ''}
+ {r.error ? ` · ${r.error}` : ''}
+ </span>
+ </div>
+ );
+ })}
+ </div>
+ </div>
+ )}
+
+ {(backups.snapshots || []).length > 0 && (
+ <div className="app-panel">
+ <div className="app-panel-header">Backups</div>
+ <div className="app-panel-body">
+ {backups.snapshots.map(s => (
+ <div className="app-info-item" key={s.id}>
+ <span className="app-info-label">{fmt(s.created_at)}{s.tag ? ` · ${s.tag}` : ''}</span>
+ <span className="app-info-value">{s.size_human} · {s.status}</span>
+ </div>
+ ))}
+ </div>
+ </div>
+ )}
+
+ <div className="app-panel">
+ <div className="app-panel-header">Security posture {vulns.as_of ? `(as of ${fmt(vulns.as_of)})` : ''}</div>
+ <div className="app-panel-body">
+ {vulns.total > 0 ? (
+ <>
+ <div className="app-detail-actions">
+ {sev.critical > 0 && <Pill kind="red">{sev.critical} critical</Pill>}
+ {sev.high > 0 && <Pill kind="red">{sev.high} high</Pill>}
+ {sev.medium > 0 && <Pill kind="amber">{sev.medium} medium</Pill>}
+ {sev.low > 0 && <Pill kind="cyan">{sev.low} low</Pill>}
+ {sev.unknown > 0 && <Pill kind="gray">{sev.unknown} unrated</Pill>}
+ </div>
+ {(vulns.items || []).map((v, i) => (
+ <div className="wp-run-row" key={i}>
+ <div className="wp-run-row-head"><Pill kind={sevTone(v.severity)}>{v.severity}</Pill><strong>{v.name}</strong></div>
+ <span className="form-hint">
+ {v.source}{v.slug ? ` · ${v.slug}` : ''} · installed {v.installed_version}
+ {v.fixed_in ? ` · fixed in ${v.fixed_in}` : ' · no fix yet'}
+ {v.advisory_id ? ` · ${v.advisory_id}` : ''}
+ </span>
+ </div>
+ ))}
+ </>
+ ) : (
+ <p className="hint">{vulns.as_of ? 'No known vulnerabilities at last scan.' : 'No vulnerability scan has run for this site yet.'}</p>
+ )}
+ </div>
+ </div>
+
+ {(d.notes || []).length > 0 && (
+ <div className="app-panel">
+ <div className="app-panel-body">
+ {d.notes.map((n, i) => <p className="hint" key={i}>{n}</p>)}
+ </div>
+ </div>
+ )}
+ </div>
+ );
+};
+
+export default ReportsTab;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/SecurityTab.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/SecurityTab.jsx
new file mode 100644
index 00000000..dea63841
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/SecurityTab.jsx
@@ -0,0 +1,249 @@
+import React, { useState, useEffect } from 'react';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import { Pill, ScoreGauge } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { SkeletonBoundary } from 'serverkit-sdk';
+import { OverviewGridSkeleton } from './wpDetailShared';
+
+// Security Tab — per-site security depth (#30): file-integrity verification,
+// WP_DEBUG toggle, and WP-Cron management, all via the Docker-aware WP-CLI bridge.
+const SecurityTab = ({ siteId }) => {
+ const toast = useToast();
+ const [integrity, setIntegrity] = useState(null);
+ const [debug, setDebug] = useState(null);
+ const [cron, setCron] = useState(null);
+ const [vulns, setVulns] = useState(null);
+ const [brute, setBrute] = useState(null);
+ const [loading, setLoading] = useState(true);
+ const [busy, setBusy] = useState(false);
+
+ const loadAll = React.useCallback(async () => {
+ try {
+ const [i, d, c, v, b] = await Promise.all([
+ wordpressApi.getIntegrity(siteId).catch(() => null),
+ wordpressApi.getDebug(siteId).catch(() => null),
+ wordpressApi.getCron(siteId).catch(() => null),
+ wordpressApi.getVulnerabilities(siteId).catch(() => null),
+ wordpressApi.getBruteForce(siteId).catch(() => null),
+ ]);
+ setIntegrity(i); setDebug(d); setCron(c); setVulns(v); setBrute(b);
+ } finally {
+ setLoading(false);
+ }
+ }, [siteId]);
+
+ useEffect(() => { loadAll(); }, [loadAll]);
+ useEffect(() => {
+ if (integrity?.status !== 'running') return undefined;
+ const t = setTimeout(() => {
+ wordpressApi.getIntegrity(siteId).then(setIntegrity).catch(() => {});
+ }, 2500);
+ return () => clearTimeout(t);
+ }, [integrity, siteId]);
+
+ async function runIntegrity() {
+ try {
+ await wordpressApi.scanIntegrity(siteId);
+ setIntegrity(await wordpressApi.getIntegrity(siteId));
+ } catch (err) { toast.error(err.message || 'Failed to start check'); }
+ }
+ async function toggleDebug() {
+ setBusy(true);
+ try {
+ const res = await wordpressApi.setDebug(siteId, !debug?.enabled);
+ if (res.success === false) { toast.error(res.error || 'Failed to update debug setting'); return; }
+ setDebug(res);
+ toast.success('Debug setting updated');
+ } catch (err) { toast.error(err.message || 'Failed to update debug setting'); }
+ finally { setBusy(false); }
+ }
+ async function runCron() {
+ setBusy(true);
+ try {
+ const r = await wordpressApi.runCron(siteId);
+ toast[r.success ? 'success' : 'error'](r.success ? 'Ran due events' : (r.error || 'Failed to run cron'));
+ setCron(await wordpressApi.getCron(siteId));
+ } catch (err) { toast.error(err.message || 'Failed to run cron'); }
+ finally { setBusy(false); }
+ }
+ async function toggleCron() {
+ setBusy(true);
+ try { setCron(await wordpressApi.setCronDisabled(siteId, !cron?.disabled)); }
+ catch (err) { toast.error(err.message || 'Failed to update WP-Cron'); }
+ finally { setBusy(false); }
+ }
+ async function toggleBrute() {
+ const wasEnabled = brute?.enabled;
+ setBusy(true);
+ try {
+ const res = await wordpressApi.setBruteForce(siteId, !wasEnabled);
+ if (res.success === false) { toast.error(res.error || 'Failed to update protection'); return; }
+ setBrute(await wordpressApi.getBruteForce(siteId));
+ toast.success(wasEnabled ? 'Brute-force protection disabled' : 'Brute-force protection enabled');
+ } catch (err) { toast.error(err.message || 'Failed to update protection'); }
+ finally { setBusy(false); }
+ }
+ async function unbanIp(ip) {
+ setBusy(true);
+ try {
+ const res = await wordpressApi.unbanBruteForceIp(siteId, ip);
+ toast[res.success ? 'success' : 'error'](res.success ? `Unbanned ${ip}` : (res.error || 'Failed to unban'));
+ setBrute(await wordpressApi.getBruteForce(siteId));
+ } catch (err) { toast.error(err.message || 'Failed to unban'); }
+ finally { setBusy(false); }
+ }
+
+ if (loading) return <SkeletonBoundary loading skeleton={<OverviewGridSkeleton panels={2} />} />;
+
+ const intRunning = integrity?.status === 'running';
+ const issues = integrity?.issues || [];
+
+ // Posture checks — real signals only; checks that haven't run yet stay out
+ // of the score (demo's posture ring, computed client-side).
+ const vsum = vulns?.summary || {};
+ const checks = [
+ {
+ label: 'Core & plugin files verified',
+ state: integrity?.status === 'completed' ? (issues.length === 0 ? 'pass' : 'fail') : 'unknown',
+ detail: integrity?.status === 'completed'
+ ? (issues.length === 0 ? 'checksums clean' : `${issues.length} issue${issues.length === 1 ? '' : 's'}`)
+ : 'not checked yet',
+ },
+ {
+ label: 'WP_DEBUG disabled',
+ state: debug ? (debug.debug?.WP_DEBUG ? 'fail' : 'pass') : 'unknown',
+ detail: debug ? (debug.debug?.WP_DEBUG ? 'debug is on' : 'off') : 'unavailable',
+ },
+ {
+ label: 'No critical / high vulnerabilities',
+ state: vulns?.scanned_at ? (((vsum.critical ?? 0) + (vsum.high ?? 0)) === 0 ? 'pass' : 'fail') : 'unknown',
+ detail: vulns?.scanned_at
+ ? `${(vsum.critical ?? 0) + (vsum.high ?? 0)} found`
+ : 'no scan yet',
+ },
+ {
+ label: 'Login brute-force protection',
+ state: brute?.available === false ? 'unknown' : (brute?.enabled ? 'pass' : 'fail'),
+ detail: brute?.available === false ? 'fail2ban unavailable' : (brute?.enabled ? 'jail active' : 'not protected'),
+ },
+ ];
+ const scored = checks.filter(c => c.state !== 'unknown');
+ const score = scored.length ? Math.round(scored.filter(c => c.state === 'pass').length / scored.length * 100) : null;
+ const scoreColor = score >= 80 ? 'var(--green)' : score >= 50 ? 'var(--amber)' : 'var(--red)';
+ const CHECK_PILL = { pass: 'green', fail: 'red', unknown: 'gray' };
+
+ return (
+ <div className="app-overview-grid">
+ <div className="app-overview-left">
+ <div className="app-panel">
+ <div className="app-panel-header">Security posture</div>
+ <div className="app-panel-body wp-posture">
+ {score !== null ? (
+ <ScoreGauge value={score} size={110} stroke={9} color={scoreColor} label="posture" />
+ ) : (
+ <p className="hint">Run the checks below to compute a posture score.</p>
+ )}
+ <div className="wp-posture__checks">
+ {checks.map(c => (
+ <div key={c.label} className="wp-posture__check">
+ <span className="wp-posture__label">{c.label}</span>
+ <span className="wp-posture__detail">{c.detail}</span>
+ <Pill kind={CHECK_PILL[c.state]}>{c.state === 'unknown' ? 'pending' : c.state}</Pill>
+ </div>
+ ))}
+ </div>
+ </div>
+ </div>
+
+ <div className="app-panel">
+ <div className="app-panel-header">File integrity</div>
+ <div className="app-panel-body">
+ <div className="app-detail-actions">
+ <Button size="sm" onClick={runIntegrity} disabled={intRunning}>{intRunning ? 'Checking…' : 'Verify checksums'}</Button>
+ </div>
+ {(!integrity || integrity.status === 'idle') && <p className="hint">Verifies WordPress core and wordpress.org plugins against official checksums to detect tampered or unexpected files.</p>}
+ {integrity?.status === 'error' && <p className="hint">Check failed: {integrity.error}</p>}
+ {integrity?.status === 'completed' && (
+ issues.length === 0
+ ? <p className="hint">All core and plugin files verify against official checksums.</p>
+ : <>
+ <div className="app-detail-actions"><Pill kind="red">{issues.length} issue{issues.length === 1 ? '' : 's'}</Pill></div>
+ <div className="wp-code-list">
+ {issues.slice(0, 50).map((line, i) => <div key={i}>{line}</div>)}
+ </div>
+ </>
+ )}
+ </div>
+ </div>
+
+ <div className="app-panel">
+ <div className="app-panel-header">Debug mode</div>
+ <div className="app-panel-body">
+ <div className="app-info-grid">
+ <div className="app-info-item"><span className="app-info-label">WP_DEBUG</span><span className="app-info-value"><Pill kind={debug?.debug?.WP_DEBUG ? 'amber' : 'gray'}>{debug?.debug?.WP_DEBUG ? 'on' : 'off'}</Pill></span></div>
+ <div className="app-info-item"><span className="app-info-label">Debug log</span><span className="app-info-value">{debug?.debug?.WP_DEBUG_LOG ? 'on' : 'off'}</span></div>
+ <div className="app-info-item"><span className="app-info-label">Script debug</span><span className="app-info-value">{debug?.debug?.SCRIPT_DEBUG ? 'on' : 'off'}</span></div>
+ </div>
+ <div className="app-detail-actions">
+ <Button variant="outline" size="sm" onClick={toggleDebug} disabled={busy}>{debug?.enabled ? 'Disable debugging' : 'Enable debugging'}</Button>
+ </div>
+ <p className="hint">Logs errors to a private file outside the web root (never to the page or a public URL). Enable to capture PHP fatals; disable in production.</p>
+ </div>
+ </div>
+
+ <div className="app-panel">
+ <div className="app-panel-header">WP-Cron</div>
+ <div className="app-panel-body">
+ <div className="app-info-grid">
+ <div className="app-info-item"><span className="app-info-label">Pseudo-cron</span><span className="app-info-value">{cron?.disabled ? 'disabled' : 'enabled'}</span></div>
+ <div className="app-info-item"><span className="app-info-label">Scheduled events</span><span className="app-info-value">{(cron?.events || []).length}</span></div>
+ </div>
+ <div className="app-detail-actions">
+ <Button variant="outline" size="sm" onClick={runCron} disabled={busy}>Run due events</Button>
+ <Button variant="outline" size="sm" onClick={toggleCron} disabled={busy}>{cron?.disabled ? 'Enable WP-Cron' : 'Disable WP-Cron'}</Button>
+ </div>
+ <p className="hint">Disable WP-Cron only if a real system cron hits wp-cron.php — otherwise scheduled tasks (publishing, updates) will not run.</p>
+ </div>
+ </div>
+
+ <div className="app-panel">
+ <div className="app-panel-header">Brute-force protection</div>
+ <div className="app-panel-body">
+ {brute?.available === false ? (
+ <p className="hint">Fail2ban isn’t installed on this server, so login brute-force protection is inactive. Install it from the <strong>Security → Fail2ban</strong> page to enable per-site jails.</p>
+ ) : (
+ <>
+ <div className="app-info-grid">
+ <div className="app-info-item"><span className="app-info-label">Login jail</span><span className="app-info-value"><Pill kind={brute?.enabled ? 'green' : 'gray'}>{brute?.enabled ? 'active' : 'off'}</Pill></span></div>
+ <div className="app-info-item"><span className="app-info-label">Currently banned</span><span className="app-info-value">{brute?.currently_banned ?? 0}</span></div>
+ <div className="app-info-item"><span className="app-info-label">Total bans</span><span className="app-info-value">{brute?.total_banned ?? 0}</span></div>
+ </div>
+ <div className="app-detail-actions">
+ <Button variant="outline" size="sm" onClick={toggleBrute} disabled={busy}>{brute?.enabled ? 'Disable protection' : 'Enable protection'}</Button>
+ </div>
+ {(brute?.banned_ips?.length > 0) && (
+ <div className="wp-banlist">
+ {brute.banned_ips.map(ip => (
+ <div key={ip} className="wp-banlist__row">
+ <span className="wp-banlist__ip">{ip}</span>
+ <Button variant="ghost" size="sm" onClick={() => unbanIp(ip)} disabled={busy}>Unban</Button>
+ </div>
+ ))}
+ </div>
+ )}
+ <p className="hint">
+ Bans IPs that repeatedly POST to <code>wp-login.php</code> or <code>xmlrpc.php</code>
+ {brute?.thresholds ? ` (${brute.thresholds.maxretry} attempts / ${Math.round(brute.thresholds.findtime / 60)} min → ${Math.round(brute.thresholds.bantime / 60)} min ban)` : ''}.
+ {brute?.available && brute?.fail2ban_running === false ? ' Fail2ban is installed but not running — start it on the Security page.' : ''}
+ </p>
+ </>
+ )}
+ </div>
+ </div>
+ </div>
+ </div>
+ );
+};
+
+export default SecurityTab;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/SettingsTab.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/SettingsTab.jsx
new file mode 100644
index 00000000..5b543050
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/SettingsTab.jsx
@@ -0,0 +1,354 @@
+import { useState } from 'react';
+import { useParams, useNavigate } from 'react-router-dom';
+import { Plus, Globe, Copy, Settings, RefreshCw, Archive, GitBranch, Lock, Shield, ShieldCheck, ShieldAlert, FileBarChart, Trash2 } from 'lucide-react';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import { useConfirm } from 'serverkit-sdk';
+import { DangerZone } from '@/components/DangerZone';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { SiteSSLPanel } from './wpDetailShared';
+import PhpTab from './PhpTab';
+import UpdatesTab from './UpdatesTab';
+import BackupsTab from './BackupsTab';
+import GitTab from './GitTab';
+import SecurityTab from './SecurityTab';
+import VulnerabilitiesTab from './VulnerabilitiesTab';
+import ReportsTab from './ReportsTab';
+
+// Search & Replace Modal (DB string replacement, guarded by dry-run)
+export const SearchReplaceModal = ({ onClose, onSubmit }) => {
+ const [search, setSearch] = useState('');
+ const [replace, setReplace] = useState('');
+ const [loading, setLoading] = useState(false);
+
+ async function run(dryRun) {
+ if (!search.trim() || !replace.trim()) return;
+ setLoading(true);
+ try {
+ await onSubmit({ search: search.trim(), replace: replace.trim(), dry_run: dryRun });
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ return (
+ <Modal open onClose={onClose} title="Search & Replace">
+ <form onSubmit={(e) => { e.preventDefault(); run(false); }}>
+ <p className="hint">Replaces a string across all database tables (e.g. an old domain). Always preview with a dry run first.</p>
+
+ <div className="form-group">
+ <Label>Search for *</Label>
+ <Input
+ type="text"
+ value={search}
+ onChange={(e) => setSearch(e.target.value)}
+ placeholder="https://old-domain.com"
+ required
+ />
+ </div>
+
+ <div className="form-group">
+ <Label>Replace with *</Label>
+ <Input
+ type="text"
+ value={replace}
+ onChange={(e) => setReplace(e.target.value)}
+ placeholder="https://new-domain.com"
+ required
+ />
+ </div>
+
+ <div className="modal-actions">
+ <Button type="button" variant="outline" onClick={onClose}>
+ Cancel
+ </Button>
+ <Button type="button" variant="outline" onClick={() => run(true)} disabled={loading || !search.trim() || !replace.trim()}>
+ {loading ? 'Running...' : 'Dry Run'}
+ </Button>
+ <Button type="submit" disabled={loading || !search.trim() || !replace.trim()}>
+ {loading ? 'Running...' : 'Run Replace'}
+ </Button>
+ </div>
+ </form>
+ </Modal>
+ );
+};
+
+// Delete Site Modal (typed confirmation + optional final backup)
+const DeleteSiteModal = ({ siteName, onClose, onConfirm }) => {
+ const [createBackup, setCreateBackup] = useState(true);
+ const [typed, setTyped] = useState('');
+ const [loading, setLoading] = useState(false);
+ const canDelete = typed.trim() === siteName;
+
+ async function handleSubmit(e) {
+ e.preventDefault();
+ if (!canDelete) return;
+ setLoading(true);
+ try {
+ await onConfirm(createBackup);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ return (
+ <Modal open onClose={onClose} title="Delete Site">
+ <form onSubmit={handleSubmit}>
+ <p className="hint">This permanently deletes <strong>{siteName}</strong>, all its environments, files and databases. This cannot be undone.</p>
+ <div className="form-group">
+ <label className="checkbox-label">
+ <input
+ type="checkbox"
+ checked={createBackup}
+ onChange={(e) => setCreateBackup(e.target.checked)}
+ />
+ <span>Create a final files + database backup before deleting</span>
+ </label>
+ </div>
+ <div className="form-group">
+ <Label>Type <strong>{siteName}</strong> to confirm *</Label>
+ <Input
+ type="text"
+ value={typed}
+ onChange={(e) => setTyped(e.target.value)}
+ placeholder={siteName}
+ autoFocus
+ />
+ </div>
+ <div className="modal-actions">
+ <Button type="button" variant="outline" onClick={onClose} disabled={loading}>
+ Cancel
+ </Button>
+ <Button type="submit" variant="destructive" disabled={loading || !canDelete}>
+ {loading ? 'Deleting...' : 'Delete Site'}
+ </Button>
+ </div>
+ </form>
+ </Modal>
+ );
+};
+
+// Settings tab — a left sub-nav that consolidates per-site configuration which
+// used to be its own top-level tabs (PHP, safe Updates, …). Each section just
+// reuses the existing tab component, so behavior is unchanged — only the home
+// moves. Defined last so the section components above are already in scope.
+// General settings — site-level actions that don't warrant an everyday top-bar
+// button (point a domain, change the URL, clone the site). They open the modals
+// that already live in WordPressDetail, via handlers passed down through ctx.
+const GeneralSettings = ({ onAddDomain, onChangeUrl, onClone }) => (
+ <div className="app-overview-grid">
+ <div className="app-overview-left">
+ <div className="app-panel">
+ <div className="app-panel-header">Domains &amp; URL</div>
+ <div className="app-panel-body">
+ <p className="hint">Point a custom domain you own at this site (auto-DNS + migrate), or change its primary URL with a serialization-safe database rewrite.</p>
+ <div className="app-detail-actions">
+ <Button variant="outline" size="sm" onClick={onAddDomain}>
+ <Plus size={15} /> Add Domain
+ </Button>
+ <Button variant="outline" size="sm" onClick={onChangeUrl}>
+ <Globe size={15} /> Change URL
+ </Button>
+ </div>
+ </div>
+ </div>
+ <div className="app-panel">
+ <div className="app-panel-header">Duplicate site</div>
+ <div className="app-panel-body">
+ <p className="hint">Clone this site as a brand-new independent site (its own Docker stack and database) with fresh admin credentials.</p>
+ <div className="app-detail-actions">
+ <Button variant="outline" size="sm" onClick={onClone}>
+ <Copy size={15} /> Clone site
+ </Button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+);
+
+// Danger Zone settings — destructive site-level actions moved out of the
+// Overview tab into Settings so the daily dashboard isn't dominated by them.
+const DangerZoneSettings = ({ site, onUpdate }) => {
+ const toast = useToast();
+ const navigate = useNavigate();
+ const { confirm } = useConfirm();
+ const [archiving, setArchiving] = useState(false);
+ const [showDeleteModal, setShowDeleteModal] = useState(false);
+
+ async function handleArchive() {
+ const ok = await confirm({
+ title: 'Archive Site',
+ message: `Stop and archive "${site.name}"? Containers are stopped but all files and the database are kept. You can unarchive it later.`,
+ confirmText: 'Archive',
+ variant: 'warning',
+ });
+ if (!ok) return;
+ setArchiving(true);
+ toast.info('Archiving site...', { duration: 3000 });
+ try {
+ await wordpressApi.archiveSite(site.id);
+ toast.success('Site archived');
+ onUpdate?.();
+ } catch (err) {
+ toast.error(err.message || 'Failed to archive site');
+ } finally {
+ setArchiving(false);
+ }
+ }
+
+ async function handleUnarchive() {
+ setArchiving(true);
+ toast.info('Unarchiving site...', { duration: 3000 });
+ try {
+ await wordpressApi.unarchiveSite(site.id);
+ toast.success('Site unarchived');
+ onUpdate?.();
+ } catch (err) {
+ toast.error(err.message || 'Failed to unarchive site');
+ } finally {
+ setArchiving(false);
+ }
+ }
+
+ async function handleDelete(createBackup) {
+ toast.info(createBackup ? 'Creating final backup and deleting site...' : 'Deleting site...', { duration: 5000 });
+ try {
+ await wordpressApi.deleteSite(site.id, { createBackup });
+ toast.success('Site deleted');
+ setShowDeleteModal(false);
+ navigate('/wordpress');
+ } catch (err) {
+ toast.error(err.message || 'Failed to delete site');
+ }
+ }
+
+ return (
+ <>
+ {showDeleteModal && (
+ <DeleteSiteModal
+ siteName={site.name}
+ onClose={() => setShowDeleteModal(false)}
+ onConfirm={handleDelete}
+ />
+ )}
+ <div className="app-overview-grid">
+ <div className="app-overview-left">
+ <div className="app-panel danger-zone-panel">
+ <div className="app-panel-header">Danger Zone</div>
+ <div className="app-panel-body danger-zone-body">
+ {site.status === 'archived' ? (
+ <DangerZone
+ title="Unarchive Site"
+ description="Restart this site's containers and bring it back online."
+ action={(
+ <Button variant="outline" onClick={handleUnarchive} disabled={archiving}>
+ <Archive size={16} />
+ {archiving ? 'Unarchiving...' : 'Unarchive'}
+ </Button>
+ )}
+ />
+ ) : (
+ <DangerZone
+ title="Archive Site"
+ description="Stop the containers but keep all files and the database. Reversible."
+ action={(
+ <Button variant="outline" onClick={handleArchive} disabled={archiving}>
+ <Archive size={16} />
+ {archiving ? 'Archiving...' : 'Archive'}
+ </Button>
+ )}
+ />
+ )}
+ <DangerZone
+ title="Delete Site"
+ description="Permanently remove this site, all environments, files and databases. A final backup is taken by default."
+ action={(
+ <Button variant="destructive" onClick={() => setShowDeleteModal(true)}>
+ <Trash2 size={16} />
+ Delete Site
+ </Button>
+ )}
+ />
+ </div>
+ </div>
+ </div>
+ </div>
+ </>
+ );
+};
+
+// Grouped left nav for the Settings tab. Each item just re-renders the existing
+// per-feature component (passed a single `ctx`), so behavior is unchanged — only
+// the home moves here to keep the top tab strip short. Groups give the nav
+// structure (the user's "group section" idea) and room to grow.
+const WP_SETTINGS_GROUPS = [
+ { label: 'General', items: [
+ { id: 'general', label: 'General', icon: Globe, render: (ctx) => <GeneralSettings {...ctx} /> },
+ ] },
+ { label: 'Configuration', items: [
+ { id: 'php', label: 'PHP', icon: Settings, render: (ctx) => <PhpTab siteId={ctx.siteId} /> },
+ { id: 'updates', label: 'Updates', icon: RefreshCw, render: (ctx) => <UpdatesTab siteId={ctx.siteId} /> },
+ ] },
+ { label: 'Data', items: [
+ { id: 'backups', label: 'Backups', icon: Archive, render: (ctx) => <BackupsTab siteId={ctx.siteId} site={ctx.site} /> },
+ ] },
+ { label: 'Connections', items: [
+ { id: 'git', label: 'Git', icon: GitBranch, render: (ctx) => <GitTab siteId={ctx.siteId} site={ctx.site} onUpdate={ctx.onUpdate} /> },
+ ] },
+ { label: 'Security', items: [
+ { id: 'security', label: 'Security', icon: Lock, render: (ctx) => <SecurityTab siteId={ctx.siteId} /> },
+ { id: 'ssl', label: 'SSL', icon: Shield, render: (ctx) => <SiteSSLPanel site={ctx.site} onUpdate={ctx.onUpdate} /> },
+ { id: 'vulnerabilities', label: 'Vulnerabilities', icon: ShieldCheck, render: (ctx) => <VulnerabilitiesTab siteId={ctx.siteId} /> },
+ ] },
+ { label: 'Reports', items: [
+ { id: 'reports', label: 'Reports', icon: FileBarChart, render: (ctx) => <ReportsTab siteId={ctx.siteId} /> },
+ ] },
+ { label: 'Danger Zone', items: [
+ { id: 'danger-zone', label: 'Danger Zone', icon: ShieldAlert, render: (ctx) => <DangerZoneSettings site={ctx.site} onUpdate={ctx.onUpdate} /> },
+ ] },
+];
+
+const WP_SETTINGS_ITEMS = WP_SETTINGS_GROUPS.flatMap((g) => g.items);
+
+const SettingsTab = ({ siteId, site, onUpdate, onAddDomain, onChangeUrl, onClone }) => {
+ // Section lives in the URL (/wordpress/:id/settings/:section) so it's
+ // shareable and survives a refresh, instead of resetting to General.
+ const { id, section: sectionParam } = useParams();
+ const navigate = useNavigate();
+ const section = WP_SETTINGS_ITEMS.some((s) => s.id === sectionParam) ? sectionParam : 'general';
+ const setSection = (s) => navigate(`/wordpress/${id}/settings/${s}`, { replace: true });
+ const active = WP_SETTINGS_ITEMS.find((s) => s.id === section) || WP_SETTINGS_ITEMS[0];
+ const ctx = { siteId, site, onUpdate, onAddDomain, onChangeUrl, onClone };
+ return (
+ <div className="wp-settings">
+ <nav className="wp-settings__nav" aria-label="WordPress settings sections">
+ {WP_SETTINGS_GROUPS.map((g) => (
+ <div className="wp-settings__group" key={g.label}>
+ <div className="wp-settings__grouplabel">{g.label}</div>
+ {g.items.map((s) => (
+ <button
+ type="button"
+ key={s.id}
+ className={`wp-settings__navitem ${section === s.id ? 'is-active' : ''}`}
+ onClick={() => setSection(s.id)}
+ >
+ <s.icon size={15} />
+ {s.label}
+ </button>
+ ))}
+ </div>
+ ))}
+ </nav>
+ <div className="wp-settings__content">
+ {active.render(ctx)}
+ </div>
+ </div>
+ );
+};
+
+export default SettingsTab;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/ThemesTab.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/ThemesTab.jsx
new file mode 100644
index 00000000..c2d67667
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/ThemesTab.jsx
@@ -0,0 +1,203 @@
+import { useState, useEffect } from 'react';
+import { Palette } from 'lucide-react';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import { ErrorState } from '@/components/ErrorBoundary';
+import { EmptyState } from 'serverkit-sdk';
+import { Pill } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { SkeletonBoundary } from 'serverkit-sdk';
+import { ListItemSkeleton } from './wpDetailShared';
+
+// Themes Tab
+const ThemesTab = ({ siteId }) => {
+ const toast = useToast();
+ const [themes, setThemes] = useState([]);
+ const [loading, setLoading] = useState(true);
+ const [error, setError] = useState(null);
+ const [installing, setInstalling] = useState(false);
+ const [updating, setUpdating] = useState(null); // theme name being updated, or 'all'
+ const [newTheme, setNewTheme] = useState('');
+ const [activating, setActivating] = useState(null); // theme name being activated
+
+ useEffect(() => {
+ loadThemes();
+ }, [siteId]);
+
+ async function loadThemes() {
+ setLoading(true);
+ setError(null);
+ try {
+ const data = await wordpressApi.getThemes(siteId);
+ setThemes(data.themes || []);
+ } catch (err) {
+ console.error('Failed to load themes:', err);
+ setError(err);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ async function handleInstall(e) {
+ e.preventDefault();
+ if (!newTheme.trim()) return;
+
+ setInstalling(true);
+ try {
+ await wordpressApi.installTheme(siteId, { slug: newTheme.trim() });
+ toast.success('Theme installed successfully');
+ setNewTheme('');
+ loadThemes();
+ } catch (err) {
+ toast.error(err.message || 'Failed to install theme');
+ } finally {
+ setInstalling(false);
+ }
+ }
+
+ async function handleUpdate(themeName) {
+ setUpdating(themeName || 'all');
+ toast.info(themeName ? `Updating ${themeName}...` : 'Updating all themes...', { duration: 4000 });
+ try {
+ const res = await wordpressApi.updateThemes(siteId, themeName ? [themeName] : undefined);
+ if (res.success === false) {
+ toast.error(res.error || 'Theme update failed');
+ return;
+ }
+ toast.success(res.message || 'Themes updated');
+ loadThemes();
+ } catch (err) {
+ toast.error(err.message || 'Theme update failed');
+ } finally {
+ setUpdating(null);
+ }
+ }
+
+ async function handleActivate(theme) {
+ setActivating(theme.name);
+ try {
+ const res = await wordpressApi.activateTheme(siteId, theme.name);
+ if (res && res.success === false) {
+ toast.error(res.error || `Failed to activate ${theme.name}`);
+ return;
+ }
+ toast.success(`${theme.title || theme.name} activated`);
+ loadThemes();
+ } catch (err) {
+ toast.error(err.message || 'Failed to activate theme');
+ } finally {
+ setActivating(null);
+ }
+ }
+
+ if (loading) {
+ return (
+ <SkeletonBoundary loading skeleton={(
+ <div className="themes-tab">
+ <div className="section-header">
+ <div className="skeleton" style={{ width: 80, height: 24 }} />
+ </div>
+ <div className="skeleton" style={{ height: 44, borderRadius: 6, marginBottom: 16 }} />
+ <div className="themes-list">
+ <ListItemSkeleton />
+ <ListItemSkeleton />
+ <ListItemSkeleton />
+ </div>
+ </div>
+ )} />
+ );
+ }
+
+ if (error) {
+ return (
+ <ErrorState
+ title="Failed to load themes"
+ error={error}
+ onRetry={loadThemes}
+ />
+ );
+ }
+
+ return (
+ <div className="themes-tab">
+ <div className="section-header">
+ <h3>Themes</h3>
+ </div>
+
+ <form className="install-form" onSubmit={handleInstall}>
+ <Input
+ type="text"
+ value={newTheme}
+ onChange={(e) => setNewTheme(e.target.value)}
+ placeholder="Theme slug (e.g., twentytwentyfour)"
+ />
+ <Button type="submit" disabled={installing}>
+ {installing ? 'Installing...' : 'Install Theme'}
+ </Button>
+ </form>
+
+ {themes.some(t => t.update === 'available') && (
+ <div className="bulk-update-bar">
+ <span>{themes.filter(t => t.update === 'available').length} theme update(s) available</span>
+ <Button
+ variant="outline"
+ size="sm"
+ onClick={() => handleUpdate(null)}
+ disabled={updating !== null}
+ >
+ {updating === 'all' ? 'Updating...' : 'Update all'}
+ </Button>
+ </div>
+ )}
+
+ {themes.length === 0 ? (
+ <EmptyState icon={Palette} title="No themes installed" description="Install a theme by entering its slug above." />
+ ) : (
+ <div className="wp-theme-grid">
+ {themes.map(theme => {
+ const isActive = theme.status === 'active';
+ return (
+ <div className={`wp-theme-card ${isActive ? 'is-active' : ''}`} key={theme.name}>
+ <div className="wp-theme-card__shot">
+ <Palette size={26} />
+ {isActive && <Pill kind="green">Active</Pill>}
+ </div>
+ <div className="wp-theme-card__meta">
+ <div className="wp-theme-card__name">{theme.title || theme.name}</div>
+ <div className="wp-theme-card__sub">{theme.name} · v{theme.version}</div>
+ <div className="wp-theme-card__actions">
+ {isActive ? (
+ <span className="wp-theme-card__current">Current theme</span>
+ ) : (
+ <Button
+ variant="outline"
+ size="sm"
+ onClick={() => handleActivate(theme)}
+ disabled={activating === theme.name}
+ >
+ {activating === theme.name ? 'Activating…' : 'Activate'}
+ </Button>
+ )}
+ {theme.update === 'available' && (
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={() => handleUpdate(theme.name)}
+ disabled={updating !== null}
+ >
+ {updating === theme.name ? 'Updating…' : 'Update'}
+ </Button>
+ )}
+ </div>
+ </div>
+ </div>
+ );
+ })}
+ </div>
+ )}
+ </div>
+ );
+};
+
+export default ThemesTab;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/UpdatesTab.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/UpdatesTab.jsx
new file mode 100644
index 00000000..79febcb4
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/UpdatesTab.jsx
@@ -0,0 +1,137 @@
+import React, { useState, useEffect } from 'react';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import { Pill } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { SkeletonBoundary } from 'serverkit-sdk';
+import { OverviewGridSkeleton, UPDATE_SCHEDULES } from './wpDetailShared';
+
+// Updates Tab — safe update manager (#29): snapshot -> update -> health-check ->
+// auto-rollback, plus a per-site schedule and a run-history report.
+const UpdatesTab = ({ siteId }) => {
+ const toast = useToast();
+ const [data, setData] = useState(null);
+ const [loading, setLoading] = useState(true);
+ const [busy, setBusy] = useState(false);
+ const [schedule, setSchedule] = useState('');
+ const [excludeText, setExcludeText] = useState('');
+
+ const load = React.useCallback(async () => {
+ try {
+ const res = await wordpressApi.getUpdates(siteId);
+ setData(res);
+ setSchedule(res.schedule || '');
+ setExcludeText((res.exclude || []).join(', '));
+ } catch (err) {
+ toast.error(err.message || 'Failed to load updates');
+ } finally {
+ setLoading(false);
+ }
+ }, [siteId, toast]);
+
+ useEffect(() => { load(); }, [load]);
+ useEffect(() => {
+ if (!data?.running) return undefined;
+ const t = setTimeout(() => { wordpressApi.getUpdates(siteId).then(setData).catch(() => {}); }, 3000);
+ return () => clearTimeout(t);
+ }, [data, siteId]);
+
+ const toList = (s) => s.split(',').map(x => x.trim()).filter(Boolean);
+
+ async function runUpdate() {
+ if (!window.confirm('Run a safe update now? A database snapshot is taken first and the site auto-rolls-back if the update breaks it.')) return;
+ setBusy(true);
+ try {
+ await wordpressApi.runUpdates(siteId, { exclude: toList(excludeText) });
+ toast.info('Safe update started…');
+ setData(await wordpressApi.getUpdates(siteId));
+ } catch (err) { toast.error(err.message || 'Failed to start update'); }
+ finally { setBusy(false); }
+ }
+ async function saveSchedule() {
+ setBusy(true);
+ try {
+ await wordpressApi.setUpdateSchedule(siteId, { schedule, exclude: toList(excludeText) });
+ toast.success('Schedule saved');
+ await load();
+ } catch (err) { toast.error(err.message || 'Failed to save schedule'); }
+ finally { setBusy(false); }
+ }
+
+ if (loading) return <SkeletonBoundary loading skeleton={<OverviewGridSkeleton panels={2} />} />;
+
+ const runs = data?.runs || [];
+ const running = data?.running;
+ const statusPill = (s) => ({ completed: 'green', rolled_back: 'amber', failed: 'red', running: 'cyan' }[s] || 'gray');
+
+ return (
+ <div className="app-overview-grid">
+ <div className="app-overview-left">
+ <div className="app-panel">
+ <div className="app-panel-header">Safe update</div>
+ <div className="app-panel-body">
+ <p className="hint">Snapshots the database, updates core + plugins + themes, health-checks the site, and automatically rolls back (version-pin + DB restore) if the update breaks it.</p>
+ <div className="form-group">
+ <Label>Exclude (skip) plugins/themes</Label>
+ <Input value={excludeText} onChange={e => setExcludeText(e.target.value)} placeholder="e.g. woocommerce, my-custom-plugin" />
+ <span className="form-hint">Comma-separated slugs to never auto-update.</span>
+ </div>
+ <div className="app-detail-actions">
+ <Button size="sm" onClick={runUpdate} disabled={busy || running}>{running ? 'Updating…' : 'Run safe update now'}</Button>
+ </div>
+ </div>
+ </div>
+
+ <div className="app-panel">
+ <div className="app-panel-header">Schedule</div>
+ <div className="app-panel-body">
+ <div className="form-group">
+ <Label>Automatic safe updates</Label>
+ <select value={schedule} onChange={e => setSchedule(e.target.value)} disabled={busy}>
+ {UPDATE_SCHEDULES.map(s => <option key={s.value} value={s.value}>{s.label}</option>)}
+ {schedule && !UPDATE_SCHEDULES.some(s => s.value === schedule) && <option value={schedule}>{schedule}</option>}
+ </select>
+ <span className="form-hint">Runs the same safe update (with auto-rollback) on a schedule.</span>
+ </div>
+ <div className="app-detail-actions">
+ <Button variant="outline" size="sm" onClick={saveSchedule} disabled={busy}>Save schedule</Button>
+ </div>
+ </div>
+ </div>
+
+ <div className="app-panel">
+ <div className="app-panel-header">Update history</div>
+ <div className="app-panel-body">
+ {runs.length === 0 ? (
+ <p className="hint">No updates have run yet.</p>
+ ) : runs.map(r => {
+ const d = r.details || {};
+ const n = (d.updated || []).length;
+ return (
+ <div className="wp-run-row" key={r.id}>
+ <div className="wp-run-row-head">
+ <Pill kind={statusPill(r.status)}>{r.status.replace('_', ' ')}</Pill>
+ <span className="wp-run-row-meta">{r.started_at ? new Date(r.started_at).toLocaleString() : ''} · {r.trigger}</span>
+ </div>
+ <span className="form-hint">
+ {n === 0 ? 'No components needed updating' : `${n} component${n === 1 ? '' : 's'} updated`}
+ {d.rolled_back ? ' · auto-rolled back (update regressed the site)' : ''}
+ {r.error ? ` · ${r.error}` : ''}
+ </span>
+ {d.warning && <span className="form-hint">⚠ {d.warning}</span>}
+ {(d.updated || []).slice(0, 10).map((u, i) => (
+ <span className="form-hint wp-run-component" key={i}>{u.type} {u.slug}: {u.from} → {u.to}</span>
+ ))}
+ </div>
+ );
+ })}
+ </div>
+ </div>
+ </div>
+ </div>
+ );
+};
+
+export default UpdatesTab;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/UptimeTab.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/UptimeTab.jsx
new file mode 100644
index 00000000..a3f59202
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/UptimeTab.jsx
@@ -0,0 +1,139 @@
+import React, { useState, useEffect } from 'react';
+import { Activity } from 'lucide-react';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import { HealthDot } from '../HealthStatusPanel';
+import { MetricCard } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { SkeletonBoundary } from 'serverkit-sdk';
+import { OverviewGridSkeleton } from './wpDetailShared';
+
+// Uptime Tab — per-site health + uptime % via a bound status-page component (#26).
+// Health is polled server-side every 5 min; outages auto-open incidents and alert
+// the configured notification channels.
+const UptimeTab = ({ siteId }) => {
+ const toast = useToast();
+ const [data, setData] = useState(null);
+ const [loading, setLoading] = useState(true);
+ const [pageId, setPageId] = useState('');
+ const [busy, setBusy] = useState(false);
+
+ const load = React.useCallback(async () => {
+ setLoading(true);
+ try {
+ const res = await wordpressApi.getSiteStatusPage(siteId);
+ setData(res);
+ } catch (err) {
+ toast.error(err.message || 'Failed to load uptime info');
+ } finally {
+ setLoading(false);
+ }
+ }, [siteId, toast]);
+
+ useEffect(() => { load(); }, [load]);
+ useEffect(() => {
+ if (data?.pages?.length) setPageId(prev => prev || String(data.pages[0].id));
+ }, [data]);
+
+ async function handleAttach() {
+ if (!pageId) { toast.error('Choose a status page'); return; }
+ setBusy(true);
+ try {
+ await wordpressApi.attachStatusPage(siteId, Number(pageId));
+ toast.success('Added to status page');
+ await load();
+ } catch (err) {
+ toast.error(err.message || 'Failed to add to status page');
+ } finally { setBusy(false); }
+ }
+
+ async function handleDetach() {
+ if (!window.confirm('Remove this site from its status page? Its uptime history and component will be deleted.')) return;
+ setBusy(true);
+ try {
+ await wordpressApi.detachStatusPage(siteId);
+ toast.success('Removed from status page');
+ await load();
+ } catch (err) {
+ toast.error(err.message || 'Failed to remove from status page');
+ } finally { setBusy(false); }
+ }
+
+ if (loading) return <SkeletonBoundary loading skeleton={<OverviewGridSkeleton panels={2} />} />;
+
+ const comp = data?.component;
+ const pages = data?.pages || [];
+ const pct = (v) => (v != null ? `${v.toFixed(2)}%` : '—');
+
+ return (
+ <div className="app-overview-grid">
+ <div className="app-overview-left">
+ <div className="app-panel">
+ <div className="app-panel-header">Health</div>
+ <div className="app-panel-body">
+ <div className="app-info-grid">
+ <div className="app-info-item">
+ <span className="app-info-label">Current Status</span>
+ <span className="app-info-value">
+ <HealthDot status={data?.health_status} /> {data?.health_status || 'unknown'}
+ </span>
+ </div>
+ <div className="app-info-item">
+ <span className="app-info-label">Last Checked</span>
+ <span className="app-info-value">{data?.last_health_check ? new Date(data.last_health_check).toLocaleString() : 'Never'}</span>
+ </div>
+ </div>
+ <p className="hint">Health is polled automatically every 5 minutes. Outages and recoveries alert your configured notification channels.</p>
+ </div>
+ </div>
+
+ {comp ? (
+ <div className="app-panel">
+ <div className="app-panel-header">Uptime</div>
+ <div className="app-panel-body">
+ {comp.last_check_at ? (
+ <div className="wp-kpis">
+ <MetricCard icon={<Activity size={16} />} tone="green" value={pct(comp.uptime_24h)} label="Uptime · 24 hours" />
+ <MetricCard icon={<Activity size={16} />} tone="green" value={pct(comp.uptime_7d)} label="Uptime · 7 days" />
+ <MetricCard icon={<Activity size={16} />} tone="cyan" value={pct(comp.uptime_30d)} label="Uptime · 30 days" />
+ <MetricCard icon={<Activity size={16} />} tone="cyan" value={pct(comp.uptime_90d)} label="Uptime · 90 days" />
+ </div>
+ ) : (
+ <p className="hint">Awaiting the first health check (runs within 5 minutes).</p>
+ )}
+ <p className="hint">Uptime accrues from the 5-minute health checks; only fully-healthy checks count, so degraded periods reduce it. This site appears on its status page and auto-opens an incident on an outage (auto-resolved on recovery).</p>
+ <div className="app-detail-actions">
+ <Button variant="outline" size="sm" disabled={busy} onClick={handleDetach}>Remove from status page</Button>
+ </div>
+ </div>
+ </div>
+ ) : (
+ <div className="app-panel">
+ <div className="app-panel-header">Add to status page</div>
+ <div className="app-panel-body">
+ {pages.length === 0 ? (
+ <p className="hint">No status pages exist yet. Create one under Status Pages first, then add this site to track its uptime and auto-open incidents on outages.</p>
+ ) : (
+ <>
+ <p className="hint">Track uptime for this site on a status page. It accrues a real uptime % and auto-opens/resolves incidents on outages.</p>
+ <div className="form-group">
+ <Label>Status Page</Label>
+ <select value={pageId} onChange={e => setPageId(e.target.value)} disabled={busy}>
+ {pages.map(p => <option key={p.id} value={p.id}>{p.name}</option>)}
+ </select>
+ </div>
+ <div className="app-detail-actions">
+ <Button size="sm" disabled={busy} onClick={handleAttach}>Add to status page</Button>
+ </div>
+ </>
+ )}
+ </div>
+ </div>
+ )}
+ </div>
+ </div>
+ );
+};
+
+export default UptimeTab;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/VulnerabilitiesTab.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/VulnerabilitiesTab.jsx
new file mode 100644
index 00000000..d4983ef2
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/VulnerabilitiesTab.jsx
@@ -0,0 +1,138 @@
+import React, { useState, useEffect } from 'react';
+import { AlertTriangle } from 'lucide-react';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import { KpiBand, MetricCard } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { SkeletonBoundary } from 'serverkit-sdk';
+import { OverviewGridSkeleton } from './wpDetailShared';
+
+// Vulnerabilities Tab — cross-references plugin/theme/core versions against the
+// keyless WPVulnerability community feed (#28). On-demand background scan + poll.
+const VulnerabilitiesTab = ({ siteId }) => {
+ const toast = useToast();
+ const [data, setData] = useState(null);
+ const [loading, setLoading] = useState(true);
+ const [scanning, setScanning] = useState(false);
+
+ const load = React.useCallback(async () => {
+ try {
+ const res = await wordpressApi.getVulnerabilities(siteId);
+ setData(res);
+ } catch (err) {
+ toast.error(err.message || 'Failed to load vulnerabilities');
+ } finally {
+ setLoading(false);
+ }
+ }, [siteId, toast]);
+
+ useEffect(() => { load(); }, [load]);
+ useEffect(() => {
+ if (data?.scan_status !== 'running') return undefined;
+ const t = setTimeout(() => { load(); }, 2500);
+ return () => clearTimeout(t);
+ }, [data, load]);
+
+ async function handleScan() {
+ setScanning(true);
+ try {
+ await wordpressApi.scanVulnerabilities(siteId);
+ toast.info('Vulnerability scan started…');
+ await load();
+ } catch (err) {
+ toast.error(err.message || 'Failed to start scan');
+ } finally {
+ setScanning(false);
+ }
+ }
+
+ if (loading) return <SkeletonBoundary loading skeleton={<OverviewGridSkeleton panels={2} />} />;
+
+ const running = data?.scan_status === 'running';
+ const summary = data?.summary || {};
+ const vulns = data?.vulnerabilities || [];
+
+ return (
+ <div className="app-overview-grid">
+ <div className="app-overview-left">
+ <div className="app-panel">
+ <div className="app-panel-header">Vulnerability scan</div>
+ <div className="app-panel-body">
+ <div className="app-detail-actions">
+ <Button size="sm" onClick={handleScan} disabled={scanning || running}>
+ {running ? 'Scanning…' : 'Run scan'}
+ </Button>
+ </div>
+ <div className="app-info-grid">
+ <div className="app-info-item"><span className="app-info-label">Last scan</span><span className="app-info-value">{data?.scanned_at ? new Date(data.scanned_at).toLocaleString() : 'Never'}</span></div>
+ <div className="app-info-item"><span className="app-info-label">Findings</span><span className="app-info-value">{summary.total ?? 0}</span></div>
+ </div>
+ {data?.scan_error && <p className="hint">Last scan error: {data.scan_error}</p>}
+ <p className="hint">Cross-references installed plugin, theme, and core versions against the WPVulnerability community database. Re-run after updating.</p>
+ </div>
+ </div>
+
+ {data?.scanned_at && (
+ <KpiBand>
+ <MetricCard icon={<AlertTriangle size={16} />} tone="red" value={summary.critical ?? 0} label="Critical" />
+ <MetricCard icon={<AlertTriangle size={16} />} tone="red" value={summary.high ?? 0} label="High" />
+ <MetricCard icon={<AlertTriangle size={16} />} tone="amber" value={summary.medium ?? 0} label="Medium" />
+ <MetricCard icon={<AlertTriangle size={16} />} tone="cyan" value={summary.low ?? 0} label="Low" />
+ {summary.unknown > 0 && (
+ <MetricCard icon={<AlertTriangle size={16} />} tone="violet" value={summary.unknown} label="Unrated" />
+ )}
+ </KpiBand>
+ )}
+
+ {vulns.length === 0 ? (
+ <div className="app-panel">
+ <div className="app-panel-body">
+ <p className="hint">{data?.scanned_at ? 'No known vulnerabilities found.' : 'No scan has run yet — click Run scan to check this site.'}</p>
+ </div>
+ </div>
+ ) : (
+ <div className="app-panel">
+ <div className="app-panel-header">Findings</div>
+ <table className="sk-dtable wp-vuln-table">
+ <thead>
+ <tr>
+ <th>Severity</th>
+ <th>Component</th>
+ <th>Issue</th>
+ <th>Installed</th>
+ <th>Fixed in</th>
+ <th>Advisory</th>
+ </tr>
+ </thead>
+ <tbody>
+ {vulns.map(v => (
+ <tr key={v.id}>
+ <td><span className={`wp-sev wp-sev--${v.severity || 'unknown'}`}><span className="d" />{v.severity || 'unrated'}</span></td>
+ <td>
+ <div className="sk-cell-name">{v.name}</div>
+ <div className="sk-cell-sub">{v.source}{v.slug ? ` · ${v.slug}` : ''}</div>
+ </td>
+ <td className="wp-vuln-title">{v.title || '—'}</td>
+ <td><span className="sk-cell-mono">{v.installed_version}</span></td>
+ <td>
+ {v.fixed_in
+ ? <span className="wp-fix-chip">{v.fixed_in}</span>
+ : <span className="wp-no-fix">no fix yet</span>}
+ </td>
+ <td>
+ {v.reference_url
+ ? <a className="wp-advisory-link" href={v.reference_url} target="_blank" rel="noopener noreferrer">{v.advisory_id || 'advisory'} ↗</a>
+ : <span className="sk-cell-mono">{v.advisory_id || '—'}</span>}
+ </td>
+ </tr>
+ ))}
+ </tbody>
+ </table>
+ </div>
+ )}
+ </div>
+ </div>
+ );
+};
+
+export default VulnerabilitiesTab;
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/wpDetailShared.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/wpDetailShared.jsx
new file mode 100644
index 00000000..c7c6ef5f
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/detail/wpDetailShared.jsx
@@ -0,0 +1,553 @@
+import { useState, useEffect } from 'react';
+import { Link } from 'react-router-dom';
+import { ChevronDown, Check, Lock, Globe, Shield, CircleCheck, CircleX } from 'lucide-react';
+import { api } from 'serverkit-sdk';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import { Pill } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+
+// Detail Page Skeleton for initial loading
+// Mirrors the real page chrome (top bar, identity, repo pill, tabs) and the
+// Overview tab layout (KPIs, quick-actions + traffic grid, activity feed).
+export const DetailPageSkeleton = () => (
+ <div className="wp-detail-page wp-detail-page--skeleton">
+ {/* Top bar chrome */}
+ <div className="sk-topbar-skeleton">
+ <div className="sk-topbar-skeleton__icon" />
+ <div className="sk-topbar-skeleton__title" />
+ <div className="sk-topbar-skeleton__spacer" />
+ <div className="sk-topbar-skeleton__actions">
+ <div className="sk-topbar-skeleton__btn" />
+ <div className="sk-topbar-skeleton__btn" />
+ <div className="sk-topbar-skeleton__btn sk-topbar-skeleton__btn--primary" />
+ </div>
+ </div>
+
+ <div className="app-detail-body">
+ {/* Identity header */}
+ <div className="app-detail-header">
+ <div className="app-detail-icon wp-icon skeleton" style={{ width: 52, height: 52, borderRadius: 13 }} />
+ <div className="app-detail-title-block">
+ <div className="skeleton" style={{ width: 260, height: 24, marginBottom: 10 }} />
+ <div className="skeleton" style={{ width: 340, height: 14 }} />
+ </div>
+ </div>
+
+ {/* Repo pill placeholder */}
+ <div className="wp-detail__repo-bar">
+ <div className="wp-detail-skeleton-repo" />
+ </div>
+
+ {/* Tab strip */}
+ <div className="app-detail-tabs">
+ {[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14].map(i => (
+ <div key={i} className="skeleton app-detail-tab-skeleton" />
+ ))}
+ </div>
+
+ {/* Overview tab content placeholder */}
+ <div className="app-detail-content">
+ <div className="wp-overview wp-overview--skeleton">
+ {/* KPI row */}
+ <div className="wp-kpis wp-kpis--skeleton">
+ {[1, 2, 3, 4].map(i => (
+ <div key={i} className="wp-detail-skeleton-kpi">
+ <div className="wp-detail-skeleton-kpi__label" />
+ <div className="wp-detail-skeleton-kpi__value" />
+ </div>
+ ))}
+ </div>
+
+ {/* Quick actions + traffic grid */}
+ <div className="wp-overview-main">
+ <div className="app-panel wp-detail-skeleton-panel">
+ <div className="app-panel-header">
+ <div className="skeleton" style={{ width: 100, height: 12 }} />
+ </div>
+ <div className="app-panel-body">
+ <div className="quick-actions-grid">
+ {[1, 2, 3, 4, 5, 6, 7, 8].map(i => (
+ <div key={i} className="skeleton" style={{ height: 38, borderRadius: 8 }} />
+ ))}
+ </div>
+ </div>
+ </div>
+
+ <div className="app-panel wp-detail-skeleton-panel wp-traffic-panel">
+ <div className="app-panel-header">
+ <div className="skeleton" style={{ width: 80, height: 12, marginBottom: 4 }} />
+ <div className="skeleton" style={{ width: 140, height: 10 }} />
+ </div>
+ <div className="app-panel-body">
+ <div className="wp-detail-skeleton-chart" />
+ </div>
+ </div>
+ </div>
+
+ {/* Recent activity panel */}
+ <div className="app-panel wp-detail-skeleton-panel wp-activity-panel">
+ <div className="app-panel-header">
+ <div className="skeleton" style={{ width: 110, height: 12 }} />
+ </div>
+ <div className="app-panel-body">
+ <div className="wp-detail-skeleton-activity">
+ {[1, 2, 3, 4].map(i => (
+ <div key={i} className="wp-detail-skeleton-activity__row">
+ <div className="skeleton" style={{ width: 32, height: 32, borderRadius: '50%' }} />
+ <div className="wp-detail-skeleton-activity__lines">
+ <div className="skeleton" style={{ width: '40%', height: 12, marginBottom: 6 }} />
+ <div className="skeleton" style={{ width: '65%', height: 10 }} />
+ </div>
+ </div>
+ ))}
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+);
+
+// Environment-type → dot tint for the header environment switcher.
+export const ENV_DOT_COLORS = {
+ production: 'var(--green)',
+ staging: 'var(--amber)',
+ development: 'var(--cyan)',
+ multidev: 'var(--violet)',
+};
+
+// Short label for an environment type tag (PROD / STAGING / DEV).
+export const envTagLabel = (type) => (
+ type === 'production' ? 'PROD' : type === 'staging' ? 'STAGING' : 'DEV'
+);
+
+export const ENV_TYPE_LABELS = { production: 'Production', staging: 'Staging', development: 'Development', multidev: 'Multidev' };
+
+// Compact header environment switcher — navigates between the environment
+// site ids already present in the loaded payload (no extra fetches).
+export const EnvSwitcher = ({ options, onSelect }) => {
+ const [open, setOpen] = useState(false);
+
+ useEffect(() => {
+ if (!open) return undefined;
+ const close = () => setOpen(false);
+ window.addEventListener('click', close);
+ return () => window.removeEventListener('click', close);
+ }, [open]);
+
+ const current = options.find(o => o.current) || options[0];
+
+ return (
+ <div className="wp-envswitch-wrap">
+ <button
+ type="button"
+ className={`wp-envswitch ${open ? 'open' : ''}`}
+ onClick={(e) => { e.stopPropagation(); setOpen(o => !o); }}
+ title="Switch environment"
+ >
+ <span className="ed" style={{ background: ENV_DOT_COLORS[current.type] || 'var(--text-faint)' }} />
+ {ENV_TYPE_LABELS[current.type] || current.name}
+ <ChevronDown size={13} className="chev" />
+ </button>
+ {open && (
+ <div className="wp-envswitch-menu" onClick={e => e.stopPropagation()}>
+ <div className="wp-envswitch-head">Switch environment</div>
+ {options.map(o => (
+ <button
+ type="button"
+ className="wp-envswitch-opt"
+ key={o.id}
+ onClick={() => { setOpen(false); if (!o.current) onSelect(o.id); }}
+ >
+ <span className="ed" style={{ background: ENV_DOT_COLORS[o.type] || 'var(--text-faint)' }} />
+ <span className="wp-envswitch-opt-body">
+ <span className="nm">{o.name}</span>
+ <span className="meta">
+ {envTagLabel(o.type)}
+ {o.url ? ` · ${o.url.replace(/^https?:\/\//, '')}` : ''}
+ </span>
+ </span>
+ {o.current && <Check size={14} className="check" />}
+ </button>
+ ))}
+ </div>
+ )}
+ </div>
+ );
+};
+
+// Header alert that nags the operator to secure the site when the primary
+// URL is not HTTPS. Clicking it jumps to SSL settings so the user can enable
+// HTTPS in one click (or see why it can't be issued yet, e.g. localhost).
+export const SSLAlert = ({ site }) => {
+ const isHttps = (site.url || '').startsWith('https://');
+
+ if (!site.url || isHttps) return null;
+
+ return (
+ <Link
+ to={`/wordpress/${site.id}/settings/ssl`}
+ className="sk-pill sk-pill--amber"
+ >
+ <span className="sk-pill__dot" />
+ Not Secured
+ </Link>
+ );
+};
+
+// Friendly labels for the editable php.ini directives (#24 limits panel).
+export const PHP_LIMIT_LABELS = {
+ memory_limit: 'Memory Limit',
+ upload_max_filesize: 'Upload Max Filesize',
+ post_max_size: 'Post Max Size',
+ max_execution_time: 'Max Execution Time',
+ max_input_time: 'Max Input Time',
+ max_input_vars: 'Max Input Vars',
+};
+
+// Updates Tab — safe update schedule options (#29).
+export const UPDATE_SCHEDULES = [
+ { label: 'Off', value: '' },
+ { label: 'Weekly (Sun 3am)', value: '0 3 * * 0' },
+ { label: 'Daily (3am)', value: '0 3 * * *' },
+];
+
+// Analytics Tab — period options (#25).
+export const ANALYTICS_PERIODS = [{ label: '24h', hours: 24 }, { label: '7d', hours: 168 }];
+
+// SSL Certificate panel — guided one-click SSL that walks the user through the
+// prerequisites (public domain, DNS, admin email) and then issues the cert.
+export const SiteSSLPanel = ({ site, onUpdate }) => {
+ const toast = useToast();
+ const domains = site.application?.domains || [];
+ const primaryDomain = (domains.find(d => d.is_primary) || domains[0])?.name || null;
+ // localhost / private-IP / no-domain sites cannot get a public certificate.
+ const isPublicDomain = !!primaryDomain
+ && !/^(localhost|127\.|10\.|192\.168\.|172\.(1[6-9]|2\d|3[01])\.)/.test(primaryDomain)
+ && primaryDomain.includes('.');
+ const hasAdminEmail = !!site.admin_email;
+ const [health, setHealth] = useState(null);
+ const [checking, setChecking] = useState(true);
+ const [issuing, setIssuing] = useState(false);
+
+ // Inline domain attach state (replaces the modal for the SSL flow).
+ const [attachDomain, setAttachDomain] = useState('');
+ const [attaching, setAttaching] = useState(false);
+ const [attachResult, setAttachResult] = useState(null);
+
+ // Connected DNS providers + ServerKit domains so the SSL panel feels linked
+ // to the rest of the app.
+ const [dnsProviders, setDnsProviders] = useState([]);
+ const [serverkitDomains, setServerkitDomains] = useState([]);
+ const [contextLoading, setContextLoading] = useState(true);
+
+ useEffect(() => {
+ if (!primaryDomain) { setChecking(false); return; }
+ let cancelled = false;
+ (async () => {
+ setChecking(true);
+ try {
+ const res = await api.getSSLHealth(primaryDomain);
+ if (!cancelled) setHealth(res);
+ } catch (err) {
+ if (!cancelled) setHealth({ valid: false, error: err.message });
+ } finally {
+ if (!cancelled) setChecking(false);
+ }
+ })();
+ return () => { cancelled = true; };
+ }, [primaryDomain]);
+
+ useEffect(() => {
+ let cancelled = false;
+ (async () => {
+ setContextLoading(true);
+ try {
+ const [providersRes, domainsRes] = await Promise.all([
+ api.getEmailDNSProviders().then(d => d.providers || []).catch(() => []),
+ api.getDomains().then(d => d.domains || []).catch(() => []),
+ ]);
+ if (!cancelled) {
+ setDnsProviders(providersRes);
+ setServerkitDomains(domainsRes);
+ }
+ } finally {
+ if (!cancelled) setContextLoading(false);
+ }
+ })();
+ return () => { cancelled = true; };
+ }, [site.id]);
+
+ async function handleEnableSSL() {
+ if (!primaryDomain || !site.admin_email) return;
+ setIssuing(true);
+ toast.info(`Requesting certificate for ${primaryDomain}...`, { duration: 4000 });
+ try {
+ const res = await api.obtainCertificate({ domains: [primaryDomain], email: site.admin_email, use_nginx: true });
+ if (res.success) {
+ toast.success(res.message || 'Certificate issued');
+ const updated = await api.getSSLHealth(primaryDomain);
+ setHealth(updated);
+ } else {
+ toast.error(res.error || 'Certificate request failed');
+ }
+ } catch (err) {
+ toast.error(err.message || 'Certificate request failed');
+ } finally {
+ setIssuing(false);
+ }
+ }
+
+ async function handleAttachDomain(e) {
+ e?.preventDefault();
+ const domain = attachDomain.trim();
+ if (!domain || attaching) return;
+ setAttaching(true);
+ toast.info('Attaching domain — creating DNS and moving the site…', { duration: 5000 });
+ try {
+ const res = await wordpressApi.attachDomain(site.id, { domain, issueSsl: true });
+ if (res.success) {
+ setAttachResult(res);
+ if (res.dns?.created) toast.success(`DNS A record created via ${res.dns.provider}`);
+ else toast.warning('Domain attached — add the DNS record shown to finish.', { duration: 7000 });
+ onUpdate?.();
+ } else {
+ toast.error(res.error || 'Failed to attach domain');
+ }
+ } catch (err) {
+ toast.error(err.message || 'Failed to attach domain');
+ } finally {
+ setAttaching(false);
+ }
+ }
+
+ const issued = health?.valid;
+ const attachValid = /^[a-z0-9.-]+\.[a-z]{2,}$/i.test(attachDomain.trim());
+
+ const CheckItem = ({ ok, label }) => (
+ <div className="ssl-check-item">
+ {ok ? <CircleCheck size={14} className="ssl-check-icon ssl-check-icon--ok" /> : <CircleX size={14} className="ssl-check-icon ssl-check-icon--missing" />}
+ <span className={ok ? 'ssl-check-label ssl-check-label--ok' : 'ssl-check-label'}>{label}</span>
+ </div>
+ );
+
+ const rec = attachResult?.dns?.record;
+
+ return (
+ <div className="app-panel">
+ <div className="app-panel-header"><Lock size={16} /> SSL Certificate</div>
+ <div className="app-panel-body">
+ <div className="app-info-grid">
+ <div className="app-info-item">
+ <span className="app-info-label">Primary Domain</span>
+ <span className="app-info-value mono">{primaryDomain || 'None configured'}</span>
+ </div>
+ <div className="app-info-item">
+ <span className="app-info-label">Status</span>
+ <span className="app-info-value">
+ <Pill kind={checking ? 'gray' : issued ? 'green' : 'amber'}>
+ {checking ? 'Checking...' : issued ? `Active (${health.grade})` : 'Not Secured'}
+ </Pill>
+ </span>
+ </div>
+ {issued && health.expires_at && (
+ <div className="app-info-item">
+ <span className="app-info-label">Expires</span>
+ <span className="app-info-value">
+ {new Date(health.expires_at).toLocaleDateString()}
+ {typeof health.days_remaining === 'number' ? ` (${health.days_remaining}d)` : ''}
+ </span>
+ </div>
+ )}
+ {issued && health.issuer && (
+ <div className="app-info-item">
+ <span className="app-info-label">Issuer</span>
+ <span className="app-info-value">{health.issuer}</span>
+ </div>
+ )}
+ </div>
+
+ {!isPublicDomain ? (
+ <div className="ssl-guide">
+ <p className="hint">SSL requires a public domain pointed at this server. This site is on <code>{primaryDomain || 'localhost'}</code>, so a certificate cannot be issued here.</p>
+ <div className="ssl-checklist">
+ <CheckItem ok={false} label="Public domain mapped to this site" />
+ <CheckItem ok={hasAdminEmail} label="Admin email set for certificate expiry notices" />
+ </div>
+
+ {!attachResult ? (
+ <form className="ssl-inline-attach" onSubmit={handleAttachDomain}>
+ {contextLoading ? (
+ <p className="hint">Loading domain connections…</p>
+ ) : (
+ <div className="ssl-context">
+ {dnsProviders.length > 0 ? (
+ <div className="ssl-provider-status ssl-provider-status--ok">
+ <CircleCheck size={14} />
+ DNS auto-managed via {dnsProviders.map(p => p.name || p.provider).join(', ')}
+ </div>
+ ) : (
+ <div className="ssl-provider-status ssl-provider-status--missing">
+ <CircleX size={14} />
+ No DNS provider connected — add Cloudflare/Route53/etc. for automatic records, or add the DNS record manually after attaching.
+ </div>
+ )}
+ <div className="ssl-context-links">
+ <Link to="/settings/connections">DNS connections</Link>
+ <span>·</span>
+ <Link to="/domains">Manage domains</Link>
+ </div>
+ </div>
+ )}
+
+ <div className="form-group">
+ <Label>Domain</Label>
+ <Input
+ type="text"
+ value={attachDomain}
+ onChange={(e) => setAttachDomain(e.target.value)}
+ placeholder="example.com"
+ disabled={attaching}
+ list="ssl-existing-domains"
+ />
+ <datalist id="ssl-existing-domains">
+ {serverkitDomains
+ .filter(d => !domains.some(ad => ad.name === d.name))
+ .map(d => (
+ <option key={d.id} value={d.name}>
+ {d.ssl_enabled ? 'SSL enabled' : 'No SSL'}
+ </option>
+ ))}
+ </datalist>
+ <span className="form-hint">Pick an existing ServerKit domain or type one you control, without http://</span>
+ </div>
+ <div className="app-detail-actions">
+ <Button type="submit" disabled={!attachValid || attaching}>
+ <Globe size={14} />
+ {attaching ? 'Attaching…' : 'Attach Domain & Enable SSL'}
+ </Button>
+ </div>
+ </form>
+ ) : (
+ <div className="ssl-attach-result">
+ <div className="ssl-attach-result__success">
+ <CircleCheck size={16} />
+ Site is now at <code>{attachResult.url}</code>
+ </div>
+ {attachResult.dns?.created ? (
+ <p className="hint">DNS A record created automatically via {attachResult.dns.provider}{attachResult.dns.zone ? ` (zone ${attachResult.dns.zone})` : ''}.</p>
+ ) : (
+ <div className="ssl-attach-result__manual">
+ <strong>Add this DNS record to finish:</strong>
+ {rec?.value ? (
+ <code className="ssl-attach-result__record">{rec.type}&nbsp;&nbsp;{rec.name}&nbsp;→&nbsp;{rec.value}</code>
+ ) : (
+ <p className="hint">{attachResult.dns?.message}</p>
+ )}
+ </div>
+ )}
+ {attachResult.warning && <p className="hint">{attachResult.warning}</p>}
+ </div>
+ )}
+ </div>
+ ) : !hasAdminEmail ? (
+ <div className="ssl-guide">
+ <p className="hint">A public domain is configured, but an admin email is required before requesting a certificate.</p>
+ <div className="ssl-checklist">
+ <CheckItem ok label={`Domain ${primaryDomain} configured`} />
+ <CheckItem ok={false} label="Admin email set" />
+ </div>
+ <p className="hint">Update the site&apos;s admin email in Settings → General, then return here to enable SSL.</p>
+ </div>
+ ) : (
+ <div className="ssl-guide">
+ {issued ? (
+ <p className="hint">This site is secured with a valid SSL certificate. You can re-issue it if needed.</p>
+ ) : (
+ <>
+ <p className="hint">Everything is ready. One click will request a free certificate from Let&apos;s Encrypt and configure the server.</p>
+ <div className="ssl-checklist">
+ <CheckItem ok label={`Domain ${primaryDomain} configured`} />
+ <CheckItem ok label="Admin email set" />
+ </div>
+ </>
+ )}
+ <div className="app-detail-actions">
+ <Button onClick={handleEnableSSL} disabled={issuing}>
+ {issued ? <Shield size={14} /> : <Lock size={14} />}
+ {issuing ? 'Requesting...' : issued ? 'Re-issue Certificate' : 'Enable SSL'}
+ </Button>
+ </div>
+ </div>
+ )}
+ </div>
+ </div>
+ );
+};
+
+// Reusable Skeleton Components for Tabs
+export const EnvironmentCardSkeleton = () => (
+ <div className="wp-env-card-skeleton">
+ <div className="wp-env-card-skeleton-header">
+ <div className="wp-env-card-skeleton-badge" />
+ <div className="wp-env-card-skeleton-status" />
+ </div>
+ <div className="wp-env-card-skeleton-body">
+ <div className="wp-env-card-skeleton-url" />
+ <div className="wp-env-card-skeleton-meta">
+ <div className="wp-env-card-skeleton-meta-item">
+ <div className="skeleton-label" />
+ <div className="skeleton-value" />
+ </div>
+ <div className="wp-env-card-skeleton-meta-item">
+ <div className="skeleton-label" />
+ <div className="skeleton-value" />
+ </div>
+ </div>
+ </div>
+ <div className="wp-env-card-skeleton-footer">
+ <div className="skeleton" style={{ flex: 1, height: 28, borderRadius: 4 }} />
+ <div className="skeleton" style={{ flex: 1, height: 28, borderRadius: 4 }} />
+ </div>
+ </div>
+);
+
+export const ListItemSkeleton = () => (
+ <div className="skeleton" style={{ height: 48, borderRadius: 6, marginBottom: 8 }} />
+);
+
+// Generic panel skeleton — matches .app-panel + .app-panel-header + .app-panel-body
+export const PanelSkeleton = ({ headerWidth = 100, rows = 3, children }) => (
+ <div className="app-panel wp-detail-skeleton-panel">
+ <div className="app-panel-header">
+ <div className="skeleton" style={{ width: headerWidth, height: 12 }} />
+ </div>
+ <div className="app-panel-body">
+ {children || (
+ <div className="wp-detail-skeleton-rows">
+ {Array.from({ length: rows }).map((_, i) => (
+ <div key={i} className="wp-detail-skeleton-row">
+ <div className="skeleton" style={{ width: '35%', height: 10 }} />
+ <div className="skeleton" style={{ width: '55%', height: 14 }} />
+ </div>
+ ))}
+ </div>
+ )}
+ </div>
+ </div>
+);
+
+// Skeleton used by tabs that render inside .app-overview-grid > .app-overview-left
+export const OverviewGridSkeleton = ({ panels = 2 }) => (
+ <div className="app-overview-grid">
+ <div className="app-overview-left">
+ {Array.from({ length: panels }).map((_, i) => (
+ <PanelSkeleton key={i} headerWidth={i === 0 ? 120 : 160} />
+ ))}
+ </div>
+ </div>
+);
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/index.js b/frontend/src/plugins/serverkit-wordpress/components/wordpress/index.js
new file mode 100644
index 00000000..965680fc
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/index.js
@@ -0,0 +1,21 @@
+export { default as WordPressSiteCard } from './WordPressSiteCard';
+export { default as EnvironmentCard } from './EnvironmentCard';
+export { default as SnapshotTable } from './SnapshotTable';
+export { default as GitConnectForm } from './GitConnectForm';
+export { default as CommitList } from './CommitList';
+export { default as PipelineView } from './PipelineView';
+export { default as PromoteModal } from './PromoteModal';
+export { default as SyncModal } from './SyncModal';
+export { default as ActivityFeed } from './ActivityFeed';
+export { default as ContainerLogs } from './ContainerLogs';
+export { default as EnvironmentStatusBadge } from './EnvironmentStatusBadge';
+export { default as CompareView } from './CompareView';
+export { default as SanitizationProfileForm } from './SanitizationProfileForm';
+export { default as ResourceLimitsModal } from './ResourceLimitsModal';
+export { default as BasicAuthModal } from './BasicAuthModal';
+export { default as WpCliTerminal } from './WpCliTerminal';
+export { default as HealthStatusPanel } from './HealthStatusPanel';
+export { HealthDot } from './HealthStatusPanel';
+export { default as DiskUsageBar } from './DiskUsageBar';
+export { default as AutoSyncScheduleModal } from './AutoSyncScheduleModal';
+export { default as BulkActionsBar } from './BulkActionsBar';
diff --git a/frontend/src/plugins/serverkit-wordpress/components/wordpress/wordpressTabs.jsx b/frontend/src/plugins/serverkit-wordpress/components/wordpress/wordpressTabs.jsx
new file mode 100644
index 00000000..05e9f5a1
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/components/wordpress/wordpressTabs.jsx
@@ -0,0 +1,12 @@
+import { Globe, GitBranch, Package } from 'lucide-react';
+
+// Shared sub-nav for the WordPress page group (WordPress sites / Pipeline).
+// Rendered in each page's <PageTopbar tabs={WORDPRESS_TABS}> — the demo's
+// top-bar layout replaces the old sidebar sub-menu (REDESIGN_MAP §6 dec. 3).
+// (The Pipeline tab was wpInstalled-gated in the sidebar; kept always-visible
+// here for simplicity — the pipeline page shows an empty state when unused.)
+export const WORDPRESS_TABS = [
+ { to: '/wordpress', label: 'WordPress', end: true, icon: <Globe size={15} /> },
+ { to: '/wordpress/plugins/library', label: 'Plugin Library', icon: <Package size={15} /> },
+ { to: '/wordpress/pipelines', label: 'Pipeline', icon: <GitBranch size={15} /> },
+];
diff --git a/frontend/src/plugins/serverkit-wordpress/index.jsx b/frontend/src/plugins/serverkit-wordpress/index.jsx
index b6defac9..6d7b0486 100644
--- a/frontend/src/plugins/serverkit-wordpress/index.jsx
+++ b/frontend/src/plugins/serverkit-wordpress/index.jsx
@@ -1,12 +1,20 @@
-// WordPress UI, contributed through the extension system. The full WordPress
-// backend (the /api/v1/wordpress* blueprints + services) lives in this
-// extension's backend/; the page components stay in the host pages/ dir and are
-// re-used here (same re-export pattern as serverkit-git/email/workflows) so
-// their many relative imports keep resolving.
-//
-// After sync this file lives at frontend/src/plugins/serverkit-wordpress/ so the
-// relative imports resolve against the host's src/ tree.
+// WordPress UI, contributed through the extension system. Both halves now
+// live in this extension: the backend (the /api/v1/wordpress* blueprints +
+// services) under backend/, and the full frontend (5 pages + the
+// components/wordpress tree + styles/) here — moved out of the host's pages/
+// and styles/ in plan 52 Phase 4. After `sync-builtin-frontends.mjs` this
+// tree is baked at frontend/src/plugins/serverkit-wordpress/, where the host
+// build compiles it (the @/ alias imports that remain resolve there; the
+// runtime-ESM conversion that drops them is Phase 5).
//
+// Styles ship with the extension: the three SCSS entries below are compiled
+// by the host build through this module graph (they import the host's
+// variables partial via a sync-safe relative path), replacing the former
+// main.scss partials.
+import './styles/wordpress.scss';
+import './styles/wordpress-pipeline.scss';
+import './styles/wordpress-plugin-library.scss';
+
// The WordPress surface is a tab group + full-bleed detail pages. Contributed
// routes are flat (there's no way to contribute a shared TabGroupLayout parent
// inside the dashboard), so we contribute ONE splat route (`wordpress/*`) and
@@ -15,14 +23,14 @@
// over the three list pages; full-bleed detail/pipeline routes as siblings;
// the legacy /wordpress/projects → /wordpress/pipelines deprecation redirects).
import { Routes, Route, Navigate, useParams } from 'react-router-dom';
+import { TabGroupLayout } from 'serverkit-sdk';
-import TabGroupLayout from '../../layouts/TabGroupLayout';
-import { WORDPRESS_TABS } from '../../components/wordpress/wordpressTabs';
-import WordPress from '../../pages/WordPress';
-import WordPressPluginLibrary from '../../pages/WordPressPluginLibrary';
-import WordPressProjects from '../../pages/WordPressProjects';
-import WordPressProject from '../../pages/WordPressProject';
-import WordPressDetail from '../../pages/WordPressDetail';
+import { WORDPRESS_TABS } from './components/wordpress/wordpressTabs';
+import WordPress from './pages/WordPress';
+import WordPressPluginLibrary from './pages/WordPressPluginLibrary';
+import WordPressProjects from './pages/WordPressProjects';
+import WordPressProject from './pages/WordPressProject';
+import WordPressDetail from './pages/WordPressDetail';
import WordPressSshImport from './WordPressSshImport';
// "WordPress Projects" was renamed to "Pipelines" (§2 unification). Forward old
diff --git a/frontend/src/plugins/serverkit-wordpress/pages/WordPress.jsx b/frontend/src/plugins/serverkit-wordpress/pages/WordPress.jsx
new file mode 100644
index 00000000..e47fffb5
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/pages/WordPress.jsx
@@ -0,0 +1,677 @@
+import { useState, useEffect } from 'react';
+import { useNavigate } from 'react-router-dom';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import ResourceAdvisory from '@/components/ResourceAdvisory';
+import { Spinner } from 'serverkit-sdk';
+import ResourceListPage from '@/components/layouts/ResourceListPage';
+import { Globe, ChevronRight } from 'lucide-react';
+import { Pill, ServiceTile, Drawer } from 'serverkit-sdk';
+import { useTopbarActions } from 'serverkit-sdk';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { Checkbox } from 'serverkit-sdk';
+import { SkeletonBoundary } from 'serverkit-sdk';
+
+// Mirror the backend slug rule (a-z, 0-9, single dashes) so the create modal can
+// preview the exact <slug>.<base> host the site will be published at.
+function slugifyPreview(name) {
+ return (name || '').toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '') || 'site';
+}
+
+function WordPress() {
+ const [sites, setSites] = useState([]);
+ const [loading, setLoading] = useState(true);
+ const [activeTag, setActiveTag] = useState(null); // null = show all
+ const [statusFilter, setStatusFilter] = useState('all'); // all | running | stopped
+ const [siteSearch, setSiteSearch] = useState(''); // client-side name/title/domain filter
+ const [showCreateModal, setShowCreateModal] = useState(false);
+ const [createLoading, setCreateLoading] = useState(false);
+ const [createForm, setCreateForm] = useState({
+ name: '', domain: '', adminEmail: '', phpVersion: '', enablePageCache: false, enableObjectCache: false,
+ baseDomain: '',
+ });
+ // Base domains a new site can be published under (<slug>.<base>), loaded when
+ // the create modal opens. Empty when site routing isn't configured.
+ const [baseDomains, setBaseDomains] = useState([]);
+ const [createdCreds, setCreatedCreds] = useState(null);
+ // Where a freshly-created site is reachable, so we can tell the user it is
+ // already live (at <slug>.<base>, HTTPS when the wildcard cert is set up)
+ // rather than leaving them to wonder — or nudge them to set a base domain
+ // when the site only came up on localhost.
+ const [createdSite, setCreatedSite] = useState(null);
+ const [showImportModal, setShowImportModal] = useState(false);
+ const [importLoading, setImportLoading] = useState(false);
+ const [importForm, setImportForm] = useState({ name: '', adminEmail: '', oldUrl: '' });
+ const [importFile, setImportFile] = useState(null);
+ const [wpContentFile, setWpContentFile] = useState(null);
+ const [selectedIds, setSelectedIds] = useState(new Set());
+ const [bulkLoading, setBulkLoading] = useState(false);
+
+ const navigate = useNavigate();
+ const toast = useToast();
+
+ useEffect(() => {
+ loadSites();
+ }, []);
+
+ // Load the available base domains when the create modal opens, and preselect
+ // the default so the site publishes under it unless the user picks another.
+ useEffect(() => {
+ if (!showCreateModal) return;
+ let cancelled = false;
+ (async () => {
+ try {
+ const data = await wordpressApi.listBaseDomains();
+ if (cancelled) return;
+ const bases = data.base_domains || [];
+ setBaseDomains(bases);
+ setCreateForm(f => ({ ...f, baseDomain: f.baseDomain || data.default || '' }));
+ } catch {
+ if (!cancelled) setBaseDomains([]);
+ }
+ })();
+ return () => { cancelled = true; };
+ }, [showCreateModal]);
+
+ const loadSites = async () => {
+ setLoading(true);
+ try {
+ const data = await wordpressApi.getSites();
+ setSites(data.sites || []);
+ } catch (error) {
+ console.error('Failed to load WordPress sites:', error);
+ setSites([]);
+ } finally {
+ setLoading(false);
+ }
+ };
+
+ const handleCreate = async () => {
+ if (!createForm.name) {
+ toast.error('Site name is required');
+ return;
+ }
+
+ setCreateLoading(true);
+ try {
+ const result = await wordpressApi.createSite(createForm);
+ if (result.success) {
+ if (result.admin_password) {
+ // The generated admin password is returned once — surface it.
+ setCreatedCreds({ user: result.admin_user || 'admin', password: result.admin_password });
+ }
+ if (result.url) {
+ setCreatedSite({ url: result.url, domain: result.domain || null });
+ }
+ if (result.warning) {
+ toast.info(result.warning, { duration: 8000 });
+ }
+ toast.success('WordPress site created successfully');
+ setShowCreateModal(false);
+ setCreateForm({ name: '', domain: '', adminEmail: '', phpVersion: '', enablePageCache: false, enableObjectCache: false, baseDomain: '' });
+ await loadSites();
+ } else {
+ toast.error(result.error || 'Failed to create site');
+ }
+ } catch (error) {
+ toast.error(`Failed to create site: ${error.message}`);
+ } finally {
+ setCreateLoading(false);
+ }
+ };
+
+ // Bulk ops fan out per-site (no bulk route yet — §5); `applies` filters the
+ // selection to sites the action makes sense for.
+ const bulkRun = async (label, fn, applies = () => true) => {
+ const targets = sites.filter(s => selectedIds.has(s.id) && applies(s));
+ if (targets.length === 0) {
+ toast.info(`No selected sites need "${label}"`);
+ return;
+ }
+ setBulkLoading(true);
+ try {
+ const results = await Promise.allSettled(targets.map(s => fn(s)));
+ const failed = results.filter(r => r.status === 'rejected').length;
+ if (failed) toast.error(`${label}: ${failed} of ${targets.length} failed`);
+ else toast.success(`${label} sent to ${targets.length} site${targets.length === 1 ? '' : 's'}`);
+ setSelectedIds(new Set());
+ await loadSites();
+ } finally {
+ setBulkLoading(false);
+ }
+ };
+
+ const handleImport = async () => {
+ if (!importForm.name) { toast.error('Site name is required'); return; }
+ if (!importForm.oldUrl) { toast.error('Original site URL is required'); return; }
+ if (!importFile) { toast.error('A .sql or .sql.gz dump is required'); return; }
+ setImportLoading(true);
+ try {
+ const result = await wordpressApi.importSite({
+ name: importForm.name,
+ adminEmail: importForm.adminEmail,
+ oldUrl: importForm.oldUrl,
+ sqlFile: importFile,
+ wpContentFile: wpContentFile,
+ });
+ if (result.success) {
+ toast.success('WordPress site imported successfully');
+ if (result.wp_content_imported) toast.success('wp-content (plugins/themes/uploads) imported');
+ if (result.warning) toast.info(result.warning, { duration: 8000 });
+ setShowImportModal(false);
+ setImportForm({ name: '', adminEmail: '', oldUrl: '' });
+ setImportFile(null);
+ setWpContentFile(null);
+ await loadSites();
+ } else {
+ toast.error(result.error || 'Failed to import site');
+ }
+ } catch (error) {
+ toast.error(`Failed to import site: ${error.message}`);
+ } finally {
+ setImportLoading(false);
+ }
+ };
+
+ useTopbarActions(() =>
+ <>
+ <Button variant="outline" size="sm" onClick={() => navigate('/imports')}>
+ Import a site
+ </Button>
+ <Button variant="outline" size="sm" onClick={() => setShowImportModal(true)}>
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
+ Import Site
+ </Button>
+ <Button size="sm" onClick={() => setShowCreateModal(true)}>
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
+ Create Site
+ </Button>
+ </>,
+ []
+ );
+
+ const wpListSkeleton = (
+ <div className="wp-sites-grid">
+ {[1, 2, 3].map(i => (
+ <div key={i} className="wp-site-card-skeleton">
+ <div className="wp-site-card-skeleton-header">
+ <div className="wp-site-card-skeleton-icon" />
+ <div className="wp-site-card-skeleton-info">
+ <div className="wp-site-card-skeleton-name" />
+ <div className="wp-site-card-skeleton-url" />
+ </div>
+ <div className="wp-site-card-skeleton-status" />
+ </div>
+ <div className="wp-site-card-skeleton-body">
+ <div className="wp-site-card-skeleton-meta">
+ <div className="wp-site-card-skeleton-label" />
+ <div className="wp-site-card-skeleton-value" />
+ </div>
+ <div className="wp-site-card-skeleton-meta">
+ <div className="wp-site-card-skeleton-label" />
+ <div className="wp-site-card-skeleton-value" />
+ </div>
+ </div>
+ </div>
+ ))}
+ </div>
+ );
+
+ if (loading) {
+ return (
+ <SkeletonBoundary
+ className="sk-tabgroup__inner wordpress-page"
+ loading
+ skeleton={wpListSkeleton}
+ />
+ );
+ }
+
+ const allTags = Array.from(new Set(sites.flatMap(s => s.tags || []))).sort();
+ const runningCount = sites.filter(s => s.status === 'running').length;
+ const q = siteSearch.trim().toLowerCase();
+ const siteLabel = site => site.name || site.application?.name || `Site ${site.id}`;
+ const shownSites = sites.filter(site => (
+ (statusFilter === 'all'
+ || (statusFilter === 'running' ? site.status === 'running' : site.status !== 'running'))
+ && (activeTag === null || (site.tags || []).includes(activeTag))
+ && (q === '' || [siteLabel(site), site.title, site.url, site.domain]
+ .some(v => v && String(v).toLowerCase().includes(q)))
+ ));
+ const allSelected = shownSites.length > 0 && shownSites.every(s => selectedIds.has(s.id));
+
+ const columns = [
+ {
+ key: '__select',
+ className: 'wp-list__ck',
+ cellClassName: 'wp-list__ck',
+ header: (
+ <Checkbox
+ checked={allSelected}
+ onCheckedChange={(checked) => setSelectedIds(checked ? new Set(shownSites.map(s => s.id)) : new Set())}
+ aria-label="Select all sites"
+ />
+ ),
+ render: (site) => (
+ <div onClick={e => e.stopPropagation()}>
+ <Checkbox
+ checked={selectedIds.has(site.id)}
+ onCheckedChange={(checked) => {
+ setSelectedIds(prev => {
+ const next = new Set(prev);
+ if (checked) next.add(site.id);
+ else next.delete(site.id);
+ return next;
+ });
+ }}
+ aria-label={`Select ${site.name || `site ${site.id}`}`}
+ />
+ </div>
+ ),
+ },
+ {
+ key: 'name',
+ header: 'Site',
+ render: (site) => (
+ <div className="sk-cell-name">
+ <ServiceTile name={siteLabel(site)} size={30} className="wp-list__tile" aria-hidden="true" />
+ <span>
+ <div>{siteLabel(site)}</div>
+ {site.port && <div className="sk-cell-sub">:{site.port}</div>}
+ </span>
+ </div>
+ ),
+ },
+ { key: 'environments', header: 'Environments', cellClassName: 'sk-cell-mono', render: (site) => (site.environment_count || 0) + 1 },
+ { key: 'version', header: 'Version', cellClassName: 'sk-cell-mono', render: (site) => `WP ${site.wp_version || '6.4'}` },
+ {
+ key: 'status',
+ header: 'Status',
+ render: (site) => (
+ <Pill kind={site.status === 'running' ? 'green' : 'gray'}>
+ {site.status === 'running' ? 'Running' : 'Stopped'}
+ </Pill>
+ ),
+ },
+ {
+ key: 'tags',
+ header: 'Tags',
+ render: (site) => (
+ site.tags?.length
+ ? site.tags.map(tag => <span key={tag} className="sk-tag">{tag}</span>)
+ : <span className="wp-list__dash">—</span>
+ ),
+ },
+ {
+ key: '__links',
+ header: '',
+ width: 70,
+ render: (site) => (
+ site.url && site.status === 'running' ? (
+ <div className="wp-list__links" onClick={e => e.stopPropagation()}>
+ <a href={site.url} target="_blank" rel="noopener noreferrer" title="Open site" aria-label="Open site">
+ <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>
+ </a>
+ <a href={`${site.url}/wp-admin`} target="_blank" rel="noopener noreferrer" title="WP Admin" aria-label="WP Admin">
+ <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>
+ </a>
+ </div>
+ ) : (
+ <ChevronRight size={16} className="wp-list__chev" />
+ )
+ ),
+ },
+ ];
+
+ return (
+ <ResourceListPage
+ className="wordpress-page"
+ totalCount={sites.length}
+ items={shownSites}
+ columns={columns}
+ keyField="id"
+ onRowClick={(site) => navigate(`/wordpress/${site.id}`)}
+ rowClassName={(site) => (selectedIds.has(site.id) ? 'is-selected' : '')}
+ header={<>
+ {/* Advisory, not a gate: a constrained server says so here and
+ the operator still decides. */}
+ <ResourceAdvisory workload="wordpress" />
+ {(createdCreds || createdSite) && (
+ <div className="wp-creds-banner">
+ <div className="wp-creds-banner-text">
+ {createdSite && (createdSite.domain ? (
+ <span>
+ Your site is live at{' '}
+ <a href={createdSite.url} target="_blank" rel="noopener noreferrer"><code>{createdSite.domain}</code></a>
+ {createdSite.url?.startsWith('https') ? ' — HTTPS is ready.' : '.'}
+ </span>
+ ) : (
+ <span>
+ Your site is running at{' '}
+ <a href={createdSite.url} target="_blank" rel="noopener noreferrer"><code>{createdSite.url}</code></a>.
+ {' '}Set a managed-sites base domain in Settings to publish it at a public URL.
+ </span>
+ ))}
+ {createdCreds && (
+ <>
+ <strong>Save these admin credentials — they are shown only once.</strong>
+ <span>Username: <code>{createdCreds.user}</code></span>
+ <span>Password: <code>{createdCreds.password}</code></span>
+ </>
+ )}
+ </div>
+ <Button variant="ghost" onClick={() => { setCreatedCreds(null); setCreatedSite(null); }}>Dismiss</Button>
+ </div>
+ )}
+ </>}
+ filters={[
+ { value: 'all', label: 'All', count: sites.length },
+ { value: 'running', label: 'Running', count: runningCount },
+ { value: 'stopped', label: 'Stopped', count: sites.length - runningCount },
+ ]}
+ activeFilter={statusFilter}
+ onFilterChange={setStatusFilter}
+ searchTerm={siteSearch}
+ onSearchChange={setSiteSearch}
+ searchPlaceholder="Search sites…"
+ toolbarExtra={allTags.length > 0 && (
+ <div className="wp-tag-filter">
+ <button type="button"
+ className={`wp-tag-chip wp-tag-chip--filter ${activeTag === null ? 'is-active' : ''}`}
+ onClick={() => setActiveTag(null)}
+ >
+ All tags
+ </button>
+ {allTags.map(tag => (
+ <button type="button"
+ key={tag}
+ className={`wp-tag-chip wp-tag-chip--filter ${activeTag === tag ? 'is-active' : ''}`}
+ onClick={() => setActiveTag(tag)}
+ >
+ {tag}
+ </button>
+ ))}
+ </div>
+ )}
+ selectedCount={selectedIds.size}
+ onClearSelection={() => setSelectedIds(new Set())}
+ bulkActions={
+ <>
+ <Button variant="outline" size="sm" disabled={bulkLoading}
+ onClick={() => bulkRun('Start', s => wordpressApi.unarchiveSite(s.id), s => s.status !== 'running')}>
+ Start
+ </Button>
+ <Button variant="outline" size="sm" disabled={bulkLoading}
+ onClick={() => bulkRun('Stop', s => wordpressApi.archiveSite(s.id), s => s.status === 'running')}>
+ Stop
+ </Button>
+ <Button variant="outline" size="sm" disabled={bulkLoading}
+ onClick={() => bulkRun('Update core', s => wordpressApi.updateCore(s.id), s => s.status === 'running')}>
+ Update
+ </Button>
+ <Button variant="outline" size="sm" disabled={bulkLoading}
+ onClick={() => bulkRun('Backup', s => wordpressApi.createSnapshot(s.id, { name: 'bulk-backup' }), s => s.status === 'running')}>
+ Backup
+ </Button>
+ <Button variant="outline" size="sm" disabled={bulkLoading}
+ onClick={() => bulkRun('Clear cache', s => wordpressApi.flushCache(s.id), s => s.status === 'running')}>
+ Clear cache
+ </Button>
+ </>
+ }
+ emptyIcon={Globe}
+ emptyTitle="No WordPress Sites"
+ emptyDescription="Create your first WordPress site powered by Docker. Each site gets its own isolated environment with MySQL."
+ emptyAction={
+ <Button onClick={() => setShowCreateModal(true)}>
+ Create Site
+ </Button>
+ }
+ filteredEmptyIcon={Globe}
+ filteredEmptyTitle="No sites found"
+ filteredEmptyDescription="Try adjusting your search or filter"
+ >
+ {/* Import Site Modal */}
+ <Modal
+ open={showImportModal}
+ onClose={() => !importLoading && setShowImportModal(false)}
+ title="Import WordPress Site"
+ size="lg"
+ >
+ <div className="modal-body">
+ <div className="install-warning">
+ <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><circle cx="12" cy="12" r="10"/><path d="M12 8v4M12 16h.01"/></svg>
+ <div>
+ <strong>Imports a database dump into a new stack:</strong>
+ <ul>
+ <li>Provisions a fresh WordPress + MySQL container</li>
+ <li>Loads your .sql / .sql.gz dump</li>
+ <li>Rewrites the site URL to this server</li>
+ </ul>
+ </div>
+ </div>
+
+ <div className="form-group">
+ <Label>Site Name <span className="required">*</span></Label>
+ <Input
+ type="text"
+ value={importForm.name}
+ onChange={e => setImportForm({ ...importForm, name: e.target.value })}
+ placeholder="my-imported-site"
+ disabled={importLoading}
+ />
+ <span className="form-hint">Used as the Docker project name. Letters, numbers, and hyphens only.</span>
+ </div>
+
+ <div className="form-group">
+ <Label>Original Site URL <span className="required">*</span></Label>
+ <Input
+ type="text"
+ value={importForm.oldUrl}
+ onChange={e => setImportForm({ ...importForm, oldUrl: e.target.value })}
+ placeholder="https://old-site.com"
+ disabled={importLoading}
+ />
+ <span className="form-hint">The live URL in your dump; we rewrite it to the localhost address on this server.</span>
+ </div>
+
+ <div className="form-group">
+ <Label>Admin Email</Label>
+ <Input
+ type="email"
+ value={importForm.adminEmail}
+ onChange={e => setImportForm({ ...importForm, adminEmail: e.target.value })}
+ placeholder="[email protected]"
+ disabled={importLoading}
+ />
+ </div>
+
+ <div className="form-group">
+ <Label>Database Dump <span className="required">*</span></Label>
+ <input
+ type="file"
+ accept=".sql,.gz,.sql.gz"
+ disabled={importLoading}
+ onChange={e => setImportFile(e.target.files?.[0] || null)}
+ />
+ <span className="form-hint">Export via phpMyAdmin or the wp db export command. .sql.gz is supported and recommended (100MB upload limit).</span>
+ </div>
+
+ <div className="form-group">
+ <Label>wp-content archive (optional)</Label>
+ <input
+ type="file"
+ accept=".zip"
+ disabled={importLoading}
+ onChange={e => setWpContentFile(e.target.files?.[0] || null)}
+ />
+ <span className="form-hint">A .zip of wp-content (plugins/themes/uploads) or the full site. Copied into the new container after the database import. Leave empty to import the database only.</span>
+ </div>
+ </div>
+ <div className="modal-footer">
+ <Button variant="outline" onClick={() => setShowImportModal(false)} disabled={importLoading}>
+ Cancel
+ </Button>
+ <Button onClick={handleImport} disabled={importLoading || !importForm.name || !importForm.oldUrl || !importFile}>
+ {importLoading ? <><Spinner size="sm" /> Importing...</> : 'Import Site'}
+ </Button>
+ </div>
+ </Modal>
+
+ {/* Create Site — the same drawer shape the templates catalog uses, so
+ creating a WordPress site and deploying a template feel like one
+ product rather than two. */}
+ <Drawer
+ flush
+ open={showCreateModal}
+ onOpenChange={(next) => { if (!next && !createLoading) setShowCreateModal(false); }}
+ title="Create WordPress Site"
+ subtitle="WordPress + MySQL on an isolated Docker network"
+ icon={<Globe size={20} />}
+ width={560}
+ className="sk-formdrawer"
+ >
+ <div className="sk-formdrawer__form">
+ <div className="sk-formdrawer__body">
+ <div className="sk-formdrawer__callout">
+ <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><circle cx="12" cy="12" r="10"/><path d="M12 8v4M12 16h.01"/></svg>
+ <div>
+ <strong>This will create:</strong>
+ <ul>
+ <li>WordPress 6.4 (Apache) container</li>
+ <li>MySQL 8.0 database container</li>
+ <li>Isolated Docker network</li>
+ </ul>
+ </div>
+ </div>
+
+ <div className="sk-formdrawer__field">
+ <Label>
+ Site Name <span className="required">*</span>
+ </Label>
+ <Input
+ type="text"
+ value={createForm.name}
+ onChange={e => setCreateForm({ ...createForm, name: e.target.value })}
+ placeholder="my-wordpress-site"
+ disabled={createLoading}
+ />
+ <span className="sk-formdrawer__hint">Used as the Docker project name. Letters, numbers, and hyphens only.</span>
+ </div>
+
+ {baseDomains.length > 0 ? (
+ <div className="sk-formdrawer__field">
+ <Label>Publish under</Label>
+ <select
+ value={createForm.baseDomain}
+ onChange={e => setCreateForm({ ...createForm, baseDomain: e.target.value })}
+ disabled={createLoading}
+ >
+ {baseDomains.map(b => (
+ <option key={b.domain} value={b.domain}>
+ {b.domain}{b.is_default ? ' (default)' : ''}{b.https_enabled ? ' — HTTPS' : ''}
+ </option>
+ ))}
+ </select>
+ <span className="sk-formdrawer__hint">
+ {createForm.name
+ ? <>The site will be live at <code>{slugifyPreview(createForm.name)}.{createForm.baseDomain}</code>.</>
+ : <>Which base domain to publish this site under.</>}
+ </span>
+ </div>
+ ) : (
+ <div className="sk-formdrawer__field">
+ <Label>Publish under</Label>
+ <span className="sk-formdrawer__hint">No base domain configured — the site will be reachable at <code>localhost:&lt;port&gt;</code>. Add a managed-sites base domain in Settings to publish it at a real subdomain.</span>
+ </div>
+ )}
+
+ <div className="sk-formdrawer__field">
+ <Label>Custom Domain</Label>
+ <Input
+ type="text"
+ value={createForm.domain}
+ onChange={e => setCreateForm({ ...createForm, domain: e.target.value })}
+ placeholder="example.com"
+ disabled={createLoading}
+ />
+ <span className="sk-formdrawer__hint">Optional. Overrides the base domain above — the site is created and migrated to this domain.</span>
+ </div>
+
+ <div className="sk-formdrawer__field">
+ <Label>Admin Email</Label>
+ <Input
+ type="email"
+ value={createForm.adminEmail}
+ onChange={e => setCreateForm({ ...createForm, adminEmail: e.target.value })}
+ placeholder="[email protected]"
+ disabled={createLoading}
+ />
+ </div>
+
+ <div className="sk-formdrawer__field">
+ <Label>PHP Version</Label>
+ <select
+ value={createForm.phpVersion}
+ onChange={e => setCreateForm({ ...createForm, phpVersion: e.target.value })}
+ disabled={createLoading}
+ >
+ <option value="">Default (latest for WordPress 6.4)</option>
+ <option value="8.1">PHP 8.1</option>
+ <option value="8.2">PHP 8.2</option>
+ <option value="8.3">PHP 8.3</option>
+ </select>
+ <span className="sk-formdrawer__hint">Baked into the container image at creation. Changeable later from the PHP tab.</span>
+ </div>
+
+ <div className="sk-formdrawer__field">
+ <label className="checkbox-label">
+ <input
+ type="checkbox"
+ checked={createForm.enablePageCache}
+ onChange={e => setCreateForm({ ...createForm, enablePageCache: e.target.checked })}
+ disabled={createLoading}
+ />
+ Enable full-page cache
+ </label>
+ <span className="sk-formdrawer__hint">Disk page cache with WordPress-aware skip rules (admin, login, cart, checkout).</span>
+ </div>
+
+ <div className="sk-formdrawer__field">
+ <label className="checkbox-label">
+ <input
+ type="checkbox"
+ checked={createForm.enableObjectCache}
+ onChange={e => setCreateForm({ ...createForm, enableObjectCache: e.target.checked })}
+ disabled={createLoading}
+ />
+ Enable Redis object cache
+ </label>
+ <span className="sk-formdrawer__hint">Uses the bundled Redis container with the redis-cache drop-in.</span>
+ </div>
+ </div>
+ <div className="sk-formdrawer__foot">
+ <Button
+ variant="outline"
+ onClick={() => setShowCreateModal(false)}
+ disabled={createLoading}
+ >
+ Cancel
+ </Button>
+ <Button
+ onClick={handleCreate}
+ disabled={createLoading || !createForm.name}
+ >
+ {createLoading ? <><Spinner size="sm" /> Creating...</> : 'Create Site'}
+ </Button>
+ </div>
+ </div>
+ </Drawer>
+ </ResourceListPage>
+ );
+}
+
+export default WordPress;
diff --git a/frontend/src/plugins/serverkit-wordpress/pages/WordPressDetail.jsx b/frontend/src/plugins/serverkit-wordpress/pages/WordPressDetail.jsx
new file mode 100644
index 00000000..c2781bdb
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/pages/WordPressDetail.jsx
@@ -0,0 +1,469 @@
+import { useState, useEffect } from 'react';
+import { useParams, useNavigate, Link } from 'react-router-dom';
+import { Settings, Database, GitBranch, Package, Palette, FolderOpen, FileText, Lock, Activity, Globe, BarChart3, LayoutDashboard, Layers } from 'lucide-react';
+import { useTabParam } from 'serverkit-sdk';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import { useLogsDrawer } from '@/contexts/LogsDrawerContext';
+import ChangeUrlModal from '../components/wordpress/ChangeUrlModal';
+import AttachDomainModal from '../components/wordpress/AttachDomainModal';
+import { Pill, EnvTag, PageTopbar } from 'serverkit-sdk';
+import { ErrorBoundary } from '@/components/ErrorBoundary';
+import { EmptyState } from 'serverkit-sdk';
+import PluginSlot from '@/components/PluginSlot';
+import { SkeletonBoundary } from 'serverkit-sdk';
+import { Modal } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import {
+ DetailPageSkeleton,
+ EnvSwitcher,
+ SSLAlert,
+ envTagLabel,
+} from '../components/wordpress/detail/wpDetailShared';
+import OverviewTab from '../components/wordpress/detail/OverviewTab';
+import EnvironmentsTab from '../components/wordpress/detail/EnvironmentsTab';
+import DatabaseTab from '../components/wordpress/detail/DatabaseTab';
+import PluginsTab from '../components/wordpress/detail/PluginsTab';
+import ThemesTab from '../components/wordpress/detail/ThemesTab';
+import GitTab from '../components/wordpress/detail/GitTab';
+import BackupsTab from '../components/wordpress/detail/BackupsTab';
+import UptimeTab from '../components/wordpress/detail/UptimeTab';
+import AnalyticsTab from '../components/wordpress/detail/AnalyticsTab';
+import VulnerabilitiesTab from '../components/wordpress/detail/VulnerabilitiesTab';
+import SecurityTab from '../components/wordpress/detail/SecurityTab';
+import UpdatesTab from '../components/wordpress/detail/UpdatesTab';
+import PhpTab from '../components/wordpress/detail/PhpTab';
+import ReportsTab from '../components/wordpress/detail/ReportsTab';
+import SettingsTab from '../components/wordpress/detail/SettingsTab';
+
+// 'php' and 'updates' no longer have their own top-level tab — they live inside
+// the Settings tab's left nav — but stay valid so existing deep links still work.
+const VALID_TABS = ['overview', 'environments', 'database', 'plugins', 'themes', 'git', 'backups', 'uptime', 'analytics', 'vulnerabilities', 'security', 'updates', 'php', 'reports', 'settings'];
+
+const WordPressDetail = () => {
+ const { id } = useParams();
+ const navigate = useNavigate();
+ const toast = useToast();
+ const { openDrawer } = useLogsDrawer();
+ const [site, setSite] = useState(null);
+ const [loading, setLoading] = useState(true);
+ const [activeTab, setActiveTab] = useTabParam(`/wordpress/${id}`, VALID_TABS);
+ const [autoLoggingIn, setAutoLoggingIn] = useState(false);
+ const [showCloneModal, setShowCloneModal] = useState(false);
+ const [showChangeUrl, setShowChangeUrl] = useState(false);
+ const [showAddDomain, setShowAddDomain] = useState(false);
+ const [cloning, setCloning] = useState(false);
+ const [cloneName, setCloneName] = useState('');
+ const [clonedCreds, setClonedCreds] = useState(null);
+ const [gitStatus, setGitStatus] = useState(null);
+
+ useEffect(() => {
+ // Show the skeleton again when navigating between environment site ids
+ // (env switcher / "Open new site") so stale data never renders.
+ setLoading(true);
+ loadSite();
+ }, [id]);
+
+ useEffect(() => {
+ // Load Git connection summary so we can surface a repo pill in the header,
+ // matching the Service detail page's "Connect a repository" affordance.
+ if (!id) return;
+ wordpressApi.getGitStatus(id)
+ .then(setGitStatus)
+ .catch(() => setGitStatus(null));
+ }, [id]);
+
+ async function loadSite() {
+ try {
+ const data = await wordpressApi.getSite(id);
+ setSite(data.site || data);
+ } catch (err) {
+ console.error('Failed to load site:', err);
+ toast.error('Failed to load WordPress site');
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ async function handleClone() {
+ if (!cloneName.trim()) {
+ toast.error('New site name is required');
+ return;
+ }
+ setCloning(true);
+ toast.info('Cloning site... this spins up a new stack and may take a minute.', { duration: 6000 });
+ try {
+ const res = await wordpressApi.cloneSite(site.id, { name: cloneName.trim() });
+ if (res.success) {
+ setShowCloneModal(false);
+ setCloneName('');
+ if (res.admin_password) {
+ setClonedCreds({ user: res.admin_user || 'admin', password: res.admin_password, id: res.site?.id });
+ }
+ toast.success('Site cloned successfully');
+ } else {
+ toast.error(res.error || 'Failed to clone site');
+ }
+ } catch (err) {
+ toast.error(err.message || 'Failed to clone site');
+ } finally {
+ setCloning(false);
+ }
+ }
+
+ async function handleAutoLogin() {
+ setAutoLoggingIn(true);
+ toast.info('Creating one-time login link...', { duration: 3000 });
+ try {
+ const res = await wordpressApi.autoLogin(site.id);
+ if (res && res.url) {
+ window.open(res.url, '_blank', 'noopener,noreferrer');
+ } else {
+ toast.error('No login URL returned');
+ }
+ } catch (err) {
+ toast.error(err.message || 'Failed to create login link');
+ } finally {
+ setAutoLoggingIn(false);
+ }
+ }
+
+ if (loading) {
+ return <SkeletonBoundary loading skeleton={<DetailPageSkeleton />} />;
+ }
+
+ if (!site) {
+ return (
+ <EmptyState
+ icon={Globe}
+ title="Site not found"
+ description="This WordPress site does not exist or has been removed."
+ action={<Button onClick={() => navigate('/wordpress')}>Back to WordPress Sites</Button>}
+ />
+ );
+ }
+
+ const isRunning = site.status === 'running';
+
+ // Environment switcher options from data already in the payload:
+ // production sites carry `environments`; child envs carry `production_site_id`.
+ let envOptions = null;
+ if (site.is_production && (site.environments || []).length > 0) {
+ envOptions = [
+ { id: site.id, name: site.name, type: 'production', url: site.url, current: true },
+ ...site.environments.map(e => ({
+ id: e.id,
+ name: e.name || e.environment_type || `Environment ${e.id}`,
+ type: e.environment_type || 'development',
+ url: e.url,
+ current: false,
+ })),
+ ];
+ } else if (!site.is_production && site.production_site_id) {
+ envOptions = [
+ { id: site.production_site_id, name: 'Production', type: 'production', current: false },
+ { id: site.id, name: site.name, type: site.environment_type || 'development', url: site.url, current: true },
+ ];
+ }
+
+ return (
+ <div className="app-detail-page app-detail-page--wide wp-detail-page">
+ {/* One-time cloned-admin credentials banner */}
+ {clonedCreds && (
+ <div className="wp-creds-banner">
+ <div className="wp-creds-banner-text">
+ <strong>New site created — save these admin credentials, shown only once.</strong>
+ <span>Username: <code>{clonedCreds.user}</code></span>
+ <span>Password: <code>{clonedCreds.password}</code></span>
+ {clonedCreds.id && (
+ <Button variant="ghost" onClick={() => navigate(`/wordpress/${clonedCreds.id}`)}>Open new site</Button>
+ )}
+ </div>
+ <Button variant="ghost" onClick={() => setClonedCreds(null)}>Dismiss</Button>
+ </div>
+ )}
+
+ {/* Top bar — the canonical PageTopbar (.sk-topbar): the SAME chrome as
+ the WordPress LIST page and every other page, so the top menu is
+ consistent. Breadcrumb in the title slot, actions on the right. */}
+ <PageTopbar
+ className="wp-detail-topbar"
+ icon={<Globe size={18} />}
+ title={(
+ <span className="wp-crumbs">
+ <Link to="/wordpress">WordPress</Link>
+ <span className="wp-crumbs__sep">/</span>
+ <span className="wp-crumbs__cur">{site.name}</span>
+ </span>
+ )}
+ actions={(
+ <>
+ <Button
+ variant="ghost"
+ onClick={() => navigate(`/files?path=${encodeURIComponent(site.application?.root_path || '/')}`)}
+ disabled={!site.application?.root_path}
+ title={site.application?.root_path ? `Open ${site.application.root_path} in the File Manager` : 'No root path configured for this site'}
+ >
+ <FolderOpen size={16} />
+ Open Files
+ </Button>
+ {site.db_name && (
+ <Button
+ variant="ghost"
+ onClick={() => navigate(`/databases/mysql?db=${encodeURIComponent(site.db_name)}`)}
+ title={`Open ${site.db_name} in the Database manager`}
+ >
+ <Database size={16} />
+ Open Database
+ </Button>
+ )}
+ <Button
+ variant="ghost"
+ onClick={() => openDrawer({ name: site.name, containerId: site.application_id, appType: 'docker' })}
+ title="View live container logs"
+ >
+ <FileText size={16} />
+ View Logs
+ </Button>
+ {site.url && (
+ <Button variant="ghost" asChild>
+ <a
+ href={`${site.url}/wp-admin`}
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+ <Settings size={16} />
+ Dashboard
+ </a>
+ </Button>
+ )}
+ <Button
+ variant="default"
+ onClick={handleAutoLogin}
+ disabled={autoLoggingIn}
+ title="Open wp-admin logged in, no password (one-time link)"
+ >
+ <Lock size={16} />
+ {autoLoggingIn ? 'Signing in...' : 'Auto Login'}
+ </Button>
+ </>
+ )}
+ />
+
+ {/* Everything below the full-bleed top bar is padded by .app-detail-body
+ (the top bar itself spans edge-to-edge like the list page). */}
+ <div className="app-detail-body">
+ {/* Identity — icon + name + status + environment + version (no actions). */}
+ <div className="app-detail-header">
+ <div className="app-detail-icon wp-icon">
+ <svg viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" strokeWidth="2">
+ <circle cx="12" cy="12" r="8" />
+ </svg>
+ <span className={`wp-head-dot ${isRunning ? 'running' : 'stopped'}`} />
+ </div>
+ <div className="app-detail-title-block">
+ <h1>
+ {site.name}
+ <Pill kind={isRunning ? 'green' : 'gray'}>{isRunning ? 'Running' : 'Stopped'}</Pill>
+ {site.is_production ? (
+ <EnvTag env="PROD" />
+ ) : site.production_site_id ? (
+ <EnvTag env={envTagLabel(site.environment_type)} />
+ ) : null}
+ {envOptions && envOptions.length > 1 && (
+ <EnvSwitcher options={envOptions} onSelect={(envId) => navigate(`/wordpress/${envId}`)} />
+ )}
+ <SSLAlert site={site} />
+ </h1>
+ <div className="app-detail-subtitle">
+ <span>WordPress {site.wp_version || '—'}</span>
+ {site.application?.php_version && (
+ <>
+ <span className="separator">·</span>
+ <span>PHP {site.application.php_version}</span>
+ </>
+ )}
+ {site.url && (
+ <>
+ <span className="separator">·</span>
+ <a href={site.url} target="_blank" rel="noopener noreferrer">{site.url}</a>
+ </>
+ )}
+ {site.multisite && (
+ <>
+ <span className="separator">·</span>
+ <span>multisite</span>
+ </>
+ )}
+ </div>
+ </div>
+ </div>
+
+ {/* Repo Connection Pill — same prominent affordance as the service detail page. */}
+ <div className="wp-detail__repo-bar">
+ {gitStatus?.connected ? (
+ <div
+ className="wp-detail__repo-pill"
+ onClick={() => navigate(`/wordpress/${id}/settings/git`)}
+ title="Repository connected — open Git settings"
+ >
+ <GitBranch size={14} />
+ <span className="wp-detail__repo-url">{extractRepoDisplay(gitStatus.repo_url)}</span>
+ <span className="wp-detail__repo-arrow">→</span>
+ <span className="wp-detail__repo-branch">{gitStatus.branch || 'main'}</span>
+ {gitStatus.auto_deploy && (
+ <span className="wp-detail__auto-deploy-badge">Auto</span>
+ )}
+ </div>
+ ) : (
+ <button type="button"
+ className="wp-detail__connect-repo"
+ onClick={() => navigate(`/wordpress/${id}/settings/git`)}
+ >
+ <GitBranch size={14} />
+ Connect a repository
+ </button>
+ )}
+ </div>
+
+ {/* Tabs */}
+ <div className="app-detail-tabs">
+ <div
+ className={`app-detail-tab ${activeTab === 'overview' ? 'active' : ''}`}
+ onClick={() => setActiveTab('overview')}
+ >
+ <LayoutDashboard size={14} /> Overview
+ </div>
+ <div
+ className={`app-detail-tab ${activeTab === 'environments' ? 'active' : ''}`}
+ onClick={() => setActiveTab('environments')}
+ >
+ <Layers size={14} /> Env
+ </div>
+ <div
+ className={`app-detail-tab ${activeTab === 'database' ? 'active' : ''}`}
+ onClick={() => setActiveTab('database')}
+ >
+ <Database size={14} /> Database
+ </div>
+ <div
+ className={`app-detail-tab ${activeTab === 'plugins' ? 'active' : ''}`}
+ onClick={() => setActiveTab('plugins')}
+ >
+ <Package size={14} /> Plugins
+ </div>
+ <div
+ className={`app-detail-tab ${activeTab === 'themes' ? 'active' : ''}`}
+ onClick={() => setActiveTab('themes')}
+ >
+ <Palette size={14} /> Themes
+ </div>
+ <div
+ className={`app-detail-tab ${activeTab === 'uptime' ? 'active' : ''}`}
+ onClick={() => setActiveTab('uptime')}
+ >
+ <Activity size={14} /> Uptime
+ </div>
+ <div
+ className={`app-detail-tab ${activeTab === 'analytics' ? 'active' : ''}`}
+ onClick={() => setActiveTab('analytics')}
+ >
+ <BarChart3 size={14} /> Analytics
+ </div>
+ <div
+ className={`app-detail-tab app-detail-tab--end ${activeTab === 'settings' ? 'active' : ''}`}
+ onClick={() => setActiveTab('settings')}
+ >
+ <Settings size={14} /> Settings
+ </div>
+ </div>
+
+ {showChangeUrl && (
+ <ChangeUrlModal
+ site={site}
+ onClose={() => setShowChangeUrl(false)}
+ onChanged={loadSite}
+ />
+ )}
+
+ {showAddDomain && (
+ <AttachDomainModal
+ site={site}
+ onClose={() => setShowAddDomain(false)}
+ onChanged={loadSite}
+ />
+ )}
+
+ {/* Clone Site Modal */}
+ <Modal open={showCloneModal} onClose={() => !cloning && setShowCloneModal(false)} title="Clone Site">
+ <form onSubmit={(e) => { e.preventDefault(); handleClone(); }}>
+ <p className="hint">Creates a brand-new independent WordPress site (its own Docker stack and database) seeded from <strong>{site.name}</strong>, with fresh admin credentials shown once.</p>
+ <div className="form-group">
+ <Label>New Site Name *</Label>
+ <Input
+ type="text"
+ value={cloneName}
+ onChange={(e) => setCloneName(e.target.value)}
+ placeholder={`${site.name}-copy`}
+ autoFocus
+ disabled={cloning}
+ />
+ </div>
+ <div className="modal-actions">
+ <Button type="button" variant="outline" onClick={() => setShowCloneModal(false)} disabled={cloning}>Cancel</Button>
+ <Button type="submit" disabled={cloning || !cloneName.trim()}>{cloning ? 'Cloning...' : 'Clone Site'}</Button>
+ </div>
+ </form>
+ </Modal>
+
+ {/* Tab Content */}
+ <div className="app-detail-content">
+ <ErrorBoundary key={activeTab} onRetry={loadSite}>
+ {activeTab === 'overview' && <OverviewTab site={site} onUpdate={loadSite} />}
+ {activeTab === 'environments' && <EnvironmentsTab siteId={site.id} site={site} onUpdate={loadSite} />}
+ {activeTab === 'database' && <DatabaseTab siteId={site.id} site={site} />}
+ {activeTab === 'plugins' && <PluginsTab siteId={site.id} />}
+ {activeTab === 'themes' && <ThemesTab siteId={site.id} />}
+ {activeTab === 'git' && <GitTab siteId={site.id} site={site} onUpdate={loadSite} />}
+ {activeTab === 'backups' && <BackupsTab siteId={site.id} site={site} />}
+ {activeTab === 'uptime' && <UptimeTab siteId={site.id} />}
+ {activeTab === 'analytics' && <AnalyticsTab siteId={site.id} />}
+ {activeTab === 'vulnerabilities' && <VulnerabilitiesTab siteId={site.id} />}
+ {activeTab === 'security' && <SecurityTab siteId={site.id} />}
+ {activeTab === 'updates' && <UpdatesTab siteId={site.id} />}
+ {activeTab === 'php' && <PhpTab siteId={site.id} />}
+ {activeTab === 'reports' && <ReportsTab siteId={site.id} />}
+ {activeTab === 'settings' && (
+ <SettingsTab
+ siteId={site.id}
+ site={site}
+ onUpdate={loadSite}
+ onAddDomain={() => setShowAddDomain(true)}
+ onChangeUrl={() => setShowChangeUrl(true)}
+ onClone={() => setShowCloneModal(true)}
+ />
+ )}
+ </ErrorBoundary>
+ </div>
+
+ {/* Extension slot: widgets contributed to the WordPress detail page */}
+ <PluginSlot name="wordpress.detail.panel" context={{ site }} />
+ </div>
+ </div>
+ );
+};
+
+function extractRepoDisplay(url) {
+ if (!url) return '';
+ try {
+ const cleaned = url.replace(/\.git$/, '').replace(/^https?:\/\/[^@]+@/, 'https://');
+ const parts = cleaned.split(/[/:]/).filter(Boolean);
+ return parts.slice(-2).join('/');
+ } catch {
+ return url;
+ }
+}
+
+export default WordPressDetail;
diff --git a/frontend/src/plugins/serverkit-wordpress/pages/WordPressPluginLibrary.jsx b/frontend/src/plugins/serverkit-wordpress/pages/WordPressPluginLibrary.jsx
new file mode 100644
index 00000000..4ddd4a5b
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/pages/WordPressPluginLibrary.jsx
@@ -0,0 +1,353 @@
+import { useState, useEffect } from 'react';
+import { Package, RefreshCw, Download, Trash2, Github, FolderGit2, Pencil, Server } from 'lucide-react';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import { useAuth } from 'serverkit-sdk';
+import { EmptyState } from 'serverkit-sdk';
+import { Spinner } from 'serverkit-sdk';
+import { Modal } from 'serverkit-sdk';
+import { Pill, ServiceTile } from 'serverkit-sdk';
+import { useTopbarActions } from 'serverkit-sdk';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+import { Switch } from 'serverkit-sdk';
+
+const EMPTY_FORM = { source_type: 'github', source_url: '', slug: '', branch: 'main' };
+
+function WordPressPluginLibrary() {
+ const toast = useToast();
+ const { user } = useAuth();
+ const isAdmin = user?.role === 'admin';
+
+ const [plugins, setPlugins] = useState([]);
+ const [loading, setLoading] = useState(true);
+ const [busy, setBusy] = useState(null); // `${action}:${id}` currently running
+
+ const [showAdd, setShowAdd] = useState(false);
+ const [editing, setEditing] = useState(null); // plugin being edited, or null
+ const [form, setForm] = useState(EMPTY_FORM);
+ const [saving, setSaving] = useState(false);
+
+ const [installFor, setInstallFor] = useState(null); // plugin selected for "install on site"
+ const [sites, setSites] = useState([]);
+ const [installSiteId, setInstallSiteId] = useState('');
+ const [installActivate, setInstallActivate] = useState(true);
+
+ useEffect(() => { loadPlugins(); }, []);
+
+ async function loadPlugins() {
+ setLoading(true);
+ try {
+ const data = await wordpressApi.getLibraryPlugins();
+ setPlugins(data.plugins || []);
+ } catch (err) {
+ toast.error(err.message || 'Failed to load plugin library');
+ setPlugins([]);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ function openAdd() {
+ setEditing(null);
+ setForm(EMPTY_FORM);
+ setShowAdd(true);
+ }
+
+ function openEdit(plugin) {
+ setEditing(plugin);
+ setForm({
+ source_type: plugin.source_type,
+ source_url: plugin.source_url,
+ slug: plugin.slug,
+ branch: plugin.branch || 'main',
+ });
+ setShowAdd(true);
+ }
+
+ async function handleSave() {
+ if (!form.source_url.trim()) {
+ toast.error(form.source_type === 'local' ? 'A local path is required' : 'A repo (owner/repo or git URL) is required');
+ return;
+ }
+ setSaving(true);
+ try {
+ if (editing) {
+ await wordpressApi.updateLibraryPlugin(editing.id, form);
+ toast.success('Plugin updated');
+ } else {
+ const res = await wordpressApi.addLibraryPlugin(form);
+ if (res.sync_error) toast.info(`Added, but sync failed: ${res.sync_error}`, { duration: 8000 });
+ else toast.success('Plugin added to library');
+ }
+ setShowAdd(false);
+ await loadPlugins();
+ } catch (err) {
+ toast.error(err.message || 'Failed to save plugin');
+ } finally {
+ setSaving(false);
+ }
+ }
+
+ async function handleSync(plugin) {
+ setBusy(`sync:${plugin.id}`);
+ try {
+ const res = await wordpressApi.syncLibraryPlugin(plugin.id);
+ if (res.success === false) toast.error(res.error || 'Sync failed');
+ else toast.success(`Synced ${plugin.slug} (v${res.plugin?.version || '?'})`);
+ await loadPlugins();
+ } catch (err) {
+ toast.error(err.message || 'Sync failed');
+ } finally {
+ setBusy(null);
+ }
+ }
+
+ async function handleBulkUpdate(plugin) {
+ setBusy(`bulk:${plugin.id}`);
+ try {
+ const res = await wordpressApi.bulkUpdateLibraryPlugin(plugin.id);
+ toast.success(`Updated ${res.updated} of ${res.total} site(s)`);
+ await loadPlugins();
+ } catch (err) {
+ toast.error(err.message || 'Bulk update failed');
+ } finally {
+ setBusy(null);
+ }
+ }
+
+ async function handleDelete(plugin) {
+ if (!window.confirm(`Remove "${plugin.slug}" from the library? Installed copies on sites are left untouched.`)) return;
+ setBusy(`delete:${plugin.id}`);
+ try {
+ await wordpressApi.deleteLibraryPlugin(plugin.id);
+ toast.success('Plugin removed from library');
+ await loadPlugins();
+ } catch (err) {
+ toast.error(err.message || 'Failed to remove plugin');
+ } finally {
+ setBusy(null);
+ }
+ }
+
+ async function openInstall(plugin) {
+ setInstallFor(plugin);
+ setInstallSiteId('');
+ setInstallActivate(true);
+ try {
+ const data = await wordpressApi.getSites();
+ setSites(data.sites || []);
+ } catch {
+ setSites([]);
+ }
+ }
+
+ async function handleInstall() {
+ if (!installSiteId) { toast.error('Pick a site'); return; }
+ setBusy(`install:${installFor.id}`);
+ try {
+ const res = await wordpressApi.installLibraryPluginOnSite(installFor.id, Number(installSiteId), installActivate);
+ if (res.success === false) toast.error(res.error || 'Install failed');
+ else toast.success(`Installed ${installFor.slug} (${res.status})`);
+ setInstallFor(null);
+ await loadPlugins();
+ } catch (err) {
+ toast.error(err.message || 'Install failed');
+ } finally {
+ setBusy(null);
+ }
+ }
+
+ useTopbarActions(() => (
+ isAdmin ? (
+ <Button size="sm" onClick={openAdd}>
+ <Package size={16} /> Add Plugin
+ </Button>
+ ) : null
+ ), [isAdmin]);
+
+ if (loading) {
+ return (
+ <div className="sk-tabgroup__inner wp-plugin-library">
+ <div className="wp-plugin-library__loading"><Spinner /></div>
+ </div>
+ );
+ }
+
+ return (
+ <div className="sk-tabgroup__inner wp-plugin-library">
+ {plugins.length === 0 ? (
+ <EmptyState
+ icon={Package}
+ title="No plugins in the library yet"
+ description="Register your own plugins from a GitHub repo or a local path, then install or update them across every managed WordPress site from here."
+ action={isAdmin ? <Button onClick={openAdd}><Package size={16} /> Add Plugin</Button> : null}
+ />
+ ) : (
+ <div className="wp-plib-grid">
+ {plugins.map(plugin => {
+ const SourceIcon = plugin.source_type === 'github' ? Github : FolderGit2;
+ return (
+ <div className={`wp-plib-card ${plugin.is_active ? '' : 'is-disabled'}`} key={plugin.id}>
+ <div className="wp-plib-card__head">
+ <ServiceTile name={plugin.name || plugin.slug} size={40} />
+ <div className="wp-plib-card__title">
+ <div className="wp-plib-card__name">{plugin.name || plugin.slug}</div>
+ <div className="wp-plib-card__slug">{plugin.slug}</div>
+ </div>
+ {plugin.version && <Pill kind="gray">v{plugin.version}</Pill>}
+ </div>
+
+ {plugin.description && (
+ <p className="wp-plib-card__desc">{plugin.description}</p>
+ )}
+
+ <div className="wp-plib-card__meta">
+ <span className="wp-plib-card__source" title={plugin.source_url}>
+ <SourceIcon size={13} /> {plugin.source_url}
+ </span>
+ <span className="wp-plib-card__branch">{plugin.branch}</span>
+ </div>
+
+ <div className="wp-plib-card__stats">
+ <span><Server size={13} /> {plugin.install_count} site{plugin.install_count === 1 ? '' : 's'}</span>
+ {plugin.sync_error
+ ? <Pill kind="red" title={plugin.sync_error}>Sync error</Pill>
+ : plugin.last_synced_at
+ ? <span className="wp-plib-card__synced">Synced</span>
+ : <Pill kind="amber">Not synced</Pill>}
+ </div>
+
+ {isAdmin && (
+ <div className="wp-plib-card__actions">
+ <Button variant="outline" size="sm" disabled={busy === `sync:${plugin.id}`} onClick={() => handleSync(plugin)}>
+ <RefreshCw size={14} className={busy === `sync:${plugin.id}` ? 'spin' : ''} /> Sync
+ </Button>
+ <Button variant="outline" size="sm" onClick={() => openInstall(plugin)}>
+ <Download size={14} /> Install
+ </Button>
+ <Button variant="outline" size="sm" disabled={!plugin.install_count || busy === `bulk:${plugin.id}`} onClick={() => handleBulkUpdate(plugin)}>
+ Bulk update
+ </Button>
+ <Button variant="ghost" size="sm" onClick={() => openEdit(plugin)} aria-label="Edit">
+ <Pencil size={14} />
+ </Button>
+ <Button variant="ghost" size="sm" onClick={() => handleDelete(plugin)} aria-label="Delete">
+ <Trash2 size={14} />
+ </Button>
+ </div>
+ )}
+ </div>
+ );
+ })}
+ </div>
+ )}
+
+ {/* Add / Edit modal */}
+ <Modal
+ open={showAdd}
+ onClose={() => setShowAdd(false)}
+ title={editing ? `Edit ${editing.slug}` : 'Add plugin to library'}
+ >
+ <div className="wp-plib-form">
+ <div className="wp-plib-form__row">
+ <Label>Source</Label>
+ <div className="wp-plib-form__toggle">
+ <button
+ type="button"
+ className={form.source_type === 'github' ? 'is-on' : ''}
+ onClick={() => setForm(f => ({ ...f, source_type: 'github' }))}
+ ><Github size={14} /> GitHub</button>
+ <button
+ type="button"
+ className={form.source_type === 'local' ? 'is-on' : ''}
+ onClick={() => setForm(f => ({ ...f, source_type: 'local' }))}
+ ><FolderGit2 size={14} /> Local path</button>
+ </div>
+ </div>
+
+ <div className="wp-plib-form__row">
+ <Label htmlFor="plib-src">
+ {form.source_type === 'github' ? 'Repository (owner/repo or git URL)' : 'Absolute local path'}
+ </Label>
+ <Input
+ id="plib-src"
+ value={form.source_url}
+ onChange={e => setForm(f => ({ ...f, source_url: e.target.value }))}
+ placeholder={form.source_type === 'github' ? 'acme/my-plugin' : '/srv/plugins/my-plugin'}
+ />
+ </div>
+
+ <div className="wp-plib-form__row">
+ <Label htmlFor="plib-slug">Plugin slug <span className="wp-plib-form__hint">(folder name; auto-derived if blank)</span></Label>
+ <Input
+ id="plib-slug"
+ value={form.slug}
+ onChange={e => setForm(f => ({ ...f, slug: e.target.value }))}
+ placeholder="my-plugin"
+ disabled={!!editing}
+ />
+ </div>
+
+ {form.source_type === 'github' && (
+ <div className="wp-plib-form__row">
+ <Label htmlFor="plib-branch">Branch or tag</Label>
+ <Input
+ id="plib-branch"
+ value={form.branch}
+ onChange={e => setForm(f => ({ ...f, branch: e.target.value }))}
+ placeholder="main"
+ />
+ </div>
+ )}
+
+ <div className="wp-plib-form__footer">
+ <Button variant="outline" onClick={() => setShowAdd(false)}>Cancel</Button>
+ <Button onClick={handleSave} disabled={saving}>
+ {saving ? 'Saving…' : editing ? 'Save' : 'Add & sync'}
+ </Button>
+ </div>
+ </div>
+ </Modal>
+
+ {/* Install-on-site modal */}
+ <Modal
+ open={!!installFor}
+ onClose={() => setInstallFor(null)}
+ title={installFor ? `Install ${installFor.slug} on a site` : ''}
+ >
+ <div className="wp-plib-form">
+ <div className="wp-plib-form__row">
+ <Label htmlFor="plib-site">Target site</Label>
+ <select
+ id="plib-site"
+ className="wp-plib-form__select"
+ value={installSiteId}
+ onChange={e => setInstallSiteId(e.target.value)}
+ >
+ <option value="">Select a site…</option>
+ {sites.map(s => (
+ <option key={s.id} value={s.id}>
+ {s.name || s.application?.name || `Site ${s.id}`}
+ </option>
+ ))}
+ </select>
+ </div>
+ <div className="wp-plib-form__row wp-plib-form__row--inline">
+ <Switch checked={installActivate} onCheckedChange={setInstallActivate} id="plib-activate" />
+ <Label htmlFor="plib-activate">Activate after install</Label>
+ </div>
+ <div className="wp-plib-form__footer">
+ <Button variant="outline" onClick={() => setInstallFor(null)}>Cancel</Button>
+ <Button onClick={handleInstall} disabled={busy === `install:${installFor?.id}`}>
+ {busy === `install:${installFor?.id}` ? 'Installing…' : 'Install'}
+ </Button>
+ </div>
+ </div>
+ </Modal>
+ </div>
+ );
+}
+
+export default WordPressPluginLibrary;
diff --git a/frontend/src/plugins/serverkit-wordpress/pages/WordPressProject.jsx b/frontend/src/plugins/serverkit-wordpress/pages/WordPressProject.jsx
new file mode 100644
index 00000000..39cf9169
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/pages/WordPressProject.jsx
@@ -0,0 +1,1042 @@
+import { useState, useEffect, useCallback, useRef } from 'react';
+import { useParams, useNavigate, Link } from 'react-router-dom';
+import { Plus, ExternalLink, RefreshCw, GitBranch, Search, Shield, Activity, Settings, ArrowRight, RotateCcw } from 'lucide-react';
+import { useTabParam } from 'serverkit-sdk';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import {
+ PipelineView,
+ PromoteModal,
+ SyncModal,
+ ActivityFeed,
+ ContainerLogs,
+ CompareView,
+ SanitizationProfileForm,
+ ResourceLimitsModal,
+ BasicAuthModal,
+ WpCliTerminal,
+ HealthStatusPanel,
+ AutoSyncScheduleModal,
+ BulkActionsBar,
+} from '../components/wordpress';
+import { ConfirmDialog } from 'serverkit-sdk';
+import { Modal } from 'serverkit-sdk';
+import { Spinner } from 'serverkit-sdk';
+import { EmptyState } from 'serverkit-sdk';
+import { FolderGit2 } from 'lucide-react';
+import { io } from 'socket.io-client';
+import { Button } from 'serverkit-sdk';
+import { Input } from 'serverkit-sdk';
+import { Label } from 'serverkit-sdk';
+
+const SOCKET_URL = import.meta.env.VITE_API_URL?.replace('/api/v1', '') || window.location.origin;
+
+const VALID_TABS = ['pipeline', 'activity', 'health'];
+
+const WordPressProject = () => {
+ const { id } = useParams();
+ const navigate = useNavigate();
+ const toast = useToast();
+
+ const [pipeline, setPipeline] = useState(null);
+ const [loading, setLoading] = useState(true);
+ const [activeTab, setActiveTab] = useTabParam(`/wordpress/pipelines/${id}`, VALID_TABS);
+ const [showCreateEnvModal, setShowCreateEnvModal] = useState(false);
+ const [promoteModal, setPromoteModal] = useState(null);
+ const [syncModal, setSyncModal] = useState(null);
+ const [logsPanel, setLogsPanel] = useState(null);
+ const [confirmDialog, setConfirmDialog] = useState(null);
+ const [operationInProgress, setOperationInProgress] = useState(null);
+ const [operationProgress, setOperationProgress] = useState(null);
+ const [compareModal, setCompareModal] = useState(null);
+ const [showSanitizationProfiles, setShowSanitizationProfiles] = useState(false);
+
+ // Phase 7 state
+ const [resourceLimitsModal, setResourceLimitsModal] = useState(null);
+ const [basicAuthModal, setBasicAuthModal] = useState(null);
+ const [wpCliModal, setWpCliModal] = useState(null);
+ const [autoSyncModal, setAutoSyncModal] = useState(null);
+ const [healthData, setHealthData] = useState({});
+ const [diskUsageData, setDiskUsageData] = useState({});
+ const [bulkSelected, setBulkSelected] = useState([]);
+
+ const socketRef = useRef(null);
+
+ useEffect(() => {
+ loadPipeline();
+ connectSocket();
+
+ return () => {
+ if (socketRef.current) {
+ socketRef.current.emit('unsubscribe_pipeline', { project_id: Number(id) });
+ socketRef.current.disconnect();
+ }
+ };
+ }, [id]);
+
+ function connectSocket() {
+ const token = localStorage.getItem('access_token');
+ if (!token) return;
+
+ const socket = io(SOCKET_URL, {
+ auth: { token },
+ transports: ['websocket', 'polling']
+ });
+
+ socket.on('connect', () => {
+ socket.emit('subscribe_pipeline', { project_id: Number(id) });
+ });
+
+ socket.on('pipeline_event', (data) => {
+ handlePipelineEvent(data);
+ });
+
+ socketRef.current = socket;
+ }
+
+ function handlePipelineEvent(data) {
+ const { event, data: eventData } = data;
+
+ switch (event) {
+ case 'environment_created':
+ case 'environment_deleted':
+ case 'promotion_completed':
+ case 'sync_completed':
+ loadPipeline();
+ if (eventData.success) {
+ toast.success(eventData.message || `${event.replace(/_/g, ' ')} successfully`);
+ }
+ setOperationInProgress(null);
+ break;
+ case 'environment_create_failed':
+ case 'environment_delete_failed':
+ case 'promotion_failed':
+ case 'sync_failed':
+ loadPipeline();
+ toast.error(eventData.message || `${event.replace(/_/g, ' ')}`);
+ setOperationInProgress(null);
+ break;
+ case 'environment_started':
+ case 'environment_stopped':
+ case 'environment_restarted':
+ case 'environment_locked':
+ case 'environment_unlocked':
+ loadPipeline();
+ break;
+ case 'promotion_started':
+ case 'sync_started':
+ case 'environment_creating':
+ setOperationInProgress(event);
+ setOperationProgress(null);
+ break;
+ case 'operation_progress':
+ setOperationProgress(eventData);
+ break;
+ case 'bulk_operation_completed':
+ loadPipeline();
+ toast.success('Bulk operation completed');
+ break;
+ default:
+ break;
+ }
+ }
+
+ async function loadPipeline() {
+ try {
+ const data = await wordpressApi.getProjectPipeline(id);
+ setPipeline(data);
+ } catch (err) {
+ console.error('Failed to load pipeline:', err);
+ toast.error('Failed to load project pipeline');
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ const handlePromote = useCallback((sourceEnv, targetEnv) => {
+ setPromoteModal({ sourceEnv, targetEnv });
+ }, []);
+
+ const handleDoPromote = useCallback(async (config) => {
+ try {
+ const res = await wordpressApi.promoteEnvironment(id, config);
+ setPromoteModal(null);
+ // A promotion is a deployment now: open its console, where the
+ // steps, live log and retry live.
+ if (res?.job_id) navigate(`/deployments/${res.job_id}`);
+ else toast.info('Promotion queued');
+ } catch (err) {
+ toast.error(err.message || 'Promotion failed');
+ }
+ }, [id, navigate, toast]);
+
+ const handleSync = useCallback((env) => {
+ setSyncModal({ environment: env });
+ }, []);
+
+ const handleDoSync = useCallback(async (config) => {
+ const env = syncModal.environment;
+ toast.info('Starting sync...', { duration: 3000 });
+ try {
+ await wordpressApi.syncProjectEnvironment(id, env.id, config);
+ setSyncModal(null);
+ } catch (err) {
+ toast.error(err.message || 'Sync failed');
+ }
+ }, [id, syncModal, toast]);
+
+ const handleStart = useCallback(async (env) => {
+ try {
+ await wordpressApi.startEnvironment(id, env.id);
+ toast.success('Environment started');
+ loadPipeline();
+ } catch (err) {
+ toast.error(err.message || 'Failed to start environment');
+ }
+ }, [id, toast]);
+
+ const handleStop = useCallback(async (env) => {
+ setConfirmDialog({
+ title: 'Stop Environment',
+ message: `Stop the ${env.environment_type || ''} environment "${env.name}"?`,
+ confirmText: 'Stop',
+ variant: 'warning',
+ onConfirm: async () => {
+ try {
+ await wordpressApi.stopEnvironment(id, env.id);
+ toast.success('Environment stopped');
+ loadPipeline();
+ } catch (err) {
+ toast.error(err.message || 'Failed to stop environment');
+ } finally {
+ setConfirmDialog(null);
+ }
+ },
+ onCancel: () => setConfirmDialog(null)
+ });
+ }, [id, toast]);
+
+ const handleRollback = useCallback((promotion) => {
+ setConfirmDialog({
+ title: 'Roll Back Promotion',
+ message: `Restore the pre-promotion snapshot for "${promotion.target_site?.name || 'target environment'}"? This overwrites the target environment's current database with the snapshot taken just before promotion #${promotion.id}.`,
+ confirmText: 'Roll Back',
+ variant: 'danger',
+ onConfirm: async () => {
+ toast.info('Rolling back promotion...', { duration: 4000 });
+ try {
+ await wordpressApi.rollbackPromotion(id, promotion.id);
+ toast.success('Promotion rolled back');
+ loadPipeline();
+ } catch (err) {
+ toast.error(err.message || 'Rollback failed');
+ } finally {
+ setConfirmDialog(null);
+ }
+ },
+ onCancel: () => setConfirmDialog(null),
+ });
+ }, [id, toast]);
+
+ const handleRestart = useCallback(async (env) => {
+ try {
+ await wordpressApi.restartEnvironment(id, env.id);
+ toast.success('Environment restarted');
+ loadPipeline();
+ } catch (err) {
+ toast.error(err.message || 'Failed to restart environment');
+ }
+ }, [id, toast]);
+
+ const handleDelete = useCallback((env) => {
+ setConfirmDialog({
+ title: 'Delete Environment',
+ message: `Are you sure you want to delete "${env.name}"? This will remove all containers, files, and database for this environment.`,
+ confirmText: 'Delete Environment',
+ variant: 'danger',
+ onConfirm: async () => {
+ try {
+ await wordpressApi.deleteProjectEnvironment(id, env.id);
+ toast.success('Environment deleted');
+ loadPipeline();
+ } catch (err) {
+ toast.error(err.message || 'Failed to delete environment');
+ } finally {
+ setConfirmDialog(null);
+ }
+ },
+ onCancel: () => setConfirmDialog(null)
+ });
+ }, [id, toast]);
+
+ const handleLock = useCallback(async (env) => {
+ try {
+ await wordpressApi.lockEnvironment(id, env.id, {
+ reason: 'Manually locked',
+ duration_minutes: 60
+ });
+ toast.success('Environment locked');
+ loadPipeline();
+ } catch (err) {
+ toast.error(err.message || 'Failed to lock environment');
+ }
+ }, [id, toast]);
+
+ const handleUnlock = useCallback(async (env) => {
+ try {
+ await wordpressApi.unlockEnvironment(id, env.id);
+ toast.success('Environment unlocked');
+ loadPipeline();
+ } catch (err) {
+ toast.error(err.message || 'Failed to unlock environment');
+ }
+ }, [id, toast]);
+
+ const handleViewLogs = useCallback((env) => {
+ setLogsPanel({ envId: env.id });
+ }, []);
+
+ const handleCompare = useCallback((envA, envB) => {
+ setCompareModal({ envA, envB });
+ }, []);
+
+ // Phase 7 handlers
+ const handleResourceLimits = useCallback((env) => {
+ setResourceLimitsModal({ environment: env, currentLimits: env.resource_limits });
+ }, []);
+
+ const handleApplyResourceLimits = useCallback(async (limits) => {
+ const env = resourceLimitsModal.environment;
+ try {
+ await wordpressApi.updateResourceLimits(id, env.id, limits);
+ toast.success('Resource limits updated, containers restarting');
+ setResourceLimitsModal(null);
+ loadPipeline();
+ } catch (err) {
+ toast.error(err.message || 'Failed to update resource limits');
+ }
+ }, [id, resourceLimitsModal, toast]);
+
+ const handleBasicAuth = useCallback((env) => {
+ setBasicAuthModal({ environment: env });
+ }, []);
+
+ const handleWpCli = useCallback((env) => {
+ setWpCliModal({ environment: env });
+ }, []);
+
+ const handleAutoSync = useCallback((env) => {
+ setAutoSyncModal({ environment: env });
+ }, []);
+
+ const handleHealthCheck = useCallback(async (env) => {
+ try {
+ const data = await wordpressApi.getEnvironmentHealth(id, env.id);
+ if (data.success) {
+ setHealthData(prev => ({ ...prev, [env.id]: data }));
+ toast.info(`${env.name}: ${data.overall_status}`);
+ }
+ } catch (err) {
+ toast.error('Health check failed');
+ }
+ }, [id, toast]);
+
+ const handleBulkToggle = useCallback((envId) => {
+ setBulkSelected(prev =>
+ prev.includes(envId)
+ ? prev.filter(id => id !== envId)
+ : [...prev, envId]
+ );
+ }, []);
+
+ const handleBulkExecute = useCallback(async (action, envIds) => {
+ try {
+ await wordpressApi.executeBulkOperation(id, [{ action, env_ids: envIds }]);
+ toast.success(`Bulk ${action} completed`);
+ setBulkSelected([]);
+ loadPipeline();
+ } catch (err) {
+ toast.error(err.message || `Bulk ${action} failed`);
+ }
+ }, [id, toast]);
+
+ // Load health and disk usage data on pipeline load
+ useEffect(() => {
+ if (pipeline) {
+ loadHealthData();
+ loadDiskUsageData();
+ }
+ }, [pipeline]);
+
+ async function loadHealthData() {
+ try {
+ const data = await wordpressApi.getProjectHealth(id);
+ if (data.success) {
+ setHealthData(data.environments || {});
+ }
+ } catch {
+ // Health data is optional
+ }
+ }
+
+ async function loadDiskUsageData() {
+ try {
+ const data = await wordpressApi.getProjectDiskUsage(id);
+ if (data.success) {
+ setDiskUsageData(data.environments || {});
+ }
+ } catch {
+ // Disk usage data is optional
+ }
+ }
+
+ const handleCreateEnvironment = useCallback(async (data) => {
+ toast.info('Creating environment...', { duration: 5000 });
+ try {
+ await wordpressApi.createProjectEnvironment(id, data);
+ setShowCreateEnvModal(false);
+ } catch (err) {
+ toast.error(err.message || 'Failed to create environment');
+ }
+ }, [id, toast]);
+
+ if (loading) {
+ return <EmptyState loading loadingVariant="detail" size="lg" title="Loading project pipeline" />;
+ }
+
+ if (!pipeline) {
+ return (
+ <EmptyState
+ icon={FolderGit2}
+ title="Pipeline not found"
+ description="This WordPress pipeline does not exist or has been removed."
+ action={<Button onClick={() => navigate('/wordpress/pipelines')}>Back to Pipelines</Button>}
+ />
+ );
+ }
+
+ const production = pipeline.production || pipeline;
+ const projectName = production.name || 'WordPress Project';
+ const projectDomain = production.application?.domains?.[0] || production.url || '';
+
+ return (
+ <div className="app-detail-page app-detail-page--wide wp-project-page">
+ {/* Top Bar */}
+ <div className="app-detail-topbar">
+ <div className="app-detail-breadcrumbs">
+ <Link to="/wordpress/pipelines">Pipelines</Link>
+ <span>/</span>
+ <span className="current">{projectName}</span>
+ </div>
+ <div className="app-detail-actions">
+ {projectDomain && (
+ <Button variant="ghost" asChild>
+ <a
+ href={projectDomain.startsWith('http') ? projectDomain : `https://${projectDomain}`}
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+ <ExternalLink size={16} />
+ Visit Site
+ </a>
+ </Button>
+ )}
+ <Button
+ variant="ghost"
+ onClick={() => setShowSanitizationProfiles(true)}
+ title="Manage sanitization profiles"
+ >
+ <Shield size={16} />
+ Profiles
+ </Button>
+ <Button
+ onClick={() => setShowCreateEnvModal(true)}
+ >
+ <Plus size={16} />
+ New Environment
+ </Button>
+ </div>
+ </div>
+
+ {/* Header */}
+ <div className="app-detail-header">
+ <div className="app-detail-icon wp-icon">
+ <svg viewBox="0 0 24 24" width="28" height="28" fill="currentColor">
+ <path d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2zm0 19.542c-5.261 0-9.542-4.281-9.542-9.542S6.739 2.458 12 2.458 21.542 6.739 21.542 12 17.261 21.542 12 21.542z" />
+ </svg>
+ </div>
+ <div className="app-detail-title-block">
+ <h1>
+ {projectName}
+ <span className={`app-status-badge ${production.status === 'running' ? 'running' : 'stopped'}`}>
+ <span className="pulse-dot" />
+ {production.status === 'running' ? 'Running' : 'Stopped'}
+ </span>
+ </h1>
+ <div className="app-detail-subtitle">
+ {projectDomain && <span className="mono">{projectDomain}</span>}
+ {production.wp_version && (
+ <>
+ <span className="separator">•</span>
+ <span>WordPress {production.wp_version}</span>
+ </>
+ )}
+ {pipeline.environments && (
+ <>
+ <span className="separator">•</span>
+ <span>{(pipeline.environments?.length || 0) + 1} environments</span>
+ </>
+ )}
+ </div>
+ </div>
+ </div>
+
+ {/* Tabs */}
+ <div className="app-detail-tabs">
+ <div
+ className={`app-detail-tab ${activeTab === 'pipeline' ? 'active' : ''}`}
+ onClick={() => setActiveTab('pipeline')}
+ >
+ Pipeline
+ </div>
+ <div
+ className={`app-detail-tab ${activeTab === 'activity' ? 'active' : ''}`}
+ onClick={() => setActiveTab('activity')}
+ >
+ Activity
+ </div>
+ <div
+ className={`app-detail-tab ${activeTab === 'health' ? 'active' : ''}`}
+ onClick={() => setActiveTab('health')}
+ >
+ Health
+ </div>
+ </div>
+
+ {/* Tab Content */}
+ <div className="app-detail-content">
+ {activeTab === 'pipeline' && (
+ <div className="pipeline-tab">
+ {operationInProgress && (
+ <div className="pipeline-operation-banner">
+ <Spinner size="sm" />
+ <div className="operation-progress-content">
+ <span>
+ {operationInProgress === 'promotion_started' && 'Promotion in progress...'}
+ {operationInProgress === 'sync_started' && 'Sync in progress...'}
+ {operationInProgress === 'environment_creating' && 'Creating environment...'}
+ </span>
+ {operationProgress && (
+ <div className="operation-progress">
+ <div className="operation-progress-bar">
+ <div
+ className="operation-progress-fill"
+ style={{ width: `${operationProgress.percent || 0}%` }}
+ />
+ </div>
+ <span className="operation-progress-step">
+ Step {operationProgress.step}/{operationProgress.total}: {operationProgress.message}
+ </span>
+ </div>
+ )}
+ </div>
+ </div>
+ )}
+
+ {bulkSelected.length > 0 && (
+ <BulkActionsBar
+ selectedIds={bulkSelected}
+ environments={[
+ ...(pipeline.environments || []),
+ pipeline.production
+ ].filter(Boolean)}
+ prodId={id}
+ onClear={() => setBulkSelected([])}
+ onExecute={handleBulkExecute}
+ api={wordpressApi}
+ />
+ )}
+
+ <PipelineView
+ pipeline={pipeline}
+ onPromote={handlePromote}
+ onSync={handleSync}
+ onStart={handleStart}
+ onStop={handleStop}
+ onRestart={handleRestart}
+ onDelete={handleDelete}
+ onLock={handleLock}
+ onUnlock={handleUnlock}
+ onViewLogs={handleViewLogs}
+ onCompare={handleCompare}
+ onCreateMultidev={() => {
+ setShowCreateEnvModal(true);
+ }}
+ onResourceLimits={handleResourceLimits}
+ onBasicAuth={handleBasicAuth}
+ onWpCli={handleWpCli}
+ onAutoSync={handleAutoSync}
+ onHealthCheck={handleHealthCheck}
+ operationInProgress={operationInProgress}
+ healthData={healthData}
+ diskUsageData={diskUsageData}
+ bulkSelected={bulkSelected}
+ onBulkToggle={handleBulkToggle}
+ />
+
+ {/* Promotion History (with rollback) */}
+ <PromotionHistory projectId={id} onRollback={handleRollback} />
+
+ {/* Recent Activity Preview */}
+ <div className="pipeline-activity-preview">
+ <div className="section-header">
+ <h3>Recent Activity</h3>
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={() => setActiveTab('activity')}
+ >
+ View All
+ </Button>
+ </div>
+ <ActivityFeed projectId={id} limit={5} compact />
+ </div>
+ </div>
+ )}
+
+ {activeTab === 'activity' && (
+ <div className="activity-tab">
+ <div className="section-header">
+ <h3>Activity Log</h3>
+ <Button variant="ghost" size="sm" onClick={loadPipeline}>
+ <RefreshCw size={14} /> Refresh
+ </Button>
+ </div>
+ <ActivityFeed projectId={id} limit={50} />
+ </div>
+ )}
+
+ {activeTab === 'health' && (
+ <div className="health-tab">
+ <HealthStatusPanel
+ projectId={id}
+ environments={[
+ pipeline.production,
+ ...(pipeline.environments || [])
+ ].filter(Boolean)}
+ api={wordpressApi}
+ />
+ </div>
+ )}
+ </div>
+
+ {/* Logs Panel */}
+ {logsPanel && (
+ <div className="pipeline-logs-overlay">
+ <ContainerLogs
+ projectId={id}
+ envId={logsPanel.envId}
+ onClose={() => setLogsPanel(null)}
+ />
+ </div>
+ )}
+
+ {/* Modals */}
+ {promoteModal && (
+ <PromoteModal
+ sourceEnv={promoteModal.sourceEnv}
+ targetEnv={promoteModal.targetEnv}
+ onClose={() => setPromoteModal(null)}
+ onPromote={handleDoPromote}
+ />
+ )}
+
+ {syncModal && (
+ <SyncModal
+ environment={syncModal.environment}
+ productionName={projectName}
+ onClose={() => setSyncModal(null)}
+ onSync={handleDoSync}
+ />
+ )}
+
+ {showCreateEnvModal && (
+ <CreatePipelineEnvModal
+ onClose={() => setShowCreateEnvModal(false)}
+ onCreate={handleCreateEnvironment}
+ productionDomain={projectDomain}
+ existingTypes={(pipeline.environments || []).map(e => e.environment_type)}
+ projectId={id}
+ />
+ )}
+
+ {compareModal && (
+ <CompareView
+ projectId={id}
+ envA={compareModal.envA}
+ envB={compareModal.envB}
+ onClose={() => setCompareModal(null)}
+ />
+ )}
+
+ {showSanitizationProfiles && (
+ <SanitizationProfileForm
+ onClose={() => setShowSanitizationProfiles(false)}
+ onProfilesChange={() => {}}
+ />
+ )}
+
+ {resourceLimitsModal && (
+ <ResourceLimitsModal
+ environment={resourceLimitsModal.environment}
+ currentLimits={resourceLimitsModal.currentLimits}
+ onClose={() => setResourceLimitsModal(null)}
+ onApply={handleApplyResourceLimits}
+ />
+ )}
+
+ {basicAuthModal && (
+ <BasicAuthModal
+ environment={basicAuthModal.environment}
+ prodId={id}
+ onClose={() => setBasicAuthModal(null)}
+ api={wordpressApi}
+ />
+ )}
+
+ {wpCliModal && (
+ <WpCliTerminal
+ environment={wpCliModal.environment}
+ prodId={id}
+ onClose={() => setWpCliModal(null)}
+ api={wordpressApi}
+ />
+ )}
+
+ {autoSyncModal && (
+ <AutoSyncScheduleModal
+ environment={autoSyncModal.environment}
+ prodId={id}
+ onClose={() => setAutoSyncModal(null)}
+ api={wordpressApi}
+ />
+ )}
+
+ <ConfirmDialog
+ isOpen={!!confirmDialog}
+ title={confirmDialog?.title}
+ message={confirmDialog?.message}
+ confirmText={confirmDialog?.confirmText}
+ variant={confirmDialog?.variant}
+ onConfirm={confirmDialog?.onConfirm}
+ onCancel={confirmDialog?.onCancel || (() => setConfirmDialog(null))}
+ />
+ </div>
+ );
+};
+
+// Promotion History (lists past promotions; rollback available for completed promotions with a pre-promotion snapshot)
+const PromotionHistory = ({ projectId, onRollback }) => {
+ const [promotions, setPromotions] = useState([]);
+ const [loading, setLoading] = useState(true);
+
+ const load = useCallback(async () => {
+ setLoading(true);
+ try {
+ const data = await wordpressApi.getPromotionHistory(projectId, { limit: 20 });
+ setPromotions(data.promotions || []);
+ } catch {
+ setPromotions([]);
+ } finally {
+ setLoading(false);
+ }
+ }, [projectId]);
+
+ useEffect(() => { load(); }, [load]);
+
+ if (loading || promotions.length === 0) {
+ return null;
+ }
+
+ return (
+ <div className="pipeline-promotion-history">
+ <div className="section-header">
+ <h3>Promotion History</h3>
+ <Button variant="ghost" size="sm" onClick={load}>
+ <RefreshCw size={14} /> Refresh
+ </Button>
+ </div>
+ <div className="promotion-history-list">
+ {promotions.map(p => {
+ const canRollback = p.status === 'completed' && !!p.pre_promotion_snapshot_id;
+ return (
+ <div key={p.id} className="promotion-history-item">
+ <div className="promotion-history-main">
+ <span className={`promotion-status promotion-status-${p.status}`}>{p.status}</span>
+ <span className="promotion-route">
+ {p.source_site?.name || `#${p.source_site_id}`} <ArrowRight size={12} /> {p.target_site?.name || `#${p.target_site_id}`}
+ </span>
+ <span className="promotion-type">{p.promotion_type}</span>
+ {p.created_at && (
+ <span className="promotion-date">{new Date(p.created_at).toLocaleString()}</span>
+ )}
+ </div>
+ {canRollback && (
+ <Button variant="outline" size="sm" onClick={() => onRollback(p)}>
+ <RotateCcw size={14} /> Rollback
+ </Button>
+ )}
+ </div>
+ );
+ })}
+ </div>
+ </div>
+ );
+};
+
+// Create Environment Modal (Pipeline version)
+const CreatePipelineEnvModal = ({ onClose, onCreate, productionDomain, existingTypes, projectId }) => {
+ const [formData, setFormData] = useState({
+ type: existingTypes.includes('development') ? 'staging' : 'development',
+ name: '',
+ branch: '',
+ clone_db: true
+ });
+ const [loading, setLoading] = useState(false);
+ const [branches, setBranches] = useState([]);
+ const [branchesLoading, setBranchesLoading] = useState(false);
+ const [branchSearch, setBranchSearch] = useState('');
+ const [useCustomBranch, setUseCustomBranch] = useState(false);
+
+ const availableTypes = [
+ { value: 'development', label: 'Development', disabled: existingTypes.includes('development') },
+ { value: 'staging', label: 'Staging', disabled: existingTypes.includes('staging') },
+ { value: 'multidev', label: 'Multidev (branch-based)', disabled: false }
+ ];
+
+ useEffect(() => {
+ if (formData.type === 'multidev' && branches.length === 0 && !branchesLoading) {
+ loadBranches();
+ }
+ }, [formData.type]);
+
+ async function loadBranches() {
+ setBranchesLoading(true);
+ try {
+ const data = await wordpressApi.getBranches(projectId);
+ setBranches(data.branches || []);
+ } catch {
+ setBranches([]);
+ } finally {
+ setBranchesLoading(false);
+ }
+ }
+
+ function handleChange(e) {
+ const { name, value, type, checked } = e.target;
+ setFormData(prev => ({
+ ...prev,
+ [name]: type === 'checkbox' ? checked : value
+ }));
+ }
+
+ function selectBranch(branchName) {
+ setFormData(prev => ({ ...prev, branch: branchName }));
+ setBranchSearch('');
+ }
+
+ async function handleSubmit(e) {
+ e.preventDefault();
+ setLoading(true);
+ try {
+ await onCreate(formData);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ const filteredBranches = branches.filter(b => {
+ if (!branchSearch) return true;
+ return b.name.toLowerCase().includes(branchSearch.toLowerCase());
+ });
+
+ return (
+ <Modal open onClose={onClose} title="Create Environment">
+ <form onSubmit={handleSubmit}>
+ <div className="form-group">
+ <Label>Environment Type</Label>
+ <select name="type" value={formData.type} onChange={handleChange}>
+ {availableTypes.map(t => (
+ <option key={t.value} value={t.value} disabled={t.disabled}>
+ {t.label}{t.disabled ? ' (already exists)' : ''}
+ </option>
+ ))}
+ </select>
+ </div>
+
+ {formData.type === 'multidev' && (
+ <div className="form-group">
+ <Label>
+ <GitBranch size={14} className="mr-1" style={{ verticalAlign: -2 }} />
+ Git Branch *
+ </Label>
+
+ {formData.branch && !useCustomBranch && (
+ <div className="branch-selected">
+ <GitBranch size={14} />
+ <span className="branch-selected-name">{formData.branch}</span>
+ <Button
+ type="button"
+ variant="ghost"
+ size="sm"
+ onClick={() => setFormData(prev => ({ ...prev, branch: '' }))}
+ >
+ Change
+ </Button>
+ </div>
+ )}
+
+ {!formData.branch && !useCustomBranch && (
+ <>
+ {branchesLoading ? (
+ <div className="branch-picker-loading">
+ <Spinner size="sm" />
+ <span>Loading branches...</span>
+ </div>
+ ) : branches.length > 0 ? (
+ <div className="branch-picker">
+ <div className="branch-picker-search">
+ <Search size={14} />
+ <Input
+ type="text"
+ value={branchSearch}
+ onChange={e => setBranchSearch(e.target.value)}
+ placeholder="Search branches..."
+ autoFocus
+ />
+ </div>
+ <div className="branch-picker-list">
+ {filteredBranches.map(b => (
+ <button
+ key={b.name}
+ type="button"
+ className={`branch-picker-item ${b.has_multidev ? 'has-env' : ''} ${b.is_current ? 'current' : ''}`}
+ onClick={() => selectBranch(b.name)}
+ disabled={b.has_multidev}
+ title={b.has_multidev ? 'Multidev already exists for this branch' : ''}
+ >
+ <div className="branch-picker-item-main">
+ <GitBranch size={12} />
+ <span className="branch-name">{b.name}</span>
+ {b.is_current && <span className="branch-tag">default</span>}
+ {b.has_multidev && <span className="branch-tag env">has env</span>}
+ </div>
+ {b.message && (
+ <div className="branch-picker-item-meta">
+ <span className="branch-sha">{b.short_sha}</span>
+ <span className="branch-msg">{b.message}</span>
+ </div>
+ )}
+ </button>
+ ))}
+ {filteredBranches.length === 0 && (
+ <div className="branch-picker-empty">
+ No branches match &quot;{branchSearch}&quot;
+ </div>
+ )}
+ </div>
+ <Button
+ type="button"
+ variant="ghost"
+ size="sm"
+ className="branch-picker-custom"
+ onClick={() => setUseCustomBranch(true)}
+ >
+ Enter branch name manually
+ </Button>
+ </div>
+ ) : (
+ <div>
+ <Input
+ type="text"
+ name="branch"
+ value={formData.branch}
+ onChange={handleChange}
+ placeholder="feature/my-branch"
+ required
+ />
+ <span className="form-hint">No git repo connected or no branches found. Enter branch name manually.</span>
+ </div>
+ )}
+ </>
+ )}
+
+ {useCustomBranch && (
+ <div>
+ <Input
+ type="text"
+ name="branch"
+ value={formData.branch}
+ onChange={handleChange}
+ placeholder="feature/my-branch"
+ required
+ autoFocus
+ />
+ {branches.length > 0 && (
+ <Button
+ type="button"
+ variant="ghost"
+ size="sm"
+ className="mt-1"
+ onClick={() => { setUseCustomBranch(false); setFormData(prev => ({ ...prev, branch: '' })); }}
+ >
+ Back to branch list
+ </Button>
+ )}
+ </div>
+ )}
+ </div>
+ )}
+
+ <div className="form-group">
+ <Label>Environment Name</Label>
+ <Input
+ type="text"
+ name="name"
+ value={formData.name}
+ onChange={handleChange}
+ placeholder={formData.type === 'multidev' ? 'Auto-generated from branch' : `${formData.type} environment`}
+ />
+ <span className="form-hint">Leave empty to auto-generate</span>
+ </div>
+
+ <div className="form-group">
+ <label className="checkbox-label">
+ <input
+ type="checkbox"
+ name="clone_db"
+ checked={formData.clone_db}
+ onChange={handleChange}
+ />
+ <span>Clone production database</span>
+ </label>
+ <span className="form-hint">Creates a copy of the production database for this environment</span>
+ </div>
+
+ <div className="modal-actions">
+ <Button type="button" variant="outline" onClick={onClose} disabled={loading}>
+ Cancel
+ </Button>
+ <Button
+ type="submit"
+ disabled={loading || (formData.type === 'multidev' && !formData.branch)}
+ >
+ {loading ? <><Spinner size="sm" /> Creating...</> : 'Create Environment'}
+ </Button>
+ </div>
+ </form>
+ </Modal>
+ );
+};
+
+export default WordPressProject;
diff --git a/frontend/src/plugins/serverkit-wordpress/pages/WordPressProjects.jsx b/frontend/src/plugins/serverkit-wordpress/pages/WordPressProjects.jsx
new file mode 100644
index 00000000..9eaf353d
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/pages/WordPressProjects.jsx
@@ -0,0 +1,181 @@
+import { useState, useEffect } from 'react';
+import { useNavigate } from 'react-router-dom';
+import { GitBranch, Layers } from 'lucide-react';
+import wordpressApi from '@/services/wordpress';
+import { useToast } from 'serverkit-sdk';
+import ResourceListPage from '@/components/layouts/ResourceListPage';
+import { Pill, ServiceTile, EnvTag } from 'serverkit-sdk';
+
+// Environment badges, in promotion order — production is always present, the
+// rest only when the project actually has them.
+const ENV_TAGS = [
+ ['staging', 'STG'],
+ ['development', 'DEV'],
+ ['multidev', 'MD'],
+];
+
+// A WordPress project = one site plus its environment chain. This lists which
+// projects HAVE a pipeline; the run history of what was promoted and when lives
+// in Deploy Activity, which answers a different question.
+const WordPressProjects = () => {
+ const [projects, setProjects] = useState([]);
+ const [loading, setLoading] = useState(true);
+ const [search, setSearch] = useState('');
+ const [statusFilter, setStatusFilter] = useState('all');
+ const navigate = useNavigate();
+ const toast = useToast();
+
+ useEffect(() => {
+ loadProjects();
+ }, []);
+
+ async function loadProjects() {
+ setLoading(true);
+ try {
+ const data = await wordpressApi.getPipelines();
+ setProjects(data.projects || []);
+ } catch (err) {
+ console.error('Failed to load projects:', err);
+ toast.error('Failed to load WordPress projects');
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ const runningCount = projects.filter(p => p.status === 'running').length;
+
+ const shown = projects.filter(p => {
+ if (statusFilter === 'running' && p.status !== 'running') return false;
+ if (statusFilter === 'stopped' && p.status === 'running') return false;
+ const q = search.trim().toLowerCase();
+ if (!q) return true;
+ return [p.name, p.url, p.application?.domains?.[0]]
+ .some(v => v && String(v).toLowerCase().includes(q));
+ });
+
+ const domainOf = (p) => p.application?.domains?.[0] || p.url || '';
+ const envCount = (p) => (p.environment_count || 0) + 1;
+
+ const columns = [
+ {
+ key: 'name',
+ header: 'Project',
+ render: (p) => (
+ <div className="sk-cell-name">
+ <ServiceTile name={p.name} size={30} aria-hidden="true" />
+ <span>
+ <div>{p.name}</div>
+ {domainOf(p) && <div className="sk-cell-sub">{domainOf(p)}</div>}
+ </span>
+ </div>
+ ),
+ },
+ {
+ key: 'environments',
+ header: 'Environments',
+ render: (p) => (
+ <span className="wp-projects-page__envs">
+ <span className="wp-projects-page__envcount">
+ <Layers size={13} aria-hidden="true" />
+ {envCount(p)}
+ </span>
+ <EnvTag env="production">PROD</EnvTag>
+ {ENV_TAGS.map(([type, label]) => (
+ (p.environment_types || []).includes(type)
+ ? <EnvTag key={type} env={type}>{label}</EnvTag>
+ : null
+ ))}
+ </span>
+ ),
+ },
+ {
+ key: 'version',
+ header: 'Version',
+ cellClassName: 'sk-cell-mono',
+ render: (p) => (p.wp_version ? `WP ${p.wp_version}` : '—'),
+ },
+ {
+ key: 'source',
+ header: 'Source',
+ render: (p) => (
+ p.git_repo_url
+ ? <span className="wp-projects-page__git"><GitBranch size={12} /> Git connected</span>
+ : <span className="wp-list__dash">—</span>
+ ),
+ },
+ {
+ key: 'status',
+ header: 'Status',
+ render: (p) => (
+ <Pill kind={p.status === 'running' ? 'green' : 'gray'}>
+ {p.status === 'running' ? 'Running' : 'Stopped'}
+ </Pill>
+ ),
+ },
+ ];
+
+ return (
+ <ResourceListPage
+ className="wp-projects-page"
+ loading={loading}
+ loadingTitle="Loading WordPress pipelines"
+ totalCount={projects.length}
+ items={shown}
+ columns={columns}
+ keyField="id"
+ onRowClick={(p) => navigate(`/wordpress/pipelines/${p.id}`)}
+ filters={[
+ { value: 'all', label: 'All', count: projects.length },
+ { value: 'running', label: 'Running', count: runningCount },
+ { value: 'stopped', label: 'Stopped', count: projects.length - runningCount },
+ ]}
+ activeFilter={statusFilter}
+ onFilterChange={setStatusFilter}
+ searchTerm={search}
+ onSearchChange={setSearch}
+ searchPlaceholder="Search pipelines…"
+ emptyIcon={Layers}
+ emptyTitle="No WordPress pipelines"
+ emptyDescription="Sites with environment pipelines appear here. Create a WordPress site with environments enabled to get started."
+ filteredEmptyIcon={Layers}
+ filteredEmptyTitle="No pipelines found"
+ filteredEmptyDescription="Try adjusting your search or filter."
+ viewStorageKey="serverkit.wpPipelines.view"
+ renderCard={(p) => (
+ <>
+ <div className="services-card__top">
+ <ServiceTile name={p.name} size={40} aria-hidden="true" />
+ <div className="services-card__id">
+ <div className="services-card__name">{p.name}</div>
+ <div className="sk-cell-sub">{p.wp_version ? `WordPress ${p.wp_version}` : 'WordPress'}</div>
+ </div>
+ <Pill kind={p.status === 'running' ? 'green' : 'gray'}>
+ {p.status === 'running' ? 'Running' : 'Stopped'}
+ </Pill>
+ </div>
+
+ <div className="services-card__domain">
+ {domainOf(p) || <span className="wp-list__dash">No domain</span>}
+ </div>
+
+ <div className="services-card__stats">
+ <div>
+ <span className="l">Environments</span>
+ <span className="v">{envCount(p)}</span>
+ </div>
+ <div>
+ <span className="l">Source</span>
+ <span className="v">{p.git_repo_url ? 'Git' : 'Local'}</span>
+ </div>
+ <div>
+ <span className="l">Status</span>
+ <span className="v">{p.status === 'running' ? 'Running' : 'Stopped'}</span>
+ </div>
+ </div>
+ </>
+ )}
+ />
+ );
+};
+
+export default WordPressProjects;
diff --git a/frontend/src/plugins/serverkit-wordpress/styles/wordpress-pipeline.scss b/frontend/src/plugins/serverkit-wordpress/styles/wordpress-pipeline.scss
new file mode 100644
index 00000000..3daeede8
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/styles/wordpress-pipeline.scss
@@ -0,0 +1,2351 @@
+// Compiled through the extension's module graph (imported by index.jsx).
+// The host's design-token partial is imported via a sync-safe relative
+// path — the baked copy lives at frontend/src/plugins/serverkit-wordpress/,
+// so this resolves to frontend/src/styles/_variables.scss.
+@import '../../../styles/variables';
+
+// ============================================
+// WORDPRESS PIPELINE STYLES
+// ============================================
+
+// Page Loading
+.page-loading {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ min-height: 400px;
+}
+
+// Projects Page
+.wp-projects-page {
+ padding: $space-4;
+
+ .empty-state-large {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding: 60px $space-6;
+ background: $bg-card;
+ border-radius: $radius-xl;
+ text-align: center;
+
+ .empty-icon {
+ color: $text-tertiary;
+ margin-bottom: $space-4;
+ }
+
+ h2 {
+ font-size: $font-size-lg;
+ font-weight: $font-weight-semibold;
+ color: $text-primary;
+ margin: 0 0 $space-2;
+ }
+
+ p {
+ font-size: $font-size-sm;
+ color: $text-secondary;
+ max-width: 460px;
+ margin: 0;
+ }
+ }
+}
+
+
+// ============================================
+// PIPELINE DASHBOARD
+// ============================================
+
+.wp-project-page {
+ .wp-icon {
+ background: $color-wordpress !important;
+ }
+}
+
+// Pipeline Tab
+.pipeline-tab {
+ padding: $space-4 0;
+}
+
+.pipeline-operation-banner {
+ display: flex;
+ align-items: center;
+ gap: $space-3;
+ padding: $space-3 $space-4;
+ background: fade($info-raw, 10%);
+ border: 1px solid fade($info-raw, 25%);
+ border-radius: $radius-md;
+ margin-bottom: $space-4;
+ font-size: $font-size-sm;
+ color: $color-info;
+}
+
+// Pipeline View
+.pipeline-view {
+ margin-bottom: $space-6;
+}
+
+.pipeline-row {
+ display: flex;
+ align-items: stretch;
+ gap: 0;
+ overflow-x: auto;
+ padding-bottom: $space-2;
+}
+
+.pipeline-card {
+ flex: 1;
+ min-width: 220px;
+ max-width: 320px;
+ background: $bg-card;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-lg;
+ display: flex;
+ flex-direction: column;
+ position: relative;
+
+ &.production {
+ border-color: fade($danger-raw, 45%);
+ }
+
+ &.locked {
+ opacity: 0.85;
+ }
+
+ &.empty {
+ border-style: dashed;
+ border-color: $border-subtle;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ min-height: 180px;
+ }
+}
+
+.pipeline-empty-content {
+ text-align: center;
+ color: $text-tertiary;
+
+ p {
+ margin: $space-2 0 0;
+ font-size: $font-size-sm;
+ }
+}
+
+.pipeline-card-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: $space-3 $space-4;
+ border-bottom: 1px solid $border-subtle;
+}
+
+.env-status-badge-group {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+}
+
+.env-locked-badge {
+ display: flex;
+ align-items: center;
+ padding: 2px 4px;
+ background: fade($warning-raw, 15%);
+ color: $color-warning;
+ border-radius: $radius-sm;
+}
+
+.pipeline-card-menu-wrapper {
+ position: relative;
+}
+
+.pipeline-card-menu-btn {
+ padding: 4px !important;
+}
+
+.pipeline-card-menu {
+ position: absolute;
+ right: 0;
+ top: 100%;
+ background: $bg-elevated;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-md;
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
+ z-index: 100;
+ min-width: 140px;
+ padding: $space-1;
+
+ button {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ width: 100%;
+ padding: $space-2 $space-3;
+ border: none;
+ background: none;
+ color: $text-secondary;
+ font-size: $font-size-sm;
+ cursor: pointer;
+ border-radius: $radius-sm;
+ text-align: left;
+
+ &:hover {
+ background: $bg-hover;
+ color: $text-primary;
+ }
+
+ &.danger {
+ color: $color-danger;
+
+ &:hover {
+ background: fade($danger-raw, 10%);
+ }
+ }
+ }
+}
+
+.pipeline-card-body {
+ flex: 1;
+ padding: $space-4;
+}
+
+.pipeline-card-name {
+ font-size: $font-size-base;
+ font-weight: $font-weight-semibold;
+ color: $text-primary;
+ margin: 0 0 $space-2;
+}
+
+.pipeline-card-domain {
+ display: block;
+ font-size: $font-size-xs;
+ font-family: $font-family-mono;
+ color: $color-primary;
+ margin-bottom: $space-2;
+ text-decoration: none;
+
+ &:hover {
+ text-decoration: underline;
+ }
+}
+
+.pipeline-card-meta {
+ display: flex;
+ flex-wrap: wrap;
+ gap: $space-2;
+}
+
+.pipeline-meta-item {
+ font-size: $font-size-xs;
+ color: $text-tertiary;
+}
+
+.pipeline-card-footer {
+ display: flex;
+ gap: $space-2;
+ padding: $space-2 $space-3;
+ border-top: 1px solid $border-subtle;
+ background: $bg-tertiary;
+ border-radius: 0 0 $radius-lg $radius-lg;
+}
+
+.pipeline-card-lock-banner {
+ display: flex;
+ align-items: center;
+ gap: $space-1;
+ padding: $space-2 $space-3;
+ background: fade($warning-raw, 10%);
+ font-size: $font-size-xs;
+ color: $color-warning;
+ border-radius: 0 0 $radius-lg $radius-lg;
+}
+
+// Pipeline Arrows
+.pipeline-arrow {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ min-width: 80px;
+ padding: 0 $space-2;
+
+ &.disabled {
+ opacity: 0.3;
+ pointer-events: none;
+ }
+}
+
+.pipeline-arrow-btn {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 4px;
+ padding: $space-2 $space-3;
+ border: 1px solid $border-subtle;
+ background: $bg-card;
+ border-radius: $radius-md;
+ cursor: pointer;
+ color: $text-secondary;
+ transition: all 0.15s ease;
+
+ &:hover:not(:disabled) {
+ border-color: $color-primary;
+ color: $color-primary;
+ background: fade($accent-primary-raw, 5%);
+ }
+
+ &:disabled {
+ cursor: not-allowed;
+ opacity: 0.4;
+ }
+}
+
+.pipeline-arrow-label {
+ font-size: 10px;
+ font-weight: $font-weight-medium;
+ text-transform: uppercase;
+ letter-spacing: 0.5px;
+}
+
+// Pipeline Sync Row
+.pipeline-sync-row {
+ display: flex;
+ gap: 0;
+ margin-top: $space-2;
+
+ .pipeline-sync-action {
+ flex: 1;
+ min-width: 220px;
+ max-width: 320px;
+ display: flex;
+ justify-content: center;
+ }
+}
+
+// Multidev Section
+.pipeline-multidev-section {
+ margin-top: $space-6;
+ padding-top: $space-4;
+ border-top: 1px solid $border-subtle;
+}
+
+.pipeline-section-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: $space-3;
+}
+
+.pipeline-section-title {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ font-size: $font-size-sm;
+ font-weight: $font-weight-semibold;
+ color: $text-secondary;
+ text-transform: uppercase;
+ letter-spacing: 0.5px;
+ margin: 0;
+}
+
+.pipeline-section-count {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ min-width: 20px;
+ height: 20px;
+ padding: 0 6px;
+ background: fade($accent-primary-raw, 12%);
+ color: $color-primary;
+ border-radius: 10px;
+ font-size: 11px;
+ font-weight: $font-weight-bold;
+ text-transform: none;
+ letter-spacing: 0;
+}
+
+.pipeline-multidev-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
+ gap: $space-3;
+}
+
+.pipeline-multidev-empty {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding: $space-8 $space-4;
+ background: $bg-card;
+ border: 1px dashed $border-subtle;
+ border-radius: $radius-lg;
+ text-align: center;
+
+ > svg {
+ color: $text-tertiary;
+ margin-bottom: $space-3;
+ }
+
+ p {
+ font-size: $font-size-base;
+ font-weight: $font-weight-medium;
+ color: $text-secondary;
+ margin: 0 0 $space-1;
+ }
+
+ > span {
+ font-size: $font-size-sm;
+ color: $text-tertiary;
+ margin-bottom: $space-4;
+ }
+}
+
+.multidev-card {
+ background: $bg-card;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-lg;
+ transition: border-color 0.15s ease;
+
+ &:hover {
+ border-color: $border-hover;
+ }
+
+ &.locked {
+ opacity: 0.85;
+ }
+}
+
+.multidev-card-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: $space-3 $space-4;
+ border-bottom: 1px solid $border-subtle;
+}
+
+.multidev-card-header-left {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+}
+
+.multidev-lock-icon {
+ color: $color-warning;
+}
+
+.multidev-card-menu-wrapper {
+ position: relative;
+}
+
+.multidev-card-body {
+ padding: $space-3 $space-4;
+}
+
+.multidev-card-name {
+ font-size: $font-size-sm;
+ font-weight: $font-weight-semibold;
+ color: $text-primary;
+ margin: 0 0 $space-2;
+}
+
+.multidev-branch {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ font-size: $font-size-xs;
+ font-family: $font-family-mono;
+ color: $text-tertiary;
+ background: $bg-tertiary;
+ padding: 2px 8px;
+ border-radius: $radius-sm;
+ margin-bottom: $space-2;
+}
+
+.multidev-domain {
+ display: block;
+ font-size: $font-size-xs;
+ font-family: $font-family-mono;
+ color: $color-primary;
+ text-decoration: none;
+ margin-bottom: $space-2;
+
+ &:hover {
+ text-decoration: underline;
+ }
+}
+
+.multidev-card-meta {
+ display: flex;
+ flex-wrap: wrap;
+ gap: $space-2;
+}
+
+.multidev-meta-item {
+ font-size: $font-size-xs;
+ color: $text-tertiary;
+}
+
+.multidev-card-footer {
+ display: flex;
+ gap: $space-2;
+ padding: $space-2 $space-3;
+ border-top: 1px solid $border-subtle;
+ background: $bg-tertiary;
+ border-radius: 0 0 $radius-lg $radius-lg;
+}
+
+.wp-env-badge.env-multidev {
+ background: fade($accent-primary-raw, 12%);
+ color: $color-primary;
+}
+
+// ============================================
+// BRANCH PICKER
+// ============================================
+
+.branch-selected {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ padding: $space-3;
+ background: fade($accent-primary-raw, 8%);
+ border: 1px solid fade($accent-primary-raw, 25%);
+ border-radius: $radius-md;
+
+ svg {
+ color: $color-primary;
+ flex-shrink: 0;
+ }
+}
+
+.branch-selected-name {
+ flex: 1;
+ font-family: $font-family-mono;
+ font-size: $font-size-sm;
+ font-weight: $font-weight-medium;
+ color: $text-primary;
+}
+
+.branch-picker-loading {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ padding: $space-4;
+ justify-content: center;
+ color: $text-tertiary;
+ font-size: $font-size-sm;
+}
+
+.branch-picker {
+ border: 1px solid $border-subtle;
+ border-radius: $radius-md;
+ overflow: hidden;
+}
+
+.branch-picker-search {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ padding: $space-2 $space-3;
+ border-bottom: 1px solid $border-subtle;
+ background: $bg-tertiary;
+
+ svg {
+ color: $text-tertiary;
+ flex-shrink: 0;
+ }
+
+ input {
+ flex: 1;
+ border: none;
+ background: none;
+ font-size: $font-size-sm;
+ color: $text-primary;
+ outline: none;
+ padding: 0;
+
+ &::placeholder {
+ color: $text-tertiary;
+ }
+ }
+}
+
+.branch-picker-list {
+ max-height: 240px;
+ overflow-y: auto;
+}
+
+.branch-picker-item {
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+ width: 100%;
+ padding: $space-2 $space-3;
+ border: none;
+ border-bottom: 1px solid $border-subtle;
+ background: $bg-card;
+ cursor: pointer;
+ text-align: left;
+ transition: background 0.1s ease;
+
+ &:last-child {
+ border-bottom: none;
+ }
+
+ &:hover:not(:disabled) {
+ background: $bg-hover;
+ }
+
+ &:disabled {
+ opacity: 0.5;
+ cursor: not-allowed;
+ }
+
+ &.has-env {
+ background: fade($text-tertiary-raw, 3%);
+ }
+}
+
+.branch-picker-item-main {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ font-size: $font-size-sm;
+ color: $text-primary;
+
+ svg {
+ color: $text-tertiary;
+ flex-shrink: 0;
+ }
+}
+
+.branch-name {
+ font-family: $font-family-mono;
+ font-weight: $font-weight-medium;
+}
+
+.branch-tag {
+ font-size: 10px;
+ font-weight: $font-weight-medium;
+ padding: 1px 6px;
+ border-radius: $radius-sm;
+ background: fade($text-tertiary-raw, 10%);
+ color: $text-tertiary;
+
+ &.env {
+ background: fade($accent-primary-raw, 10%);
+ color: $color-primary;
+ }
+}
+
+.branch-picker-item-meta {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ padding-left: 20px;
+
+ .branch-sha {
+ font-family: $font-family-mono;
+ font-size: 11px;
+ color: $text-tertiary;
+ }
+
+ .branch-msg {
+ font-size: 11px;
+ color: $text-tertiary;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+}
+
+.branch-picker-empty {
+ padding: $space-4;
+ text-align: center;
+ font-size: $font-size-sm;
+ color: $text-tertiary;
+}
+
+.branch-picker-custom {
+ width: 100%;
+ border-top: 1px solid $border-subtle;
+ border-radius: 0 0 $radius-md $radius-md;
+ justify-content: center;
+ color: $color-primary !important;
+}
+
+// ============================================
+// PROMOTE / SYNC MODALS
+// ============================================
+
+.promote-direction,
+.sync-direction {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: $space-3;
+ padding: $space-4;
+ background: $bg-tertiary;
+ border-radius: $radius-md;
+ margin-bottom: $space-4;
+}
+
+.promote-env-pill {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 4px;
+ padding: $space-3 $space-4;
+ background: $bg-card;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-md;
+ min-width: 120px;
+
+ .promote-env-type {
+ font-size: $font-size-xs;
+ font-weight: $font-weight-bold;
+ text-transform: uppercase;
+ letter-spacing: 0.5px;
+ }
+
+ .promote-env-name {
+ font-size: $font-size-sm;
+ color: $text-secondary;
+ max-width: 150px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+
+ &.production .promote-env-type { color: $color-danger; }
+ &.staging .promote-env-type { color: $color-warning; }
+ &.development .promote-env-type { color: $color-info; }
+ &.multidev .promote-env-type { color: $color-primary; }
+}
+
+.promote-arrow {
+ color: $text-tertiary;
+ flex-shrink: 0;
+}
+
+.promote-warning,
+.sync-warning {
+ display: flex;
+ align-items: flex-start;
+ gap: $space-3;
+ padding: $space-3 $space-4;
+ background: fade($warning-raw, 8%);
+ border: 1px solid fade($warning-raw, 20%);
+ border-radius: $radius-md;
+ margin-top: $space-4;
+ font-size: $font-size-sm;
+ color: $text-secondary;
+
+ > svg {
+ color: $color-warning;
+ flex-shrink: 0;
+ margin-top: 2px;
+ }
+
+ strong {
+ color: $text-primary;
+ }
+
+ p {
+ margin: $space-1 0 0;
+ }
+}
+
+// Radio Group for promotion/sync type selection
+.radio-group {
+ display: flex;
+ flex-direction: column;
+ gap: $space-2;
+}
+
+.radio-label {
+ display: flex;
+ align-items: flex-start;
+ gap: $space-3;
+ padding: $space-3;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-md;
+ cursor: pointer;
+ transition: all 0.15s ease;
+
+ &:hover {
+ border-color: $border-hover;
+ background: $bg-hover;
+ }
+
+ &:has(input:checked) {
+ border-color: $color-primary;
+ background: fade($accent-primary-raw, 5%);
+ }
+
+ input[type="radio"] {
+ margin-top: 4px;
+ accent-color: var(--accent-primary, #3b82f6);
+ }
+}
+
+.radio-content {
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+
+ strong {
+ font-size: $font-size-sm;
+ color: $text-primary;
+ }
+
+ span {
+ font-size: $font-size-xs;
+ color: $text-tertiary;
+ }
+}
+
+.checkbox-group {
+ display: flex;
+ flex-direction: column;
+ gap: $space-2;
+}
+
+// ============================================
+// ACTIVITY FEED
+// ============================================
+
+.activity-feed {
+ display: flex;
+ flex-direction: column;
+ gap: 1px;
+ background: $border-subtle;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-lg;
+ overflow: hidden;
+
+ &.compact .activity-item {
+ padding: $space-2 $space-3;
+ }
+}
+
+.activity-feed-empty {
+ padding: $space-6;
+ text-align: center;
+ color: $text-tertiary;
+ font-size: $font-size-sm;
+}
+
+.activity-item {
+ display: flex;
+ align-items: center;
+ gap: $space-3;
+ padding: $space-3 $space-4;
+ background: $bg-card;
+}
+
+.activity-item-skeleton {
+ display: flex;
+ align-items: center;
+ gap: $space-3;
+ padding: $space-3 $space-4;
+}
+
+.activity-icon {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 28px;
+ height: 28px;
+ border-radius: 50%;
+ flex-shrink: 0;
+
+ &.success {
+ background: fade($success-raw, 12%);
+ color: $color-success;
+ }
+ &.danger {
+ background: fade($danger-raw, 12%);
+ color: $color-danger;
+ }
+ &.warning {
+ background: fade($warning-raw, 12%);
+ color: $color-warning;
+ }
+ &.info {
+ background: fade($info-raw, 12%);
+ color: $color-info;
+ }
+ &.primary {
+ background: fade($accent-primary-raw, 12%);
+ color: $color-primary;
+ }
+ &.default {
+ background: fade($text-tertiary-raw, 12%);
+ color: $text-tertiary;
+ }
+}
+
+.activity-content {
+ flex: 1;
+ min-width: 0;
+}
+
+.activity-description {
+ font-size: $font-size-sm;
+ color: $text-primary;
+ display: block;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.activity-error {
+ font-size: $font-size-xs;
+ color: $color-danger;
+ display: block;
+ margin-top: 2px;
+}
+
+.activity-meta {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ flex-shrink: 0;
+}
+
+.activity-time {
+ font-size: $font-size-xs;
+ color: $text-tertiary;
+ white-space: nowrap;
+}
+
+.activity-status-badge {
+ font-size: 10px;
+ font-weight: $font-weight-medium;
+ padding: 2px 6px;
+ border-radius: $radius-sm;
+
+ &.failed {
+ background: fade($danger-raw, 12%);
+ color: $color-danger;
+ }
+
+ &.running {
+ background: fade($info-raw, 12%);
+ color: $color-info;
+ }
+}
+
+.activity-load-more {
+ background: $bg-card;
+ padding: $space-3;
+ text-align: center;
+ width: 100%;
+ justify-content: center;
+}
+
+// Pipeline Activity Preview
+.pipeline-activity-preview {
+ margin-top: $space-6;
+}
+
+// ============================================
+// CONTAINER LOGS
+// ============================================
+
+.pipeline-logs-overlay {
+ position: fixed;
+ bottom: 0;
+ right: 0;
+ width: 600px;
+ max-width: 100%;
+ height: 400px;
+ z-index: 200;
+ // Up-facing variant of --shadow-lg (token shadows cast downward).
+ box-shadow: 0 -16px 48px -12px rgba(0, 0, 0, 0.5);
+ border-radius: var(--radius-lg) var(--radius-lg) 0 0;
+ overflow: hidden;
+
+ @media (max-width: $breakpoint-md) {
+ width: 100%;
+ }
+}
+
+.container-logs-panel {
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+ background: var(--surface);
+ border: 1px solid var(--border-strong);
+ border-radius: var(--radius-lg) var(--radius-lg) 0 0;
+}
+
+.container-logs-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: $space-3;
+ padding: $space-2 $space-3;
+ border-bottom: 1px solid var(--border-soft);
+ background: var(--surface);
+}
+
+.container-logs-title {
+ display: flex;
+ align-items: center;
+ gap: $space-3;
+ min-width: 0;
+ color: var(--text);
+}
+
+.container-logs-ico {
+ width: 28px;
+ height: 28px;
+ border-radius: 8px;
+ display: grid;
+ place-items: center;
+ background: var(--cyan-bg);
+ color: var(--cyan);
+ flex-shrink: 0;
+}
+
+.container-logs-titles {
+ display: flex;
+ flex-direction: column;
+ min-width: 0;
+ font-size: 13px;
+ font-weight: $font-weight-semibold;
+}
+
+.container-logs-sub {
+ font-family: var(--mono);
+ font-size: 10.5px;
+ font-weight: $font-weight-normal;
+ color: var(--text-faint);
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.container-logs-controls {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ flex-shrink: 0;
+}
+
+.logs-service-select,
+.logs-lines-select {
+ padding: 4px $space-2;
+ font-family: var(--mono);
+ font-size: 11.5px;
+ border: 1px solid var(--border);
+ border-radius: $radius-md;
+ background: var(--surface-2);
+ color: var(--text-dim);
+ transition: border-color $transition-fast, color $transition-fast;
+
+ &:hover {
+ border-color: var(--border-strong);
+ color: var(--text);
+ }
+}
+
+.container-logs-body {
+ flex: 1;
+ overflow-y: auto;
+ background: var(--bg-code);
+ scrollbar-width: thin;
+}
+
+.logs-loading,
+.logs-empty {
+ padding: $space-6;
+ text-align: center;
+ color: var(--text-faint);
+ font-family: var(--mono);
+ font-size: $font-size-sm;
+}
+
+.logs-content {
+ margin: 0;
+ padding: $space-3 $space-4;
+ font-family: var(--mono);
+ font-size: 12px;
+ line-height: 1.7;
+ color: var(--text-dim);
+ white-space: pre-wrap;
+ word-break: break-all;
+}
+
+.log-line {
+ padding: 1px 0;
+
+ &:hover {
+ background: fade($text-primary-raw, 5%);
+ }
+}
+
+// ============================================
+// COMPARE VIEW
+// ============================================
+
+.compare-header {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: $space-3;
+ padding: $space-4;
+ background: $bg-tertiary;
+ margin: 0 -$space-5;
+ padding: $space-4 $space-5;
+}
+
+.compare-env-pill {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 4px;
+ padding: $space-3 $space-4;
+ background: $bg-card;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-md;
+ min-width: 120px;
+
+ .compare-env-type {
+ font-size: $font-size-xs;
+ font-weight: $font-weight-bold;
+ text-transform: uppercase;
+ letter-spacing: 0.5px;
+ }
+
+ .compare-env-name {
+ font-size: $font-size-sm;
+ color: $text-secondary;
+ max-width: 150px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+
+ &.production .compare-env-type { color: $color-danger; }
+ &.staging .compare-env-type { color: $color-warning; }
+ &.development .compare-env-type { color: $color-info; }
+ &.multidev .compare-env-type { color: $color-primary; }
+}
+
+.compare-vs-icon {
+ color: $text-tertiary;
+ flex-shrink: 0;
+}
+
+.compare-body {
+ padding: $space-4 0;
+ max-height: 60vh;
+ overflow-y: auto;
+}
+
+.compare-loading {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: $space-3;
+ padding: $space-8;
+ color: $text-tertiary;
+ font-size: $font-size-sm;
+}
+
+.compare-error {
+ text-align: center;
+ padding: $space-6;
+
+ p {
+ color: $color-danger;
+ margin: 0 0 $space-3;
+ }
+}
+
+.compare-section {
+ margin-bottom: $space-4;
+
+ &:last-child {
+ margin-bottom: 0;
+ }
+}
+
+.compare-section-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: $space-2 $space-3;
+ background: $bg-tertiary;
+ border-radius: $radius-md;
+ margin-bottom: $space-2;
+
+ h4 {
+ margin: 0;
+ font-size: $font-size-sm;
+ font-weight: $font-weight-semibold;
+ color: $text-primary;
+ }
+}
+
+.compare-section-summary {
+ font-size: $font-size-xs;
+ color: $text-tertiary;
+}
+
+.compare-table {
+ border: 1px solid $border-subtle;
+ border-radius: $radius-md;
+ overflow: hidden;
+}
+
+.compare-row {
+ display: grid;
+ grid-template-columns: 1fr 1fr 1fr;
+ gap: $space-2;
+ padding: $space-2 $space-3;
+ border-bottom: 1px solid $border-subtle;
+ font-size: $font-size-sm;
+ align-items: center;
+
+ &:last-child {
+ border-bottom: none;
+ }
+
+ &.match {
+ .compare-row-icon { color: $color-success; }
+ }
+
+ &.different {
+ background: fade($danger-raw, 5%);
+ .compare-row-icon { color: $color-danger; }
+ .compare-row-value-a,
+ .compare-row-value-b {
+ font-weight: $font-weight-medium;
+ }
+ }
+
+ &.only-a {
+ .compare-row-icon { color: $color-warning; }
+ .compare-row-value-b { opacity: 0.4; }
+ }
+
+ &.only-b {
+ .compare-row-icon { color: $color-warning; }
+ .compare-row-value-a { opacity: 0.4; }
+ }
+}
+
+.compare-row-label {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ font-weight: $font-weight-medium;
+ color: $text-primary;
+}
+
+.compare-row-icon {
+ flex-shrink: 0;
+}
+
+.compare-row-value-a,
+.compare-row-value-b {
+ font-size: $font-size-xs;
+ color: $text-secondary;
+ font-family: $font-family-mono;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.compare-na {
+ color: $text-tertiary;
+ font-style: italic;
+}
+
+.compare-empty-row {
+ padding: $space-4;
+ text-align: center;
+ font-size: $font-size-sm;
+ color: $text-tertiary;
+}
+
+// Pipeline Compare Row
+.pipeline-compare-row {
+ display: flex;
+ gap: $space-3;
+ justify-content: center;
+ margin-top: $space-2;
+ padding: $space-2 0;
+}
+
+.pipeline-compare-btn {
+ color: $text-tertiary !important;
+ font-size: $font-size-xs !important;
+
+ &:hover {
+ color: $color-primary !important;
+ }
+}
+
+// ============================================
+// SANITIZATION PROFILES
+// ============================================
+
+.sanitization-profiles-body {
+ padding: $space-4 0;
+ max-height: 60vh;
+ overflow-y: auto;
+}
+
+.sanitization-loading {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: $space-8;
+}
+
+.sanitization-profile-list {
+ display: flex;
+ flex-direction: column;
+ gap: $space-3;
+ margin-bottom: $space-4;
+}
+
+.sanitization-profile-card {
+ background: $bg-card;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-md;
+ padding: $space-3 $space-4;
+ transition: border-color 0.15s ease;
+
+ &:hover {
+ border-color: $border-hover;
+ }
+
+ &.default {
+ border-color: fade($accent-primary-raw, 45%);
+ }
+}
+
+.sanitization-profile-card-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-bottom: $space-2;
+}
+
+.sanitization-profile-card-title {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+
+ h5 {
+ margin: 0;
+ font-size: $font-size-sm;
+ font-weight: $font-weight-semibold;
+ color: $text-primary;
+ }
+}
+
+.sanitization-tag {
+ font-size: 10px;
+ font-weight: $font-weight-medium;
+ padding: 1px 6px;
+ border-radius: $radius-sm;
+
+ &.builtin {
+ background: fade($text-tertiary-raw, 10%);
+ color: $text-tertiary;
+ }
+
+ &.default {
+ background: fade($accent-primary-raw, 12%);
+ color: $color-primary;
+ }
+}
+
+.sanitization-profile-card-actions {
+ display: flex;
+ gap: $space-1;
+}
+
+.sanitization-profile-desc {
+ font-size: $font-size-xs;
+ color: $text-secondary;
+ margin: 0 0 $space-2;
+}
+
+.sanitization-rule-tags {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 4px;
+}
+
+.sanitization-rule-tag {
+ font-size: 10px;
+ padding: 2px 8px;
+ background: $bg-tertiary;
+ border-radius: $radius-sm;
+ color: $text-tertiary;
+
+ &.empty {
+ font-style: italic;
+ }
+}
+
+.sanitization-add-btn {
+ width: 100%;
+ justify-content: center;
+}
+
+// Profile Editor
+.sanitization-editor {
+ background: $bg-tertiary;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-md;
+ padding: $space-4;
+ margin-top: $space-3;
+
+ h4 {
+ margin: 0 0 $space-3;
+ font-size: $font-size-sm;
+ font-weight: $font-weight-semibold;
+ color: $text-primary;
+ }
+
+ .form-group {
+ margin-bottom: $space-3;
+
+ &:last-of-type {
+ margin-bottom: $space-4;
+ }
+ }
+}
+
+.sanitization-editor-actions {
+ display: flex;
+ justify-content: flex-end;
+ gap: $space-2;
+ padding-top: $space-3;
+ border-top: 1px solid $border-subtle;
+}
+
+// ============================================
+// RESPONSIVE
+// ============================================
+
+// ============================================
+// PIPELINE CARD ADDITIONS (Phase 7)
+// ============================================
+
+.pipeline-card-checkbox {
+ margin-right: $space-1;
+ accent-color: var(--accent-primary, #3b82f6);
+}
+
+.pipeline-card-menu-divider {
+ height: 1px;
+ background: $border-subtle;
+ margin: $space-1 0;
+}
+
+// ============================================
+// RESOURCE LIMITS MODAL
+// ============================================
+
+.resource-limits-modal {
+ max-width: 480px;
+}
+
+.resource-limits-env-name {
+ font-size: $font-size-sm;
+ font-weight: $font-weight-semibold;
+ color: $text-primary;
+ padding-bottom: $space-3;
+ border-bottom: 1px solid $border-subtle;
+ margin-bottom: $space-3;
+}
+
+.resource-limits-presets {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ margin-bottom: $space-4;
+}
+
+.resource-limits-presets-label {
+ font-size: $font-size-sm;
+ color: $text-secondary;
+}
+
+.resource-preset-btn {
+ text-transform: capitalize;
+}
+
+.resource-limits-section {
+ margin-bottom: $space-4;
+
+ h4 {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ font-size: $font-size-sm;
+ font-weight: $font-weight-semibold;
+ color: $text-secondary;
+ margin: 0 0 $space-3;
+ }
+}
+
+.resource-limits-row {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: $space-2 0;
+
+ label {
+ font-size: $font-size-sm;
+ color: $text-primary;
+ }
+
+ select {
+ width: 120px;
+ padding: $space-1 $space-2;
+ font-size: $font-size-sm;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-sm;
+ background: $bg-card;
+ color: $text-primary;
+ }
+}
+
+.resource-limits-warning {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ padding: $space-3;
+ background: fade($warning-raw, 8%);
+ border: 1px solid fade($warning-raw, 20%);
+ border-radius: $radius-md;
+ margin-top: $space-3;
+ margin-bottom: $space-3;
+ font-size: $font-size-xs;
+ color: $color-warning;
+}
+
+// ============================================
+// BASIC AUTH MODAL
+// ============================================
+
+.basic-auth-modal {
+ max-width: 460px;
+}
+
+.basic-auth-body {
+ padding: $space-4 0;
+}
+
+.basic-auth-env-name {
+ font-size: $font-size-sm;
+ font-weight: $font-weight-semibold;
+ color: $text-primary;
+ padding-bottom: $space-3;
+ border-bottom: 1px solid $border-subtle;
+ margin-bottom: $space-3;
+}
+
+.basic-auth-loading {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ justify-content: center;
+ padding: $space-4;
+ color: $text-tertiary;
+ font-size: $font-size-sm;
+}
+
+.basic-auth-toggle {
+ margin-bottom: $space-4;
+}
+
+.basic-auth-toggle-label {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ cursor: pointer;
+
+ span {
+ font-size: $font-size-sm;
+ font-weight: $font-weight-medium;
+ color: $text-primary;
+ }
+}
+
+.basic-auth-description {
+ font-size: $font-size-xs;
+ color: $text-tertiary;
+ margin: $space-1 0 0;
+}
+
+.toggle-switch {
+ position: relative;
+ width: 44px;
+ height: 24px;
+ border: none;
+ border-radius: 12px;
+ background: $bg-tertiary;
+ cursor: pointer;
+ transition: background 0.2s ease;
+ padding: 0;
+
+ &.active {
+ background: var(--accent-primary, #3b82f6);
+ }
+}
+
+.toggle-switch-slider {
+ position: absolute;
+ top: 2px;
+ left: 2px;
+ width: 20px;
+ height: 20px;
+ border-radius: 50%;
+ background: white;
+ transition: transform 0.2s ease;
+
+ .toggle-switch.active & {
+ transform: translateX(20px);
+ }
+}
+
+.basic-auth-current {
+ padding: $space-3;
+ background: $bg-tertiary;
+ border-radius: $radius-md;
+}
+
+.basic-auth-credentials {
+ display: flex;
+ flex-direction: column;
+ gap: $space-3;
+}
+
+.basic-auth-credential-warning {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ padding: $space-2 $space-3;
+ background: fade($warning-raw, 10%);
+ border: 1px solid fade($warning-raw, 20%);
+ border-radius: $radius-md;
+ font-size: $font-size-xs;
+ color: $color-warning;
+}
+
+.basic-auth-field {
+ display: flex;
+ flex-direction: column;
+ gap: $space-1;
+
+ label {
+ font-size: $font-size-xs;
+ font-weight: $font-weight-medium;
+ color: $text-tertiary;
+ text-transform: uppercase;
+ letter-spacing: 0.5px;
+ }
+}
+
+.basic-auth-value {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ padding: $space-2 $space-3;
+ background: $bg-tertiary;
+ border-radius: $radius-sm;
+
+ code {
+ flex: 1;
+ font-family: $font-family-mono;
+ font-size: $font-size-sm;
+ color: $text-primary;
+ }
+}
+
+.basic-auth-hint {
+ font-size: $font-size-xs;
+ color: $text-tertiary;
+ margin-top: $space-2;
+}
+
+// ============================================
+// WP-CLI TERMINAL
+// ============================================
+
+.wpcli-terminal-modal {
+ max-width: 700px;
+ height: 560px;
+ display: flex;
+ flex-direction: column;
+}
+
+.wpcli-quick-actions {
+ display: flex;
+ flex-wrap: wrap;
+ gap: $space-1;
+ padding: $space-2 $space-4;
+ border-bottom: 1px solid $border-subtle;
+ background: $bg-tertiary;
+}
+
+.wpcli-history {
+ border-bottom: 1px solid $border-subtle;
+ max-height: 200px;
+ overflow-y: auto;
+}
+
+.wpcli-history-item {
+ display: block;
+ width: 100%;
+ padding: $space-2 $space-4;
+ border: none;
+ background: none;
+ text-align: left;
+ cursor: pointer;
+ border-bottom: 1px solid $border-subtle;
+
+ &:last-child {
+ border-bottom: none;
+ }
+
+ &:hover {
+ background: $bg-hover;
+ }
+
+ code {
+ font-family: $font-family-mono;
+ font-size: $font-size-xs;
+ color: $text-primary;
+ }
+}
+
+.wpcli-output {
+ flex: 1;
+ overflow-y: auto;
+ padding: $space-3;
+ background: $bg-body;
+ font-family: $font-family-mono;
+ font-size: 12px;
+ line-height: 1.6;
+}
+
+.wpcli-output-empty {
+ color: $text-tertiary;
+ text-align: center;
+ padding: $space-6;
+ font-size: $font-size-sm;
+}
+
+.wpcli-output-command {
+ display: flex;
+ gap: $space-2;
+ color: $color-primary;
+ margin-top: $space-2;
+
+ &:first-child {
+ margin-top: 0;
+ }
+}
+
+.wpcli-output-text {
+ margin: 0;
+ color: $text-secondary;
+ white-space: pre-wrap;
+ word-break: break-all;
+}
+
+.wpcli-output-error {
+ margin: 0;
+ color: $color-danger;
+ white-space: pre-wrap;
+ word-break: break-all;
+}
+
+.wpcli-prompt {
+ color: $color-success;
+ font-weight: $font-weight-bold;
+ user-select: none;
+}
+
+.wpcli-executing {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ padding: $space-2 0;
+ color: $text-tertiary;
+ font-size: $font-size-xs;
+}
+
+.wpcli-input-row {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ padding: $space-2 $space-3;
+ border-top: 1px solid $border-subtle;
+ background: $bg-elevated;
+}
+
+.wpcli-input {
+ flex: 1;
+ border: none;
+ background: none;
+ font-family: $font-family-mono;
+ font-size: $font-size-sm;
+ color: $text-primary;
+ outline: none;
+ padding: $space-1 0;
+
+ &::placeholder {
+ color: $text-tertiary;
+ }
+}
+
+// ============================================
+// HEALTH STATUS PANEL
+// ============================================
+
+.health-status-panel {
+ background: $bg-card;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-lg;
+ padding: $space-4;
+}
+
+.health-panel-loading {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: $space-2;
+ padding: $space-6;
+ color: $text-tertiary;
+ font-size: $font-size-sm;
+}
+
+.health-panel-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: $space-4;
+
+ h4 {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ margin: 0;
+ font-size: $font-size-base;
+ font-weight: $font-weight-semibold;
+ color: $text-primary;
+ }
+}
+
+.health-panel-grid {
+ display: flex;
+ flex-direction: column;
+ gap: $space-3;
+}
+
+.health-panel-env {
+ padding: $space-3;
+ background: $bg-tertiary;
+ border-radius: $radius-md;
+}
+
+.health-panel-env-header {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ margin-bottom: $space-2;
+}
+
+.health-panel-env-name {
+ flex: 1;
+ font-size: $font-size-sm;
+ font-weight: $font-weight-semibold;
+ color: $text-primary;
+}
+
+.health-panel-overall {
+ font-size: $font-size-xs;
+ font-weight: $font-weight-medium;
+ padding: 2px 8px;
+ border-radius: $radius-sm;
+
+ &.health-healthy {
+ background: fade($success-raw, 12%);
+ color: $color-success;
+ }
+ &.health-degraded {
+ background: fade($warning-raw, 12%);
+ color: $color-warning;
+ }
+ &.health-unhealthy {
+ background: fade($danger-raw, 12%);
+ color: $color-danger;
+ }
+ &.health-unknown {
+ background: fade($text-tertiary-raw, 12%);
+ color: $text-tertiary;
+ }
+}
+
+.health-panel-checks {
+ display: flex;
+ flex-direction: column;
+ gap: $space-1;
+}
+
+.health-panel-check {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ padding: $space-1 0;
+ font-size: $font-size-xs;
+}
+
+.health-panel-check-name {
+ font-weight: $font-weight-medium;
+ color: $text-secondary;
+ min-width: 80px;
+}
+
+.health-panel-check-msg {
+ color: $text-tertiary;
+}
+
+.health-panel-empty {
+ text-align: center;
+ padding: $space-6;
+ color: $text-tertiary;
+ font-size: $font-size-sm;
+}
+
+.health-dot {
+ flex-shrink: 0;
+}
+
+// ============================================
+// DISK USAGE BAR
+// ============================================
+
+.disk-usage-compact {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ font-size: $font-size-xs;
+ color: $text-tertiary;
+}
+
+.disk-usage-compact-text {
+ font-family: $font-family-mono;
+}
+
+.disk-usage-bar-container {
+ padding: $space-3;
+ background: $bg-card;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-md;
+}
+
+.disk-usage-header {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ margin-bottom: $space-2;
+ font-size: $font-size-sm;
+ color: $text-primary;
+}
+
+.disk-usage-total {
+ font-weight: $font-weight-semibold;
+ font-family: $font-family-mono;
+}
+
+.disk-usage-bar {
+ display: flex;
+ height: 8px;
+ border-radius: 4px;
+ overflow: hidden;
+ background: $bg-tertiary;
+}
+
+.disk-usage-segment {
+ height: 100%;
+ transition: width 0.3s ease;
+
+ &.wordpress {
+ &.green { background: $color-success; }
+ &.yellow { background: $color-warning; }
+ &.red { background: $color-danger; }
+ }
+
+ &.mysql {
+ background: $color-info;
+ }
+
+ &.snapshots {
+ background: fade($text-tertiary-raw, 30%);
+ }
+}
+
+.disk-usage-legend {
+ display: flex;
+ flex-wrap: wrap;
+ gap: $space-3;
+ margin-top: $space-2;
+}
+
+.disk-usage-legend-item {
+ display: flex;
+ align-items: center;
+ gap: 4px;
+ font-size: $font-size-xs;
+ color: $text-tertiary;
+}
+
+.disk-usage-legend-dot {
+ width: 8px;
+ height: 8px;
+ border-radius: 2px;
+
+ &.wordpress { background: $color-success; }
+ &.mysql { background: $color-info; }
+ &.snapshots { background: fade($text-tertiary-raw, 30%); }
+}
+
+// ============================================
+// AUTO-SYNC MODAL
+// ============================================
+
+.auto-sync-modal {
+ max-width: 480px;
+}
+
+.auto-sync-loading {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: $space-2;
+ padding: $space-6;
+ color: $text-tertiary;
+ font-size: $font-size-sm;
+}
+
+.auto-sync-body {
+ padding: $space-4 0;
+}
+
+.auto-sync-env-name {
+ font-size: $font-size-sm;
+ font-weight: $font-weight-semibold;
+ color: $text-primary;
+ padding-bottom: $space-3;
+ border-bottom: 1px solid $border-subtle;
+ margin-bottom: $space-3;
+}
+
+.auto-sync-toggle {
+ margin-bottom: $space-4;
+}
+
+.auto-sync-toggle-label {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ cursor: pointer;
+
+ span {
+ font-size: $font-size-sm;
+ font-weight: $font-weight-medium;
+ color: $text-primary;
+ }
+}
+
+.auto-sync-description {
+ font-size: $font-size-xs;
+ color: $text-tertiary;
+ margin: $space-1 0 0;
+}
+
+.auto-sync-presets {
+ display: flex;
+ flex-direction: column;
+ gap: $space-2;
+}
+
+.auto-sync-cron-display {
+ font-family: $font-family-mono;
+ font-size: $font-size-xs;
+ color: $text-tertiary;
+}
+
+.auto-sync-cron-input {
+ font-family: $font-family-mono;
+}
+
+.auto-sync-next-runs {
+ margin-top: $space-4;
+ padding: $space-3;
+ background: $bg-tertiary;
+ border-radius: $radius-md;
+
+ h5 {
+ margin: 0 0 $space-2;
+ font-size: $font-size-xs;
+ font-weight: $font-weight-semibold;
+ color: $text-secondary;
+ text-transform: uppercase;
+ letter-spacing: 0.5px;
+ }
+
+ ul {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ }
+
+ li {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ padding: $space-1 0;
+ font-size: $font-size-xs;
+ color: $text-secondary;
+
+ svg {
+ color: $text-tertiary;
+ }
+ }
+}
+
+// ============================================
+// BULK ACTIONS BAR
+// ============================================
+
+.bulk-actions-bar {
+ display: flex;
+ align-items: center;
+ gap: $space-3;
+ padding: $space-3 $space-4;
+ background: fade($accent-primary-raw, 8%);
+ border: 1px solid fade($accent-primary-raw, 20%);
+ border-radius: $radius-md;
+ margin-bottom: $space-4;
+}
+
+.bulk-actions-info {
+ display: flex;
+ align-items: center;
+ gap: $space-1;
+ font-size: $font-size-sm;
+ color: $text-secondary;
+}
+
+.bulk-actions-count {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ min-width: 24px;
+ height: 24px;
+ padding: 0 6px;
+ background: $color-primary;
+ color: white;
+ border-radius: 12px;
+ font-size: $font-size-xs;
+ font-weight: $font-weight-bold;
+}
+
+.bulk-actions-buttons {
+ display: flex;
+ gap: $space-1;
+ flex: 1;
+}
+
+.bulk-actions-clear {
+ color: $text-tertiary !important;
+}
+
+.bulk-actions-confirm {
+ display: flex;
+ align-items: center;
+ gap: $space-3;
+ width: 100%;
+
+ span {
+ flex: 1;
+ font-size: $font-size-sm;
+ color: $text-primary;
+ font-weight: $font-weight-medium;
+ }
+}
+
+// ============================================
+// OPERATION PROGRESS
+// ============================================
+
+.operation-progress-content {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ gap: $space-2;
+}
+
+.operation-progress {
+ display: flex;
+ flex-direction: column;
+ gap: $space-1;
+}
+
+.operation-progress-bar {
+ height: 4px;
+ background: fade($info-raw, 20%);
+ border-radius: 2px;
+ overflow: hidden;
+}
+
+.operation-progress-fill {
+ height: 100%;
+ background: $color-info;
+ border-radius: 2px;
+ transition: width 0.3s ease;
+}
+
+.operation-progress-step {
+ font-size: $font-size-xs;
+ color: $text-tertiary;
+}
+
+// ============================================
+// HEALTH TAB
+// ============================================
+
+.health-tab {
+ padding: $space-4 0;
+}
+
+// ============================================
+// RESPONSIVE
+// ============================================
+
+@media (max-width: 900px) {
+ .pipeline-row {
+ flex-direction: column;
+ align-items: stretch;
+
+ .pipeline-card {
+ max-width: none;
+ }
+ }
+
+ .pipeline-arrow {
+ min-width: auto;
+ padding: $space-2 0;
+
+ .pipeline-arrow-btn {
+ flex-direction: row;
+ }
+
+ svg {
+ transform: rotate(90deg);
+ }
+ }
+
+ .pipeline-sync-row {
+ flex-direction: column;
+
+ .pipeline-sync-action {
+ max-width: none;
+ }
+ }
+
+ .bulk-actions-bar {
+ flex-wrap: wrap;
+ }
+
+ .bulk-actions-buttons {
+ flex-wrap: wrap;
+ }
+}
+
+// ============================================
+// PROMOTION HISTORY (pipeline tab, with rollback)
+// ============================================
+.pipeline-promotion-history {
+ margin-top: $space-6;
+
+ .promotion-history-list {
+ display: flex;
+ flex-direction: column;
+ gap: $space-2;
+ margin-top: $space-3;
+ }
+
+ .promotion-history-item {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: $space-3;
+ padding: $space-3 $space-4;
+ background: $bg-card;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-md;
+ }
+
+ .promotion-history-main {
+ display: flex;
+ align-items: center;
+ gap: $space-3;
+ flex-wrap: wrap;
+ font-size: $font-size-sm;
+ }
+
+ .promotion-route {
+ display: inline-flex;
+ align-items: center;
+ gap: $space-1;
+ color: $text-primary;
+ font-weight: $font-weight-medium;
+ }
+
+ .promotion-type,
+ .promotion-date {
+ color: $text-tertiary;
+ font-size: $font-size-xs;
+ }
+
+ .promotion-status {
+ text-transform: capitalize;
+ font-size: $font-size-xs;
+ font-weight: $font-weight-medium;
+ padding: 2px 8px;
+ border-radius: $radius-sm;
+ background: fade($info-raw, 12%);
+ color: $color-info;
+
+ &.promotion-status-completed {
+ background: fade($success-raw, 12%);
+ color: $color-success;
+ }
+
+ &.promotion-status-failed {
+ background: fade($danger-raw, 12%);
+ color: $color-danger;
+ }
+
+ &.promotion-status-rolled_back {
+ background: fade($warning-raw, 12%);
+ color: $color-warning;
+ }
+ }
+}
diff --git a/frontend/src/plugins/serverkit-wordpress/styles/wordpress-plugin-library.scss b/frontend/src/plugins/serverkit-wordpress/styles/wordpress-plugin-library.scss
new file mode 100644
index 00000000..40940ff6
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/styles/wordpress-plugin-library.scss
@@ -0,0 +1,185 @@
+// Compiled through the extension's module graph (imported by index.jsx).
+// The host's design-token partial is imported via a sync-safe relative
+// path — the baked copy lives at frontend/src/plugins/serverkit-wordpress/,
+// so this resolves to frontend/src/styles/_variables.scss.
+@import '../../../styles/variables';
+
+// WordPress Global Plugin Library page.
+.wp-plugin-library {
+
+ &__loading {
+ display: grid;
+ place-items: center;
+ min-height: 240px;
+ }
+
+ .wp-plib-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
+ gap: 16px;
+ }
+
+ .wp-plib-card {
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+ background: var(--surface);
+ border: 1px solid var(--border-soft);
+ border-radius: var(--radius);
+ padding: 16px;
+ transition: border-color 0.15s, transform 0.15s;
+
+ &:hover { border-color: var(--border-strong); }
+ &.is-disabled { opacity: 0.6; }
+
+ &__head {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ }
+
+ &__title { flex: 1; min-width: 0; }
+
+ &__name {
+ font-weight: 600;
+ font-size: 14px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+
+ &__slug {
+ font-family: var(--mono);
+ font-size: 11px;
+ color: var(--text-dim);
+ }
+
+ &__desc {
+ font-size: 12.5px;
+ color: var(--text-dim);
+ margin: 0;
+ display: -webkit-box;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+ }
+
+ &__meta {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 8px;
+ font-size: 11.5px;
+ color: var(--text-dim);
+ }
+
+ &__source {
+ display: inline-flex;
+ align-items: center;
+ gap: 5px;
+ font-family: var(--mono);
+ min-width: 0;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+
+ &__branch {
+ font-family: var(--mono);
+ background: var(--surface-2, rgba(127, 127, 127, 0.1));
+ padding: 1px 7px;
+ border-radius: 4px;
+ flex-shrink: 0;
+ }
+
+ &__stats {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ font-size: 12px;
+ color: var(--text-dim);
+
+ span { display: inline-flex; align-items: center; gap: 5px; }
+ }
+
+ &__synced { color: var(--green, #22c55e); }
+
+ &__actions {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 6px;
+ padding-top: 8px;
+ border-top: 1px solid var(--border-soft);
+ }
+ }
+
+ .spin { animation: wp-plib-spin 0.9s linear infinite; }
+}
+
+@keyframes wp-plib-spin { to { transform: rotate(360deg); } }
+
+// Shared by both modals on the library page.
+.wp-plib-form {
+ display: flex;
+ flex-direction: column;
+ gap: 16px;
+
+ &__row {
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
+
+ &--inline {
+ flex-direction: row;
+ align-items: center;
+ gap: 10px;
+ }
+ }
+
+ &__hint {
+ font-weight: 400;
+ font-size: 11px;
+ color: var(--text-dim);
+ }
+
+ &__toggle {
+ display: inline-flex;
+ gap: 6px;
+
+ button {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ font-size: 12.5px;
+ padding: 6px 12px;
+ border-radius: 6px;
+ border: 1px solid var(--border-soft);
+ background: transparent;
+ color: var(--text-dim);
+ cursor: pointer;
+
+ &.is-on {
+ border-color: var(--accent);
+ color: var(--accent);
+ background: var(--accent-bg, rgba(99, 102, 241, 0.12));
+ }
+ }
+ }
+
+ &__select {
+ width: 100%;
+ padding: 8px 10px;
+ font-size: 13px;
+ border-radius: 6px;
+ border: 1px solid var(--border-soft);
+ background: var(--surface);
+ color: var(--text);
+ }
+
+ &__footer {
+ display: flex;
+ justify-content: flex-end;
+ gap: 8px;
+ padding-top: 4px;
+ }
+}
diff --git a/frontend/src/plugins/serverkit-wordpress/styles/wordpress.scss b/frontend/src/plugins/serverkit-wordpress/styles/wordpress.scss
new file mode 100644
index 00000000..a3fb3b97
--- /dev/null
+++ b/frontend/src/plugins/serverkit-wordpress/styles/wordpress.scss
@@ -0,0 +1,3376 @@
+// Compiled through the extension's module graph (imported by index.jsx).
+// The host's design-token partial is imported via a sync-safe relative
+// path — the baked copy lives at frontend/src/plugins/serverkit-wordpress/,
+// so this resolves to frontend/src/styles/_variables.scss.
+@import '../../../styles/variables';
+
+// ============================================
+// WORDPRESS PAGE STYLES
+// ============================================
+
+// WordPress Standalone Page (Docker-based, mirrors Git page layout)
+.wordpress-standalone-page {
+ // Inherits .git-page styles for layout, status cards, overview tab, etc.
+
+ .empty-state-large {
+ .empty-icon svg {
+ stroke: $color-wordpress;
+ }
+ }
+
+ .status-card.success {
+ border-left-color: $color-success;
+
+ .status-icon {
+ color: $color-success;
+ }
+ }
+
+ .status-card.danger {
+ border-left-color: $color-danger;
+
+ .status-icon {
+ color: $color-danger;
+ }
+ }
+}
+
+// WordPress Page Layout (extends Docker page styles)
+.wordpress-page {
+ .empty-state-large {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding: 60px $space-6;
+ background: $bg-card;
+ border-radius: $radius-xl;
+ text-align: center;
+ margin: 0 $space-4;
+
+ .empty-icon {
+ color: $text-tertiary;
+ margin-bottom: $space-6;
+
+ svg {
+ stroke: $color-wordpress;
+ }
+ }
+
+ h2 {
+ margin: 0 0 $space-3 0;
+ font-size: $font-size-2xl;
+ font-weight: $font-weight-semibold;
+ }
+
+ p {
+ margin: 0 0 $space-6 0;
+ color: $text-secondary;
+ max-width: 460px;
+ }
+ }
+
+ .install-warning {
+ display: flex;
+ gap: $space-3;
+ padding: $space-4;
+ background: fade($warning-raw, 8%);
+ border: 1px solid fade($warning-raw, 20%);
+ border-radius: $radius-md;
+ margin-bottom: $space-4;
+
+ > svg {
+ flex-shrink: 0;
+ color: $color-warning;
+ margin-top: 2px;
+ }
+
+ strong {
+ display: block;
+ margin-bottom: $space-2;
+ }
+
+ ul {
+ margin: 0;
+ padding-left: $space-4;
+ color: $text-secondary;
+ font-size: $font-size-sm;
+
+ li {
+ margin-bottom: $space-1;
+ }
+ }
+ }
+
+ .form-hint {
+ display: block;
+ font-size: $font-size-xs;
+ color: $text-tertiary;
+ margin-top: $space-1;
+ }
+
+ .docker-empty {
+ .wp-empty-icon {
+ color: $text-tertiary;
+ margin-bottom: $space-4;
+
+ svg {
+ stroke: currentColor;
+ }
+ }
+ }
+}
+
+// Sites Grid
+.wp-sites-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
+ gap: $space-4;
+ padding: $space-4;
+}
+
+// Redesign: dense WordPress site table (replaces the .wp-site-card grid).
+.wp-list {
+ padding: $space-4;
+
+ &__toolbar {
+ display: flex;
+ align-items: center;
+ gap: $space-3;
+ flex-wrap: wrap;
+ margin-bottom: $space-3;
+
+ .wp-tag-filter { margin: 0; }
+ }
+
+ // Client-side site search (name / title / domain). Mirrors the demo's
+ // .input: leading icon + borderless field on a quiet surface.
+ &__search {
+ display: inline-flex;
+ align-items: center;
+ gap: $space-2;
+ margin-left: auto;
+ padding: 0 10px;
+ width: 240px;
+ max-width: 100%;
+ height: 32px;
+ background: var(--surface-2);
+ border: 1px solid var(--border-soft);
+ border-radius: 8px;
+ color: var(--text-faint);
+ transition: border-color 0.14s;
+
+ &:focus-within { border-color: var(--accent-dim); }
+
+ svg { flex-shrink: 0; }
+
+ input {
+ flex: 1;
+ min-width: 0;
+ border: none;
+ background: none;
+ color: var(--text);
+ font-size: 13px;
+
+ &::placeholder { color: var(--text-faint); }
+ &:focus { outline: none; }
+ }
+ }
+
+ // Count subtitle accent ("M running") in the PageTopbar meta slot.
+ &__meta-running { color: var(--green); }
+
+ // Table/cards switch — only rendered by pages that pass a card renderer to
+ // ResourceListPage. It claims the free space so it stays right-aligned on
+ // pages whose search lives in the top bar instead (Services); where a
+ // toolbar search IS present that element already claims it, so the switch
+ // gives the margin back and simply trails it.
+ &__viewswitch {
+ display: flex;
+ gap: 2px;
+ flex-shrink: 0;
+ margin-left: auto;
+ padding: 3px;
+ background: var(--surface-2);
+ border: 1px solid var(--border);
+ border-radius: 9px;
+
+ button {
+ display: grid;
+ place-items: center;
+ padding: 6px 9px;
+ background: none;
+ border: none;
+ border-radius: 6px;
+ color: var(--text-faint);
+ cursor: pointer;
+ transition: background 0.14s, color 0.14s;
+
+ &:hover { color: var(--text); }
+ &.is-active { background: var(--surface-3); color: var(--text); }
+ }
+ }
+
+ &__search + &__viewswitch { margin-left: 0; }
+
+ // Card layout for the same rows the table shows.
+ &__cards {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
+ gap: 14px;
+ }
+
+ &__cardtile {
+ display: flex;
+ flex-direction: column;
+ padding: $space-4;
+ background: var(--surface);
+ border: 1px solid var(--border-soft);
+ border-radius: var(--radius);
+ cursor: pointer;
+ transition: border-color 0.14s, transform 0.14s;
+
+ &:hover { border-color: var(--border-strong); transform: translateY(-2px); }
+ &.is-selected { border-color: var(--accent-dim); background: var(--accent-bg-soft); }
+ }
+
+ // bulk-select bar (demo's bulkbar) — appears once any row is checked
+ &__bulkbar {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: $space-3;
+ flex-wrap: wrap;
+ padding: $space-2 $space-4;
+ margin-bottom: $space-3;
+ background: var(--accent-bg-soft);
+ border: 1px solid var(--accent-dim);
+ border-radius: var(--radius);
+ }
+
+ &__bulkcount {
+ font-family: var(--mono);
+ font-size: 12px;
+ font-weight: $font-weight-medium;
+ color: var(--accent-bright);
+ }
+
+ &__bulkactions {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ flex-wrap: wrap;
+ }
+
+ &__ck {
+ width: 36px;
+ padding-right: 0;
+ }
+
+ &__action { width: 70px; }
+
+ &__card {
+ background: var(--surface);
+ border: 1px solid var(--border-soft);
+ border-radius: var(--radius);
+ overflow: hidden;
+ }
+
+ // Per-site gradient initial avatar (ds ServiceTile / .sk-tile). The tile
+ // brings its own size + hue-hashed gradient inline; we only soften the
+ // corner to the demo's small rounded-square look.
+ &__tile {
+ border-radius: 8px;
+ }
+
+ &__links {
+ display: inline-flex;
+ gap: $space-2;
+
+ a {
+ display: inline-flex;
+ color: var(--text-faint);
+ transition: color 0.14s;
+ &:hover { color: var(--accent-bright); }
+ }
+ }
+
+ &__dash { color: var(--text-ghost); font-family: var(--mono); font-size: 12px; }
+ &__chev { color: var(--text-ghost); }
+
+ .sk-tag + .sk-tag { margin-left: 4px; }
+}
+
+// Site tags / labels (chips + filter bar)
+.wp-tag-filter {
+ display: flex;
+ flex-wrap: wrap;
+ gap: $space-2;
+ margin: 0 $space-4 $space-4;
+}
+
+.wp-site-tags {
+ display: flex;
+ flex-wrap: wrap;
+ gap: $space-1;
+ margin-top: $space-3;
+}
+
+.wp-tag-chip {
+ display: inline-flex;
+ align-items: center;
+ padding: 2px 10px;
+ font-size: $font-size-xs;
+ line-height: 1.4;
+ border-radius: $radius-full;
+ background: $bg-tertiary;
+ color: $text-secondary;
+ border: 1px solid $border-subtle;
+
+ &--filter {
+ cursor: pointer;
+ background: $bg-card;
+
+ &.is-active {
+ background: $color-primary;
+ color: #fff;
+ border-color: $color-primary;
+ }
+ }
+}
+
+// Site Card
+.wp-site-card {
+ background: $bg-card;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-lg;
+ cursor: pointer;
+ transition: all 0.15s ease;
+
+ &:hover {
+ border-color: $border-hover;
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
+ }
+}
+
+.wp-site-card-header {
+ display: flex;
+ align-items: center;
+ gap: $space-3;
+ padding: $space-4;
+ border-bottom: 1px solid $border-subtle;
+}
+
+.wp-site-icon {
+ width: 40px;
+ height: 40px;
+ background: $color-wordpress;
+ border-radius: $radius-md;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ color: #fff;
+ flex-shrink: 0;
+}
+
+.wp-site-info {
+ flex: 1;
+ min-width: 0;
+}
+
+.wp-site-name {
+ font-size: $font-size-base;
+ font-weight: $font-weight-semibold;
+ color: $text-primary;
+ margin: 0;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.wp-site-url {
+ font-size: $font-size-xs;
+ color: $text-tertiary;
+ font-family: $font-family-mono;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ display: block;
+}
+
+.wp-site-status {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ font-size: $font-size-xs;
+ padding: 4px 10px;
+ border-radius: $radius-full;
+ font-weight: $font-weight-medium;
+
+ .status-dot {
+ width: 6px;
+ height: 6px;
+ border-radius: 50%;
+ }
+
+ &.running {
+ background: fade($success-raw, 12%);
+ color: $color-success;
+
+ .status-dot {
+ background: $color-success;
+ }
+ }
+
+ &.stopped {
+ background: fade($text-tertiary-raw, 12%);
+ color: $text-tertiary;
+
+ .status-dot {
+ background: $text-tertiary;
+ }
+ }
+}
+
+.wp-site-card-body {
+ padding: $space-4;
+}
+
+.wp-site-meta {
+ display: grid;
+ grid-template-columns: repeat(2, 1fr);
+ gap: $space-3;
+}
+
+.wp-site-meta-item {
+ .meta-label {
+ display: block;
+ font-size: $font-size-xs;
+ color: $text-tertiary;
+ margin-bottom: 2px;
+ }
+
+ .meta-value {
+ font-size: $font-size-sm;
+ color: $text-primary;
+ font-weight: $font-weight-medium;
+
+ &.git-connected {
+ color: $color-success;
+ }
+ }
+}
+
+.wp-site-badge {
+ display: inline-block;
+ font-size: $font-size-xs;
+ font-weight: $font-weight-medium;
+ padding: 2px 8px;
+ border-radius: $radius-sm;
+ margin-top: $space-3;
+
+ &.production {
+ background: fade($danger-raw, 12%);
+ color: $color-danger;
+ }
+
+ &.development {
+ background: fade($info-raw, 12%);
+ color: $color-info;
+ }
+}
+
+.wp-site-card-links {
+ display: flex;
+ gap: $space-3;
+ margin-top: $space-3;
+ padding-top: $space-3;
+ border-top: 1px solid $border-subtle;
+}
+
+.wp-site-link {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ font-size: $font-size-xs;
+ font-weight: $font-weight-medium;
+ color: $color-primary;
+ text-decoration: none;
+
+ &:hover {
+ text-decoration: underline;
+ }
+}
+
+.wp-site-card-footer {
+ display: flex;
+ gap: $space-2;
+ padding: $space-3 $space-4;
+ border-top: 1px solid $border-subtle;
+ background: $bg-tertiary;
+ border-radius: 0 0 $radius-lg $radius-lg;
+
+ .btn {
+ flex: 1;
+ justify-content: center;
+
+ &.btn-danger {
+ flex: 0;
+ color: $color-danger;
+
+ &:hover {
+ background: fade($danger-raw, 10%);
+ }
+ }
+ }
+}
+
+// ============================================
+// WORDPRESS DETAIL PAGE (redesign — infra console look)
+// ============================================
+// Everything here is scoped under .wp-detail-page on purpose: the base
+// `app-*` classes (.app-panel, .app-info-grid, .app-detail-tabs, …) live in
+// _applications.scss and are ALSO rendered by the Applications detail page,
+// which keeps its current look until its own pass. Same pattern as the
+// `.server-detail-page` block in _servers.scss.
+
+// Run the detail page FULL-BLEED, like the WordPress list page: drop the
+// .main-content 40px frame so the .sk-topbar spans edge-to-edge. (Unlike the
+// generic full-bleed rule in _main-content.scss, we keep the normal scroll —
+// no height:100vh/overflow:hidden — because this is a long scrolling page, not
+// a self-managing two-pane tool.) .app-detail-body re-pads the content below.
+.main-content:has(.wp-detail-page) {
+ padding: 0;
+
+ // padding:0 also drops the base rule's mobile top-clearance, so restore it
+ // (the fixed mobile header would otherwise overlap the top bar).
+ @media (max-width: $breakpoint-md) {
+ margin-top: calc(#{$mobile-header-height} + env(safe-area-inset-top));
+ }
+}
+
+.wp-detail-page {
+ // The full-bleed top bar sits flush above the padded body (no page gap).
+ gap: 0;
+
+ // Content below the full-bleed top bar: a CENTERED max-width column (like the
+ // prototype), laid out as a flex column so identity / tabs / content are
+ // evenly spaced (fixes the tab-touches-content gap).
+ .app-detail-body {
+ display: flex;
+ flex-direction: column;
+ gap: $space-5;
+ width: 100%;
+ max-width: 1200px;
+ margin-inline: auto;
+ padding: $space-6 $space-6 $space-10;
+ }
+
+ // ---- Breadcrumbs (mono trail) ----
+ .app-detail-breadcrumbs {
+ font-family: var(--mono);
+ font-size: $font-size-sm;
+
+ a {
+ color: var(--text-faint);
+
+ &:hover {
+ color: var(--accent-bright);
+ }
+ }
+
+ > span {
+ color: var(--text-ghost);
+ }
+
+ .current {
+ color: var(--text-dim);
+ font-weight: $font-weight-medium;
+ }
+ }
+
+ // ---- Header (demo .site-header: gradient surface + accent wash) ----
+ // Identity row — NO card background (matches the prototype): just the icon +
+ // name + status sitting directly on the page.
+ .app-detail-header {
+ position: relative;
+ gap: $space-4;
+ padding: 4px 0 0;
+ background: none;
+ border: none;
+ border-radius: 0;
+ }
+
+ // The detail page uses the canonical PageTopbar (.sk-topbar) for its top bar
+ // so the chrome matches the WordPress LIST page and every other page. Tweaks:
+ // a breadcrumb title and a compact, wrapping action cluster (the detail page
+ // carries more actions than a typical page).
+ .wp-detail-topbar {
+ // Full-bleed now that .main-content has no padding; match the list page's
+ // sk-topbar inset. Many actions, so wrap the bar as a whole instead of
+ // squeezing the title (which made the breadcrumb collide with a button).
+ padding: 10px $space-4;
+ flex-wrap: wrap;
+ row-gap: 8px;
+
+ // The bar's flex:1 spacer would force the actions onto their own line
+ // every time; drop it and push the cluster right with margin instead, so
+ // the actions sit beside the title when they fit and wrap only when not.
+ .sk-topbar__spacer { display: none; }
+
+ .sk-topbar__titles { flex-shrink: 0; }
+
+ .wp-crumbs {
+ display: inline-flex;
+ align-items: center;
+ gap: 8px;
+ white-space: nowrap;
+
+ a {
+ color: var(--text-dim);
+ text-decoration: none;
+ &:hover { color: var(--accent-bright); }
+ }
+ &__sep { color: var(--text-ghost); }
+ &__cur { color: var(--text); }
+ }
+
+ .sk-topbar__actions {
+ margin-left: auto;
+ flex-wrap: wrap;
+ justify-content: flex-end;
+ row-gap: 6px;
+
+ .ui-button {
+ height: 32px;
+ padding: 0 10px;
+ font-size: 12.5px;
+ gap: 6px;
+ }
+ }
+ }
+
+ // Overview top grid: Site information (left) + Traffic chart (right), matching
+ // the mockup's ~40/60 split; collapses to one column on narrow screens.
+ .wp-overview-main {
+ display: grid;
+ grid-template-columns: minmax(300px, 0.85fr) 1.15fr;
+ gap: $space-4;
+ margin-bottom: $space-4;
+
+ @media (max-width: $breakpoint-lg) {
+ grid-template-columns: 1fr;
+ }
+ }
+
+ // Traffic panel: stack the title over a muted mono sub-label.
+ .wp-traffic-panel {
+ .app-panel-header {
+ flex-direction: column;
+ align-items: flex-start;
+ gap: 2px;
+ }
+ .wp-panel-sub {
+ font-family: var(--mono);
+ font-size: 11px;
+ font-weight: $font-weight-normal;
+ letter-spacing: 0;
+ text-transform: none;
+ color: var(--text-faint);
+ }
+ }
+
+ // Recent activity spans full width beneath the main grid.
+ .wp-activity-panel { margin-bottom: $space-4; }
+
+ // WP detail carries more tabs than fit one row at common widths, so let the
+ // strip WRAP instead of scrolling — otherwise the right-pinned Settings tab
+ // gets pushed off-screen and becomes unreachable.
+ .app-detail-tabs {
+ flex-wrap: wrap;
+ overflow-x: visible;
+ row-gap: 2px;
+ }
+
+ // Settings tab pinned to the far right of the tab strip (the mockup's gear).
+ .app-detail-tab--end { margin-left: auto; }
+
+ // Settings tab — left sub-nav + content (PHP, Updates, …).
+ .wp-settings {
+ display: grid;
+ grid-template-columns: 200px 1fr;
+ gap: $space-4;
+ align-items: start;
+
+ @media (max-width: $breakpoint-md) {
+ grid-template-columns: 1fr;
+ }
+ }
+
+ .wp-settings__nav {
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+ position: sticky;
+ top: $space-4;
+
+ @media (max-width: $breakpoint-md) {
+ position: static;
+ flex-direction: row;
+ flex-wrap: wrap;
+ }
+ }
+
+ .wp-settings__navitem {
+ display: flex;
+ width: 100%; // fill the nav column — a flex <button> otherwise shrinks
+ // to its label, so each item's box was a different width
+ align-items: center;
+ gap: 9px;
+ padding: 9px 12px;
+ border: none;
+ border-radius: 8px;
+ background: none;
+ color: var(--text-dim);
+ font-size: 13.5px;
+ font-weight: $font-weight-medium;
+ text-align: left;
+ cursor: pointer;
+ transition: background 0.14s, color 0.14s;
+
+ svg { color: var(--text-faint); flex-shrink: 0; }
+
+ &:hover { background: var(--surface-hover); color: var(--text); }
+ &.is-active {
+ background: var(--accent-bg);
+ color: var(--accent-bright);
+ svg { color: var(--accent-bright); }
+ }
+ }
+
+ .wp-settings__content { min-width: 0; }
+
+ // Grouped left nav — an uppercase mono label per group (the sidebar-style
+ // "group section" the user asked for).
+ .wp-settings__group + .wp-settings__group { margin-top: $space-4; }
+
+ .wp-settings__grouplabel {
+ padding: 0 12px;
+ margin-bottom: 6px;
+ font-family: var(--mono);
+ font-size: 10px;
+ font-weight: $font-weight-semibold;
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ color: var(--text-faint);
+ }
+
+ .app-detail-icon {
+ position: relative;
+ width: 52px;
+ height: 52px;
+ border-radius: 13px;
+ border: 1px solid fade(#fff, 8%);
+ box-shadow: var(--shadow-sm);
+ }
+
+ .wp-icon {
+ background: linear-gradient(150deg, lighten($color-wordpress, 12%), $color-wordpress) !important;
+ }
+
+ // Status dot pinned to the favicon corner (demo .site-favicon .badge)
+ .wp-head-dot {
+ position: absolute;
+ bottom: -4px;
+ right: -4px;
+ width: 14px;
+ height: 14px;
+ border-radius: 50%;
+ border: 2.5px solid var(--surface);
+ background: var(--text-faint);
+
+ &.running {
+ background: var(--green);
+ }
+
+ &.stopped {
+ background: var(--red);
+ }
+ }
+
+ .app-detail-title-block h1 {
+ font-size: 21px;
+ font-weight: $font-weight-semibold;
+ letter-spacing: -0.02em;
+ gap: 14px;
+ flex-wrap: wrap;
+ align-items: center;
+ }
+
+ .app-detail-subtitle {
+ display: flex;
+ align-items: center;
+ gap: 9px;
+ flex-wrap: wrap;
+ margin-top: 4px;
+ font-family: var(--mono);
+ font-size: 12px;
+ color: var(--text-dim);
+
+ a {
+ color: var(--accent-bright);
+ text-decoration: none;
+
+ &:hover {
+ text-decoration: underline;
+ }
+ }
+
+ .separator {
+ color: var(--text-ghost);
+ }
+ }
+
+ // ---- Repo connection pill (mirrors service detail page) ----
+ .wp-detail__repo-bar {
+ display: flex;
+ margin-top: -#{$space-2}; // tuck it up under the identity header a bit
+ }
+
+ .wp-detail__repo-pill {
+ display: inline-flex;
+ align-items: center;
+ gap: $space-2;
+ padding: 6px $space-3;
+ background: var(--surface);
+ border: 1px solid var(--border);
+ border-radius: $radius-full;
+ font-family: var(--mono);
+ font-size: $font-size-sm;
+ color: var(--text-dim);
+ cursor: pointer;
+ transition: border-color $transition-fast, background $transition-fast;
+
+ svg { color: var(--text-faint); }
+
+ &:hover {
+ border-color: var(--accent-dim);
+ background: var(--surface-2);
+ }
+ }
+
+ .wp-detail__repo-url {
+ font-size: $font-size-sm;
+ color: $text-primary;
+ }
+
+ .wp-detail__repo-arrow {
+ color: var(--text-ghost);
+ }
+
+ .wp-detail__repo-branch {
+ font-size: $font-size-sm;
+ color: var(--accent-bright);
+ font-weight: $font-weight-medium;
+ }
+
+ .wp-detail__auto-deploy-badge {
+ font-family: var(--mono);
+ font-size: 10px;
+ font-weight: $font-weight-semibold;
+ letter-spacing: 0.05em;
+ text-transform: uppercase;
+ padding: 1px 6px;
+ background: var(--green-bg);
+ color: var(--green);
+ border-radius: $radius-sm;
+ }
+
+ .wp-detail__connect-repo {
+ display: inline-flex;
+ align-items: center;
+ gap: $space-2;
+ padding: 6px $space-3;
+ background: none;
+ border: 1px dashed var(--border-strong);
+ border-radius: $radius-full;
+ font-size: $font-size-sm;
+ color: var(--text-faint);
+ cursor: pointer;
+ transition: all $transition-fast;
+
+ svg { color: var(--text-faint); }
+
+ &:hover {
+ border-color: var(--accent-dim);
+ color: var(--accent-bright);
+ background: var(--accent-bg-soft);
+ }
+ }
+
+ // ---- Tab strip (segmented bar — pills in a bordered surface, matching the
+ // shared .app-detail-tabs treatment in _applications.scss so every detail
+ // page's nav reads the same) ----
+ .app-detail-tabs {
+ gap: 3px;
+ background: var(--surface);
+ border: 1px solid var(--border);
+ border-radius: var(--radius);
+ padding: 4px;
+ overflow-x: auto;
+
+ &::-webkit-scrollbar {
+ height: 0;
+ }
+ }
+
+ .app-detail-tab {
+ display: flex;
+ align-items: center;
+ gap: 7px;
+ padding: 8px 13px;
+ border-radius: 7px;
+ color: var(--text-dim);
+ font-size: 13px;
+ font-weight: $font-weight-medium;
+ white-space: nowrap;
+ transition: color 0.14s, background 0.14s;
+
+ svg {
+ color: var(--text-faint);
+ transition: color 0.14s;
+ flex-shrink: 0;
+ }
+
+ &:hover {
+ background: var(--surface-2);
+ color: var(--text);
+
+ svg {
+ color: var(--text-dim);
+ }
+ }
+
+ &.active {
+ background: var(--accent-bg);
+ color: var(--accent-bright);
+ font-weight: $font-weight-semibold;
+
+ svg {
+ color: var(--accent-bright);
+ }
+ }
+ }
+
+ // ---- Panels (quiet surface + mono eyebrow header) ----
+ .app-panel {
+ background: var(--surface);
+ border: 1px solid var(--border-soft);
+ border-radius: var(--radius);
+ }
+
+ .app-panel-header {
+ display: flex;
+ align-items: center;
+ justify-content: flex-start;
+ gap: 7px;
+ padding: 12px 17px;
+ border-bottom: 1px solid var(--border-soft);
+ font-family: var(--mono);
+ font-size: 10.5px;
+ font-weight: $font-weight-semibold;
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ color: var(--text-faint);
+
+ svg {
+ width: 13px;
+ height: 13px;
+ color: var(--accent-bright);
+ }
+ }
+
+ .app-panel-body {
+ padding: $space-4 17px;
+
+ .hint:last-child {
+ margin-bottom: 0;
+ }
+
+ .app-detail-actions {
+ flex-wrap: wrap;
+ align-items: center;
+ margin-bottom: $space-3;
+
+ &:last-child {
+ margin-bottom: 0;
+ }
+ }
+
+ .app-info-grid + .app-detail-actions,
+ .app-info-grid + .hint {
+ margin-top: $space-3;
+ }
+ }
+
+ // Danger Zone panel — stack the rows with a gap so Archive and Delete don't
+ // sit flush against each other.
+ .danger-zone-body {
+ display: flex;
+ flex-direction: column;
+ gap: $space-3;
+
+ .danger-zone {
+ margin-top: 0;
+ }
+ }
+
+ // SSL guided flow — checklist + primary action.
+ .ssl-guide {
+ display: flex;
+ flex-direction: column;
+ gap: $space-3;
+ margin-top: $space-3;
+ }
+
+ .ssl-checklist {
+ display: flex;
+ flex-direction: column;
+ gap: $space-2;
+ padding: $space-3;
+ background: var(--surface-2);
+ border: 1px solid var(--border-soft);
+ border-radius: var(--radius);
+ }
+
+ .ssl-check-item {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ font-size: $font-size-sm;
+ color: var(--text-dim);
+ }
+
+ .ssl-check-icon {
+ flex-shrink: 0;
+
+ &--ok { color: var(--green); }
+ &--missing { color: var(--amber); }
+ }
+
+ .ssl-check-label {
+ &--ok { color: var(--text); }
+ }
+
+ // Inline domain attach inside the SSL panel — no modal needed.
+ .ssl-inline-attach {
+ display: flex;
+ flex-direction: column;
+ gap: $space-3;
+ margin-top: $space-3;
+ padding-top: $space-3;
+ border-top: 1px solid var(--border-soft);
+ }
+
+ .ssl-context {
+ display: flex;
+ flex-direction: column;
+ gap: $space-2;
+ }
+
+ .ssl-provider-status {
+ display: inline-flex;
+ align-items: center;
+ gap: $space-2;
+ font-size: $font-size-sm;
+
+ &--ok {
+ color: var(--green);
+
+ svg { color: var(--green); }
+ }
+
+ &--missing {
+ color: var(--amber);
+
+ svg { color: var(--amber); }
+ }
+ }
+
+ .ssl-context-links {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ font-size: $font-size-xs;
+ color: var(--text-faint);
+
+ a {
+ color: var(--accent-bright);
+ text-decoration: none;
+
+ &:hover { text-decoration: underline; }
+ }
+ }
+
+ .ssl-attach-result {
+ display: flex;
+ flex-direction: column;
+ gap: $space-3;
+ margin-top: $space-3;
+ padding: $space-3;
+ background: var(--surface-2);
+ border: 1px solid var(--border-soft);
+ border-radius: var(--radius);
+
+ &__success {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ font-size: $font-size-sm;
+ color: var(--green);
+
+ svg { color: var(--green); }
+ }
+
+ &__manual {
+ display: flex;
+ flex-direction: column;
+ gap: $space-2;
+ font-size: $font-size-sm;
+ }
+
+ &__record {
+ display: block;
+ padding: $space-2 $space-3;
+ background: var(--surface);
+ border: 1px solid var(--border-soft);
+ border-radius: var(--radius);
+ font-family: var(--mono);
+ font-size: $font-size-xs;
+ color: var(--text);
+ }
+ }
+
+ // ---- Info grids → k/v spec rows (.sk-info-row look, CSS-only) ----
+ .app-info-grid {
+ display: flex;
+ flex-direction: column;
+ gap: 0;
+ }
+
+ .app-info-item {
+ flex-direction: row;
+ justify-content: space-between;
+ align-items: center;
+ gap: $space-4;
+ padding: 10px 0;
+ border-top: 1px solid var(--border-soft);
+
+ &:first-child {
+ border-top: none;
+ padding-top: 0;
+ }
+
+ &:last-child {
+ padding-bottom: 0;
+ }
+ }
+
+ .app-info-label {
+ font-family: var(--mono);
+ font-size: 12px;
+ color: var(--text-faint);
+ min-width: 0;
+ overflow-wrap: anywhere;
+ }
+
+ .app-info-value {
+ display: inline-flex;
+ align-items: center;
+ justify-content: flex-end;
+ flex-wrap: wrap;
+ gap: $space-2;
+ font-family: var(--mono);
+ font-size: 12.5px;
+ color: var(--text);
+ text-align: right;
+ min-width: 0;
+ overflow-wrap: anywhere;
+
+ a {
+ color: var(--accent-bright);
+ text-decoration: none;
+
+ &:hover {
+ text-decoration: underline;
+ }
+ }
+ }
+
+ // ---- Section headers → mono eyebrows ----
+ .section-header {
+ margin-bottom: $space-4;
+
+ h3 {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ margin: 0;
+ font-family: var(--mono);
+ font-size: 11px;
+ font-weight: $font-weight-semibold;
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ color: var(--text-faint);
+ }
+ }
+
+ // ---- KPI strip (ds MetricCard rows) ----
+ .wp-kpis {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
+ gap: $space-4;
+ }
+
+ .wp-overview {
+ display: flex;
+ flex-direction: column;
+ gap: $space-4;
+ }
+
+ // ---- Dense table chrome shared by plugins/themes/vulns ----
+ .wp-asset-table,
+ .wp-vuln-table {
+ .sk-cell-name {
+ font-size: 13px;
+ }
+
+ .sk-cell-sub {
+ margin-top: 2px;
+ }
+ }
+
+ .wp-vuln-title {
+ font-size: 12.5px;
+ color: var(--text-dim);
+ max-width: 360px;
+ overflow-wrap: anywhere;
+ }
+
+ // app-panel hosting a flush table (Findings)
+ .app-panel > .sk-dtable {
+ border-radius: 0 0 var(--radius) var(--radius);
+ overflow: hidden;
+ }
+
+ // ---- Severity chips (prototype .sev / security ramp) ----
+ .wp-sev {
+ display: inline-flex;
+ align-items: center;
+ gap: 7px;
+ font-family: var(--mono);
+ font-size: 11px;
+ font-weight: $font-weight-semibold;
+ text-transform: uppercase;
+ letter-spacing: 0.04em;
+ white-space: nowrap;
+
+ .d {
+ width: 9px;
+ height: 9px;
+ border-radius: 3px;
+ flex-shrink: 0;
+ background: var(--text-ghost);
+ }
+
+ &--critical {
+ color: var(--red);
+
+ .d {
+ background: var(--red);
+ box-shadow: 0 0 6px var(--red);
+ }
+ }
+
+ &--high {
+ color: var(--red);
+
+ .d {
+ background: var(--red);
+ }
+ }
+
+ &--medium {
+ color: var(--amber);
+
+ .d {
+ background: var(--amber);
+ }
+ }
+
+ &--low {
+ color: var(--cyan);
+
+ .d {
+ background: var(--cyan);
+ }
+ }
+
+ &--unknown {
+ color: var(--text-faint);
+
+ .d {
+ background: var(--text-faint);
+ }
+ }
+ }
+
+ .wp-fix-chip {
+ font-family: var(--mono);
+ font-size: 10.5px;
+ color: var(--accent-bright);
+ background: var(--accent-bg);
+ padding: 2px 7px;
+ border-radius: 5px;
+ white-space: nowrap;
+ }
+
+ .wp-no-fix {
+ font-family: var(--mono);
+ font-size: 11px;
+ color: var(--text-faint);
+ }
+
+ .wp-advisory-link {
+ font-family: var(--mono);
+ font-size: 11.5px;
+ color: var(--accent-bright);
+ text-decoration: none;
+
+ &:hover {
+ text-decoration: underline;
+ }
+ }
+
+ // ---- Update chips + bulk bar (amber wash, mono) ----
+ .wp-update-badge {
+ font-family: var(--mono);
+ font-size: 10.5px;
+ font-weight: $font-weight-medium;
+ color: var(--amber);
+ background: var(--amber-bg);
+ padding: 2px 7px;
+ border-radius: 5px;
+ margin-left: $space-2;
+ }
+
+ .bulk-update-bar {
+ background: var(--amber-bg);
+ border: 1px solid fade($warning-raw, 25%);
+ border-radius: var(--radius);
+ font-family: var(--mono);
+ font-size: 12px;
+ color: var(--amber);
+ }
+
+ .install-form {
+ margin-bottom: $space-4;
+ }
+
+ // ---- Security posture (ScoreGauge ring + checklist, demo Posture panel) ----
+ .wp-posture {
+ display: flex;
+ align-items: center;
+ gap: $space-6;
+
+ &__checks {
+ flex: 1;
+ min-width: 0;
+ }
+
+ &__check {
+ display: flex;
+ align-items: center;
+ gap: $space-3;
+ padding: 10px 0;
+ border-top: 1px solid var(--border-soft);
+ font-size: 13px;
+
+ &:first-child { border-top: none; }
+ }
+
+ &__label {
+ flex: 1;
+ min-width: 0;
+ color: var(--text);
+ }
+
+ &__detail {
+ font-family: var(--mono);
+ font-size: 11.5px;
+ color: var(--text-faint);
+ white-space: nowrap;
+ }
+
+ @media (max-width: $breakpoint-md) {
+ flex-direction: column;
+ align-items: flex-start;
+
+ &__checks { width: 100%; }
+ }
+ }
+
+ // ---- Mono code well (integrity issue lines) ----
+ .wp-code-list {
+ margin-top: $space-3;
+ padding: $space-3 $space-4;
+ background: var(--bg-code);
+ border: 1px solid var(--border-soft);
+ border-radius: $radius-md;
+ max-height: 320px;
+ overflow-y: auto;
+ font-family: var(--mono);
+ font-size: 12px;
+ line-height: 1.7;
+ color: var(--text-code);
+ overflow-wrap: anywhere;
+ }
+
+ // ---- Brute-force jail: banned-IP rows with an inline Unban action ----
+ .wp-banlist {
+ margin-top: $space-3;
+ border: 1px solid var(--border-soft);
+ border-radius: $radius-md;
+ overflow: hidden;
+ }
+ .wp-banlist__row {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: $space-3;
+ padding: 8px $space-4;
+
+ & + & {
+ border-top: 1px solid var(--border-soft);
+ }
+ }
+ .wp-banlist__ip {
+ font-family: var(--mono);
+ font-size: 13px;
+ color: var(--text-code);
+ }
+
+ // ---- Run-history / incident rows (Updates + Reports) ----
+ .wp-run-row {
+ display: flex;
+ flex-direction: column;
+ gap: 3px;
+ padding: 11px 0;
+ border-top: 1px solid var(--border-soft);
+
+ &:first-child {
+ border-top: none;
+ padding-top: 0;
+ }
+
+ .form-hint {
+ margin-top: 0;
+ }
+ }
+
+ .wp-run-row-head {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ flex-wrap: wrap;
+
+ strong {
+ font-size: 13px;
+ }
+ }
+
+ .wp-run-row-meta {
+ font-family: var(--mono);
+ font-size: 11px;
+ color: var(--text-faint);
+ }
+
+ .wp-run-component {
+ font-family: var(--mono);
+ }
+
+ // ---- Analytics head (eyebrow + SegControl) ----
+ .wp-analytics-banner {
+ display: flex;
+ align-items: center;
+ gap: $space-3;
+ margin-bottom: $space-4;
+ padding: $space-3 $space-4;
+ border: 1px solid rgba(129, 140, 248, 0.28);
+ border-radius: var(--radius, 8px);
+ background: rgba(129, 140, 248, 0.08);
+ color: var(--text-primary);
+ flex-wrap: wrap;
+
+ svg { color: var(--accent-bright, #818cf8); flex-shrink: 0; }
+
+ &__text { flex: 1 1 240px; font-size: 13px; line-height: 1.4; }
+ &__text span { color: var(--text-secondary); }
+
+ &__link {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ white-space: nowrap;
+ font-size: 13px;
+ font-weight: $font-weight-semibold;
+ color: var(--accent-bright, #818cf8);
+ }
+ }
+
+ .wp-analytics-head {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ gap: $space-3;
+ flex-wrap: wrap;
+ }
+
+ .wp-eyebrow {
+ margin: 0;
+ font-family: var(--mono);
+ font-size: 11px;
+ font-weight: $font-weight-semibold;
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ color: var(--text-faint);
+ }
+
+ // Recharts default tooltip → surface tokens (recharts inline-styles it)
+ .recharts-default-tooltip {
+ background: var(--surface-2) !important;
+ border: 1px solid var(--border) !important;
+ border-radius: var(--radius-sm);
+ box-shadow: var(--shadow-md);
+ font-family: var(--mono);
+ font-size: 11.5px;
+ }
+
+ .recharts-tooltip-label {
+ color: var(--text-faint) !important;
+ }
+
+ // ---- Report header actions keep normal type inside the eyebrow bar ----
+ .wp-report-actions {
+ font-family: $font-main;
+ text-transform: none;
+ letter-spacing: normal;
+ }
+
+ // ---- Commit list (scoped: Git.jsx renders .commit-item too) ----
+ .commit-list {
+ gap: 0;
+ background: var(--surface);
+ border: 1px solid var(--border-soft);
+ border-radius: var(--radius);
+ overflow: hidden;
+ max-width: 860px;
+ }
+
+ .commit-item {
+ background: transparent;
+ border: none;
+ border-radius: 0;
+ padding: 12px $space-4;
+ transition: background 0.12s;
+
+ & + .commit-item {
+ border-top: 1px solid var(--border-soft);
+ }
+
+ &:hover {
+ background: var(--surface-2);
+ }
+
+ &.current {
+ background: fade($success-raw, 5%);
+ }
+ }
+
+ .commit-icon {
+ color: var(--text-faint);
+
+ .current-icon {
+ color: var(--green);
+ }
+ }
+
+ .commit-sha {
+ font-family: var(--mono);
+ font-size: 11px;
+ color: var(--accent-bright);
+ background: var(--accent-bg);
+ padding: 2px 7px;
+ border-radius: 5px;
+ }
+ // Clickable SHA → the commit on the remote host.
+ a.commit-sha--link {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ text-decoration: none;
+ transition: background 0.14s;
+
+ svg { opacity: 0.6; }
+ &:hover { background: var(--accent-bg-soft); text-decoration: underline; svg { opacity: 1; } }
+ }
+
+ .current-badge {
+ font-family: var(--mono);
+ font-size: 10px;
+ font-weight: $font-weight-semibold;
+ text-transform: uppercase;
+ letter-spacing: 0.05em;
+ background: var(--green-bg);
+ color: var(--green);
+ padding: 2px 7px;
+ border-radius: 5px;
+ }
+
+ .commit-date {
+ font-family: var(--mono);
+ font-size: 10.5px;
+ color: var(--text-faint);
+ }
+
+ .commit-message {
+ font-size: 13px;
+ font-weight: $font-weight-medium;
+ }
+
+ .commit-author {
+ font-family: var(--mono);
+ font-size: 11px;
+ color: var(--text-faint);
+ }
+
+ // ---- DiskUsageBar container re-tint (styles live in _wordpress-pipeline) ----
+ .app-health-disk .disk-usage-bar-container {
+ background: var(--surface-2);
+ border-color: var(--border-soft);
+ }
+}
+
+// ---- Header environment switcher (prototype .env-switch / .env-menu) ----
+.wp-envswitch-wrap {
+ position: relative;
+ display: inline-flex;
+}
+
+.wp-envswitch {
+ display: inline-flex;
+ align-items: center;
+ gap: 8px;
+ padding: 5px 10px 5px 11px;
+ border: 1px solid var(--border-strong);
+ border-radius: 8px;
+ background: var(--surface-2);
+ font-family: $font-main;
+ font-size: 12.5px;
+ font-weight: $font-weight-medium;
+ letter-spacing: normal;
+ color: var(--text);
+ cursor: pointer;
+ transition: border-color 0.14s, background 0.14s;
+
+ .ed {
+ width: 8px;
+ height: 8px;
+ border-radius: 50%;
+ flex-shrink: 0;
+ }
+
+ .chev {
+ color: var(--text-faint);
+ transition: transform 0.15s;
+ }
+
+ &.open .chev {
+ transform: rotate(180deg);
+ }
+
+ &:hover {
+ background: var(--surface-3);
+ border-color: var(--border-strong);
+ }
+}
+
+.wp-envswitch-menu {
+ position: absolute;
+ top: 100%;
+ left: 0;
+ margin-top: 7px;
+ z-index: $z-dropdown + 5;
+ min-width: 280px;
+ background: var(--surface-2);
+ border: 1px solid var(--border-strong);
+ border-radius: 12px;
+ box-shadow: var(--shadow-lg);
+ padding: 7px;
+}
+
+.wp-envswitch-head {
+ font-family: var(--mono);
+ font-size: 10px;
+ letter-spacing: 0.12em;
+ text-transform: uppercase;
+ color: var(--text-ghost);
+ padding: 7px 10px 5px;
+}
+
+.wp-envswitch-opt {
+ display: flex;
+ align-items: center;
+ gap: 11px;
+ width: 100%;
+ padding: 9px 10px;
+ border: none;
+ border-radius: 9px;
+ background: none;
+ color: var(--text);
+ font-family: $font-main;
+ letter-spacing: normal;
+ text-transform: none;
+ text-align: left;
+ cursor: pointer;
+ transition: background 0.1s;
+
+ &:hover {
+ background: var(--surface-3);
+ }
+
+ .ed {
+ width: 9px;
+ height: 9px;
+ border-radius: 50%;
+ flex-shrink: 0;
+ }
+
+ .check {
+ margin-left: auto;
+ color: var(--accent-bright);
+ flex-shrink: 0;
+ }
+}
+
+.wp-envswitch-opt-body {
+ flex: 1;
+ min-width: 0;
+
+ .nm {
+ display: block;
+ font-weight: $font-weight-medium;
+ font-size: 13px;
+ }
+
+ .meta {
+ display: block;
+ font-family: var(--mono);
+ font-size: 10.5px;
+ color: var(--text-faint);
+ margin-top: 1px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+}
+
+// ---- Surface card wrapper for dense tables (SnapshotTable & friends) ----
+.wp-table-card {
+ background: var(--surface);
+ border: 1px solid var(--border-soft);
+ border-radius: var(--radius);
+ overflow: hidden;
+}
+
+.wp-th-right {
+ text-align: right !important;
+}
+
+.wp-cell-actions {
+ text-align: right;
+ white-space: nowrap;
+}
+
+.wp-row-action {
+ display: inline-grid;
+ place-items: center;
+ width: 28px;
+ height: 28px;
+ border: none;
+ border-radius: 7px;
+ background: none;
+ color: var(--text-faint);
+ cursor: pointer;
+ transition: background 0.14s, color 0.14s;
+
+ &:hover:not(:disabled) {
+ background: var(--surface-3);
+ color: var(--text);
+ }
+
+ &:disabled {
+ opacity: 0.5;
+ cursor: default;
+ }
+
+ &--danger:hover:not(:disabled) {
+ background: var(--red-bg);
+ color: var(--red);
+ }
+}
+
+// Environment Cards (EnvironmentCard.jsx — WP detail Environments tab).
+// Restyled to the prototype's .env-card: quiet surface, accent border on
+// production, EnvTag/Pill rendered by the ds components.
+.environments-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
+ gap: $space-4;
+ margin-top: $space-4;
+}
+
+// Dashed "add environment" tile — an in-grid affordance that reads as
+// intentional, replacing the old full-width empty-state block that looked
+// like an error sitting under the production card.
+.wp-env-add-tile {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ gap: $space-2;
+ min-height: 150px;
+ padding: $space-6;
+ text-align: center;
+ border: 1px dashed var(--border-strong);
+ border-radius: var(--radius);
+ background: transparent;
+ color: var(--text-dim);
+ cursor: pointer;
+ transition: border-color 0.15s, color 0.15s, background 0.15s;
+
+ &:hover {
+ border-color: var(--accent);
+ color: var(--text);
+ background: var(--accent-bg-soft);
+ }
+
+ &__icon {
+ display: grid;
+ place-items: center;
+ width: 40px;
+ height: 40px;
+ border-radius: var(--radius);
+ background: var(--accent-bg);
+ color: var(--accent-bright);
+ }
+
+ &__title {
+ font-size: $font-size-base;
+ font-weight: $font-weight-semibold;
+ color: var(--text);
+ }
+
+ &__hint {
+ font-size: $font-size-sm;
+ line-height: $line-height-normal;
+ max-width: 280px;
+ }
+}
+
+.wp-env-card {
+ background: var(--surface);
+ border: 1px solid var(--border-soft);
+ border-radius: var(--radius);
+ transition: border-color 0.15s;
+
+ &:hover {
+ border-color: var(--border-strong);
+ }
+
+ &.production {
+ border-color: var(--accent-dim);
+
+ &:hover {
+ border-color: var(--accent-dim);
+ }
+ }
+
+ &.stale {
+ border-color: fade($warning-raw, 35%);
+ }
+}
+
+.wp-env-status-group {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+}
+
+.wp-env-stale-badge {
+ display: flex;
+ align-items: center;
+ gap: 4px;
+ font-family: var(--mono);
+ font-size: 10.5px;
+ font-weight: $font-weight-medium;
+ padding: 2px 7px;
+ border-radius: 5px;
+ background: var(--amber-bg);
+ color: var(--amber);
+
+ svg {
+ flex-shrink: 0;
+ }
+}
+
+.text-warning {
+ color: var(--amber) !important;
+}
+
+// Kept for the pipeline surfaces: PipelineView / WordPressProjects /
+// EnvironmentStatusBadge still render these classes (EnvironmentCard itself
+// now uses the ds EnvTag/Pill components instead).
+.wp-env-badge {
+ font-size: $font-size-xs;
+ font-weight: $font-weight-bold;
+ padding: 2px 8px;
+ border-radius: $radius-sm;
+ text-transform: uppercase;
+ letter-spacing: 0.5px;
+
+ &.env-production {
+ background: fade($danger-raw, 12%);
+ color: $color-danger;
+ }
+
+ &.env-staging {
+ background: fade($warning-raw, 12%);
+ color: $color-warning;
+ }
+
+ &.env-development {
+ background: fade($info-raw, 12%);
+ color: $color-info;
+ }
+}
+
+.wp-env-status {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ font-size: $font-size-xs;
+ font-weight: $font-weight-medium;
+
+ .status-dot {
+ width: 6px;
+ height: 6px;
+ border-radius: 50%;
+ }
+
+ &.running {
+ color: $color-success;
+
+ .status-dot {
+ background: $color-success;
+ }
+ }
+
+ &.stopped {
+ color: $text-tertiary;
+
+ .status-dot {
+ background: $text-tertiary;
+ }
+ }
+}
+
+.wp-env-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ gap: $space-2;
+ padding: 14px 16px;
+ border-bottom: 1px solid var(--border-soft);
+}
+
+.wp-env-info {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ min-width: 0;
+}
+
+.wp-env-name {
+ font-size: 14px;
+ font-weight: $font-weight-semibold;
+ color: var(--text);
+ margin: 0;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.wp-env-body {
+ padding: 14px 16px;
+}
+
+.wp-env-url {
+ margin-bottom: $space-3;
+
+ a {
+ font-family: var(--mono);
+ font-size: 12.5px;
+ color: var(--accent-bright);
+ text-decoration: none;
+ overflow-wrap: anywhere;
+
+ &:hover {
+ text-decoration: underline;
+ }
+ }
+}
+
+.wp-env-meta {
+ display: grid;
+ grid-template-columns: repeat(2, 1fr);
+ gap: $space-3 $space-2;
+}
+
+.wp-env-meta-item {
+ .meta-label {
+ display: flex;
+ align-items: center;
+ gap: 4px;
+ font-family: var(--mono);
+ font-size: 10.5px;
+ letter-spacing: 0.05em;
+ text-transform: uppercase;
+ color: var(--text-faint);
+ margin-bottom: 3px;
+
+ svg {
+ color: var(--text-ghost);
+ }
+ }
+
+ .meta-value {
+ font-size: 12.5px;
+ color: var(--text);
+
+ &.mono {
+ font-family: var(--mono);
+ font-size: 12px;
+ }
+ }
+}
+
+.wp-env-footer {
+ display: flex;
+ gap: $space-1;
+ padding: 10px 12px;
+ border-top: 1px solid var(--border-soft);
+ background: transparent;
+ border-radius: 0 0 var(--radius) var(--radius);
+}
+
+// Snapshot Table (SnapshotTable.jsx — now a .sk-dtable inside .wp-table-card)
+.wp-snapshot-table {
+ .snapshot-name-cell {
+ display: flex;
+ flex-direction: column;
+ gap: 3px;
+ }
+
+ .snapshot-name {
+ font-weight: 550;
+ font-size: 13px;
+ color: var(--text);
+ }
+
+ .snapshot-tag {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ font-family: var(--mono);
+ font-size: 10.5px;
+ color: var(--cyan);
+ background: var(--cyan-bg);
+ padding: 2px 7px;
+ border-radius: 5px;
+ width: fit-content;
+ }
+
+ .snapshot-desc {
+ font-family: var(--mono);
+ font-size: 11px;
+ color: var(--text-faint);
+ }
+
+ .snapshot-date {
+ font-family: var(--mono);
+ font-size: 12px;
+ color: var(--text-dim);
+ }
+
+ .mono {
+ font-family: var(--mono);
+ font-size: 12px;
+ color: var(--text-dim);
+ }
+
+ .compressed-badge {
+ display: inline-block;
+ font-family: var(--mono);
+ font-size: 10px;
+ background: var(--green-bg);
+ color: var(--green);
+ padding: 1px 5px;
+ border-radius: 4px;
+ margin-left: $space-2;
+ }
+
+ .text-muted {
+ color: var(--text-ghost);
+ font-family: var(--mono);
+ }
+
+ .git-context {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ color: var(--text-dim);
+
+ svg {
+ color: var(--text-faint);
+ flex-shrink: 0;
+ }
+
+ .git-context-sha {
+ color: var(--accent-bright);
+ background: var(--accent-bg);
+ padding: 1px 6px;
+ border-radius: 4px;
+ font-size: 11px;
+ }
+
+ .commit-msg {
+ font-size: 11.5px;
+ color: var(--text-faint);
+ margin-left: $space-1;
+ }
+ }
+}
+
+// Commit List
+.commit-list {
+ display: flex;
+ flex-direction: column;
+ gap: $space-1;
+ max-width: 800px;
+}
+
+.commit-item {
+ display: flex;
+ align-items: flex-start;
+ gap: $space-3;
+ padding: $space-3 $space-4;
+ background: $bg-card;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-md;
+ transition: all 0.15s ease;
+
+ &:hover {
+ border-color: $border-hover;
+ }
+
+ &.current {
+ border-color: fade($success-raw, 40%);
+ background: fade($success-raw, 4%);
+ }
+}
+
+.commit-icon {
+ color: $text-tertiary;
+ margin-top: 2px;
+
+ .current-icon {
+ color: $color-success;
+ }
+}
+
+.commit-info {
+ flex: 1;
+ min-width: 0;
+}
+
+.commit-header {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ margin-bottom: $space-1;
+}
+
+.commit-sha {
+ font-size: $font-size-sm;
+ font-weight: $font-weight-medium;
+ color: $text-secondary;
+}
+
+.current-badge {
+ font-size: $font-size-xs;
+ background: $color-success;
+ color: #fff;
+ padding: 1px 6px;
+ border-radius: $radius-sm;
+}
+
+.commit-date {
+ font-size: $font-size-xs;
+ color: $text-tertiary;
+ margin-left: auto;
+}
+
+.commit-message {
+ font-size: $font-size-sm;
+ color: $text-primary;
+ margin: 0;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.commit-author {
+ font-size: $font-size-xs;
+ color: $text-tertiary;
+}
+
+.commit-actions {
+ display: flex;
+ gap: $space-2;
+ flex-shrink: 0;
+}
+
+.commit-message-preview {
+ font-style: italic;
+ color: $text-secondary;
+ padding: $space-3;
+ background: $bg-tertiary;
+ border-radius: $radius-md;
+ margin: $space-3 0;
+}
+
+// Git Commits Section
+.git-commits-section {
+ margin-top: $space-6;
+ padding-top: $space-6;
+ border-top: 1px solid $border-subtle;
+}
+
+// Quick Actions (WP detail Overview — exclusive to this page)
+.quick-actions-grid {
+ display: grid;
+ grid-template-columns: repeat(2, 1fr);
+ gap: $space-2;
+}
+
+.quick-action-btn {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: 7px;
+ padding: 10px $space-2;
+ background: var(--surface-2);
+ border: 1px solid var(--border-soft);
+ border-radius: 8px;
+ color: var(--text-dim);
+ font-size: 12.5px;
+ font-weight: $font-weight-medium;
+ text-decoration: none;
+ cursor: pointer;
+ transition: background 0.14s, border-color 0.14s, color 0.14s;
+
+ svg {
+ color: var(--text-faint);
+ flex-shrink: 0;
+ transition: color 0.14s;
+ }
+
+ &:hover:not(:disabled) {
+ background: var(--accent-bg-soft);
+ border-color: var(--accent-dim);
+ color: var(--text);
+
+ svg {
+ color: var(--accent-bright);
+ }
+ }
+
+ &:disabled {
+ opacity: 0.55;
+ cursor: default;
+ }
+}
+
+// Hint Box
+.hint-box {
+ padding: $space-4;
+ background: $bg-tertiary;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-md;
+ margin-top: $space-4;
+
+ p {
+ margin: 0;
+ color: $text-secondary;
+ font-size: $font-size-sm;
+
+ &:not(:last-child) {
+ margin-bottom: $space-2;
+ }
+ }
+}
+
+// Empty State Small
+.empty-state-small {
+ padding: $space-6;
+ text-align: center;
+ color: $text-tertiary;
+
+ p {
+ margin: 0;
+
+ &:not(:last-child) {
+ margin-bottom: $space-2;
+ }
+ }
+
+ .hint {
+ font-size: $font-size-sm;
+ }
+}
+
+// Spinning animation for sync button
+@keyframes spin {
+ from {
+ transform: rotate(0deg);
+ }
+ to {
+ transform: rotate(360deg);
+ }
+}
+
+.spinning {
+ animation: spin 1s linear infinite;
+}
+
+// ============================================
+// SKELETON LOADING STATES
+// ============================================
+
+@keyframes shimmer {
+ 0% {
+ background-position: -200% 0;
+ }
+ 100% {
+ background-position: 200% 0;
+ }
+}
+
+@mixin skeleton() {
+ background: linear-gradient(
+ 90deg,
+ $bg-tertiary 25%,
+ fade($border-subtle-raw, 50%) 50%,
+ $bg-tertiary 75%
+ );
+ background-size: 200% 100%;
+ animation: shimmer 1.5s infinite;
+ border-radius: $radius-md;
+}
+
+.skeleton {
+ @include skeleton();
+}
+
+// Skeleton Site Card
+.wp-site-card-skeleton {
+ background: $bg-card;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-lg;
+}
+
+.wp-site-card-skeleton-header {
+ display: flex;
+ align-items: center;
+ gap: $space-3;
+ padding: $space-4;
+ border-bottom: 1px solid $border-subtle;
+}
+
+.wp-site-card-skeleton-icon {
+ width: 40px;
+ height: 40px;
+ border-radius: $radius-md;
+ @include skeleton();
+}
+
+.wp-site-card-skeleton-info {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ gap: $space-2;
+}
+
+.wp-site-card-skeleton-name {
+ width: 60%;
+ height: 16px;
+ @include skeleton();
+}
+
+.wp-site-card-skeleton-url {
+ width: 80%;
+ height: 12px;
+ @include skeleton();
+}
+
+.wp-site-card-skeleton-status {
+ width: 64px;
+ height: 24px;
+ border-radius: $radius-full;
+ @include skeleton();
+}
+
+.wp-site-card-skeleton-body {
+ padding: $space-4;
+ display: grid;
+ grid-template-columns: repeat(2, 1fr);
+ gap: $space-3;
+}
+
+.wp-site-card-skeleton-meta {
+ display: flex;
+ flex-direction: column;
+ gap: $space-1;
+}
+
+.wp-site-card-skeleton-label {
+ width: 50%;
+ height: 10px;
+ @include skeleton();
+}
+
+.wp-site-card-skeleton-value {
+ width: 70%;
+ height: 14px;
+ @include skeleton();
+}
+
+.wp-site-card-skeleton-footer {
+ display: flex;
+ gap: $space-2;
+ padding: $space-3 $space-4;
+ border-top: 1px solid $border-subtle;
+ background: $bg-tertiary;
+ border-radius: 0 0 $radius-lg $radius-lg;
+}
+
+.wp-site-card-skeleton-btn {
+ flex: 1;
+ height: 32px;
+ @include skeleton();
+}
+
+// Skeleton Environment Card
+.wp-env-card-skeleton {
+ background: $bg-card;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-lg;
+}
+
+.wp-env-card-skeleton-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: $space-4;
+ border-bottom: 1px solid $border-subtle;
+}
+
+.wp-env-card-skeleton-badge {
+ width: 60px;
+ height: 20px;
+ border-radius: $radius-sm;
+ @include skeleton();
+}
+
+.wp-env-card-skeleton-status {
+ width: 64px;
+ height: 20px;
+ border-radius: $radius-sm;
+ @include skeleton();
+}
+
+.wp-env-card-skeleton-body {
+ padding: $space-4;
+}
+
+.wp-env-card-skeleton-url {
+ width: 70%;
+ height: 14px;
+ margin-bottom: $space-3;
+ @include skeleton();
+}
+
+.wp-env-card-skeleton-meta {
+ display: grid;
+ grid-template-columns: repeat(2, 1fr);
+ gap: $space-2;
+}
+
+.wp-env-card-skeleton-meta-item {
+ .skeleton-label {
+ width: 40%;
+ height: 10px;
+ margin-bottom: 4px;
+ @include skeleton();
+ }
+
+ .skeleton-value {
+ width: 60%;
+ height: 14px;
+ @include skeleton();
+ }
+}
+
+.wp-env-card-skeleton-footer {
+ display: flex;
+ gap: $space-2;
+ padding: $space-3 $space-4;
+ border-top: 1px solid $border-subtle;
+ background: $bg-tertiary;
+ border-radius: 0 0 $radius-lg $radius-lg;
+}
+
+// Skeleton Stat Card
+.docker-stat-card-skeleton {
+ background: $bg-card;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-lg;
+ padding: $space-4;
+ display: flex;
+ flex-direction: column;
+ gap: $space-2;
+}
+
+.docker-stat-card-skeleton-label {
+ width: 60%;
+ height: 12px;
+ @include skeleton();
+}
+
+.docker-stat-card-skeleton-value {
+ width: 40%;
+ height: 28px;
+ @include skeleton();
+}
+
+.docker-stat-card-skeleton-meta {
+ width: 80%;
+ height: 12px;
+ @include skeleton();
+}
+
+// Skeleton Table Row
+.skeleton-table-row {
+ display: flex;
+ align-items: center;
+ gap: $space-3;
+ padding: $space-3 $space-4;
+ border-bottom: 1px solid $border-subtle;
+
+ .skeleton-cell {
+ height: 16px;
+ @include skeleton();
+
+ &.cell-name { width: 25%; }
+ &.cell-tag { width: 15%; }
+ &.cell-size { width: 10%; }
+ &.cell-date { width: 15%; }
+ &.cell-actions { width: 20%; margin-left: auto; }
+ }
+}
+
+// Tab Content Loading
+.tab-loading {
+ display: flex;
+ flex-direction: column;
+ gap: $space-4;
+ padding: $space-4;
+}
+
+.tab-loading-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: $space-2;
+}
+
+.tab-loading-title {
+ width: 120px;
+ height: 24px;
+ @include skeleton();
+}
+
+.tab-loading-btn {
+ width: 140px;
+ height: 36px;
+ border-radius: $radius-md;
+ @include skeleton();
+}
+
+// ============================================
+// WORDPRESS DETAIL PAGE SKELETON
+// Mirrors the real page chrome + Overview tab layout.
+// ============================================
+.wp-detail-page--skeleton {
+ .sk-topbar-skeleton {
+ display: flex;
+ align-items: center;
+ gap: 14px;
+ min-height: 60px;
+ padding: 10px $space-4;
+ border-bottom: 1px solid var(--border-soft);
+
+ &__icon {
+ width: 18px;
+ height: 18px;
+ border-radius: 4px;
+ @include skeleton();
+ }
+
+ &__title {
+ width: 160px;
+ height: 16px;
+ border-radius: 4px;
+ @include skeleton();
+ }
+
+ &__spacer { flex: 1; }
+
+ &__actions {
+ display: inline-flex;
+ align-items: center;
+ gap: 8px;
+ flex-shrink: 0;
+ }
+
+ &__btn {
+ width: 90px;
+ height: 32px;
+ border-radius: $radius-md;
+ @include skeleton();
+
+ &--primary { width: 110px; }
+ }
+ }
+
+ .wp-detail-skeleton-repo {
+ width: 220px;
+ height: 30px;
+ border-radius: $radius-full;
+ @include skeleton();
+ }
+
+ .app-detail-tab-skeleton {
+ width: 80px;
+ height: 32px;
+ border-radius: 7px;
+ @include skeleton();
+ }
+
+ .wp-kpis--skeleton {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
+ gap: $space-4;
+ }
+
+ .wp-detail-skeleton-kpi {
+ background: var(--surface);
+ border: 1px solid var(--border-soft);
+ border-radius: var(--radius);
+ padding: $space-4 $space-5;
+ display: flex;
+ flex-direction: column;
+ gap: $space-2;
+
+ &__label {
+ width: 70%;
+ height: 11px;
+ border-radius: 3px;
+ @include skeleton();
+ }
+
+ &__value {
+ width: 45%;
+ height: 26px;
+ border-radius: 4px;
+ @include skeleton();
+ }
+ }
+
+ .wp-detail-skeleton-panel {
+ background: var(--surface);
+ border: 1px solid var(--border-soft);
+ border-radius: var(--radius);
+
+ .app-panel-header {
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+ gap: 2px;
+ padding: 12px 17px;
+ border-bottom: 1px solid var(--border-soft);
+ }
+
+ .app-panel-body {
+ padding: $space-4 17px;
+ }
+ }
+
+ .wp-detail-skeleton-chart {
+ height: 250px;
+ border-radius: $radius-md;
+ @include skeleton();
+ }
+
+ .wp-detail-skeleton-activity {
+ display: flex;
+ flex-direction: column;
+ gap: $space-3;
+
+ &__row {
+ display: flex;
+ align-items: center;
+ gap: $space-3;
+ }
+
+ &__lines {
+ flex: 1;
+ min-width: 0;
+ }
+ }
+
+ .wp-detail-skeleton-rows {
+ display: flex;
+ flex-direction: column;
+ gap: $space-3;
+ }
+
+ .wp-detail-skeleton-row {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ gap: $space-4;
+ }
+}
+
+// ============================================
+// ERROR STATES
+// ============================================
+
+.error-boundary,
+.error-state {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding: $space-8;
+ text-align: center;
+ min-height: 200px;
+}
+
+.error-boundary-icon,
+.error-state-icon {
+ color: $color-danger;
+ margin-bottom: $space-4;
+ padding: $space-3;
+ background: fade($danger-raw, 10%);
+ border-radius: 50%;
+}
+
+.error-boundary h3,
+.error-state-title {
+ font-size: $font-size-lg;
+ font-weight: $font-weight-semibold;
+ color: $text-primary;
+ margin: 0 0 $space-2;
+}
+
+.error-boundary-message,
+.error-state-message {
+ font-size: $font-size-sm;
+ color: $text-secondary;
+ margin: 0 0 $space-4;
+ max-width: 400px;
+}
+
+.error-state-compact {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ padding: $space-3 $space-4;
+ background: fade($danger-raw, 8%);
+ border: 1px solid fade($danger-raw, 20%);
+ border-radius: $radius-md;
+ color: $color-danger;
+ font-size: $font-size-sm;
+
+ svg {
+ flex-shrink: 0;
+ }
+
+ span {
+ flex: 1;
+ }
+
+ .btn {
+ flex-shrink: 0;
+ }
+}
+
+// ============================================
+// CONFIRM DIALOG ENHANCEMENTS
+// ============================================
+
+.confirm-dialog-details {
+ margin-top: $space-3;
+ padding: $space-3;
+ background: $bg-tertiary;
+ border-radius: $radius-md;
+ font-size: $font-size-sm;
+ color: $text-secondary;
+ text-align: left;
+
+ ul {
+ margin: 0;
+ padding-left: $space-4;
+
+ li {
+ margin-bottom: $space-1;
+
+ &:last-child {
+ margin-bottom: 0;
+ }
+ }
+ }
+
+ strong {
+ color: $text-primary;
+ }
+
+ code {
+ background: $bg-code;
+ padding: 2px 6px;
+ border-radius: 3px;
+ font-family: $font-family-mono;
+ font-size: 0.9em;
+ }
+}
+
+// Environment Preview URL in Create Modal
+.env-preview-url {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ padding: $space-3;
+ background: fade($success-raw, 8%);
+ border: 1px solid fade($success-raw, 20%);
+ border-radius: $radius-md;
+ margin-bottom: $space-4;
+
+ .preview-label {
+ font-size: $font-size-xs;
+ color: $text-secondary;
+ }
+
+ .preview-url {
+ font-family: $font-family-mono;
+ font-size: $font-size-sm;
+ color: $color-success;
+ font-weight: $font-weight-medium;
+ }
+}
+
+.form-hint-domain {
+ code {
+ background: $bg-code;
+ padding: 2px 6px;
+ border-radius: 3px;
+ font-family: $font-family-mono;
+ font-size: 0.9em;
+ }
+}
+
+.confirm-dialog-input {
+ margin-top: $space-4;
+ text-align: left;
+
+ label {
+ display: block;
+ font-size: $font-size-sm;
+ color: $text-secondary;
+ margin-bottom: $space-2;
+
+ strong {
+ color: $text-primary;
+ font-family: $font-family-mono;
+ }
+ }
+
+ input {
+ width: 100%;
+ padding: $space-3;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-md;
+ font-size: $font-size-base;
+ background: $bg-input;
+ color: $text-primary;
+
+ &:focus {
+ outline: none;
+ border-color: $color-primary;
+ box-shadow: 0 0 0 3px fade($accent-primary-raw, 15%);
+ }
+
+ &::placeholder {
+ color: $text-tertiary;
+ }
+ }
+}
+
+// ============================================
+// RESOURCE ADVISORY - INLINE CAPACITY WARNING
+// ============================================
+// Replaces the old blocked-state gate. Warns at the point of action and lets
+// the operator proceed; nothing here hides a control.
+
+.resource-advisory {
+ display: flex;
+ align-items: flex-start;
+ gap: $space-3;
+ padding: $space-4;
+ margin-bottom: $space-4;
+ background: fade($warning-raw, 8%);
+ border: 1px solid $color-warning;
+ border-radius: $radius-md;
+
+ &__icon {
+ flex-shrink: 0;
+ margin-top: 2px;
+ color: $color-warning;
+ }
+
+ &__title {
+ font-size: $font-size-sm;
+ font-weight: $font-weight-bold;
+ color: $text-primary;
+ margin-bottom: $space-1;
+ }
+
+ &__text {
+ font-size: $font-size-sm;
+ color: $text-secondary;
+ line-height: $line-height-normal;
+ margin: 0;
+ }
+
+ &__list {
+ margin: $space-2 0 0;
+ padding-left: $space-4;
+ font-size: $font-size-xs;
+ color: $text-tertiary;
+ }
+}
+
+// One-time admin credentials banner (after site create)
+.wp-creds-banner {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: $space-4;
+ margin: 0 $space-4 $space-4;
+ padding: $space-4;
+ background: fade($success-raw, 8%);
+ border: 1px solid fade($success-raw, 25%);
+ border-radius: $radius-md;
+
+ .wp-creds-banner-text {
+ display: flex;
+ flex-direction: column;
+ gap: $space-1;
+ font-size: $font-size-sm;
+
+ code {
+ font-family: $font-family-mono;
+ background: $bg-tertiary;
+ padding: 1px 6px;
+ border-radius: 3px;
+ }
+ }
+}
+
+// ============================================
+// SITE HEALTH + SSL PANEL HELPERS (Overview tab)
+// ============================================
+
+.app-health-stat {
+ display: inline-flex;
+ align-items: center;
+ gap: $space-2;
+}
+
+.app-health-disk {
+ margin-top: $space-4;
+
+ .app-info-label {
+ display: block;
+ margin-bottom: $space-2;
+ }
+}
+
+.ssl-action-btn {
+ margin-top: $space-3;
+}
+
+// Plugin / Theme card grids (WP detail — replace the dense asset tables)
+.wp-detail-page {
+ .wp-asset-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
+ gap: 14px;
+ }
+
+ .wp-asset-card {
+ display: flex;
+ gap: 13px;
+ align-items: flex-start;
+ background: var(--surface);
+ border: 1px solid var(--border-soft);
+ border-radius: var(--radius);
+ padding: 16px;
+ transition: border-color 0.15s;
+
+ &:hover { border-color: var(--border-strong); }
+ &.is-active { border-color: var(--accent-dim); }
+
+ &__body { flex: 1; min-width: 0; }
+ &__name { font-weight: 600; font-size: 14px; }
+ &__sub {
+ font-family: var(--mono);
+ font-size: 11px;
+ color: var(--text-faint);
+ margin-top: 2px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+ &__foot {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ margin-top: 12px;
+ flex-wrap: wrap;
+ }
+ &__ver { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
+
+ &__toggle {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 6px;
+ flex-shrink: 0;
+ }
+ &__state {
+ font-family: var(--mono);
+ font-size: 10px;
+ text-transform: uppercase;
+ letter-spacing: 0.04em;
+ color: var(--text-faint);
+ &.is-on { color: var(--green); }
+ }
+ }
+
+ .wp-update-flag {
+ display: inline-flex;
+ align-items: center;
+ gap: 5px;
+ font-family: var(--mono);
+ font-size: 10.5px;
+ color: var(--amber);
+ background: var(--amber-bg);
+ padding: 2px 7px;
+ border-radius: 5px;
+ border: none;
+ cursor: pointer;
+ transition: opacity 0.12s;
+
+ &:hover { opacity: 0.85; }
+ &:disabled { opacity: 0.55; cursor: default; }
+
+ // Library-backed update uses the accent tone to distinguish it from the
+ // generic wp.org update flag.
+ &--library {
+ color: var(--accent);
+ background: var(--accent-bg, rgba(99, 102, 241, 0.12));
+ }
+ }
+
+ // "Managed" badge on plugins tracked by the global plugin library.
+ .wp-managed-pill {
+ display: inline-block;
+ margin-left: 7px;
+ font-size: 9.5px;
+ font-weight: 600;
+ text-transform: uppercase;
+ letter-spacing: 0.04em;
+ color: var(--accent);
+ background: var(--accent-bg, rgba(99, 102, 241, 0.12));
+ padding: 1px 6px;
+ border-radius: 4px;
+ vertical-align: middle;
+ }
+
+ .wp-theme-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
+ gap: 14px;
+ }
+
+ .wp-theme-card {
+ background: var(--surface);
+ border: 1px solid var(--border-soft);
+ border-radius: var(--radius);
+ overflow: hidden;
+ transition: border-color 0.15s, transform 0.15s;
+
+ &:hover { border-color: var(--border-strong); transform: translateY(-2px); }
+ &.is-active { border-color: var(--accent-dim); }
+
+ &__shot {
+ position: relative;
+ height: 128px;
+ display: grid;
+ place-items: center;
+ border-bottom: 1px solid var(--border-soft);
+ background:
+ repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.018) 0 12px, transparent 12px 24px),
+ var(--surface-2);
+
+ svg { color: var(--text-ghost); }
+ .pill { position: absolute; top: 10px; right: 10px; }
+ }
+
+ &__meta { padding: 14px 16px; }
+ &__name { font-weight: 600; font-size: 14px; }
+ &__sub {
+ font-family: var(--mono);
+ font-size: 11px;
+ color: var(--text-faint);
+ margin-top: 3px;
+ }
+ &__actions {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ margin-top: 12px;
+ }
+ &__current {
+ font-family: var(--mono);
+ font-size: 11px;
+ color: var(--green);
+ }
+ }
+}
+
+// Change Site URL modal (URL-swap tool)
+.wp-url-swap {
+ display: flex;
+ flex-direction: column;
+ gap: 16px;
+ padding: 4px 0 8px;
+
+ &__warning {
+ display: flex;
+ gap: 10px;
+ padding: 12px 14px;
+ border-radius: var(--radius);
+ background: var(--surface-2);
+ border: 1px solid var(--border-soft);
+ font-size: 12.5px;
+ line-height: 1.5;
+ color: var(--text-faint);
+
+ svg { flex-shrink: 0; color: var(--amber); margin-top: 1px; }
+ }
+
+ &__fromto {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ flex-wrap: wrap;
+
+ code {
+ font-family: var(--mono);
+ font-size: 12px;
+ padding: 4px 8px;
+ border-radius: 6px;
+ background: var(--surface-2);
+ border: 1px solid var(--border-soft);
+ color: var(--text-faint);
+ word-break: break-all;
+
+ &.is-new { color: var(--green); border-color: var(--accent-dim); }
+ }
+ svg { color: var(--text-ghost); flex-shrink: 0; }
+ }
+
+ &__keep {
+ display: flex;
+ align-items: flex-start;
+ gap: 10px;
+ cursor: pointer;
+
+ > span {
+ display: flex;
+ flex-direction: column;
+ font-size: 13px;
+ font-weight: 500;
+ }
+ small {
+ font-weight: 400;
+ font-size: 11.5px;
+ color: var(--text-faint);
+ margin-top: 2px;
+ }
+ }
+
+ &__preview {
+ border-top: 1px solid var(--border-soft);
+ padding-top: 12px;
+ }
+
+ &__preview-total {
+ font-size: 13px;
+ font-weight: 600;
+ color: var(--text);
+ margin-bottom: 8px;
+ }
+
+ &__preview-pairs {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
+
+ li {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ font-size: 11.5px;
+
+ code {
+ font-family: var(--mono);
+ color: var(--text-faint);
+ word-break: break-all;
+ }
+ svg { color: var(--text-ghost); flex-shrink: 0; }
+ }
+ }
+
+ &__count {
+ margin-left: auto;
+ font-family: var(--mono);
+ font-size: 11px;
+ padding: 1px 8px;
+ border-radius: 999px;
+ background: var(--surface-2);
+ border: 1px solid var(--border-soft);
+ color: var(--text-faint);
+ flex-shrink: 0;
+ }
+
+ &__preview-error {
+ font-size: 12.5px;
+ color: var(--red);
+ }
+
+ &__result {
+ display: flex;
+ gap: 10px;
+ align-items: center;
+ font-size: 13px;
+
+ svg { color: var(--green); flex-shrink: 0; }
+ code { font-family: var(--mono); color: var(--green); word-break: break-all; }
+ }
+
+ &__dns-manual {
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
+ font-size: 12.5px;
+ }
+
+ &__record {
+ font-family: var(--mono);
+ font-size: 12px;
+ padding: 8px 10px;
+ border-radius: 6px;
+ background: var(--surface-2);
+ border: 1px solid var(--border-soft);
+ color: var(--text);
+ word-break: break-all;
+ }
+}
+
+// Pipelines list — the few cells the shared list does not already style.
+.wp-projects-page {
+ &__envs {
+ display: inline-flex;
+ align-items: center;
+ gap: 5px;
+ flex-wrap: wrap;
+ }
+
+ &__envcount {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ margin-right: $space-1;
+ color: $text-secondary;
+ font-family: var(--mono);
+ font-size: 12px;
+ }
+
+ &__git {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ color: $text-secondary;
+ font-size: $font-size-sm;
+
+ svg { color: $text-tertiary; }
+ }
+}
diff --git a/frontend/src/styles/main.scss b/frontend/src/styles/main.scss
index 9147bb11..7b3804cd 100644
--- a/frontend/src/styles/main.scss
+++ b/frontend/src/styles/main.scss
@@ -120,10 +120,9 @@
@import 'pages/_servers';
@import 'pages/_server-survey';
@import 'pages/_downloads';
-@import 'pages/_wordpress';
-@import 'pages/_wordpress-pipeline';
-@import 'pages/_wordpress-plugin-library';
@import 'pages/_ssl';
+// WordPress styles moved into the serverkit-wordpress extension (plan 52
+// Phase 4) — its synced bundle imports them through its own module graph.
@import 'pages/_email';
@import 'pages/_setup-wizard';
@import 'pages/_migration-wizard';