| 1 |
<?php |
| 2 |
|
| 3 |
if (!defined('ABSPATH')) { |
| 4 |
exit; |
| 5 |
} |
| 6 |
|
| 7 |
/** |
| 8 |
* Score-band domain constants for redirect suggestion confidence. |
| 9 |
* |
| 10 |
* The spell-checker assigns each redirect suggestion a 0-100 confidence |
| 11 |
* score, or NULL when the redirect was created manually (no automated |
| 12 |
* scoring took place). The admin UI groups these into four bands so users |
| 13 |
* can filter by confidence: |
| 14 |
* |
| 15 |
* - high: score >= HIGH (80) |
| 16 |
* - medium: MEDIUM (50) <= score < HIGH (80) |
| 17 |
* - low: score IS NOT NULL AND score < MEDIUM (50) |
| 18 |
* - manual: score IS NULL (the MANUAL sentinel) |
| 19 |
* |
| 20 |
* Single source of truth for these thresholds. Used by ViewQueryBuilder |
| 21 |
* (for filtering list queries) and View_Stats (for the score-distribution |
| 22 |
* widget). Changing a threshold here changes both surfaces consistently. |
| 23 |
* |
| 24 |
* Value-object class only: no behavior, no state, just constants. |
| 25 |
*/ |
| 26 |
final class ABJ_404_Solution_ScoreThresholds { |
| 27 |
|
| 28 |
/** High-confidence score band lower bound (inclusive). */ |
| 29 |
const HIGH = 80; |
| 30 |
|
| 31 |
/** Medium-confidence score band lower bound (inclusive). Upper bound is HIGH (exclusive). */ |
| 32 |
const MEDIUM = 50; |
| 33 |
|
| 34 |
/** Sentinel score-range selector value indicating "manual" (score IS NULL). */ |
| 35 |
const MANUAL = 'manual'; |
| 36 |
|
| 37 |
/** Score-range selector values that filter to a single band. */ |
| 38 |
const RANGE_HIGH = 'high'; |
| 39 |
const RANGE_MEDIUM = 'medium'; |
| 40 |
const RANGE_LOW = 'low'; |
| 41 |
} |
| 42 |
|