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/rest/routes/VoteRoutes.php |   18 ++++--------------
 1 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/inc/rest/routes/VoteRoutes.php b/inc/rest/routes/VoteRoutes.php
index 528cc2d..eafe526 100644
--- a/inc/rest/routes/VoteRoutes.php
+++ b/inc/rest/routes/VoteRoutes.php
@@ -1,7 +1,7 @@
 <?php
 namespace JVBase\rest\routes;
 
-use JVBase\managers\CustomTable;
+use JVBase\Instance;
 use JVBase\managers\KarmaManager;
 use JVBase\registrar\Registrar;
 use JVBase\rest\Response;
@@ -9,14 +9,13 @@
 use JVBase\rest\Route;
 use WP_REST_Request;
 use WP_REST_Response;
-use WP_Error;
-use Exception;
 
 if (!defined('ABSPATH')) {
     exit; // Exit if accessed directly
 }
 class VoteRoutes extends Rest
 {
+	use Instance;
     public function __construct()
     {
         $this->cacheName = 'karma';
@@ -77,7 +76,7 @@
 		}
 
 
-		$man = KarmaManager::getInstance($type);
+		$man = $registrar->getKarmaManager();
 		if (!$man) {
 			return Response::validationError(['message' => __('Karma not set up', 'jvb')]);
 		}
@@ -104,15 +103,6 @@
 			return $this->unauthorized();
 		}
 
-		$cache = $this->cache->get($user);
-		if ($cache) {
-			return Response::success($cache);
-		}
-
-		$votes = KarmaManager::getUserVotes($user);
-
-		$this->cache->set($user, $votes);
-
-		return Response::success($votes);
+		return Response::success(KarmaManager::getUserVotes($user));
 	}
 }

--
Gitblit v1.10.0