Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
A PHP Library plus Conventions for Building Complex Custom WordPress Apps
WPLib was designed for use by teams who build custom sites and need professional workflow. The library is a thin layer that provides a simple Module System and a lightweight Model+View architecture.
WPLib is for those professionals who want their custom-developed WordPress sites to be both robust and easy to manage and maintain as site complexity grows.
Features and Benefits
The WPLib Library includes:
- Implementation of a Module system with Auto-Loader,
- The concept of an "App" that uses app-specific Modules,
- Code optimized for use with a persistent cache, and
- Prescriptive conventions for code consistency across many developers.
- A Model+View Architecture (see next)
Unlike MVC plugins WPLib does not take control of WordPress URL routing. Instead Models+Views are about data elements in WordPress. Currently in WPLib core we have Model+View classes for Posts and Post Types, Taxonomy and Terms; and Roles and Users.
The Model+View architecture provides:
- The ability to build really complex yet maintainable WordPress sites,
- A clear separation of concerns between backend developer and front-end themer,
- Familiar yet consistent functionality to address common use-case, and
- An architecture that results in naturally reusable modules.
Can Be Used Incrementally
Note WPLib can be used a little or a lot. It can be added incrementally to a site, or a site can be started with WPLib as its base. The latter obviously provides the most benefits.
WPLib is in beta status.
We are actively working on WPLib with a goal to develop stable beta versions that can be used in production, and then a 1.0.0 version when we are comfortable that the majority of the API will not need to change.
Unfortunately these are woefully out-of-date, and may have bugs with the latest version of WPLib (remember, we are still pre-1.0 and are still changing things.)
We plan to update them in the near future, sooner if we have people who are pushing us to do so. :-)
- Underscores4WPLib - A port of an Underscores starter theme that can be used as a starter theme but is intended more to allow for comparison between standard WordPress theming practices and using WPLib best practices instead.
- LawPress - A demo theme that will eventually be a full-fledged law firm CMS starter theme.
WPLib is based on at least five (5) generations of code developed over seven (7) years.
The 1st and 2nd generations were named Sunrise and the 3rd and 4th were called NewClarity Lib (we did not release that publicly as it was focused on meeting the short term needs of clients and not focused on being widely usable.)
The architecture concepts and the implementation is now simple enough and mature enough to release publicly.