From d7dbe7fee362d587dfc334135d9581b6216a4295 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sun, 23 Nov 2025 04:13:56 +0000
Subject: [PATCH] =Timeline block, and feed block updated. DataStore.js refactored to not block rendering

---
 inc/integrations/GoogleMyBusiness.php |   41 ++++++++++++++++++++++-------------------
 1 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/inc/integrations/GoogleMyBusiness.php b/inc/integrations/GoogleMyBusiness.php
index f6541cc..e42e0b3 100644
--- a/inc/integrations/GoogleMyBusiness.php
+++ b/inc/integrations/GoogleMyBusiness.php
@@ -10,9 +10,12 @@
 
 class GoogleMyBusiness extends Integrations
 {
-	private string $access_token;
+	private ?string $access_token = null;
 	protected string $readMask = 'name,title,storefrontAddress,metadata,openInfo,storeCode,categories,phoneNumbers,labels,specialHours';
 	private ?string $location = null;
+	private ?string $refresh_token = null;
+	private ?string $client_id = null;
+	private ?string $client_secret = null;
 	private ?string $account_id = null;
 
 	public function __construct(?int $userID = null)
@@ -82,18 +85,18 @@
 				'label'	=> 'OAuth Client Secret',
 				'required'	=> true,
 			],
-			'access_token'	=> [
-				'type'	=> 'text',
-				'subtype'	=> 'password',
-				'label'	=> 'Access Token',
-				'hint'	=> 'Generated automagically after OAuth authorization.'
-			],
-			'refresh_token'	=> [
-				'type'	=> 'text',
-				'subtype'	=> 'password',
-				'label'	=> 'Refresh Token',
-				'hint'	=> 'Generated automagically after OAuth authorization.'
-			]
+//			'access_token'	=> [
+//				'type'	=> 'text',
+//				'subtype'	=> 'password',
+//				'label'	=> 'Access Token',
+//				'hint'	=> 'Generated automagically after OAuth authorization.'
+//			],
+//			'refresh_token'	=> [
+//				'type'	=> 'text',
+//				'subtype'	=> 'password',
+//				'label'	=> 'Refresh Token',
+//				'hint'	=> 'Generated automagically after OAuth authorization.'
+//			]
 		];
 
 		$this->advanced = [
@@ -134,12 +137,12 @@
 		if (empty($this->credentials)) {
 			$this->loadCredentials();
 		}
-		$this->access_token = $this->credentials['access_token'] ?? '';
-		$this->refresh_token = $this->credentials['refresh_token'] ?? '';
-		$this->client_id = $this->credentials['client_id'] ?? '';
-		$this->client_secret = $this->credentials['client_secret'] ?? '';
-		$this->location = $this->credentials['location'] ?? null;
-		$this->account_id = $this->credentials['account'] ?? null;
+		$this->access_token = (array_key_exists('access_token', $this->credentials)) ? $this->credentials['access_token'] : null;
+		$this->refresh_token = (array_key_exists('refresh_token', $this->credentials)) ? $this->credentials['refresh_token'] : null;
+		$this->client_id = (array_key_exists('client_id', $this->credentials)) ? $this->credentials['client_id'] : null;
+		$this->client_secret = (array_key_exists('client_secret', $this->credentials)) ? $this->credentials['client_secret'] : null;
+		$this->location = (array_key_exists('location', $this->credentials)) ? $this->credentials['location'] : null;
+		$this->account_id = (array_key_exists('account', $this->credentials)) ? $this->credentials['account'] : null;
 
 		if ($this->account_id) {
 			$this->apiEndpoints[] = "/v1/{$this->account_id}/locations";

--
Gitblit v1.10.0