From 3d25ad7de4fdbb3eba2cde2a62422e6be5d79a0a Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Tue, 25 Aug 2026 22:57:22 +0000
Subject: [PATCH] =It's been a minute. I went through the Routes and associated Managers and ensured they played together well. Reworked the Cache.php, and I think I caught all the references. Moving away from JVBase() root class, to individuall classes that are Instanced. Double checked for the ABSPATH check in every file, and added index.php to every directory that didn't already have it. Also still working on the MenuBlock to work with WooCommerce for now for Northeh
---
inc/managers/OperationQueue.php | 40 ++++++++++++++++++++--------------------
1 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/inc/managers/OperationQueue.php b/inc/managers/OperationQueue.php
index 7ea6aaa..949e5c6 100644
--- a/inc/managers/OperationQueue.php
+++ b/inc/managers/OperationQueue.php
@@ -90,7 +90,7 @@
}
public function registerAdminAction():void
{
- $admin = JVB()->admin();
+ $admin = AdminPages::getInstance();
$admin->registerAction(
'Restart Stuck Operations',
'restart-stuck-operations',
@@ -1131,7 +1131,7 @@
$message .= "Please check the error logs for more details.";
- return JVB()->email()->sendEmail($admin_email, $subject, $message);
+ return Emails::getInstance()->sendEmail($admin_email, $subject, $message);
}
/**
@@ -1650,36 +1650,36 @@
$success_rate = round(($total_success / max(1, $total_ops)) * 100, 1);
- $message = JVB()->email()->h1('Daily Queue Performance Report');
+ $message = Emails::getInstance()->h1('Daily Queue Performance Report');
$message .= sprintf('<p>Report for <strong>%s</strong></p>', $yesterday);
// Summary stats in grid
$stats = [
- JVB()->email()->stat($total_ops, 'Operations'),
- JVB()->email()->stat($total_success, 'Successful', '✓'),
- JVB()->email()->stat($total_failed, 'Failed', $total_failed > 0 ? '⚠' : ''),
- JVB()->email()->stat($success_rate . '%', 'Success Rate')
+ Emails::getInstance()->stat($total_ops, 'Operations'),
+ Emails::getInstance()->stat($total_success, 'Successful', '✓'),
+ Emails::getInstance()->stat($total_failed, 'Failed', $total_failed > 0 ? '⚠' : ''),
+ Emails::getInstance()->stat($success_rate . '%', 'Success Rate')
];
- $message .= JVB()->email()->grid($stats, 4);
+ $message .= Emails::getInstance()->grid($stats, 4);
- $message .= JVB()->email()->spacer(20);
+ $message .= Emails::getInstance()->spacer(20);
// Alert if success rate is low
if ($success_rate < 90) {
- $message .= JVB()->email()->alert(
+ $message .= Emails::getInstance()->alert(
sprintf('Success rate of %s%% is below the 90%% threshold', $success_rate),
'warning'
);
}
- $message .= JVB()->email()->h2('Details by Operation Type');
+ $message .= Emails::getInstance()->h2('Details by Operation Type');
// Details for each operation type
foreach ($metrics as $metric) {
$details = [];
$details[] = ['label' => 'Total', 'value' => $metric->total_operations];
- $details[] = ['label' => 'Success', 'value' => JVB()->email()->badge($metric->successful_operations, 'success')];
- $details[] = ['label' => 'Failed', 'value' => $metric->failed_operations > 0 ? JVB()->email()->badge($metric->failed_operations, 'error') : '0'];
+ $details[] = ['label' => 'Success', 'value' => Emails::getInstance()->badge($metric->successful_operations, 'success')];
+ $details[] = ['label' => 'Failed', 'value' => $metric->failed_operations > 0 ? Emails::getInstance()->badge($metric->failed_operations, 'error') : '0'];
if ($metric->average_duration) {
$details[] = ['label' => 'Avg Duration', 'value' => round($metric->average_duration, 2) . 's'];
@@ -1692,8 +1692,8 @@
$details[] = ['label' => 'Peak Memory', 'value' => $memory_mb . ' MB'];
}
- $message .= JVB()->email()->card(
- JVB()->email()->table($details),
+ $message .= Emails::getInstance()->card(
+ Emails::getInstance()->table($details),
esc_html($metric->type)
);
}
@@ -1701,16 +1701,16 @@
// Current queue status
$pending_count = $this->getCurrentQueueSize();
if ($pending_count > 0) {
- $message .= JVB()->email()->spacer(20);
- $message .= JVB()->email()->notice(
+ $message .= Emails::getInstance()->spacer(20);
+ $message .= Emails::getInstance()->notice(
sprintf('<strong>Current Queue:</strong> %d operations pending', $pending_count)
);
}
- $message .= JVB()->email()->spacer(20);
- $message .= JVB()->email()->button(admin_url('admin.php?page=jvb-queue'), 'View Queue Dashboard');
+ $message .= Emails::getInstance()->spacer(20);
+ $message .= Emails::getInstance()->button(admin_url('admin.php?page=jvb-queue'), 'View Queue Dashboard');
- JVB()->email()->sendEmail($admin_email, $subject, $message, 'QUEUE REPORT');
+ Emails::getInstance()->sendEmail($admin_email, $subject, $message, 'QUEUE REPORT');
}
/**
--
Gitblit v1.10.0