From 3e4e3db64b366028845cfd610c5b17f26bd062ee Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sun, 06 Sep 2026 23:04:45 +0000
Subject: [PATCH] =Added conditional logic. Skeletoned a block to select a particular meta for display.

---
 inc/integrations/Integrations.php |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/inc/integrations/Integrations.php b/inc/integrations/Integrations.php
index 262f798..f2e8147 100644
--- a/inc/integrations/Integrations.php
+++ b/inc/integrations/Integrations.php
@@ -3,6 +3,7 @@
 
 use Exception;
 use JVBase\managers\Cache;
+use JVBase\managers\queue\Queue;
 use JVBase\managers\UploadManager;
 use JVBase\registrar\Registrar;
 use WP_Error;
@@ -177,7 +178,7 @@
 
 			return $this->response(false, 'Failed to save credentials to database');
 
-		} catch (\Exception $e) {
+		} catch (Exception $e) {
 			// Revert to old credentials on any error
 			$old = Auth::getInstance()->getCredentials(
 				$this->service_name,
@@ -338,7 +339,7 @@
 		array $data,
 		array $options = []
 	):bool {
-		$queue = JVB()->queue();
+		$queue = Queue::getInstance();
 
 		$queued =  $queue->queueOperation(
 			$type,
@@ -405,7 +406,7 @@
 				$this->addSavePost();
 			}
 
-			add_action('transition_post_status', [$this, 'handlePostStatusTransition'], 10, 3);
+//			add_action('transition_post_status', [$this, 'handlePostStatusTransition'], 10, 3);
 
 			if ($this->canSync['delete']) {
 				add_action('before_delete_post', [$this, 'handleDeletePost'], 10, 1);
@@ -476,7 +477,7 @@
 				'message' => 'Connection established successfully'
 			];
 
-		} catch (\Exception $e) {
+		} catch (Exception $e) {
 			return [
 				'success' => false,
 				'message' => 'Error: ' . $e->getMessage()
@@ -607,8 +608,8 @@
 		if ($jpegVersion !== '' && is_int($jpegVersion)) {
 			return $jpegVersion;
 		}
-		$uploader = new UploadManager();
-		$converted = $uploader->convertImageTo($imgID, 'jpeg', 80, false);
+		$uploader = UploadManager::getInstance();
+		$converted = $uploader->convertImageTo($imgID, 'jpeg');
 		if ($converted && !is_wp_error($converted)) {
 			update_post_meta($imgID, BASE . 'jpeg_version', $converted['attachment_id']);
 			return $converted['attachment_id'];
@@ -620,6 +621,7 @@
 
 	/**
 	 * Used by JVBase\registrar\helpers\AddIntegrationFields.php
+	 * @param string|null $content_type
 	 * @return array
 	 */
 	public function getAdditionalFields(?string $content_type = null):array

--
Gitblit v1.10.0