-
Notifications
You must be signed in to change notification settings - Fork 1
Architecture
Intercessor is organized as a modern WordPress plugin using PHP namespaces, a custom PSR-4 autoloader, and the BerlinDB library for custom database tables.
intercessor/
├── intercessor.php Main plugin file (bootstrap)
├── index.php Silence-is-golden security file
├── uninstall.php Cleanup on deletion
├── readme.txt WordPress.org readme
├── assets/
│ ├── css/ Stylesheets (3 files)
│ │ ├── admin.css Admin dashboard styles
│ │ ├── iconfont.css Icon font definitions
│ │ └── public.css Front-end block styles
│ ├── fonts/ Intercessor icon font (eot/svg/ttf/woff)
│ └── js/
│ ├── admin/
│ │ └── admin.js Admin dashboard script
│ ├── blocks/ Webpack-built Gutenberg blocks
│ │ ├── prayer-form/
│ │ ├── prayer-history/
│ │ └── prayer-wall/
│ └── public/ Front-end scripts (unminified)
│ ├── prayer-form.js
│ ├── prayer-history.js
│ └── prayer-wall.js
├── src/ PHP source (autoloaded)
│ ├── Plugin.php Central controller
│ ├── Loader.php Hook registration
│ ├── Activator.php Activation routines
│ ├── Roles.php Roles and capabilities
│ ├── Requirements.php PHP/WP version checks
│ ├── Admin/ Dashboard pages, settings, list tables
│ ├── Block/ Gutenberg block render callbacks
│ ├── Database/ BerlinDB tables, schemas, queries, rows
│ ├── Http/ Request handling, REST API, submissions
│ ├── Public/ Front-end asset loading
│ ├── Reports/ Reporting views and stats
│ ├── Tools/ Import/export handlers
│ ├── Util/ Cron, rate limiter, profanity filter, etc.
│ ├── blocks/ Gutenberg block source (JSX/JS)
│ └── includes/berlindb/ Bundled BerlinDB library
├── templates/ PHP templates
│ ├── admin/ Dashboard page templates
│ └── blocks/ Block render templates
├── languages/ Translation files (.pot, .po, .mo)
├── scripts/ Build/packaging scripts
└── tests/ PHPUnit test suite
A custom PSR-4 autoloader (Util\Autoloader) maps the Intercessor\ namespace to the src/ directory. Class names map directly to filenames: Intercessor\Block\Prayer_Wall_Block loads from src/Block/Prayer_Wall_Block.php.
-
intercessor.phpdefines constants (INTERCESSOR_VERSION,INTERCESSOR_DIR,INTERCESSOR_URL,INTERCESSOR_FILE), registers the autoloader, and callsPlugin::instance(). -
Pluginis a singleton that wires up theLoader,Admin_Loader,Public_Loader,Block_Loader,Rest_Api,Cron_Handler, and other subsystems via WordPress hooks. -
Activatorruns on plugin activation to create database tables, register roles, and store the plugin version. -
uninstall.phpruns on deletion and optionally drops all data based on thedelete_data_on_uninstallsetting.
Intercessor uses BerlinDB, a lightweight ORM-like library for WordPress custom tables. Each entity has four classes:
- Table — defines the table name, version, and schema SQL
- Schema — declares columns and their types
- Query — provides CRUD operations and query building
- Row — represents a single record as a typed object
See Database Schema for the full table definitions.
Blocks are registered via Block_Loader, which maps each block slug to a render-callback class and registers them using register_block_type() from the built assets/js/blocks/{slug}/ directory (which contains block.json, compiled index.js, and index.asset.php).
The block source (JSX) lives in src/blocks/ and is compiled with webpack. See Building from Source for build instructions.