This is a WordPress framework whose goal is to give WordPress industrial and modern development capabilities.
What are the characteristics of a modern php code base? Do we have those in WordPress by default? Do we have those by adding WonderWp?
|Characteristic||WordPress alone||with WonderWp|
|Object Oriented Programming||Born procedural, some OOP implementation||OOP by Design|
|Composer||× Absent||✔ Present|
|PHP Fig recommendations||× Not implemented||✔ Implemented|
|PSR-4||× Not supported||✔ Supported|
|Autoloader||× Not provided||✔ Provided by composer
(based on PSR-4)
|Dependency injection||× Not supported||✔ Supported by a Container|
|Package management||× Not provided||✔ Provided by composer|
As you can see, by default WordPress alone does not really have many characteristics of a modern php codebase.
The WonderWp framework's aim is to bridge that gap and enhance the developer experience. By doing so, we also make a step towards other frameworks and libraries by providing serveal PHP-FIG recommendations implementations, and opening the use of composer.
WonderWp doesn't recode WordPress, it doesn't really add core concepts that WordPress doesn't have either. Instead, it provides classes that sit on top of WordPress procedural concepts to bring developers a more modern architecture.
Probably not everyone.
This framework could interest you if
On the other hand, if you are a plugin developer who's aim is to make a plugin usable by the widest WordPress audience, it could be a cost you migh consider too big to have WonderWp and composer as dependencies.
Trying to follow good object oriented principles, we encourage developers throught the use of this framework to adopt a few concepts.
We wanted our code to be as modular as possible and bring dependency injection capabilities to WordPress.
When working with a dependency injection container, you open up the possibility to switch the object that's going to be used behind the key you request from the container as long as it implements a given interface. Because if it does, you'll be sure that is object exposes the public methods required for your code to run properly.
That's why in addition to add a DI container, we've also added many interfaces to work with WordPress core concepts, and wider programming concepts, (Emails, Routing, Logging, Caching)...
Following the full object philosophy, shortcodes or custom routes resulting in a public or admin output are managed by controllers. Controllers work with services to get the data they need, and pass that to views. Views do not have a templating engine for the moment by default as dependency in this framework, but you could easily add your own.
This framework proposes a way of organizing folders following the PSR4 recommendation for classes, an admin folder for your plugin admin side, and a public folder for your plugin public side, but nothing's sompulsary, you can do as you whish.
There's also a plugin generator to help you quick start your plugin development.