Skip to content

Instantly share code, notes, and snippets.

@cPFence
cPFence / wordpress-language-codes.csv
Created April 18, 2025 16:08 — forked from danielbachhuber/wordpress-language-codes.csv
Language / locale codes used in WordPress
language english_name native_name
af Afrikaans Afrikaans
ar Arabic العربية
ary Moroccan Arabic العربية المغربية
as Assamese অসমীয়া
az Azerbaijani Azərbaycan dili
azb South Azerbaijani گؤنئی آذربایجان
bel Belarusian Беларуская мова
bg_BG Bulgarian Български
bn_BD Bengali (Bangladesh) বাংলা
function enhance_ClientArea($params)
{
$systemUrl = Setting::getValue('SystemURL');
$webmailLink = 'https://webmail.example.com/';
$domain = $params['domain'];
$domainIP = gethostbyname($domain);
$serviceId = $params['serviceid'];
$buttonStyle = 'display: inline-block; padding: 10px 16px; margin: 4px 6px 10px 0; background-color: #0073e6; color: #fff; border: none; border-radius: 5px; font-size: 14px; cursor: pointer; text-decoration: none; transition: background-color 0.3s ease;';
$buttonHover = 'this.style.backgroundColor=\'#005bb5\'';
function enhance_ClientArea($params)
{
$systemUrl = Setting::getValue('SystemURL');
// Replace this link with your own master login webmail login link
$webmailLink = 'https://webmail.enhance.com/';
$domain = $params['domain'];
$domainIP = gethostbyname($domain);
$serviceId = $params['serviceid'];
$analyticsURL = "https://{$domain}/traffic-reports";
#!/bin/bash
# enhance_backup_sync.sh
#
# cPFence Team | https://cpfence.app
#
# Description:
# This script synchronizes the Enhance backup server's /backups directory with a remote server
# for disaster recovery (backup mode) or restores data from the remote server to the local server (restore mode).
#
# Usage:
@cPFence
cPFence / delete_old_backups
Created March 2, 2025 11:50
Delete Old Snapshot Backups in Enhance v12 ext4
# Dry-run version
DAYS=2
SECONDS_OLD=$((DAYS * 86400))
for site in /backups/*; do
[ -d "$site" ] || continue
current_snapshot=$(readlink "$site/current")
echo "Checking site: ${site##*/}"
find "$site" -maxdepth 1 -type d -name "snapshot-*" | while read -r snapshot; do
if [ "$snapshot" = "$current_snapshot" ]; then
## Steps To Test WordPress Database Malware Scanning in cPFence
1. Access the container of the test WP:
su - username
cd public_html/
2. Inject test malware into the database:
# Run the following command to add a test malware to wp_options table:
@cPFence
cPFence / Blacklist File Manager Plugins
Last active February 8, 2025 17:59
List of File Manager Plugins to Blacklist on Shared Hosting
wp-file-manager
file-manager-advanced
filester
filebird
file-manager
real-media-library-lite
wpide
folders
fileorganizer
media-library-organizer
@cPFence
cPFence / Enhance_btrfs_specific_sites_backup.sh
Created February 4, 2025 04:58
To back up only specific sites, add your target site IDs in the TARGET_SITES variable.
#!/bin/bash
################################################################################
# BTRFS Backup Script for Enhance Backup Server
#
# Overview:
# This script facilitates the efficient backup of website data stored on an
# Enhance Backup Server utilizing the BTRFS filesystem. It performs the
# following operations for each website directory:
# 1. Synchronizes the live state (`backup-subvolume`) to the destination server.
@cPFence
cPFence / Whmcs Module Enhancement
Created January 29, 2025 20:08
Whmcs Module Enhancement
function enhance_ClientArea($params)
{
$systemurl = Setting::getValue('SystemURL');
$webmailLink = 'https://webmail.enhance.com/';
// Fetch domain IP
$domain = $params['domain'];
$domainIP = gethostbyname($domain);
#!/bin/bash
#
# Written by: cPFence Team / https://cpfence.app/
#
#
# Description:
# This script is designed to work with the Enhance Control Panel to ensure
# that custom OpenLiteSpeed (OLS) configurations persist across vhost rebuilds.
# Using a simple freeze/unfreeze mechanism, it allows administrators to lock
# their custom configurations and prevent them from being overwritten by the