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 .
- Easier to use hooks declarations
- Code separation into modules
- PSR-4 Autoloading
- PHP 7.4 and above
- Wordpress 5.4 and above
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.
- Database abstraction
- Validator
- Requests Handler
- Routing
- Tests, tests, tests.
Chaospelt is licensed under the BSD 3-Clause License - see the LICENSE
file for details
Pull requests and issues are more than welcome.