PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 4.3.2
Adminify – White Label, Admin Menu Editor, Login Customizer v4.3.2
4.3.2 4.3.1 4.3.0 4.2.26 4.2.25 4.2.24 4.2.23 4.2.22 4.2.21 4.2.20 4.2.19 4.2.18 4.2.17 4.2.16 4.2.15 4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 All 165 releases
← All changes | Inc/Admin/Options/Performance.php +31 -31 4.2.144.3.2 View file →
@@ -38,9 +38,9 @@
38 38 'enabled' => false,
39 39 'backend' => 'default',
40 40 'backend_modify' => 60,
41 41 'on_post_create' => 'default',
42 - 'on_post_create_modify' => 15,
42 + 'on_post_create_modify' => 60,
43 43 'on_frontend' => 'default',
44 44 'on_frontend_modify' => 60
45 45 ],
46 46 'adminify_assets' => [],
@@ -184,8 +184,32 @@
184 184 ];
185 185 }
186 186
187 187 public function control_heartbit_api_settings(&$fields){
188 +
189 + /*
190 + * heartbeat.js accepts 1-3600 seconds, but core draws the safe line at 120.
191 + * Its own note on `minimalInterval` reads "setting it to longer than 120
192 + * seconds will limit or disable some of the functionality (like post locks)",
193 + * and the Heartbeat API handbook describes the tick as running "every 15-120
194 + * seconds". Anything past that is offered but labelled, and withheld entirely
195 + * on post screens - where the post lock and autosave live, and where core
196 + * deliberately disables idle suspension to keep the lock alive
197 + * (wp_heartbeat_set_suspension).
198 + */
199 + $safe_intervals = array(
200 + '15' => __('15 seconds', 'adminify'),
201 + '30' => __('30 seconds', 'adminify'),
202 + '60' => __('1 Minute', 'adminify'),
203 + '120' => __('2 Minute', 'adminify'),
204 + );
205 +
206 + $interval_options = $safe_intervals + array(
207 + '180' => __('3 Minute (not recommended)', 'adminify'),
208 + '300' => __('5 Minute (not recommended)', 'adminify'),
209 + '600' => __('10 Minute (not recommended)', 'adminify'),
210 + );
211 +
188 212 $fields[] = [
189 213 'id' => 'enabled',
190 214 'type' => 'switcher',
191 215 'class' => 'adminify-pt-0 adminify-pl-0',
@@ -213,18 +237,10 @@
213 237 $fields[] = [
214 238 'id' => 'backend_modify',
215 239 'type' => 'select',
216 240 'title' => __('Set interval to once every', 'adminify'),
217 - 'subtitle' => __('Default: 1 Minute', 'adminify'),
218 - 'options' => array(
219 - '15' => __('15 seconds', 'adminify'),
220 - '30' => __('30 seconds', 'adminify'),
221 - '60' => __('1 Minute', 'adminify'),
222 - '120' => __('2 Minute', 'adminify'),
223 - '180' => __('3 Minute', 'adminify'),
224 - '300' => __('5 Minute', 'adminify'),
225 - '600' => __('10 Minute', 'adminify'),
226 - ),
241 + 'subtitle' => __('Default: 1 Minute. Intervals over 2 minutes can delay post locks.', 'adminify'),
242 + 'options' => $interval_options,
227 243 'default' => $this->get_default_field('heartbeat_api')['backend_modify'],
228 244 'dependency' => ['enabled|backend', '==|==', 'true|modify', 'true'],
229 245 ];
230 246
@@ -247,18 +263,10 @@
247 263 $fields[] = [
248 264 'id' => 'on_post_create_modify',
249 265 'type' => 'select',
250 266 'title' => __('Set interval to once every', 'adminify'),
251 - 'subtitle' => __('Default: 15 seconds', 'adminify'),
252 - 'options' => array(
253 - '15' => __('15 seconds', 'adminify'),
254 - '30' => __('30 seconds', 'adminify'),
255 - '60' => __('1 Minute', 'adminify'),
256 - '120' => __('2 Minute', 'adminify'),
257 - '180' => __('3 Minute', 'adminify'),
258 - '300' => __('5 Minute', 'adminify'),
259 - '600' => __('10 Minute', 'adminify'),
260 - ),
267 + 'subtitle' => __('Default: 1 Minute. Capped at 2 minutes so post locks and autosave keep working.', 'adminify'),
268 + 'options' => $safe_intervals,
261 269 'default' => $this->get_default_field('heartbeat_api')['on_post_create_modify'],
262 270 'dependency' => ['enabled|on_post_create', '==|==', 'true|modify', 'true'],
263 271 ];
264 272
@@ -281,18 +289,10 @@
281 289 $fields[] = [
282 290 'id' => 'on_frontend_modify',
283 291 'type' => 'select',
284 292 'title' => __('Set interval to once every', 'adminify'),
285 - 'subtitle' => __('Default: 1 Minute', 'adminify'),
286 - 'options' => array(
287 - '15' => __('15 seconds', 'adminify'),
288 - '30' => __('30 seconds', 'adminify'),
289 - '60' => __('1 Minute', 'adminify'),
290 - '120' => __('2 Minute', 'adminify'),
291 - '180' => __('3 Minute', 'adminify'),
292 - '300' => __('5 Minute', 'adminify'),
293 - '600' => __('10 Minute', 'adminify'),
294 - ),
293 + 'subtitle' => __('Default: 1 Minute. Intervals over 2 minutes can delay post locks.', 'adminify'),
294 + 'options' => $interval_options,
295 295 'default' => $this->get_default_field('heartbeat_api')['on_frontend_modify'],
296 296 'dependency' => ['enabled|on_frontend', '==|==', 'true|modify', 'true'],
297 297 ];
298 298 }