stfkolev / chaospelt
Modular, robust wordpress plugin development foundation - freeing you to create without sweating the small things
Requires
- php: >=7.4
Requires (Dev)
This package is auto-updated.
Last update: 2024-05-06 19:14:31 UTC
README
Purpose
This a "foundation" package. Its purpose is to help people develop Wordpress plugins quicker and easier in a more modern way. It provides some features that provide cleaner code structuring and overall quality.
This package can prevent some headaches, but cannot replace bad code habits, you'll still need a real .
Features
- Easier to use hooks declarations
- Code separation into modules
- PSR-4 Autoloading
Installation
Compatible with
- PHP 7.4 and above
- Wordpress 5.4 and above
Installing
Create an empty composer project and require the Chaospelt package using Composer:
composer require stfkolev/chaospelt
Then, create a file with the main plugin class and extend the Chaospelt\Kernel\Plugin class:
<?php namespace Lab; use Chaospelt\Kernel\Plugin; class LabPlugin extends Plugin { public function __construct() { parent::__construct(PLUGIN_FILE); } }
Note: Be sure to follow the Wordpress Development Guide and pass the plugin file's path into the parent constructor. It is important, as it uses the path for the auto-registration of the hooks. Note 2: You can create your folder structure however you want. This is just a sample code onto how to use the foundation.
TODO
- Database abstraction
- Validator
- Requests Handler
- Routing
- Tests, tests, tests.
License
Chaospelt is licensed under the BSD 3-Clause License - see the LICENSE
file for details
Contributing
Pull requests and issues are more than welcome.