Introduction

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 bootstrap

License

MIT License