Skip to content

Plugin Structure ​

The skeleton keeps Laravel-style application folders but enters through WordPress. The files below determine the integration; most application work belongs in app, routes, and resources.

PathRole
main.phpWordPress plugin header and guarded entrypoint; defines __WS_FILE__, WS_DIR, and WS_VERSION
WordpressStarter.phpCoordinates WordPress hooks, early bootstrap, application bootstrap, and frontend dispatch
autoload.phpLoads a nearby configured WordPress installation if needed, Composer, and the starter class
bootstrap/providers.phpRegisters application service providers
routes/console.phpArtisan closure commands
app/PluginsLoader.phpOptional early rules for conditional plugin loading; create this file when needed
bootstrap/app.phpCreates the WordPress application with Application::configure(); configures URL, shortcode, and console routes, frontend middleware, and exception rendering
routes/web.phpURL routes loaded by withRouting() with the web middleware group
routes/wp.phpWordPress shortcode routes loaded by withRouting(wp: ...) with the web middleware group
app/Http/ControllersFrontend controller actions
app/Admin/AdminServiceProvider.phpAdmin kernel binding, route group, and view namespace
app/Admin/Kernel.phpIndependent admin middleware configuration
app/Admin/routes/admin.phpMenus and submenus
app/Admin/ControllersAdmin controllers with HTTP-method/action dispatch
app/Admin/resources/viewsViews under admin::, including the application layout
app/View/Components (optional)Create this directory for WordPress response components with optional boot() / mount()
app/View/ShortcodesComponents registered with the shortcode manager
app/Providers/AppServiceProvider.phpRegisters the sample shortcode and loads the text domain
config/wordpress.phpWordPress integration configuration; settings controls the option key, automatic save, and queue restart behavior
configFramework and WordPress service configuration
resources/views / resources/langFrontend Blade templates and translation resources
vite.config.js / package.jsonVite entrypoints and development/production build commands; existing Mix applications can keep their build setup
publicPublic assets; not the application's request entrypoint
storage / bootstrap/cacheRuntime files and generated caches; require write access
artisanApplication CLI entrypoint with WordPress bootstrap
vendor/wpstarter/framework/src/WpStarter/WordpressWordPress integration implementation installed by Composer

Application::configure() binds the framework's WordPress HTTP and console kernels. Configure frontend middleware through withMiddleware() and exception handling through withExceptions() in bootstrap/app.php. The admin module keeps its own App\Admin\Kernel.

The framework registers the settings provider automatically. Configure application settings under settings in config/wordpress.php; no settings provider entry is needed in bootstrap/providers.php.

URL, shortcode, and admin routes use different facades. Start with routing before moving declarations between them. An API route file is optional and must be added to withRouting() when needed.

Keep framework changes in the framework package's source repository rather than relying on edits under vendor, which a Composer update can replace. The skeleton's sample controllers, views, and routes are application examples you can adapt or remove.

WordPress integration, with Laravel-style application APIs.