This repository has been archived by the owner on Jun 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(Readme): Add the initial readme markdown
- Loading branch information
1 parent
6ec1a5d
commit 5aa0506
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# WordPress Plugin Boilerplate | ||
An organized, object-oriented, and lightweight boilerplate for testable WordPress plugin development | ||
|
||
|
||
## Installation | ||
Install directly into the plugins folder of a WordPress installation and then rename from `wordpress-plugin-boilerplate` to whatever you want your plugin to be named: | ||
|
||
composer create-project wpstrap/wordpress-plugin-boilerplate | ||
|
||
Currently a lot of Find and Replace is needed. | ||
|
||
### Plugin Structure | ||
|
||
You can add your own new class files by naming them correctly and putting the files in the most appropriate location, see other files for examples. Composer's Autoloader and the Bootstrap class will auto include your file and instantiate the class. The idea of this organisation is to be more conscious of structuring your code. | ||
|
||
* `classes/App` - holds the plugin application-specific functionality | ||
* `classes/App/Frontend` - all public-facing functionality | ||
* `classes/App/Backend` - all admin-specific functionality | ||
* `classes/App/General` - functionality shared between the back-end and frontend | ||
* `classes/App/Cli` - code for cli integrations | ||
* `classes/App/Cron` - code for cron events | ||
* `classes/App/Rest` - code for rest API functionalities | ||
* `classes/Config` - plugin configuration code | ||
* `classes/Common` - utilities shared in the whole plugin application | ||
* `classes/Integrations` - includes the integration with libraries, API's or other plugins | ||
* `classes/Compatability` - 3rd party compatibility code | ||
* `templates` - all the template files | ||
* `tests` - all the tests using Codeception | ||
* `assets` - all the assets files (css/js/images), can be extended with Webpack/Gulp for SCSS and babel etc. | ||
|
||
### Acceptance & Unit Testing | ||
- Testing with Codeception works out of the box | ||
- Create test files with `composer generate:wpunit` or `composer generate:acceptance` | ||
- Write your test methods and run `composer run:wpunit` or `composer run:acceptance` |