Back to Portfolio

WordPress Plugin Starter Kit with PSR-4 Service Container

Introduction

The WordPress Plugin Starter Kit is a modern, PSR-4 compliant dependency injection container designed specifically for WordPress plugin development. It provides a robust foundation for building maintainable, testable, and well-structured WordPress plugins.

Why This Exists

WordPress plugin development often involves complex interdependencies between classes, services, and WordPress hooks. Traditional approaches lead to:

This starter kit solves these problems by providing:

Use Cases


Features


Requirements

Getting Started

Directory Structure

File structure for plugin using this starter kit:

sefra-plugin-starter/
├── sefra-starter.php                   # Main plugin file
├── composer.json                       # Composer configuration
├── src/                                # Source files (PSR-4)
│   ├── Admin/
│   ├── Frontend/
│   ├── Providers/
|   │   PluginServiceProvider.php       # Service provider for registering and binding services
│   ├── Helpers/
|   │   └──Hooks.php                    # Wordpress hooks registration helpers
│   ├── Services/
│   └── Plugin.php                     # Main plugin class
└── assets/                             # CSS, JS, images

Next Steps

To get started with the WordPress Plugin Starter Kit


Contributing

Contributions are welcome! Please follow these guidelines:

License

This project is licensed under the MIT License.


Support


Acknowledgments

Built with inspiration from:


Changelog

Version 1.0.0