Introduction OptStack
WordPress Data Stack Framework β A PHP framework for defining, storing, and managing structured data in WordPress using a unified, extensible stack-based model.
Features
- Data-first, UI-agnostic β Focus on data modeling, not UI
- Native WordPress compatibility β Works with
get_option(),get_post_meta(),get_term_meta() - Unified data model β Same field syntax across Options, Posts, Terms, Users
- Quick field updates β Update single fields with automatic searchable field sync
- Runtime context injection β Use as plugin or Composer library, no conflicts
- Composable & extensible β Interface-driven architecture
- Future-proof β Ready for Headless WordPress and REST workflows
- Modern Admin UI β React + TypeScript + TailwindCSS frontend
Requirements
- PHP 8.1+
- WordPress 6.0+
- Node.js 18+ (for frontend development)
Architecture
βββββββββββββββββββββββββββββββββββββββββββ
β Renderers (UI/API) β β React Admin, REST
βββββββββββββββββββββββββββββββββββββββββββ€
β Store Adapters (WP) β β OptionsStore, PostStore
βββββββββββββββββββββββββββββββββββββββββββ€
β Core Framework β β Pure PHP, no WP
βββββββββββββββββββββββββββββββββββββββββββ- Core β Pure PHP, no WordPress dependencies, fully unit testable
- WordPress β Store adapters and hooks
- Frontend β React + TypeScript admin UI
Directory Structure
optstack/
βββ src/
β βββ Core/ # Pure PHP framework
β βββ WordPress/ # WP integration
β βββ Schema/ # Schema export
β βββ OptStack.php # Main facade
βββ frontend/
β βββ src/ # React/TypeScript source
β βββ dist/ # Built assets
β βββ vite.config.ts # Build configuration
βββ examples/ # Usage examples
βββ tests/ # PHPUnit tests
βββ optstack.php # Plugin bootstrapLicense
MIT License