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

---
 checks.php |   74 +++++++++++--------------------------
 1 files changed, 22 insertions(+), 52 deletions(-)

diff --git a/checks.php b/checks.php
index d92ef49..242bf4c 100644
--- a/checks.php
+++ b/checks.php
@@ -1,5 +1,6 @@
 <?php
 
+use JVBase\base\Options;
 use JVBase\base\Site;
 use JVBase\managers\Cache;
 use JVBase\registrar\Registrar;
@@ -12,59 +13,24 @@
     return (array_key_exists($key, $config) && $config[$key] === true);
 }
 
-function jvbUserIsVerified():bool
-{
-	$membership = Site::membership();
-
-    return !($membership && $membership->has('member_verified')) || current_user_can('skip_moderation');
-}
-
 function jvbUserTypes():array
 {
-	$types = get_option(BASE.'user_types');
-	if (JVB_TESTING) {
-		$types = false;
-	}
-	if ($types === false) {
-		$types = [];
-		foreach (JVB_USER as $type => $config) {
-			if (array_key_exists('profile', $config)) {
-				$types[$type] = BASE.$config['profile'];
-			}
-		}
-		update_option(BASE.'user_types', $types);
-	}
-	return $types;
+	return  Registrar::withFeature('profile_link', 'user');
 }
 
-function isJVBContentTax():bool
-{
-	return is_tax(array_map(function ($tax) {
-		return jvbCheckBase($tax);
-	}, Registrar::getFeatured('is_content', 'term')));
-}
 
-function taxIsJVBContentTax($tax):bool
-{
-	$allowed = Registrar::getFeatured('is_content', 'term');
-	$tax = jvbNoBase($tax);
-	return in_array($tax, $allowed);
-}
 
 function jvbIsOpen():bool
 {
-
-	if (!jvbCheck('limit_hours', JVB_SITE)) {
+	if (!Site::has('limit_hours')) {
 		return true;
 	}
-	if (get_option(BASE.'open_to_public') !== '1') {
+	if (Options::get('open_to_public') !== '1') {
 		return false;
 	}
-	//Check if today_hours is set
-	if (get_option(BASE.'today_hours')) {
+	if (!empty(Options::get('today_hours'))) {
 		return jvbIsTimeBetween();
 	}
-	//Default to the stored settings
 	return jvbIsCurrentlyOpen();
 }
 
@@ -77,20 +43,24 @@
 		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
+			if ($tax) {
+				$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;
+				]);
+				$result = ($query->have_posts()) ? 'true' : 'false';
+				wp_reset_postdata();
+				return $result;
+
+			}
+			return 'false';
 		}
 	);
 }

--
Gitblit v1.10.0