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
bootstrap/autoload.phpLoads WordPress if needed, Composer, optional custom bootstrap, and the starter class
bootstrap/load-wp.phpFinds a nearby configured WordPress installation for CLI/bootstrap use
bootstrap/app.phpCreates WpStarter\Wordpress\Application and binds HTTP/console kernels and exception handler
app/Http/Kernel.phpFrontend global middleware, groups, aliases; extends the WordPress kernel
app/Providers/RouteServiceProvider.phpLoads URL and shortcode route files
routes/web.php / routes/api.phpURL routes
routes/wp.phpWordPress shortcode routes
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/ComponentsWordPress response components with optional boot() / mount()
app/View/ShortcodesComponents registered with the shortcode manager
app/Providers/AppServiceProvider.phpApplication integration, sample shortcode registration, and text-domain loading
app/Providers/SettingServiceProvider.phpDefines the WordPress option key for application settings
configFramework and WordPress service configuration
resources/views / resources/langFrontend Blade templates and translation resources
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

The three route files and the admin module use different facades and kernels. Start with routing before moving declarations between them.

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.