WP Manifestindependent plugin directory

MHC Payroll

Mental Health Clinic Payroll Plugin

by WRN · github.com/yarielg/mhc · website

0stars
0forks

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.zip

Readme

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

  1. Clone the repository into wp-content/plugins/:

    cd wp-content/plugins
    git clone <repository-url> mhc
    cd mhc
  2. Install PHP dependencies:

    composer install
    composer update
    composer du
  3. Install JS dependencies:

    npm install
  4. On Windows PowerShell, allow scripts temporarily:

    Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
  5. Start the watcher for development:

    npm run watch
  6. Activate the plugin in WordPress admin under Plugins → MHC .

💡 In production, use the build command (npm run build) instead of watch.

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 watch during 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.

Read the full README on GitHub →