| @@ -34,11 +34,11 @@ | ||
| 34 | 34 | private const CONTEXTS = array( 'dashboard', 'editor', 'frontend' ); |
| 35 | 35 | |
| 36 | 36 | public function ui_metadata(): array { |
| 37 | 37 | return array( |
| 38 | - 'label' => 'Heartbeat', | |
| 38 | + 'label' => __( 'Heartbeat', 'xspeed' ), | |
| 39 | 39 | 'icon' => 'Activity', |
| 40 | - 'description' => 'Control the WordPress Heartbeat API per context.', | |
| 40 | + 'description' => __( 'Control the WordPress Heartbeat API per context.', 'xspeed' ), | |
| 41 | 41 | ); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
| @@ -60,10 +60,10 @@ | ||
| 60 | 60 | 'type' => 'enum', |
| 61 | 61 | 'default' => self::BEHAVIOR_THROTTLE, |
| 62 | 62 | 'options' => $behavior_options, |
| 63 | 63 | 'option_labels' => $behavior_option_labels, |
| 64 | - 'label' => 'Dashboard', | |
| 65 | - 'description' => 'Heartbeat behavior on /wp-admin/ screens (autosave, notifications).', | |
| 64 | + 'label' => __( 'Dashboard', 'xspeed' ), | |
| 65 | + 'description' => __( 'Heartbeat behavior on /wp-admin/ screens (autosave, notifications).', 'xspeed' ), | |
| 66 | 66 | ), |
| 67 | 67 | 'behavior_editor' => array( |
| 68 | 68 | 'type' => 'enum', |
| 69 | 69 | 'default' => self::BEHAVIOR_THROTTLE, |
| @@ -68,10 +68,10 @@ | ||
| 68 | 68 | 'type' => 'enum', |
| 69 | 69 | 'default' => self::BEHAVIOR_THROTTLE, |
| 70 | 70 | 'options' => $behavior_options, |
| 71 | 71 | 'option_labels' => $behavior_option_labels, |
| 72 | - 'label' => 'Editor', | |
| 73 | - 'description' => 'Heartbeat in the post / block editor. Disable only if you do not need autosave or co-edit locks.', | |
| 72 | + 'label' => __( 'Editor', 'xspeed' ), | |
| 73 | + 'description' => __( 'Heartbeat in the post / block editor. Disable only if you do not need autosave or co-edit locks.', 'xspeed' ), | |
| 74 | 74 | ), |
| 75 | 75 | 'behavior_frontend' => array( |
| 76 | 76 | 'type' => 'enum', |
| 77 | 77 | 'default' => self::BEHAVIOR_DISABLE, |
| @@ -76,10 +76,10 @@ | ||
| 76 | 76 | 'type' => 'enum', |
| 77 | 77 | 'default' => self::BEHAVIOR_DISABLE, |
| 78 | 78 | 'options' => $behavior_options, |
| 79 | 79 | 'option_labels' => $behavior_option_labels, |
| 80 | - 'label' => 'Frontend', | |
| 81 | - 'description' => 'Controls the Heartbeat API on the public site. Only takes effect when a plugin or theme actually loads heartbeat on the frontend (e.g. WooCommerce cart fragments, membership/notification plugins) — a default WordPress site loads none there, so this has no visible effect on such sites. Recommended: Disable, to stop the admin-ajax polling those plugins add.', | |
| 80 | + 'label' => __( 'Frontend', 'xspeed' ), | |
| 81 | + 'description' => __( 'Controls the Heartbeat API on the public site. Only takes effect when a plugin or theme actually loads heartbeat on the frontend (e.g. WooCommerce cart fragments, membership/notification plugins) — a default WordPress site loads none there, so this has no visible effect on such sites. Recommended: Disable, to stop the admin-ajax polling those plugins add.', 'xspeed' ), | |
| 82 | 82 | ), |
| 83 | 83 | 'frequency' => array( |
| 84 | 84 | 'type' => 'int', |
| 85 | 85 | 'default' => 60, |
| @@ -84,10 +84,10 @@ | ||
| 84 | 84 | 'type' => 'int', |
| 85 | 85 | 'default' => 60, |
| 86 | 86 | 'min' => 15, |
| 87 | 87 | 'max' => 300, |
| 88 | - 'label' => 'Throttle Frequency', | |
| 89 | - 'description' => 'Interval in seconds for contexts set to Throttle. 60 is a sane default; lower = faster sync but more requests.', | |
| 88 | + 'label' => __( 'Throttle Frequency', 'xspeed' ), | |
| 89 | + 'description' => __( 'Interval in seconds for contexts set to Throttle. 60 is a sane default; lower = faster sync but more requests.', 'xspeed' ), | |
| 90 | 90 | ), |
| 91 | 91 | ); |
| 92 | 92 | } |
| 93 | 93 | |
| @@ -99,8 +99,9 @@ | ||
| 99 | 99 | array( |
| 100 | 100 | 'name' => 'xspeed heartbeat', |
| 101 | 101 | 'callback' => array( $this, 'cli_handler' ), |
| 102 | 102 | 'shortdesc' => 'Inspect or modify xSpeed heartbeat settings.', |
| 103 | + 'ai_hint' => 'Inspect or change WordPress Heartbeat (admin-ajax polling) frequency. Use for high admin-ajax.php CPU load, or hosting warnings about too many background requests.', | |
| 103 | 104 | 'synopsis' => array( |
| 104 | 105 | array( |
| 105 | 106 | 'type' => 'positional', |
| 106 | 107 | 'name' => 'action', |