JE WP Plugin
WordPress plugin for construction site expense, stock, and inventory management with PDF reports.
by Mainul Hassan Main · github.com/shamimmoeen/jewpplugin · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/shamimmoeen/jewpplugin/archive/refs/heads/master.zipReadme
JE WP Plugin
Author: Mainul Hassan Main
Version: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
A custom WordPress plugin built for Jahanara Enterprise — a construction company — to manage construction sites, track daily expenses, handle stock/inventory, and generate downloadable PDF reports.
Overview
JE WP Plugin is a private business management tool developed as a WordPress plugin. It provides a complete workflow for recording and reviewing operational data on a site-by-site basis, including:
- Construction site/project management
- Daily expense tracking with voucher numbers
- Stock and material inventory
- Category-based (khat) cost classification
- PDF report generation
The plugin is built entirely with WordPress core APIs — no page builders or third-party admin frameworks — using a modular, OOP-based architecture.
Key Features
- Site Management — Create and manage construction project entries
- Daily Cost Tracking — Record expenses with date, voucher number, line items, categories (khats), and cost amounts
- Stock & Inventory — Track material quantities per site; view aggregated inventory over date ranges
- Advanced Filtering — Filter expenses by khat, date range, and voucher range; filter inventory by item and date
- PDF Reports — Export four report types:
- Single daily cost record
- All daily costs for a site
- Stock entries
- Site inventory
- Widgets — Five custom WordPress widgets for displaying site, cost, stock, and inventory data
- Shortcode —
[add_site]renders a frontend site-creation form - Login-protected Pages — Sensitive site views require user authentication
Technical Highlights
Built using core WordPress development practices:
| Technique | Details |
|---|---|
| Custom Post Types | 6 CPTs: site, daily-cost, daily-cost-item, khat, stock, stock-item |
| Custom Meta Fields | Post meta used for all structured data (dates, voucher numbers, line-item arrays) |
| Custom Template System | Plugin-level templates with theme-override support |
| OOP Architecture | Abstract base classes for form submission and filtering logic |
| Singleton Pattern | Used for Helper and Template_Loader utility classes |
| Form Handling | Redirect-on-submit pattern with nonce verification on all forms |
| Widgets | 5 custom WP_Widget subclasses |
| Shortcodes | Frontend form rendering via [add_site] |
| PDF Generation | mPDF library integration for 4 report types |
| Frontend Assets | SASS stylesheets, modular JS, Selectize.js, Datepicker |
| Security | Nonce verification, input sanitization, login-required views |
| i18n Ready | All strings wrapped with __() / _x(), text domain: jewpplugin |
Custom Post Types
| Post Type | Visibility | Purpose |
|---|---|---|
site |
Public | Container for a construction project |
daily-cost |
Public | Daily expense record |
daily-cost-item |
Internal | Individual expense line items |
khat |
Internal | Expense categories (ledger accounts) |
stock |
Public | Stock/material records per site |
stock-item |
Internal | Stock item definitions |
Main Workflow
1. Site Management
Create a site/project entry that acts as the parent container for all expenses and stock data.
2. Daily Cost Tracking
For each site, record daily costs with:
- Date and voucher number
- Multiple line items (item name + khat/category + cost)
Costs can be filtered by khat, date range, or voucher range and exported as PDFs.
3. Stock & Inventory
Submit stock entries per site. View aggregated inventory grouped by item, filterable by item and date range. Export to PDF.
4. PDF Reports
Four downloadable PDF report types generated via mPDF:
- Single daily cost record
- All daily costs for a site
- Stock entries
- Site inventory summary
Shortcode
[add_site]