Jake Vanderwerf
2026-01-20 7a9054bb3f033c98067b3196378311dae54c5fbf
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']
      ];
    }
    /**