From b38f03c0e7218762d90fa5092696b127f24f36db Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sun, 25 Jan 2026 07:07:26 +0000
Subject: [PATCH] =Some logical flaws in Queue.php, Queue.js, ContentExecutor.php, UploadExecutor.php - particularly with timeline ordering, frontend queue updates, etc

---
 checks.php |   47 +++++++++++++++++++++++------------------------
 1 files changed, 23 insertions(+), 24 deletions(-)

diff --git a/checks.php b/checks.php
index 3c6ee74..86c7526 100644
--- a/checks.php
+++ b/checks.php
@@ -1,6 +1,6 @@
 <?php
 
-use JVBase\managers\CacheManager;
+use JVBase\managers\Cache;
 use JVBase\utility\Features;
 
 if (!defined('ABSPATH')) {
@@ -261,27 +261,26 @@
 
 function jvbTermHasPosts(int $termID, string $taxonomy):bool
 {
-	$cache = CacheManager::for('terms', 30*60)->connectTo('taxonomy');
-	$key = $termID.$taxonomy;
-	$cached = $cache->get($key);
-	if ($cached) {
-		return ($cached === 'true');
-	}
-	$taxonomy = jvbCheckBase($taxonomy);
-	$tax = get_taxonomy($taxonomy);
-	$query = new WP_Query([
-		'post_type'	=> $tax->object_type,
-		'posts_per_page'	=> 1,
-		'fields'	=> 'id',
-		'tax_query'	=> [
-			[
-				'taxonomy'	=> $taxonomy,
-				'terms'	=> $termID
-			]
-		]
-	]);
-	$result = ($query->have_posts()) ? 'true': 'false';
-	wp_reset_postdata();
-	$cache->set($key, $result);
-	return $result === 'true';
+	$cache = Cache::for('termUtility', 30*60)->connect('taxonomy');
+	return $cache->remember(
+		$termID,
+		function() use($taxonomy, $termID) {
+			$taxonomy = jvbCheckBase($taxonomy);
+			$tax = get_taxonomy($taxonomy);
+			$query = new WP_Query([
+				'post_type'	=> $tax->object_type,
+				'posts_per_page' => 1,
+				'fields' => 'ids',
+				'tax_query'	=> [
+					[
+						'taxonomy' => $taxonomy,
+						'terms'	=> $termID
+					]
+				]
+			]);
+			$result = ($query->have_posts()) ? 'true' : 'false';
+			wp_reset_postdata();
+			return $result;
+		}
+	);
 }

--
Gitblit v1.10.0