| | |
| | | $this->website_id = get_option('jvb_umami_website_id', UMAMI_WEBSITE_ID); |
| | | |
| | | // Initialize cache manager |
| | | $this->cache = new CacheManager('umami_metrics', DAY_IN_SECONDS); |
| | | $this->cache = CacheManager::for('umami_metrics', DAY_IN_SECONDS); |
| | | |
| | | // Register hooks |
| | | add_action('jvb_daily_umami_collection', [$this, 'collectDailyData']); |
| | |
| | | ); |
| | | |
| | | // Clear cache for the processed date |
| | | $this->cache->invalidate('metrics_' . $date); |
| | | $this->cache->invalidate(); |
| | | } catch (Exception $e) { |
| | | $results['errors'][] = 'Exception during data collection: ' . $e->getMessage(); |
| | | |