A modern WordPress starter plugin which uses the WP Emerge framework.
This is the WP Emerge Starter Plugin project - for the WP Emerge framework please check out https://github.com/htmlburger/wpemerge.
- Documentation
- Development Team
- Comparison Table
- Features
- Non-goals
- Requirements
- Directory structure
- Contributing
http://docs.wpemerge.com/#/starter/plugin/overview
http://docs.wpemerge.com/#/starter/plugin/quickstart
Brought to you by Atanas Angelov and the lovely folks at htmlBurger.
WP Emerge Theme | WPB | WPT | |
---|---|---|---|
View Engine | PHP, Blade, Twig, any | PHP | PHP |
Routing | โ | โ | โ |
WP Admin Routing | โ | โ | โ |
WP AJAX Routing | โ | โ | โ |
MVC | โโโ | โโโ | โโโ |
Middleware | โ | โ | โ |
View Composers | โ | โ | โ |
Service Container | โ | โ | โ |
Stylesheets | SASS + PostCSS | CSS | LESS |
JavaScript | ES6 | Vanilla | Vanilla |
Hot reloading | โ | โ | โ |
Frontend/Admin/Any Bundle | โโโ | โโโยน | โโโยฒ |
Automatic Sprite Generation | โ | โ | โ |
Automatic Cache Busting | โ | โ | โ |
WPCS Linting | โ | โ | โ |
Advanced Error Reporting | โ | โ | โ |
WP Unit Tests for your classes | โ | โ | โ |
ยน There are prepared JavaScript files but they are not processed or transpiled in any way.
ยฒ The JavaScript files are only minified - no transpiling is done.
Email any factual inaccuracies to hi@atanas.dev so they can be corrected.
- All features from WP Emerge:
- SASS + PostCSS for stylesheets. Separate bundles are created for front-end and administration and custom bundles can be added easily.
- ES6 for JavaScript. Separate bundles are created for front-end and administration and custom bundles can be added easily.
- Pure Webpack to transpile and bundle assets, create sprites, optimize images etc.
- Hot Module Replacement for synchronized browser development.
- Autoloading for all classes in your
MyApp\
namespace. - Automatic, fool-proof cache busting for all assets, including ones referenced in styles.
- WPCS, JavaScript and SASS linting and fixing using a single yarn command.
- Single-command optional CSS package installation:
- Normalize.css
- Boostrap 4
- Bulma
- Foundation
- Tachyons
- Tailwind CSS
- Spectre.css
- FontAwesome
- WP Unit Test scaffolding for your own classes.
-
Taking over the WordPress main query.
WP Emerge does not take over the main query - it actively works with it.
-
Taking over WordPress routing.
WP Emerge does not take over WordPress' routing - it actively works with it. The only exception to this are hardcoded URLs explicitly added by a user.
-
Reinventing WordPress APIs using object-oriented interfaces.
WP Emerge does not provide alternative APIs for registering post types, taxonomies or the like for little added benefit. Instead, it provides logical and handy places for developers to use core APIs.
-
Using a third party engine by default.
WP Emerge uses PHP by default in the same way WordPress does but with added features. Using a third party engine is entirely optional and requires installing an extension.
-
Include most of Laravel or another framework.
WP Emerge is lean and tuned for WordPress. While inspired by Laravel, it does not come with any
illuminate/*
packages. There are only 2 third party production dependencies:pimple/pimple
- The single-file PHP service container.guzzlehttp/psr7
- A PSR-7 Request and ServerRequest implementation.
wp-content/plugins/your-plugin
โโโ app/
โ โโโ helpers/ # Helper files, add your own here as well.
โ โโโ routes/ # Register your WP Emerge routes.
โ โ โโโ admin.php
โ โ โโโ ajax.php
โ โ โโโ web.php
โ โโโ src/ # PSR-4 autoloaded classes.
โ โ โโโ Controllers/ # Controller classes for WP Emerge routes.
โ โ โโโ Routing/ # Register your custom routing conditions etc.
โ โ โโโ View/ # Register your view composers, globals etc.
โ โ โโโ WordPress/ # Register post types, taxonomies, menus etc.
โ โ โโโ ...
โ โโโ config.php # WP Emerge configuration.
โ โโโ helpers.php # Require your helper files here.
โ โโโ hooks.php # Register your actions and filters here.
โ โโโ version.php # WP Emerge version handling.
โโโ dist/ # Bundles, optimized images etc.
โโโ languages/ # Language files.
โโโ resources/
โ โโโ build/ # Build process configuration.
โ โโโ fonts/
โ โโโ images/
โ โโโ scripts/
โ โ โโโ admin/ # Administration scripts.
โ โ โโโ frontend/ # Front-end scripts.
โ โโโ styles/
โ โ โโโ admin/ # Administration styles.
โ โ โโโ frontend/ # Front-end styles.
โ โ โโโ shared/ # Shared styles.
โ โโโ vendor/ # Any third-party, non-npm assets.
โโโ vendor/ # Composer packages.
โโโ views/
โ โโโ layouts/
โ โโโ partials/
โโโ screenshot-1.png # Plugin screenshot.
โโโ wpemerge # WP Emerge CLI shortcut.
โโโ wpemerge.php # Bootstrap plugin.
โโโ ...
Add PHP helper files here. Helper files should include function definitions only. See below for information on where to put actions, filters, classes etc.
Add PHP class files here. All clases in the MyApp\
namespace are autoloaded in accordance with PSR-4.
Add images for styling here. Optimized copies will be placed in dist/images/
when running the build process.
Add .css and .scss files to add them to the front-end bundle. Don't forget to @import
them in index.scss
.
The admin styles directory which works identically to the resources/styles/frontend/
directory.
Add JavaScript files here to add them to the frontend bundle. The entry point is index.js
.
The admin scripts directory which works identically to the resources/scripts/frontend/
directory.
views/layouts/
- Layouts that other views extend.views/partials/
- Small snippets that are meant to be reused throughout other views.views/
- Full page views that may extend layouts and may include partials.
Avoid adding any PHP logic in any of these views, unless it pertains to layouting. Business logic should go into:
- Helper files (
app/helpers/*.php
) - Service classes
- WP Emerge Controllers
WP Emerge Starter Plugin is completely open source and we encourage everybody to participate by:
- Reviewing
.github/CONTRIBUTING.md
. - โญ the project on GitHub (https://github.com/htmlburger/wpemerge-plugin)
- Posting bug reports (https://github.com/htmlburger/wpemerge-plugin/issues)
- (Emailing security issues to hi@atanas.dev instead)
- Posting feature suggestions (https://github.com/htmlburger/wpemerge-plugin/issues)
- Posting and/or answering questions (https://github.com/htmlburger/wpemerge-plugin/issues)
- Submitting pull requests (https://github.com/htmlburger/wpemerge-plugin/pulls)
- Sharing your excitement about WP Emerge with your community