PluginProbe
404 Solution / trunk
404 Solution vtrunk
4.3.5 4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.2.0 4.1.19 4.1.18 4.1.17 4.1.16 4.1.15 4.1.13 4.1.12 4.1.11 4.1.10 4.1.9 4.1.8 4.1.7 4.1.6 4.1.5 4.1.4 4.1.3 trunk 2.30.0 All 109 releases
404-solution / includes / view-build / ScoreThresholds.php

ScoreThresholds.php in 404 Solution trunk, at includes/view-build/ScoreThresholds.php

42 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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