Skip to content

Instantly share code, notes, and snippets.

@EhsanCh
EhsanCh / whmcs-patch-updater.md
Last active September 16, 2026 18:18
WHMCS Automated Incremental Patch Updater

WHMCS Automated Incremental Patch Updater

A zero-configuration, production-ready Bash script to automatically download, back up, and apply official WHMCS maintenance patches.

Features

  • Zero Setup: Auto-detects custom admin directory, system URL, and file permissions from configuration.php.
  • Dynamic Upgrade Chain: Detects current database version and queries the official WHMCS API to calculate required patch steps.
  • Smart Automated Backup: Creates pre-upgrade snapshots (compressed MySQL dump + core files, excluding uploads/cache).
  • Interactive Migration Trigger: Pauses between updates, providing the exact admin URL to finalize database schema upgrades.
@EhsanCh
EhsanCh / fpm_get_status.php
Created February 19, 2023 10:54
PHP-FPM real-time status page (Single file without the need for web server configuration)
<?php
// Upload to private url or implement authorization...
if (isset($_GET["json"])) {
header("Content-type: application/json");
exit(json_encode( fpm_get_status() ));
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--