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
---
inc/helpers/formatting.php | 33 ++++++++++-----------------------
1 files changed, 10 insertions(+), 23 deletions(-)
diff --git a/inc/helpers/formatting.php b/inc/helpers/formatting.php
index ec0c40f..6f7f077 100644
--- a/inc/helpers/formatting.php
+++ b/inc/helpers/formatting.php
@@ -1,6 +1,7 @@
<?php
-use JVBase\managers\CacheManager;
+use JVBase\managers\Cache;
+use JVBase\utility\Image;
if (!defined('ABSPATH')) {
exit;
@@ -73,10 +74,9 @@
*/
function jvbFormatRating(int $ID, JVBase\meta\MetaManager|null $meta = null):string
{
- $cache = CacheManager::for('rating', WEEK_IN_SECONDS)->connectTo('post')->connectTo('term');
+ $cache = Cache::for('rating', WEEK_IN_SECONDS)->connect('post')->connect('taxonomy')->connect('user');
$cached = $cache->get($ID);
- $cached = false;
if ($cached) {
return $cached;
}
@@ -137,26 +137,8 @@
*/
function jvbImageData(int $imgID):array
{
- $cache = CacheManager::for('imageData', WEEK_IN_SECONDS)->connectTo('post');
- $cached = $cache->get($imgID);
- if ($cached) {
- return $cached;
- }
-
- if (!wp_get_attachment_image($imgID, 'tiny')) {
- return [];
- }
- $image = [
- 'tiny' => wp_get_attachment_image_src($imgID, 'tiny')[0],
- 'small' => wp_get_attachment_image_src($imgID, 'medium')[0],
- 'medium' => wp_get_attachment_image_src($imgID, 'large')[0],
- 'large' => wp_get_attachment_image_src($imgID, 'full')[0],
- 'image-alt-text'=> get_post_meta($imgID, '_wp_attachment_image_alt', true),
- 'image-title' => get_the_title($imgID),
- 'image-caption' => get_the_excerpt($imgID),
- ];
- $cache->set($imgID, $image);
- return $image;
+ $image = new Image();
+ return $image->getImageData($imgID);
}
@@ -233,3 +215,8 @@
}
return 'tel:+1'.$phoneNumber;
}
+
+function jvbFormatString(string $string):string
+{
+ return html_entity_decode($string);
+}
--
Gitblit v1.10.0