From 7a9054bb3f033c98067b3196378311dae54c5fbf Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Tue, 20 Jan 2026 01:31:53 +0000
Subject: [PATCH] =OperationQueue refactor to the JVBase/managers/queue namespace

---
 inc/managers/UmamiMetrics.php |   98 ++++++++++++++++++++++++-------------------------
 1 files changed, 48 insertions(+), 50 deletions(-)

diff --git a/inc/managers/UmamiMetrics.php b/inc/managers/UmamiMetrics.php
index 5330133..d88df16 100644
--- a/inc/managers/UmamiMetrics.php
+++ b/inc/managers/UmamiMetrics.php
@@ -1516,56 +1516,54 @@
         $month_data = $this->getUserMetrics($user_id, $month_start, $today);
 
         // Build quick summary for dashboard
-        $summary = [
-            'today' => [
-                'total_views' => $today_data['totals']['total_views'],
-                'profile_views' => $today_data['totals']['profile_views'],
-                'favourites' => $today_data['totals']['favourites'],
-                'karma' => $today_data['totals']['karma']
-            ],
-            'yesterday' => [
-                'total_views' => $yesterday_data['totals']['total_views'],
-                'profile_views' => $yesterday_data['totals']['profile_views'],
-                'favourites' => $yesterday_data['totals']['favourites'],
-                'karma' => $yesterday_data['totals']['karma']
-            ],
-            'this_week' => [
-                'total_views' => $week_data['totals']['total_views'],
-                'profile_views' => $week_data['totals']['profile_views'],
-                'favourites' => $week_data['totals']['favourites'],
-                'karma' => $week_data['totals']['karma']
-            ],
-            'this_month' => [
-                'total_views' => $month_data['totals']['total_views'],
-                'profile_views' => $month_data['totals']['profile_views'],
-                'favourites' => $month_data['totals']['favourites'],
-                'karma' => $month_data['totals']['karma']
-            ],
-            'growth' => [
-                'day_over_day' => [
-                    'total_views' => $this->calculatePercentageChange(
-                        $yesterday_data['totals']['total_views'],
-                        $today_data['totals']['total_views']
-                    ),
-                    'profile_views' => $this->calculatePercentageChange(
-                        $yesterday_data['totals']['profile_views'],
-                        $today_data['totals']['profile_views']
-                    ),
-                    'favourites' => $this->calculatePercentageChange(
-                        $yesterday_data['totals']['favourites'],
-                        $today_data['totals']['favourites']
-                    ),
-                    'karma' => $this->calculateAbsoluteChange(
-                        $yesterday_data['totals']['karma'],
-                        $today_data['totals']['karma']
-                    )
-                ]
-            ],
-            'top_content' => $this->simplifyTopContent($week_data['top_content']),
-            'sources' => $week_data['source_breakdown']
-        ];
-
-        return $summary;
+		return [
+			'today' => [
+				'total_views' => $today_data['totals']['total_views'],
+				'profile_views' => $today_data['totals']['profile_views'],
+				'favourites' => $today_data['totals']['favourites'],
+				'karma' => $today_data['totals']['karma']
+			],
+			'yesterday' => [
+				'total_views' => $yesterday_data['totals']['total_views'],
+				'profile_views' => $yesterday_data['totals']['profile_views'],
+				'favourites' => $yesterday_data['totals']['favourites'],
+				'karma' => $yesterday_data['totals']['karma']
+			],
+			'this_week' => [
+				'total_views' => $week_data['totals']['total_views'],
+				'profile_views' => $week_data['totals']['profile_views'],
+				'favourites' => $week_data['totals']['favourites'],
+				'karma' => $week_data['totals']['karma']
+			],
+			'this_month' => [
+				'total_views' => $month_data['totals']['total_views'],
+				'profile_views' => $month_data['totals']['profile_views'],
+				'favourites' => $month_data['totals']['favourites'],
+				'karma' => $month_data['totals']['karma']
+			],
+			'growth' => [
+				'day_over_day' => [
+					'total_views' => $this->calculatePercentageChange(
+						$yesterday_data['totals']['total_views'],
+						$today_data['totals']['total_views']
+					),
+					'profile_views' => $this->calculatePercentageChange(
+						$yesterday_data['totals']['profile_views'],
+						$today_data['totals']['profile_views']
+					),
+					'favourites' => $this->calculatePercentageChange(
+						$yesterday_data['totals']['favourites'],
+						$today_data['totals']['favourites']
+					),
+					'karma' => $this->calculateAbsoluteChange(
+						$yesterday_data['totals']['karma'],
+						$today_data['totals']['karma']
+					)
+				]
+			],
+			'top_content' => $this->simplifyTopContent($week_data['top_content']),
+			'sources' => $week_data['source_breakdown']
+		];
     }
 
     /**

--
Gitblit v1.10.0