Download the PHP package hsm/wplite without Composer
On this page you can find all versions of the php package hsm/wplite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package wplite
WPLite
A lightweight, Laravel-inspired micro framework for building WordPress plugins with modern PHP architecture.
WPLite gives you service containers, facades, middleware pipelines, expressive routing, Eloquent-style models, views, caching, auth guards, and more — without leaving the WordPress ecosystem.
Quick Start
Features
- Service Container — Auto-resolving dependency injection via reflection
- Facades — Static-like access:
App,Route,View,Cache,Auth,Config,Wordpress - 4 Route Types — REST API, Ajax, Admin pages, and Web routes from one unified router
- Middleware Pipeline — Chainable middleware on any route (Laravel-style
$pipeline->next()) - Query Builder & Models — Fluent
$wpdbwrapper withhasMany,hasOne,belongsTo,hasOneMetarelationships - Service Providers — Lifecycle hooks:
register,bootEarly,onInit,boot,admin,ajax,rest,activate,deactivate,uninstall - View Engine — PHP-based templating with dot notation (
view('emails.welcome', $data)) - Cache Layer — Driver-based (ships with WordPress Transients), extensible via Adapter pattern
- Auth Guards — Pluggable authentication (ships with SSO/OAuth2 guard)
- JSON Resources — API response transformers (
::make(),::collection()) - OOP Shortcodes — Class-based shortcodes with attributes and defaults
- Namespace Isolation — Build tool rewrites all namespaces so multiple WPLite plugins never conflict
- CLI Tool —
php wplite buildto scaffold and brand the framework .envSupport — Environment variables loaded automatically- Config System — Dot-notation access (
appConfig('app.api.namespace')) - Logging — Built-in file logger
Requirements
- PHP >= 7.4
- WordPress (any modern version)
- Composer
Installation
New Project
Add to Existing Plugin
Namespace Isolation (Build Step)
This is the critical step. WPLite rewrites all framework namespaces to your plugin's unique namespace so that multiple plugins using WPLite coexist on the same WordPress installation without any conflict.
What this does:
- Copies the framework source into
src/WPLite/in your project - Rewrites every
namespace WPLite\*→namespace MyPlugin\WPLite\* - Rewrites every
use WPLite\*→use MyPlugin\WPLite\* - Updates all fully qualified class references and PHPDoc annotations
- Namespaces helper functions to prevent global collisions
- Saves your prefix to
wplite-config.jsonfor future builds
After the first run, subsequent builds only need:
Use --dry-run to preview all changes without writing files.
CLI Options
Bootstrap
Your main plugin file:
Routing
Define routes in routes/rest.php, routes/ajax.php, routes/admin.php, and routes/web.php.
REST API
Ajax
Automatically registers wp_ajax_ and wp_ajax_nopriv_ hooks.
Admin Pages
Web (Frontend)
Named Routes & URL Generation
Middleware
Chain per-route or define global middleware in configs/app.php:
Service Container
Service Providers
Register in configs/app.php or place under Src\Provider\ for auto-discovery.
Models & Query Builder
Supports: select, where, join, orderBy, groupBy, limit, hasMany, hasOne, belongsTo, hasOneMeta, with(), hide(), create, update, delete.
Facades
Views
JSON Resources
Shortcodes
Usage: [pricing_table plan="pro"]
Cache
Ships with WordPress Transients driver. Extend by implementing the CacheDriver contract.
Configuration
Config Files (configs/app.php)
Environment Variables (.env)
Project Structure
Contributing
Pull requests and issues are welcome! Please follow PSR standards.
License
MIT — see LICENSE for details.