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/yarielg/mhc/archive/refs/heads/master.zipReadme
MHC – WordPress Plugin
This WordPress plugin is designed for a behavioral clinic that provides services to children with autism and other conditions affecting behavior. It integrates a custom payroll management system that allows administrators to generate detailed payslips for different worker roles — RBTs (technicians), BCaBAs (intermediate), and BCBAs (analysts) — based on hours worked with each patient, specific rates (general or per patient), and exceptional payments or deductions.
The system is built as a Vue-powered single-page application (SPA) embedded in WordPress via shortcodes. It is optimized to minimize the number of clicks needed to produce payrolls, while still supporting complex scenarios such as:
Assigning and calculating extra payments or deductions.
Managing fixed-rate activities like assessments and supervision.
Handling exceptions where certain workers skip payroll cycles.
Generating individual payslips for each worker with detailed breakdowns of payments by category.
Producing global payroll reports for internal verification and comparison with accounting systems.
By combining a modern Vue frontend with a WordPress backend, the plugin allows secure access from any location, detailed role/patient management, and automated calculations that reduce human error and manual work.
Requirements
- WordPress 6.x or higher
- PHP 8.0+ (7.4 may work but is not recommended)
- Composer 2.x
- Node.js 18+ and npm 9+
- Access to
wp-content/plugins/
PHP Extensions
These must be enabled on the server (usually they are by default on most hosting providers):
ext-mbstring– required by mPDF for UTF-8 and multibyte text rendering.ext-gd– required by mPDF for image rendering.
Additional Notes
- Ensure a writable temp directory for mPDF. Recommended: wp-content/uploads/mpdf
Installation
-
Clone the repository into
wp-content/plugins/:cd wp-content/plugins git clone <repository-url> mhc cd mhc -
Install PHP dependencies:
composer install composer update composer du -
Install JS dependencies:
npm install -
On Windows PowerShell, allow scripts temporarily:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -
Start the watcher for development:
npm run watch -
Activate the plugin in WordPress admin under Plugins → MHC .
💡 In production, use the build command (
npm run build) instead ofwatch.
PDF Generation
The plugin uses mPDF to generate worker payslips and payroll reports.
Library installed via Composer:
composer require mpdf/mpdf:^8.2
Fonts: mPDF automatically handles UTF-8 and special characters (á, ñ, ü, etc.).
Images: ensure ext-gd is enabled for logos and signatures.
Shortcodes
[mhc_app]
Renders the Vue container on the site home page:
<div id="vwp-plugin"></div>
[mhc_app_login]
Displays the WordPress login form with custom labels.
- Redirects logged-in users to
/ - Includes "Lost your password?" link
Example usage in a WordPress page:
[mhc_app_login]
⚠️ The login page must use the slug
app-login.Settings::redirect_users()sends every anonymous front-end request to/app-login; any other slug causes a redirect loop.
Development
- Use
npm run watchduring development to compile assets in real-time. - After updating PHP dependencies, run:
composer du
File Structure
mhc-/
├─ inc/
│ └─ Base/Shortcodes.php
├─ assets/ # JS/CSS source
├─ dist/ # Compiled JS/CSS
├─ mhc-.php # Plugin bootstrap
├─ composer.json
└─ package.json
License
Specify your license here (e.g., MIT, GPL-2.0+).
Changelog
- v0.1.0 – Initial release with
[mhc_]and[mhc__login]shortcodes.