A modern WordPress plugin starter kit built around OOP, PSR-4 autoloading, and a dependency injection container.
Designed for developers who want maintainable, testable, scalable plugins instead of procedural spaghetti.
- PHP ≥ 7.4
- WordPress ≥ 5.8
- Composer
Full documentation is available here:
👉 achchiraj.dev/plugins/sefra-starter
git clone https://github.com/YoussefACHCHIRAJ/sefra-plugin-starter
cd sefra-plugin-starter
composer installFor production plugins, change the default App\ namespace to a unique vendor/plugin namespace to avoid conflicts.
<?php
/**
* Plugin Name: Sefra Plugin Starter
* Description: A starter plugin for WordPress developers.
* Version: 1.0.0
*
* @package plugin-starter
*/
if (!defined('ABSPATH')) {
exit;
}
use App\Providers\PluginServiceProvider;
use App\Plugin;
use Sefra\Container;
use Sefra\Providers\App;
require __DIR__ . '/vendor/autoload.php';
App::registerProviders([
PluginServiceProvider::class,
]);
Container::getInstance()
->get(Plugin::class)
->boot();<?php
namespace App\Providers;
use Sefra\Container;
use Sefra\Providers\ServiceProvider;
use App\Services\Logger;
use App\Contracts\LoggerInterface;
class PluginServiceProvider implements ServiceProvider
{
public function register(Container $container): void
{
$container->singleton(
LoggerInterface::class,
Logger::class
);
}
public function boot(Container $container): void
{
// Register hooks, listeners, side effects
}
}class UserService
{
public function __construct(
LoggerInterface $logger
) {}
}No manual instantiation. Dependencies are resolved automatically.