WhoKnew Views™ | Drift Hierarchy & Priority Rules

Skip to main content
Table of Contents
Print

Understanding Drift Priority: Which System Wins?

WhoKnew Views Pro™ uses three distinct drift systems, each designed for different scenarios. But what happens when multiple systems try to run at the same time? The answer lies in the drift hierarchy—a carefully designed priority system that ensures the most important action always wins.

Without this hierarchy, you could have conflicting drift directions (one going up, another going down), competing for control of the same baseline. The priority system prevents chaos by establishing clear rules for which drift takes precedence.

📊 The Three-Tier Hierarchy

From the plugin’s Drop Rate settings page:

“⚙️ THREE DRIFT SYSTEMS (All use these settings)”

PrioritySystemTriggerPurpose
🔵 1 (Highest)Target Baseline DriftPreset change with “Apply with Drift”Gradual transition to new preset
🔴 2 (Medium)Hard Cap Drift95%+ of soft cap (Hard Cap Mode)Create room for real views
🟢 3 (Lowest)Living Baseline DriftExtended inactivityPrevent frozen counter look

⚡ How Priority Is Enforced

The drift system checks priorities every time it calculates display count. Higher-priority drifts automatically block or cancel lower-priority ones:

// From padded-views-drift.php - wkv_process_drift_cycle()
// DRIFT HIERARCHY: Check all higher priority systems first
// PRIORITY 1: Check for Target Baseline Drift (preset changes, auto-optimization)
// This takes precedence over ALL other drift systems
$target_drift_applied = wkv_apply_target_baseline_drift($product_id, $options);
if ($target_drift_applied) {
    return $display_count; // Skip all other drifts
}
// PRIORITY 2: Check for Hard Cap Drift (at/above 95% of soft cap)
// If Hard Cap is active, block Living Baseline from starting
if (wkv_should_apply_hard_cap_drift($product_id, $options)) {
    return wkv_get_display_count_timestamp($product_id, $options);
}
// PRIORITY 3: Living Baseline Drift (activity-based, uses bias settings)
// Only runs if NO higher priority drift is active

🔵 Priority 1: Target Baseline Drift

Target Baseline Drift has the highest priority because preset changes represent deliberate user actions that must be honored:

What It Does to Lower Priorities

  • Cancels any active Living Baseline Drift
  • Blocks Hard Cap Drift from starting
  • Continues despite real visitor activity (ignores traffic)
// DRIFT HIERARCHY: Target Drift CANCELS lower priority drifts
// When Target Drift becomes active, stop any conflicting drift systems
// Cancel Living Baseline Drift (if active)
if (get_post_meta($product_id, '_wkv_drift_active', true)) {
    delete_post_meta($product_id, '_wkv_drift_active');
    delete_post_meta($product_id, '_wkv_drift_target');
    delete_post_meta($product_id, '_wkv_drift_start_count');
    delete_post_meta($product_id, '_wkv_drift_start_time');
    
    wkv_log_activity($product_id, 'drift_hierarchy', 
        'Target Baseline Drift CANCELLED Living Baseline Drift (higher priority active)');
}

Key Behavior

  • Ignores real traffic: Doesn’t stop when visitors arrive
  • Completes its mission: Runs until baseline reaches target (±2 views)
  • Clears metadata: Removes all lower-priority drift state

🔴 Priority 2: Hard Cap Drift

Hard Cap Drift activates when a product approaches the soft cap ceiling. It has medium priority:

What It Does to Lower Priorities

  • Blocks Living Baseline Drift from starting
  • Uses hardcoded settings (ignores user configuration)
  • Yields to Target Baseline Drift if active
// PRIORITY 2: Check for Hard Cap Drift (at/above 95% of soft cap)
// If Hard Cap is active, block Living Baseline from starting
if (wkv_should_apply_hard_cap_drift($product_id, $options)) {
    error_log("Product #{$product_id}: HARD CAP ACTIVE (>=95% of cap) - Living Baseline BLOCKED");
    
    // Return normal count (no living baseline drift)
    return wkv_get_display_count_timestamp($product_id, $options);
}

Key Behavior

  • Checks Target Drift first: Won’t activate if Target Drift is running
  • Uses hardcoded aggressive settings: Fast speed, moderate range, 70% downward bias
  • Auto-expires: Clears after 72+ hours when count drops to 60%

🟢 Priority 3: Living Baseline Drift

Living Baseline Drift is the lowest priority because it only needs to run when nothing else is happening:

What Blocks It

  • Target Baseline Drift: Immediately cancels Living Baseline
  • Hard Cap Drift: Blocks Living Baseline from starting
  • Real visitor activity: Instantly locks and resets timer

Key Behavior

  • Only runs when idle: Requires full inactivity period
  • Uses your configured settings: Respects speed, range, and bias choices
  • Stops immediately on activity: Any real view locks the drift

🔄 Conflict Scenarios

Scenario 1: Living Baseline + Preset Change

INITIAL STATE:
- Product inactive for 72 hours
- Living Baseline Drift active (drifting from 200 → 175)
- Currently at 185 views
USER ACTION:
- Applies new preset with "Apply with Drift"
- Target: 250 views
RESULT:
✅ Target Drift CANCELS Living Baseline
✅ Living Baseline metadata cleared
✅ Target Drift starts: 185 → 250 (gradual)
✅ Living Baseline can restart AFTER Target Drift completes (if inactive)

Scenario 2: Living Baseline + Hard Cap

INITIAL STATE:
- Product inactive, Living Baseline about to start
- Display count: 950 views
- Soft cap: 1,000 views (95% reached)
- Hard Cap Mode enabled
RESULT:
✅ Hard Cap Drift takes over at 95%
❌ Living Baseline BLOCKED from starting
✅ Hard Cap uses hardcoded aggressive downward settings
✅ After 72h at 60%, Living Baseline can resume

Scenario 3: Hard Cap + Preset Change

INITIAL STATE:
- Hard Cap Drift active (at 95% capacity)
- Drifting baseline downward
USER ACTION:
- Applies higher-capacity preset with "Apply with Drift"
- New soft cap: 2,000 views
RESULT:
✅ Target Drift takes priority
✅ Hard Cap Drift blocked (will check after Target completes)
✅ Baseline drifts to new preset's target
✅ Once Target Drift completes, Hard Cap can reactivate IF conditions met

⚙️ The Checking Order

Every time the display count is calculated, the system follows this exact sequence:

1. Is Target Drift active? (_wkv_target_baseline exists?)
   → YES: Apply Target Drift, SKIP everything else
   → NO: Continue...
2. Is Hard Cap Drift active? (≥95% of soft cap in Hard Cap Mode?)
   → YES: Block Living Baseline, return normal count
   → NO: Continue...
3. Is Living Baseline eligible? (inactive for trigger period?)
   → YES: Start/continue drift cycle
   → NO: Return normal count (baseline + real + variations)

🛡️ Protection Mechanisms

Target Drift Protection

When locking drift due to real activity, the system specifically protects Target Drift:

// TARGET DRIFT PROTECTION - Don't lock drift from auto-upgrades
// Check if this is target drift (from auto-optimization)
// Target drift should NEVER be locked by real views - it must continue
// drifting to the new preset's target regardless of traffic
$is_target_drift = get_post_meta($product_id, '_wkv_drift_to_target', true);
if ($is_target_drift === 'true' || $is_target_drift === '1') {
    error_log("Product #{$product_id}: TARGET DRIFT active, NOT locking (auto-upgrade drift continues)");
    return; // Don't lock target drift
}

Hard Cap Cleanup

After 72+ hours of natural decay to 60%, Hard Cap Drift flags are automatically cleared:

// If drift was enabled more than 72 hours ago, this is natural decay
// Clear hard cap drift flag AND disable drift in settings
if ($hours_since_drift >= 72) {
    // Delete all hard cap drift flags
    $wpdb->query($wpdb->prepare(
        "DELETE FROM {$wpdb->postmeta} WHERE post_id = %d AND meta_key LIKE %s",
        $product_id,
        '_wkv_hard_cap_drift_enabled_%'
    ));
    
    // Disable drift in custom settings
    $current_custom_settings['living_baseline_enabled'] = 'no';
}

📋 Quick Reference Chart

If Active…Target DriftHard Cap DriftLiving Baseline
Target Drift✅ Runs❌ Blocked❌ Cancelled
Hard Cap Drift✅ Takes over✅ Runs❌ Blocked
Living Baseline✅ Takes over✅ Takes over✅ Runs
Real Activity⚡ Ignores⚡ Ignores⚡ Locks immediately

💡 Best Practices

  • 🎯 Trust the hierarchy: The system is designed to always do the right thing—you don’t need to manually manage conflicts
  • 📊 Monitor preset changes: Use “Apply with Drift” for smooth transitions; the system will pause other drifts automatically
  • ⏰ Let cleanup happen: After Hard Cap, wait 72+ hours for natural transition back to Living Baseline behavior
  • 🔍 Check product settings: Hard Cap Drift converts products to custom settings—review if needed

Share