| @@ -36,9 +36,10 @@ | ||
| 36 | 36 | public function ui_metadata(): array { |
| 37 | 37 | return array( |
| 38 | 38 | 'label' => __( 'Heartbeat', 'xspeed' ), |
| 39 | 39 | 'icon' => 'Activity', |
| 40 | - 'description' => __( 'Control the WordPress Heartbeat API per context.', 'xspeed' ), | |
| 40 | + 'description' => __( 'Controls how often WordPress checks in with your server in the background.', 'xspeed' ), | |
| 41 | + 'group' => 'performance', | |
| 41 | 42 | ); |
| 42 | 43 | } |
| 43 | 44 | |
| 44 | 45 | /** |
| @@ -61,9 +62,9 @@ | ||
| 61 | 62 | 'default' => self::BEHAVIOR_THROTTLE, |
| 62 | 63 | 'options' => $behavior_options, |
| 63 | 64 | 'option_labels' => $behavior_option_labels, |
| 64 | 65 | 'label' => __( 'Dashboard', 'xspeed' ), |
| 65 | - 'description' => __( 'Heartbeat behavior on /wp-admin/ screens (autosave, notifications).', 'xspeed' ), | |
| 66 | + 'description' => __( 'Background checks on admin screens, used for notifications.', 'xspeed' ), | |
| 66 | 67 | ), |
| 67 | 68 | 'behavior_editor' => array( |
| 68 | 69 | 'type' => 'enum', |
| 69 | 70 | 'default' => self::BEHAVIOR_THROTTLE, |
| @@ -69,9 +70,9 @@ | ||
| 69 | 70 | 'default' => self::BEHAVIOR_THROTTLE, |
| 70 | 71 | 'options' => $behavior_options, |
| 71 | 72 | 'option_labels' => $behavior_option_labels, |
| 72 | 73 | '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 | + 'description' => __( 'Background checks in the post editor. Disable only if you do not need autosave or the warning when someone else is editing.', 'xspeed' ), | |
| 74 | 75 | ), |
| 75 | 76 | 'behavior_frontend' => array( |
| 76 | 77 | 'type' => 'enum', |
| 77 | 78 | 'default' => self::BEHAVIOR_DISABLE, |
| @@ -77,9 +78,9 @@ | ||
| 77 | 78 | 'default' => self::BEHAVIOR_DISABLE, |
| 78 | 79 | 'options' => $behavior_options, |
| 79 | 80 | 'option_labels' => $behavior_option_labels, |
| 80 | 81 | '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 | + 'description' => __( 'Background checks on the public site, which only some plugins add. Disable is recommended, as it cuts extra requests to your server.', 'xspeed' ), | |
| 82 | 83 | ), |
| 83 | 84 | 'frequency' => array( |
| 84 | 85 | 'type' => 'int', |
| 85 | 86 | 'default' => 60, |
| @@ -84,10 +85,19 @@ | ||
| 84 | 85 | 'type' => 'int', |
| 85 | 86 | 'default' => 60, |
| 86 | 87 | 'min' => 15, |
| 87 | 88 | 'max' => 300, |
| 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' ), | |
| 89 | + 'label' => __( 'Throttle interval', 'xspeed' ), | |
| 90 | + 'unit' => 'seconds', | |
| 91 | + 'description' => __( 'Seconds between checks where you chose Throttle. 60 suits most sites; a lower number means more requests.', 'xspeed' ), | |
| 92 | + 'advanced' => true, | |
| 93 | + 'dependsOn' => array( | |
| 94 | + 'any' => array( | |
| 95 | + array( 'field' => 'behavior_dashboard', 'value' => self::BEHAVIOR_THROTTLE ), | |
| 96 | + array( 'field' => 'behavior_editor', 'value' => self::BEHAVIOR_THROTTLE ), | |
| 97 | + array( 'field' => 'behavior_frontend', 'value' => self::BEHAVIOR_THROTTLE ), | |
| 98 | + ), | |
| 99 | + ), | |
| 90 | 100 | ), |
| 91 | 101 | ); |
| 92 | 102 | } |
| 93 | 103 | |