Skip to content

A clean, hexagonal boilerplate for modern WordPress plugin development – powered by PHP-DI, PSR-4, CI/CD, and Composer.

License

Notifications You must be signed in to change notification settings

N3XT0R/wp-modern-plugin-skeleton

Repository files navigation

WP Modern Plugin Skeleton

This repository provides a starting point for building modern WordPress plugins with a clean architecture and dependency injection. It also includes a modern JavaScript frontend and utilities for scaffolding and packaging the plugin.

Features

  • Hexagonal architecture structure (Adapter, Application, Domain, Infrastructure, Shared)
  • Modular dependency injection container using ContainerProvider and *ContainerConfigurator classes powered by PHP-DI
  • PSR-4 autoloading via Composer
  • React-based frontend located in the frontend/ directory using Vite and Tailwind CSS
  • WordPress i18n integration for JavaScript via frontend/i18n-loader.js
  • Script bin/init-plugin.php to bootstrap the plugin file and CI workflow
  • GitHub Actions workflow for tests
  • PHPUnit test setup with code coverage
  • Build script for packaging the plugin
  • Automatic plugin header generator (generate-header.php)

Usage

  1. Install PHP dependencies
    composer install
  2. Initialize a plugin file and CI workflow (optional)
    composer init-plugin
  3. Run tests
    composer test
  4. Build the JavaScript frontend
    cd frontend
    npm install
    npm run build     # or npm run dev for development
  5. Generate plugin header
    composer generate-header
  6. Package plugin for distribution
    ./build/build.sh

About

A clean, hexagonal boilerplate for modern WordPress plugin development – powered by PHP-DI, PSR-4, CI/CD, and Composer.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published