-
Notifications
You must be signed in to change notification settings - Fork 1
Architecture
Saltus Framework follows a service-oriented architecture with a dependency injection container at its core. The framework bootstraps through the Core class, which registers all services, routes, and tool providers.
Core (Plugin interface)
|
|- ServiceContainer (DI container)
| |- Registers 10 feature services
| |- Two-pass registration: unconditional for routes/tools,
| | gated via is_needed() for hooks/assets
|
|- Modeler (RestRouteProvider + ToolContributor)
| |- Scans {project}/src/models/ for config files
| |- Creates PostType or Taxonomy instances via ModelFactory
| |- Exposes get_models(), REST routes, and MCP tools
|
|- RestServer
| |- Registers 11 REST routes in saltus-framework/v1/
| |- Uses ModelRestPolicy + CapabilityPolicy for gating
|
|- MCP/Abilities
|- 18 MCP tools registered as saltus/* abilities
|- Middleware pipeline (permission, validation, audit, cache, rate-limit)
|- Backed by REST controllers
The main entry point. Initializes the service container, registers all services, and hooks into WordPress's init action.
Loads model configuration files from the project's src/models/ directory and registers them as WordPress post types and taxonomies.
A PSR-11-compatible dependency injection container with support for:
- Service registration and resolution
- Conditional service loading via
is_needed() - Factory-based instantiation
- Assembly-based wiring
Eleven REST controllers registered under the saltus-framework/v1/ namespace, covering models, posts, settings, meta, and more.
WordPress-native MCP/Abilities integration exposing 18 tools through a middleware pipeline with caching, rate limiting, audit logging, and permission gating.
REST route providers and MCP tool contributors are registered unconditionally during plugin boot to ensure endpoints appear in the WordPress REST index. All other services (admin screens, scripts, frontend hooks) are gated behind is_needed() to avoid loading unnecessary code.
Permission, validation, error formatting, audit, cache, and rate-limit logic each exist in exactly one place — a composable middleware pipeline shared by both REST and MCP paths.
| Service | Class | Description |
|---|---|---|
admin_cols |
AdminCols |
Custom admin list table columns |
admin_filters |
AdminFilters |
Admin list table filter dropdowns |
draganddrop |
DragAndDrop |
Drag-and-drop post reordering |
duplicate |
Duplicate |
One-click post duplication |
meta |
Meta |
Codestar-powered metaboxes |
mcp |
MCP |
MCP/Abilities tools registration |
quick_edit |
QuickEdit |
Quick edit custom fields |
remember_tabs |
RememberTabs |
Tab state persistence |
settings |
Settings |
Codestar-powered settings pages |
single_export |
SingleExport |
Single-post WXR export |
-
Codestar Framework: Used for metaboxes and settings pages. Custom patches maintained in
lib/codestar-framework/patches/. - SoberWP/Models: Simplified version included for declarative CPT/taxonomy registration via PHP/JSON/YAML config files.
-
Composer Classmap: Legacy libraries use classmap autoloading. Run
composer dump-autoloadwhen adding new classes to mapped directories. -
GitHub Updater: Native support for
afragen/github-updaterfor plugin updates from GitHub.