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.
Python astracloudflarecontrol-panelcyberpaneldnsfablehosting-control-panelhosting-panelkimi-k3server-managementserverkitubuntu-web-panelwebserver
feat(extensions): Phase 5 — WordPress UI contributed by serverkit-wordpress
Juan Denis39d21f7a460a
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex e8d6aa0e..045f47d3 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -32,7 +32,13 @@ awaiting a stable release:environment activity keep their foreign keys. The old WordPress "module toggle"is retired — the extension's install/enable state is the gate. Core code reachesthe extension's services through an importlib bridge, so a panel with WordPress- uninstalled no longer loads any of the ~6k lines of WordPress service code.+ uninstalled no longer loads any of the ~6k lines of WordPress service code. The+ **WordPress UI is contributed by the extension too** — a single `wordpress/*`+ route self-renders the whole WordPress sub-router (site list + plugin library ++ pipelines tab group, plus the full-bleed site/pipeline detail pages), and the+ sidebar item, command-palette entries, and page titles all come from the+ extension manifest. Uninstalling WordPress now cleanly removes its nav, routes,+ and API in one go.- **Extensions platform (Phase 4 — Email is now an extension)** — the mail-serverstack (Postfix/Dovecot, domains, mailboxes, DKIM/SpamAssassin, Roundcube webmail,and the `/api/v1/email` API) has moved out of core into the bundleddiff --git a/builtin-extensions/serverkit-wordpress/frontend/index.jsx b/builtin-extensions/serverkit-wordpress/frontend/index.jsxnew file mode 100644index 00000000..e1286b82--- /dev/null+++ b/builtin-extensions/serverkit-wordpress/frontend/index.jsx@@ -0,0 +1,60 @@+// 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.+//+// 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+// this component self-renders the whole WordPress sub-router — reproducing the+// exact structure the core App.jsx used to own (TabGroupLayout + WORDPRESS_TABS+// 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 '../../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';++// "WordPress Projects" was renamed to "Pipelines" (§2 unification). Forward old+// deep links to the new space.+function LegacyWpPipelineRedirect() {+ const { id, tab } = useParams();+ const suffix = [id, tab].filter(Boolean).join('/');+ return <Navigate to={`/wordpress/pipelines/${suffix}`} replace />;+}++export function WordPressExtension() {+ return (+ <Routes>+ {/* Tab group — list surfaces share one PageTopbar + WORDPRESS_TABS. */}+ <Route element={<TabGroupLayout tabs={WORDPRESS_TABS} />}>+ <Route index element={<WordPress />} />+ <Route path="plugins/library" element={<WordPressPluginLibrary />} />+ <Route path="pipelines" element={<WordPressProjects />} />+ </Route>+ {/* Full-bleed pipeline detail (own chrome, outside the tab group). */}+ <Route path="pipelines/:id" element={<WordPressProject />} />+ <Route path="pipelines/:id/:tab" element={<WordPressProject />} />+ {/* Legacy "WordPress Projects" URLs → Pipelines (§2). */}+ <Route path="projects" element={<Navigate to="/wordpress/pipelines" replace />} />+ <Route path="projects/:id" element={<LegacyWpPipelineRedirect />} />+ <Route path="projects/:id/:tab" element={<LegacyWpPipelineRedirect />} />+ {/* Full-bleed site detail (own chrome, outside the tab group). The+ :tab/:section depth keeps the Settings sub-nav shareable. */}+ <Route path=":id" element={<WordPressDetail />} />+ <Route path=":id/:tab" element={<WordPressDetail />} />+ <Route path=":id/:tab/:section" element={<WordPressDetail />} />+ </Routes>+ );+}++export default WordPressExtension;diff --git a/builtin-extensions/serverkit-wordpress/plugin.json b/builtin-extensions/serverkit-wordpress/plugin.jsonindex 6632efe8..97888f65 100644--- a/builtin-extensions/serverkit-wordpress/plugin.json+++ b/builtin-extensions/serverkit-wordpress/plugin.json@@ -30,5 +30,27 @@}],"icon": "<path d=\"M12 2a10 10 0 100 20 10 10 0 000-20zm-8 10a8 8 0 011.4-4.5l4.7 12.9A8 8 0 014 12zm8 8c-.8 0-1.6-.1-2.3-.3l2.4-7 2.5 6.8.1.1A8 8 0 0112 20zm1.1-11.8c.5 0 .9-.1.9-.1.4 0 .4-.6-.1-.6 0 0-1.4.1-2.3.1-.8 0-2.2-.1-2.2-.1-.5 0-.6.6-.1.6 0 0 .4.1.9.1l1.3 3.6-1.9 5.6L6.6 8.2c.5 0 .9-.1.9-.1.4 0 .4-.6-.1-.6 0 0-1.4.1-2.3.1h-.4A8 8 0 0112 4a8 8 0 016.5 3.3h-.3c-.8 0-1.4.7-1.4 1.5 0 .7.4 1.3.8 2 .3.6.7 1.3.7 2.3 0 .7-.3 1.6-.6 2.7l-.8 2.7-2.9-8.8z\"/>",- "contributions": {}+ "contributions": {+ "nav": [+ {+ "id": "wordpress",+ "label": "WordPress",+ "route": "/wordpress",+ "category": "infrastructure",+ "icon": "<circle cx=\"12\" cy=\"12\" r=\"10\"/><path d=\"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z\"/><path d=\"M3.5 9h17M3.5 15h17\"/>"+ }+ ],+ "routes": [+ { "path": "wordpress/*", "component": "WordPressExtension" }+ ],+ "page_titles": {+ "/wordpress": "WordPress Sites",+ "/wordpress/plugins/library": "WordPress Plugin Library",+ "/wordpress/pipelines": "WordPress Pipelines"+ },+ "command_palette": [+ { "label": "WordPress", "path": "/wordpress", "category": "Pages", "keywords": "wp sites" },+ { "label": "WordPress Pipelines", "path": "/wordpress/pipelines", "category": "Pages", "keywords": "wp environments projects pipeline" }+ ]+ }}diff --git a/docs/EXTRACTION_WORDPRESS_AUDIT.md b/docs/EXTRACTION_WORDPRESS_AUDIT.mdindex b3c1add4..403cf6f6 100644--- a/docs/EXTRACTION_WORDPRESS_AUDIT.md+++ b/docs/EXTRACTION_WORDPRESS_AUDIT.md@@ -5,8 +5,10 @@ backend now lives in `builtin-extensions/serverkit-wordpress/` as a bundled,default-installed flagship (D4), loaded via an importlib bridge. See the Phase 5section of `docs/plans/12_EXTENSIONS_PLATFORM_PLAN.md` for the shipped scope anddeviations (models stay core; event-catalog + Fail2ban WP filter kept core as-two-speed items; frontend UI stays core — its tab-grouped conversion is the-scoped follow-up). Largest single move in the plan; done after Email (#32).+two-speed items). The **frontend UI is now contributed by the extension too** — a+single `wordpress/*` splat route self-renders the whole WordPress sub-router (tab+group + full-bleed detail), so the sidebar item, routes, palette, and page titles+all come from the manifest. Largest single move in the plan; done after Email (#32).**Verdict:** extractable, but WordPress has **real core hooks** that must beinverted/guarded first. WordPress ships as a bundled, default-installed,uninstallable extension (D4) — never a marketplace hunt.diff --git a/frontend/src/App.jsx b/frontend/src/App.jsxindex 3fb05122..2a2fe5ef 100644--- a/frontend/src/App.jsx+++ b/frontend/src/App.jsx@@ -40,16 +40,10 @@ import { SERVICE_TABS } from './components/services/serviceTabs';import { FILE_TABS } from './components/files/fileTabs';import { MONITOR_TABS } from './components/monitoring/monitorTabs';import { MARKET_TABS } from './components/marketplace/marketTabs';-import { WORDPRESS_TABS } from './components/wordpress/wordpressTabs';import { BACKUP_TABS } from './components/backups/backupTabs';import { SECURITY_TABS } from './components/security/securityTabs';import { ORG_TABS } from './components/organization/organizationTabs';import Downloads from './pages/Downloads';-import WordPress from './pages/WordPress';-import WordPressDetail from './pages/WordPressDetail';-import WordPressProjects from './pages/WordPressProjects';-import WordPressPluginLibrary from './pages/WordPressPluginLibrary';-import WordPressProject from './pages/WordPressProject';import SSLCertificates from './pages/SSLCertificates';import SSOCallback from './pages/SSOCallback';import SourceConnectionCallback from './pages/SourceConnectionCallback';@@ -81,7 +75,6 @@ import Telemetry from './pages/Telemetry';import Jobs from './pages/Jobs';import useExtensionRoutes from './plugins/ExtensionRoutes';import { useContributions } from './plugins/contributions';-import ModuleRoute from './components/ModuleRoute';// Page title mappingconst PAGE_TITLES = {@@ -94,9 +87,8 @@ const PAGE_TITLES = {'/projects': 'Projects','/shared-variables': 'Shared Variables','/fleet-proxy': 'Fleet Proxy',- '/wordpress': 'WordPress Sites',- '/wordpress/plugins/library': 'WordPress Plugin Library',- '/wordpress/pipelines': 'WordPress Pipelines',+ // WordPress list-page titles come from the serverkit-wordpress manifest+ // (page_titles) now; the dynamic detail-page fallbacks below stay in core.'/templates': 'Templates','/deployments': 'Deployment Activity','/domains': 'Domains',@@ -156,14 +148,6 @@ function LegacyAppRedirect() {return <Navigate to={`/services/${suffix}`} replace />;}-// "WordPress Projects" was renamed to "Pipelines" (§2 unification) to end the-// collision with generic /projects. Forward old deep links to the new space.-function LegacyWpPipelineRedirect() {- const { id, tab } = useParams();- const suffix = [id, tab].filter(Boolean).join('/');- return <Navigate to={`/wordpress/pipelines/${suffix}`} replace />;-}-function PageTitleUpdater() {const location = useLocation();const { page_titles: pluginTitles } = useContributions();@@ -336,24 +320,11 @@ function AppRoutes() {<Route path="apps" element={<Navigate to="/services" replace />} /><Route path="apps/:id" element={<LegacyAppRedirect />} /><Route path="apps/:id/:tab" element={<LegacyAppRedirect />} />- {/* WordPress routes are gated by the WordPress module toggle- (Settings → Modules); disabled ⇒ redirect to the dashboard. */}- <Route element={<TabGroupLayout tabs={WORDPRESS_TABS} />}>- <Route path="wordpress" element={<ModuleRoute name="wordpress"><WordPress /></ModuleRoute>} />- <Route path="wordpress/plugins/library" element={<ModuleRoute name="wordpress"><WordPressPluginLibrary /></ModuleRoute>} />- <Route path="wordpress/pipelines" element={<ModuleRoute name="wordpress"><WordPressProjects /></ModuleRoute>} />- </Route>- <Route path="wordpress/pipelines/:id" element={<ModuleRoute name="wordpress"><WordPressProject /></ModuleRoute>} />- <Route path="wordpress/pipelines/:id/:tab" element={<ModuleRoute name="wordpress"><WordPressProject /></ModuleRoute>} />- {/* Legacy "WordPress Projects" URLs → Pipelines (§2). */}- <Route path="wordpress/projects" element={<Navigate to="/wordpress/pipelines" replace />} />- <Route path="wordpress/projects/:id" element={<LegacyWpPipelineRedirect />} />- <Route path="wordpress/projects/:id/:tab" element={<LegacyWpPipelineRedirect />} />- <Route path="wordpress/:id" element={<ModuleRoute name="wordpress"><WordPressDetail /></ModuleRoute>} />- <Route path="wordpress/:id/:tab" element={<ModuleRoute name="wordpress"><WordPressDetail /></ModuleRoute>} />- {/* Settings sub-section in the URL (e.g. .../settings/git) so the- Settings left-nav is shareable and survives a refresh. */}- <Route path="wordpress/:id/:tab/:section" element={<ModuleRoute name="wordpress"><WordPressDetail /></ModuleRoute>} />+ {/* WordPress moved into the serverkit-wordpress builtin extension+ (Phase 5 #38). It contributes a single splat route wordpress/*+ via its manifest and self-renders the whole sub-router (tab+ group + full-bleed detail + legacy /projects redirects), so all+ the WordPress routing now lives in the extension. */}{/* /workflow is now the serverkit-workflows builtin extension(contributes the route via its manifest, full layout). */}<Route element={<TabGroupLayout tabs={DOMAIN_TABS} />}>diff --git a/frontend/src/components/CommandPalette.jsx b/frontend/src/components/CommandPalette.jsxindex 96b2aeb2..ab066729 100644--- a/frontend/src/components/CommandPalette.jsx+++ b/frontend/src/components/CommandPalette.jsx@@ -19,8 +19,7 @@ const STATIC_PAGES = [{ label: 'SSL Certificates', path: '/ssl', category: 'Pages', keywords: 'https tls' },{ label: 'Templates', path: '/templates', category: 'Pages', keywords: 'deploy one-click' },{ label: 'Deployments', path: '/deployments', category: 'Pages', keywords: 'deploy jobs status logs' },- { label: 'WordPress', path: '/wordpress', category: 'Pages', keywords: 'wp sites' },- { label: 'WordPress Pipelines', path: '/wordpress/pipelines', category: 'Pages', keywords: 'wp environments projects pipeline' },+ // WordPress palette entries are contributed by the serverkit-wordpress extension.{ label: 'Files', path: '/files', category: 'Pages', keywords: 'file manager explorer' },{ label: 'FTP Server', path: '/ftp', category: 'Pages', keywords: 'sftp upload' },{ label: 'Observability', path: '/monitoring', category: 'Pages', keywords: 'metrics uptime monitoring alerts' },diff --git a/frontend/src/components/sidebarItems.js b/frontend/src/components/sidebarItems.jsindex 0246078b..23873308 100644--- a/frontend/src/components/sidebarItems.js+++ b/frontend/src/components/sidebarItems.js@@ -86,19 +86,9 @@ export const SIDEBAR_ITEMS = [category: 'infrastructure',icon: '<path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/><polyline points="3.27 6.96 12 12.01 20.73 6.96"/><line x1="12" y1="22.08" x2="12" y2="12"/>'},- {- // Redesign: WordPress uses the top-bar layout (REDESIGN_MAP §6 dec. 3).- // Pipeline now lives in the page's top bar (PageTopbar WORDPRESS_TABS),- // not as a sidebar sub-item. The pipeline list is at /wordpress/pipelines- // (renamed from /wordpress/projects in §2; old URLs redirect).- id: 'wordpress',- label: 'WordPress',- route: '/wordpress',- category: 'infrastructure',- // Hidden when an admin disables the WordPress module (Settings → Modules).- requiresCondition: 'wordpressEnabled',- icon: '<circle cx="12" cy="12" r="10"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/><path d="M3.5 9h17M3.5 15h17"/>'- },+ // WordPress is now the serverkit-wordpress builtin extension (Phase 5 #38);+ // its sidebar item is contributed by the extension manifest (nav), so it+ // disappears cleanly when the extension is uninstalled.// Workflow Builder is now the serverkit-workflows builtin extension; its// sidebar item is contributed by the extension manifest.{diff --git a/frontend/src/plugins/serverkit-wordpress/index.jsx b/frontend/src/plugins/serverkit-wordpress/index.jsxnew file mode 100644index 00000000..e1286b82--- /dev/null+++ b/frontend/src/plugins/serverkit-wordpress/index.jsx@@ -0,0 +1,60 @@+// 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.+//+// 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+// this component self-renders the whole WordPress sub-router — reproducing the+// exact structure the core App.jsx used to own (TabGroupLayout + WORDPRESS_TABS+// 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 '../../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';++// "WordPress Projects" was renamed to "Pipelines" (§2 unification). Forward old+// deep links to the new space.+function LegacyWpPipelineRedirect() {+ const { id, tab } = useParams();+ const suffix = [id, tab].filter(Boolean).join('/');+ return <Navigate to={`/wordpress/pipelines/${suffix}`} replace />;+}++export function WordPressExtension() {+ return (+ <Routes>+ {/* Tab group — list surfaces share one PageTopbar + WORDPRESS_TABS. */}+ <Route element={<TabGroupLayout tabs={WORDPRESS_TABS} />}>+ <Route index element={<WordPress />} />+ <Route path="plugins/library" element={<WordPressPluginLibrary />} />+ <Route path="pipelines" element={<WordPressProjects />} />+ </Route>+ {/* Full-bleed pipeline detail (own chrome, outside the tab group). */}+ <Route path="pipelines/:id" element={<WordPressProject />} />+ <Route path="pipelines/:id/:tab" element={<WordPressProject />} />+ {/* Legacy "WordPress Projects" URLs → Pipelines (§2). */}+ <Route path="projects" element={<Navigate to="/wordpress/pipelines" replace />} />+ <Route path="projects/:id" element={<LegacyWpPipelineRedirect />} />+ <Route path="projects/:id/:tab" element={<LegacyWpPipelineRedirect />} />+ {/* Full-bleed site detail (own chrome, outside the tab group). The+ :tab/:section depth keeps the Settings sub-nav shareable. */}+ <Route path=":id" element={<WordPressDetail />} />+ <Route path=":id/:tab" element={<WordPressDetail />} />+ <Route path=":id/:tab/:section" element={<WordPressDetail />} />+ </Routes>+ );+}++export default WordPressExtension;diff --git a/frontend/src/plugins/serverkit-wordpress/plugin.json b/frontend/src/plugins/serverkit-wordpress/plugin.jsonnew file mode 100644index 00000000..df5a463c--- /dev/null+++ b/frontend/src/plugins/serverkit-wordpress/plugin.json@@ -0,0 +1,75 @@+{+ "name": "serverkit-wordpress",+ "display_name": "WordPress",+ "version": "1.0.0",+ "description": "The full WordPress suite — site provisioning, plugin library, environments/pipelines, updates, security hardening, vulnerability scanning, analytics and reports. Ships bundled and installed by default (a flagship), and can be uninstalled to slim the core.",+ "author": "ServerKit",+ "license": "MIT",+ "category": "integration",+ "homepage": "https://github.com/jhd3197/ServerKit",+ "permissions": [+ "shell",+ "filesystem",+ "network",+ "docker",+ "database"+ ],+ "min_panel_version": "1.7.0",+ "entry_point": "wordpress:wordpress_bp",+ "url_prefix": "/api/v1/wordpress",+ "extra_blueprints": [+ {+ "module": "wordpress_sites",+ "attr": "wordpress_sites_bp",+ "url_prefix": "/api/v1/wordpress"+ },+ {+ "module": "environment_pipeline",+ "attr": "environment_pipeline_bp",+ "url_prefix": "/api/v1/wordpress/projects"+ },+ {+ "module": "environment_pipeline",+ "attr": "environment_pipeline_bp",+ "url_prefix": "/api/v1/wordpress/pipelines",+ "name": "environment_pipeline_pipelines"+ }+ ],+ "icon": "<path d=\"M12 2a10 10 0 100 20 10 10 0 000-20zm-8 10a8 8 0 011.4-4.5l4.7 12.9A8 8 0 014 12zm8 8c-.8 0-1.6-.1-2.3-.3l2.4-7 2.5 6.8.1.1A8 8 0 0112 20zm1.1-11.8c.5 0 .9-.1.9-.1.4 0 .4-.6-.1-.6 0 0-1.4.1-2.3.1-.8 0-2.2-.1-2.2-.1-.5 0-.6.6-.1.6 0 0 .4.1.9.1l1.3 3.6-1.9 5.6L6.6 8.2c.5 0 .9-.1.9-.1.4 0 .4-.6-.1-.6 0 0-1.4.1-2.3.1h-.4A8 8 0 0112 4a8 8 0 016.5 3.3h-.3c-.8 0-1.4.7-1.4 1.5 0 .7.4 1.3.8 2 .3.6.7 1.3.7 2.3 0 .7-.3 1.6-.6 2.7l-.8 2.7-2.9-8.8z\"/>",+ "contributions": {+ "nav": [+ {+ "id": "wordpress",+ "label": "WordPress",+ "route": "/wordpress",+ "category": "infrastructure",+ "icon": "<circle cx=\"12\" cy=\"12\" r=\"10\"/><path d=\"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z\"/><path d=\"M3.5 9h17M3.5 15h17\"/>"+ }+ ],+ "routes": [+ {+ "path": "wordpress/*",+ "component": "WordPressExtension"+ }+ ],+ "page_titles": {+ "/wordpress": "WordPress Sites",+ "/wordpress/plugins/library": "WordPress Plugin Library",+ "/wordpress/pipelines": "WordPress Pipelines"+ },+ "command_palette": [+ {+ "label": "WordPress",+ "path": "/wordpress",+ "category": "Pages",+ "keywords": "wp sites"+ },+ {+ "label": "WordPress Pipelines",+ "path": "/wordpress/pipelines",+ "category": "Pages",+ "keywords": "wp environments projects pipeline"+ }+ ]+ }+}