Case Study Role: Developer Tools: PHP 8 · WordPress Plugin API · Namespaces · Shortcode Loader

Plugin Architecture — One Bundled Experience

Everything dynamic on the site is one plugin – vulcan-institute. Each subsystem is a namespaced class under VulcanInstituteCloner, CPTs, Shortcodes, Settings, Meditation_Admin, Logic_Test_Admin, Star_System_Admin, Learning_Path, Proverb_Widget. Main file requires the includes and dispatches each ::init() on plugins_loaded.

Asset registration sits on wp_enqueue_scripts but scripts are only registered there – they’re enqueued from inside each shortcode that needs them. So a page with only the meditation shortcode doesn’t pay for Three.js. Worth doing.

Shortcodes share one tiny template loader – takes a filename from templates/, extracts variables into scope, captures via ob_start(), returns the buffer. Keeps the templates focused on markup.

CSS token strategy is the bit I’m most pleased with. Plugin CSS declares its own --vulcan-* properties, but each one falls back through var(--vi-*, default) – so when the theme is active the plugin picks up the theme tokens automatically, and when it’s not the plugin has its own bronze-on-void palette to fall back on. Means the plugin still works if someone unbundles it from the theme.