Jake Vanderwerf
2025-11-23 d7dbe7fee362d587dfc334135d9581b6216a4295
inc/managers/NotificationManager.php
@@ -139,7 +139,7 @@
     */
    public function __construct()
    {
        $this->cache = new CacheManager('notifications', WEEK_IN_SECONDS); // 1 week cache
        $this->cache = CacheManager::for('notifications', WEEK_IN_SECONDS);
        // Add filter for bulk operation handling
        add_filter(BASE . 'handle_bulk_operation', [ $this, 'processOperation' ], 10, 3);
@@ -435,6 +435,10 @@
     */
    public function trackContentCreation(int $post_id, WP_POST $post, bool $update):void
    {
      // SAFETY: Skip attachments and other non-content post types
      if (in_array($post->post_type, jvbIgnoredPostTypes())) {
         return;
      }
        // Skip if not a published post
        if ($post->post_status !== 'publish') {
            return;
@@ -1095,7 +1099,7 @@
        }
        $content = '';
        $cache   = new CacheManager('digest_content', HOUR_IN_SECONDS * 6); // Cache for 6 hours
        $cache   = CacheManager::for('digest_content', HOUR_IN_SECONDS * 6); // Cache for 6 hours
        // Group updates by artist
        $updates_by_artist = [];
@@ -1630,8 +1634,9 @@
     */
    protected function clearNotificationCache(int $user_id):void
    {
        $this->cache->invalidate("user_{$user_id}_notifications_", 'notifications_' . $user_id);
        $this->cache->invalidate("user_{$user_id}_content_notifications_", 'notifications_' . $user_id);
        $this->cache->delete("user_{$user_id}_notifications_", 'notifications_' . $user_id);
        $this->cache->delete("user_{$user_id}_content_notifications_", 'notifications_' . $user_id);
    }
    /**