Diagnostic Report: Personalized Award Certificates
Configuration File
Check
Status
$value): ?>
Database
Check
Status
Database Connection
Database Tables
Table Name
Status
$exists): ?>
Dependencies
Type
Check
Status
$value): ?>
PHP
$value): ?>
System
$value): ?>
Python
Tool-Specific Checks
Check
Status
$value): ?>
FILE 5: /home/personalized-award-certificates.digitalprank.com/public_html/help.md
code
Markdown
# Help: Custom Award Certificate Generator
Design and download custom award certificates for pranks, jokes, or lighthearted recognition. Choose from stylish templates, enter names and titles, and instantly get a downloadable award.
## Quick Start Guide
Here’s how to create your award in under a minute:
1. **Step 1:** Enter the recipient's name and the title of the award. Make it as funny or serious as you like!
2. **Step 2:** Pick a certificate style from the dropdown menu. Pro users have access to exclusive designs. You can also add optional details like the presenter's name and the date.
3. **Step 3:** Click the 'Generate Certificate' button.
4. **Step 4:** Your certificate will appear on the screen. Click the 'Download' button to save it to your device and share your masterpiece!
## Features
* **Multiple Templates:** Choose from a variety of styles, from classic and professional to modern and hilarious.
* **Easy Customization:** Quickly add a recipient, award title, presenter, and date.
* **Instant Download:** Get your generated certificate immediately in PNG format.
* **Pro Features:** Upgrade to a Pro account to unlock exclusive templates, PDF downloads for high-quality printing, and the ability to upload your own signature and logo for a truly custom touch.
## Frequently Asked Questions (FAQ)
**Q: Can I print these certificates?**
A: Absolutely! They're high-resolution and print-ready. For best results, Pro users can download in PDF format, which is ideal for printing.
**Q: Can I use my own logo?**
A: Yes, Pro users can upload a custom logo or seal. This is perfect for creating awards that look like they came from a real organization or for adding a personal touch.
## Usage Examples
### Example 1: Most Likely to Be Late
A lighthearted office gag award perfect for a coworker who is always running a few minutes behind.
* **Description:** A perfect gag for office parties or team-building events.
* **Input:**
* Recipient Name: `Jason Reynolds`
* Award Title: `Most Likely to Show Up Late and Blame Traffic`
* Certificate Style: `Funny Cartoon Style`
### Example 2: World’s Best Cat Dad
A sweet and funny gift for a friend or family member who adores their pet.
* **Description:** A perfect gift for pet lovers on their birthday, Father's Day, or just for fun.
* **Input:**
* Recipient Name: `Alex Moreno`
* Award Title: `World's Best Cat Dad`
* Certificate Style: `Classic Gold Frame`
FILE 6: /home/digitalprank.com/public_html/blog/data/tools/personalized-award-certificates.json
code
JSON
{
"@context": "https://schema.org",
"@type": "WebApplication",
"name": "Custom Award Certificate Generator",
"description": "Create and download hilarious, realistic-looking custom award certificates for pranks, gags, and fun. Fully customizable with templates, text, and pro features like custom logos.",
"applicationCategory": "EntertainmentApplication",
"operatingSystem": "Any (Web-based)",
"url": "https://personalized-award-certificates.digitalprank.com",
"screenshot": "https://cdn.digitalprank.com/images/screenshots/personalized-award-certificates.jpg",
"offers": {
"@type": "Offer",
"price": "0.00",
"priceCurrency": "USD",
"category": "free"
},
"additionalProperty": [
{
"@type": "PropertyValue",
"name": "Pro Features",
"value": [
"High-Quality PDF Downloads",
"Exclusive Certificate Templates (Elegant Scroll, Dark Mode)",
"Upload Custom Signature Image",
"Upload Custom Logo or Seal"
]
}
],
"featureList": [
"Multiple free certificate templates (Classic, Modern, Funny)",
"Customizable Recipient Name and Award Title",
"Optional fields for 'Presented By' and Date",
"Instant PNG download",
"Print-ready high resolution output",
"User-friendly interface",
"Mobile and desktop compatible"
],
"potentialAction": {
"@type": "CreateAction",
"description": "Generate a new custom award certificate."
},
"mainEntity": {
"@type": "WebAPI",
"name": "Custom Award Certificate API",
"description": "API for programmatic generation of certificates (Ultimate Plan only).",
"documentation": "https://docs.digitalprank.com/api/personalized-award-certificates"
},
"publisher": {
"@type": "Organization",
"name": "DigitalPrank.com",
"url": "https://wp.digitalprank.com"
},
"keywords": "custom certificate, award generator, funny awards, joke certificate, digital prank, prank generator, custom award",
"detailedDescription": {
"articleBody": "The Custom Award Certificate Generator is a premier online tool for creating convincing and humorous awards for any occasion. Whether you're planning an office party, a family roast, or just want to pull a clever prank, this tool lets you design a professional-looking certificate in seconds. Users can choose from several free templates, including a classic gold-framed design, a modern blue-bordered style, and a whimsical cartoon theme. Customization is simple: just type in the recipient's name and the made-up achievement. For users seeking advanced capabilities, the Pro version unlocks premium templates, allows for high-resolution PDF downloads perfect for printing, and enables the uploading of custom images for signatures and logos, adding a new level of authenticity to your prank."
},
"userGuide": {
"@type": "HowTo",
"name": "How to Create a Custom Award Certificate",
"step": [
{
"@type": "HowToStep",
"name": "Enter Details",
"text": "Fill in the 'Recipient Name' and 'Award Title' fields on the form. These are the most important parts of your certificate."
},
{
"@type": "HowToStep",
"name": "Customize Style",
"text": "Select your desired look from the 'Certificate Style' dropdown. Optionally, you can add a presenter's name and a specific date."
},
{
"@type": "HowToStep",
"name": "Upload (Pro Users)",
"text": "If you have a Pro account, you can upload a PNG image of a signature or a custom logo to make the certificate even more unique."
},
{
"@type": "HowToStep",
"name": "Generate and Download",
"text": "Click the 'Generate Certificate' button. Your award will be displayed instantly. Click the 'Download' button to save the file to your computer or mobile device."
}
]
}
}
```### FILE 7: /home/personalized-award-certificates.digitalprank.com/public_html/deploy.sh
```bash
#!/bin/bash
set -e
# --- Configuration ---
TOOL_SLUG="personalized-award-certificates"
TOOL_DIR="/home/${TOOL_SLUG}.digitalprank.com/public_html"
VHOST_CONF_DIR="/usr/local/lsws/conf/vhosts"
DB_NAME="digitalprank_db"
DB_USER="dp_user"
DB_PASS="#$Dealer2355"
PHP_VERSION="8.1" # Adjust if necessary
echo "--- Starting deployment for ${TOOL_SLUG} ---"
# 1. System Package Installation
echo "Updating package lists..."
apt-get update -y
echo "Installing required system packages: imagemagick, ghostscript..."
apt-get install -y imagemagick ghostscript
# 2. PHP Extension Installation
echo "Installing PHP extensions: gd, mbstring, json, imagick..."
apt-get install -y php${PHP_VERSION}-gd php${PHP_VERSION}-mbstring php${PHP_VERSION}-imagick
# 3. Python Virtual Environment and Package Installation
if [ -f "${TOOL_DIR}/tool_config.json" ] && [ $(jq '.tool.dependencies.python_packages | length' "${TOOL_DIR}/tool_config.json") -gt 0 ]; then
echo "Setting up Python virtual environment..."
python3 -m venv "${TOOL_DIR}/venv"
echo "Activating virtual environment and installing packages..."
source "${TOOL_DIR}/venv/bin/activate"
pip install --upgrade pip
pip install reportlab pillow
deactivate
echo "Python environment setup complete."
else
echo "No Python packages required, skipping venv setup."
fi
# 4. Directory Structure and Permissions
echo "Creating required directories..."
mkdir -p "${TOOL_DIR}/assets/templates"
mkdir -p "${TOOL_DIR}/output"
echo "Setting permissions for ${TOOL_DIR}..."
chown -R www-data:www-data "${TOOL_DIR}"
chmod -R 755 "${TOOL_DIR}"
chmod 775 "${TOOL_DIR}/output" # Ensure www-data can write here
echo "NOTE: Manually add template PNG files to ${TOOL_DIR}/assets/templates/"
# 5. Database Table Creation
echo "Creating tool-specific database table 'award_certificate_history'..."
SQL_CREATE_TABLE="CREATE TABLE IF NOT EXISTS \`award_certificate_history\` (
\`id\` BIGINT PRIMARY KEY AUTO_INCREMENT,
\`user_id\` BIGINT NOT NULL,
\`recipient_name\` VARCHAR(100) NOT NULL,
\`award_title\` VARCHAR(255) NOT NULL,
\`issuer_name\` VARCHAR(100),
\`award_date\` DATE,
\`template_style\` VARCHAR(50) NOT NULL,
\`file_path\` VARCHAR(512) NOT NULL,
\`download_format\` VARCHAR(10) NOT NULL,
\`created_at\` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
INDEX \`user_id_idx\` (\`user_id\`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"
mysql -u"${DB_USER}" -p"${DB_PASS}" -hlocalhost "${DB_NAME}" -e"${SQL_CREATE_TABLE}"
echo "Database table check/creation complete."
# 6. OpenLiteSpeed Virtual Host Configuration
VHOST_CONF_PATH="${VHOST_CONF_DIR}/${TOOL_SLUG}.conf"
echo "Creating OpenLiteSpeed virtual host configuration at ${VHOST_CONF_PATH}..."
cat > "${VHOST_CONF_PATH}" << EOF
docRoot \$SERVER_ROOT/${TOOL_SLUG}/public_html/
vhDomain ${TOOL_SLUG}.digitalprank.com
vhAliases www.${TOOL_SLUG}.digitalprank.com
adminEmails admin@digitalprank.com
enableGzip 1
errorlog \$SERVER_ROOT/logs/\$VH_NAME.error.log {
useServer 0
logLevel ERROR
rollingSize 10M
}
accesslog \$SERVER_ROOT/logs/\$VH_NAME.access.log {
useServer 0
logFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
rollingSize 10M
keepDays 10
compressArchive 1
}
extprocessor php {
type lsapi
address uds://tmp/lshttpd/php.sock
maxConns 35
env PHP_LSAPI_CHILDREN=35
initTimeout 60
retryTimeout 0
persistConn 1
respBuffer 0
autoStart 1
path /usr/local/lsws/lsphp${PHP_VERSION//.}/bin/lsphp
backlog 100
instances 1
}
scripthandler {
add lsapi:php .php
}
rewrite {
enable 1
autoLoadHtaccess 1
}
vhssl {
keyFile /etc/letsencrypt/live/digitalprank.com/privkey.pem
certFile /etc/letsencrypt/live/digitalprank.com/fullchain.pem
certChain 1
sslProtocol 24
ciphers EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
}
EOF
echo "Virtual host configuration created."
# 7. Log Rotation
LOGROTATE_CONF="/etc/logrotate.d/${TOOL_SLUG}"
echo "Setting up log rotation at ${LOGROTATE_CONF}"
cat > "${LOGROTATE_CONF}" << EOF
/usr/local/lsws/logs/${TOOL_SLUG}.*.log {
daily
missingok
rotate 14
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
postrotate
/usr/local/lsws/bin/lswsctrl restart
endscript
}
EOF
echo "Log rotation configured."
# 8. Service Restart and Health Check
echo "Restarting OpenLiteSpeed to apply changes..."
/usr/local/lsws/bin/lswsctrl restart
echo "Waiting for service to come online..."
sleep 5
echo "Performing health check..."
if curl -s --head "https://${TOOL_SLUG}.digitalprank.com" | head -n 1 | grep "HTTP/1.[1|2|3] [23].." > /dev/null; then
echo "Health check PASSED. Site is online."
else
echo "Health check FAILED. Please check OpenLiteSpeed logs."
exit 1
fi
echo "--- Deployment for ${TOOL_SLUG} completed successfully! ---"
Google Search Suggestions
Display of Search Suggestions is required when using Grounding with Google Search. Learn more
Google logo
Model
ThinkingThoughts
(experimental)
Auto
Expand to view model thoughts
chevron_right
FILE 8: /home/personalized-award-certificates.digitalprank.com/public_html/assets/templates/README.md
code
Markdown
# Certificate Templates
This directory should contain the base image templates for the certificate generator. The filenames must correspond to the `value` properties in the `template_style` field options within `tool_config.json`.
## Required Files
- `classic_gold.png`
- `modern_blue.png`
- `funny_cartoon.png`
- `elegant_scroll.png` (Pro)
- `dark_mode.png` (Pro)
## Image Specifications
- **Format:** PNG (for best quality with transparency if needed)
- **Recommended Dimensions:** 1200px width x 849px height (A4 paper ratio)
- **Resolution:** 150 DPI or higher is recommended for good print quality.
The `processor.php` script relies on these exact filenames. Ensure they are present before deploying the tool.
Model
ThinkingThoughts
(experimental)
Auto
Expand to view model thoughts
chevron_right
An internal error has occurred.
Model
ThinkingThoughts
(experimental)
Auto
Expand to view model thoughts
chevron_right
FILE 9: /home/cdn.digitalprank.com/public_html/php/universal_functions.php
code
PHP
'free',
'has_pro_access' => false,
'plan_id' => null
];
if ($user_id === 0) {
return $access;
}
try {
// Check for an active subscription in Paid Member Subscriptions
$stmt = $pdo->prepare(
"SELECT subscription_plan_id FROM wp_pms_member_subscriptions
WHERE user_id = ? AND status = 'active'
ORDER BY subscription_plan_id DESC LIMIT 1"
);
$stmt->execute([$user_id]);
$subscription = $stmt->fetch(PDO::FETCH_ASSOC);
if ($subscription) {
$plan_id = (int)$subscription['subscription_plan_id'];
$access['plan_id'] = $plan_id;
// Basic Tier IDs: 174, 184
if (in_array($plan_id, [174, 184])) {
$access['tier'] = 'basic';
$access['has_pro_access'] = true;
}
// Gold Tier IDs: 175, 185
elseif (in_array($plan_id, [175, 185])) {
$access['tier'] = 'gold';
$access['has_pro_access'] = true;
}
// Ultimate Tier IDs: 176, 186
elseif (in_array($plan_id, [176, 186])) {
$access['tier'] = 'ultimate';
$access['has_pro_access'] = true;
}
}
} catch (PDOException $e) {
// Log error, but don't break execution. Default to free tier.
error_log("PDO Exception in getUserAccessLevel: " . $e->getMessage());
}
return $access;
}
/**
* Gets the number of times a tool has been used today by a user or IP.
*
* @param PDO $pdo The database connection object.
* @param string $tool_slug The tool's slug.
* @param string $user_ip The user's IP address.
* @param int $user_id The user's ID (0 for guest).
* @return int The total usage count for the current day.
*/
function getTodaysUsage(PDO $pdo, string $tool_slug, string $user_ip, int $user_id): int
{
try {
if ($user_id > 0) {
// Logged-in users are tracked by user_id
$sql = "SELECT COUNT(*) FROM wp_digitalprank_usage WHERE user_id = ? AND tool_slug = ? AND DATE(timestamp) = CURDATE() AND credits_used > 0";
$stmt = $pdo->prepare($sql);
$stmt->execute([$user_id, $tool_slug]);
} else {
// Guests are tracked by IP address
$sql = "SELECT COUNT(*) FROM wp_digitalprank_usage WHERE ip_address = ? AND user_id = 0 AND tool_slug = ? AND DATE(timestamp) = CURDATE() AND credits_used > 0";
$stmt = $pdo->prepare($sql);
$stmt->execute([$user_ip, $tool_slug]);
}
return (int)$stmt->fetchColumn();
} catch (PDOException $e) {
error_log("PDO Exception in getTodaysUsage: " . $e->getMessage());
return 9999; // Return a high number to prevent further use on error
}
}
/**
* Checks if the user is within their daily usage limit.
*
* @param PDO $pdo The database connection object.
* @param string $tool_slug The tool's slug.
* @param string $user_ip The user's IP address.
* @param int $user_id The user's ID (0 for guest).
* @param int $limit The daily limit for the user's tier (-1 for unlimited).
* @return bool True if usage is allowed, false otherwise.
*/
function checkDailyUsage(PDO $pdo, string $tool_slug, string $user_ip, int $user_id, int $limit): bool
{
if ($limit === -1) {
return true; // Unlimited usage
}
$todays_usage = getTodaysUsage($pdo, $tool_slug, $user_ip, $user_id);
return $todays_usage < $limit;
}
/**
* Logs a tool usage event to the database.
*
* @param PDO $pdo The database connection object.
* @param string $tool_slug The tool's slug.
* @param string $user_ip The user's IP address.
* @param int $user_id The user's ID (0 for guest).
* @param string $action_type The type of action (e.g., 'success', 'failed').
* @param string|null $input_data JSON encoded input data.
* @param string|null $output_data JSON encoded output data.
* @param float $processing_time The script execution time in seconds.
* @param int $credits_used The number of credits this action consumed.
* @return void
*/
function logUsage(PDO $pdo, string $tool_slug, string $user_ip, int $user_id, string $action_type, ?string $input_data, ?string $output_data, float $processing_time, int $credits_used = 0): void
{
try {
$pdo->beginTransaction();
$sql_log = "INSERT INTO wp_digitalprank_usage_log (user_id, tool_slug, action_type, ip_address, session_id, user_agent, input_data, output_data, processing_time, status) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
$stmt_log = $pdo->prepare($sql_log);
$status = ($action_type === 'success') ? 'success' : 'failed';
$stmt_log->execute([
$user_id,
$tool_slug,
$action_type,
$user_ip,
session_id(),
$_SERVER['HTTP_USER_AGENT'] ?? 'N/A',
$input_data,
$output_data,
$processing_time,
$status
]);
$sql_usage = "INSERT INTO wp_digitalprank_usage (user_id, tool_slug, action, credits_used, processing_time, ip_address, session_id, user_agent) VALUES (?, ?, ?, ?, ?, ?, ?, ?)";
$stmt_usage = $pdo->prepare($sql_usage);
$stmt_usage->execute([
$user_id,
$tool_slug,
$action_type,
$credits_used,
$processing_time,
$user_ip,
session_id(),
$_SERVER['HTTP_USER_AGENT'] ?? 'N/A'
]);
$pdo->commit();
} catch (PDOException $e) {
if ($pdo->inTransaction()) {
$pdo->rollBack();
}
error_log("PDO Exception in logUsage: " . $e->getMessage());
}
}
/**
* Retrieves field-specific tier overrides for a tool.
*
* @param PDO $pdo The database connection object.
* @param string $tool_slug The slug of the tool.
* @return array An associative array of field_id => tier_required.
*/
function getToolOverrides(PDO $pdo, string $tool_slug): array
{
$overrides = [];
try {
$stmt = $pdo->prepare(
"SELECT t.field_id, t.tier_required FROM wp_digitalprank_tool_overrides t
JOIN wp_digitalprank_tools tl ON t.tool_id = tl.tool_id
WHERE tl.slug = ? AND t.is_active = 1 AND t.override_type = 'tier'"
);
$stmt->execute([$tool_slug]);
$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
foreach ($results as $row) {
$overrides[$row['field_id']] = $row['tier_required'];
}
} catch (PDOException $e) {
error_log("PDO Exception in getToolOverrides: " . $e->getMessage());
}
return $overrides;
}
?>
FILE 10: /home/personalized-award-certificates.digitalprank.com/public_html/assets/css/style.css
code
CSS
/* --- Universal Tool Form Styles --- */
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
line-height: 1.6;
color: #333;
max-width: 800px;
margin: 20px auto;
padding: 0 15px;
background-color: #f9f9f9;
}
.container {
background-color: #ffffff;
padding: 25px 30px;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
h1 {
text-align: center;
color: #0077CC; /* From JSON ui.theme.primary_color */
margin-bottom: 5px;
}
p.tagline {
text-align: center;
color: #555;
margin-top: 0;
margin-bottom: 30px;
}
/* --- Form Group Styling --- */
.form-group {
margin-bottom: 22px;
}
.form-group label {
display: block;
margin-bottom: 8px;
font-weight: bold;
color: #444;
}
.form-group input[type="text"],
.form-group input[type="date"],
.form-group select {
width: 100%;
padding: 12px;
border: 1px solid #ccc;
border-radius: 5px;
box-sizing: border-box;
transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input[type="text"]:focus,
.form-group input[type="date"]:focus,
.form-group select:focus {
outline: none;
border-color: #0077CC;
box-shadow: 0 0 0 2px rgba(0, 119, 204, 0.2);
}
.form-group input[type="file"] {
padding: 8px;
border: 1px solid #ccc;
border-radius: 5px;
width: 100%;
box-sizing: border-box;
}
.form-group .help-text {
font-size: 0.9em;
color: #777;
margin-top: 6px;
}
/* --- Badges and Indicators --- */
.pro-badge {
background-color: #ffd700;
color: #333;
font-size: 0.7em;
padding: 3px 6px;
border-radius: 4px;
margin-left: 8px;
font-weight: bold;
vertical-align: middle;
text-transform: uppercase;
}
/* --- Buttons --- */
button#submit-button {
background-color: #0077CC;
color: #ffffff;
padding: 14px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
width: 100%;
font-size: 1.1em;
font-weight: bold;
transition: background-color 0.2s;
}
button#submit-button:hover {
background-color: #005fa3;
}
button#submit-button:disabled {
background-color: #cccccc;
cursor: not-allowed;
}
/* --- Results and Feedback --- */
.feedback-container {
margin-top: 25px;
text-align: center;
}
.hidden {
display: none;
}
#loading-indicator {
font-weight: bold;
color: #0077CC;
}
#error-message {
color: #d9534f;
background-color: #f2dede;
padding: 12px;
border: 1px solid #ebccd1;
border-radius: 4px;
}
#result-container {
margin-top: 30px;
text-align: center;
border-top: 1px solid #eeeeee;
padding-top: 25px;
}
#result-container h2 {
color: #333;
margin-bottom: 20px;
}
#result-image {
max-width: 100%;
border: 1px solid #dddddd;
border-radius: 4px;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
a.download-button {
display: inline-block;
margin-top: 20px;
padding: 12px 25px;
background-color: #28a745;
color: #ffffff;
text-decoration: none;
border-radius: 5px;
font-weight: bold;
transition: background-color 0.2s;
}
a.download-button:hover {
background-color: #218838;
}
FILE 3: /home/personalized-award-certificates.digitalprank.com/public_html/tool_form.php (REVISED)
code
PHP
- DigitalPrank