PluginProbe
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) / 2.1.3
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) v2.1.3
2.1.3 2.1.2 2.1.1 2.1.0 2.0.4 2.0.3 2.0.2 2.0.1 2.0.0 1.5.5 1.5.4 1.5.3 1.5.2 1.5.1 1.5.0 trunk 1.0.1 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3.0 All 57 releases
← All changes | src/Admin/Views/Control.php +190 -0 2.0.32.1.3 View file →
@@ -269,9 +269,115 @@
269 269 // Commit instantly even though other fields depend on it.
270 270 'auto_save' => true,
271 271 ),
272 272
273 + /*
274 + * Admin palettes are separate from the frontend's `color_pallets`
275 + * and from each other. wp-admin is rendered by Dark Reader, which
276 + * derives a colour per source colour; a preset overrides only the
277 + * page background and text colour and lets it derive the rest.
278 + *
279 + * "Auto" is the default and the recommended value: pinning those two
280 + * flattens distinctions the derivation would otherwise keep, which
281 + * matters most on admin screens built by other plugins.
282 + *
283 + * Only the five presets darkify_apply_palette() actually defines are
284 + * listed. The block editor's toolbar dropdown offers more than that
285 + * and silently falls back for the rest — do not copy that list here.
286 + *
287 + * The swatch colours match the toolbar dropdown (.darkify-dropdown in
288 + * src/assets/css/client_main.css) so the same preset is recognisable
289 + * in both places. "Auto" shows a gradient: it has no single colour.
290 + *
291 + * These are the site-wide default. The editor's toolbar dropdown
292 + * still writes a per-user choice to localStorage, which wins for
293 + * that user — the same relationship the toolbar has always had.
294 + */
273 295 array(
296 + 'id' => 'admin_panel_palette',
297 + 'type' => 'select',
298 + 'title' => esc_html__('Admin Panel Palette', 'darkify'),
299 + 'title_help' =>
300 + '<div class="darkify-info-label">' .
301 + __('Color preset for the WordPress admin. Auto lets Darkify derive each color from the original.', 'darkify') .
302 + '</div>',
303 + 'default' => 'auto',
304 + 'options' => array(
305 + 'auto' => array(
306 + 'text' => esc_html__('Auto (recommended)', 'darkify'),
307 + 'swatch' => 'linear-gradient(135deg, #0f0f0f 0%, #3a3a3a 50%, #8f8f8f 100%)',
308 + ),
309 + 'set1' => array(
310 + 'text' => esc_html__('Carbon Mist', 'darkify'),
311 + 'swatch' => '#171717',
312 + ),
313 + 'set3' => array(
314 + 'text' => esc_html__('Midnight Reverie', 'darkify'),
315 + 'swatch' => '#4e478d',
316 + ),
317 + 'set9' => array(
318 + 'text' => esc_html__('Verdant Depths', 'darkify'),
319 + 'swatch' => '#073d2f',
320 + ),
321 + 'set6' => array(
322 + 'text' => esc_html__('Celestial Tide', 'darkify'),
323 + 'swatch' => '#144e78',
324 + ),
325 + 'set10' => array(
326 + 'text' => esc_html__('Emberwood', 'darkify'),
327 + 'swatch' => '#372911',
328 + ),
329 +
330 + /*
331 + * Pro presets, listed after every one that works here so the
332 + * usable list is not diluted at the top.
333 + *
334 + * These are not new upsell surface. The block editor's toolbar
335 + * dropdown has always offered all eleven names while
336 + * darkify_apply_palette() defines only five, so picking one of
337 + * these silently rendered Carbon Mist — they looked broken
338 + * rather than gated. Marking them is what makes that honest.
339 + *
340 + * `pro_only` is the whole mechanism: locked_option_keys() turns
341 + * it into the `pro_options` stamp the React admin renders as a
342 + * disabled, badged row, and strip_pro_keys() refuses to persist
343 + * the value even if a crafted request sends it.
344 + */
345 + 'set2' => array(
346 + 'text' => esc_html__('Glacier Drift', 'darkify'),
347 + 'swatch' => '#123d52',
348 + 'pro_only' => true,
349 + ),
350 + 'set4' => array(
351 + 'text' => esc_html__('Indigo Veil', 'darkify'),
352 + 'swatch' => '#46598c',
353 + 'pro_only' => true,
354 + ),
355 + 'set5' => array(
356 + 'text' => esc_html__('Duskmire', 'darkify'),
357 + 'swatch' => '#403953',
358 + 'pro_only' => true,
359 + ),
360 + 'set7' => array(
361 + 'text' => esc_html__('Tidal Frost', 'darkify'),
362 + 'swatch' => '#286f8d',
363 + 'pro_only' => true,
364 + ),
365 + 'set8' => array(
366 + 'text' => esc_html__('Blue Bastion', 'darkify'),
367 + 'swatch' => '#244892',
368 + 'pro_only' => true,
369 + ),
370 + 'set11' => array(
371 + 'text' => esc_html__('Crimson Veil', 'darkify'),
372 + 'swatch' => '#440649',
373 + 'pro_only' => true,
374 + ),
375 + ),
376 + 'dependency' => array('enable_admin_panel_dark_mode', '==', 'true'),
377 + ),
378 +
379 + array(
274 380 'id' => 'block_editor_dark_mode',
275 381 'type' => 'switcher',
276 382 'title' => esc_html__('Block Editor Dark Mode', 'darkify'),
277 383 'title_help' =>
@@ -284,8 +390,92 @@
284 390 'text_off' => esc_html__('Disabled', 'darkify'),
285 391 'default' => false,
286 392 'text_width' => 100,
287 393 ),
394 + array(
395 + 'id' => 'block_editor_palette',
396 + 'type' => 'select',
397 + 'title' => esc_html__('Block Editor Palette', 'darkify'),
398 + 'title_help' =>
399 + '<div class="darkify-info-label">' .
400 + __('Color preset for the block editor, independent of the rest of the admin.', 'darkify') .
401 + '</div>',
402 + 'default' => 'auto',
403 + 'options' => array(
404 + 'auto' => array(
405 + 'text' => esc_html__('Auto (recommended)', 'darkify'),
406 + 'swatch' => 'linear-gradient(135deg, #0f0f0f 0%, #3a3a3a 50%, #8f8f8f 100%)',
407 + ),
408 + 'set1' => array(
409 + 'text' => esc_html__('Carbon Mist', 'darkify'),
410 + 'swatch' => '#171717',
411 + ),
412 + 'set3' => array(
413 + 'text' => esc_html__('Midnight Reverie', 'darkify'),
414 + 'swatch' => '#4e478d',
415 + ),
416 + 'set9' => array(
417 + 'text' => esc_html__('Verdant Depths', 'darkify'),
418 + 'swatch' => '#073d2f',
419 + ),
420 + 'set6' => array(
421 + 'text' => esc_html__('Celestial Tide', 'darkify'),
422 + 'swatch' => '#144e78',
423 + ),
424 + 'set10' => array(
425 + 'text' => esc_html__('Emberwood', 'darkify'),
426 + 'swatch' => '#372911',
427 + ),
428 +
429 + /*
430 + * Pro presets, listed after every one that works here so the
431 + * usable list is not diluted at the top.
432 + *
433 + * These are not new upsell surface. The block editor's toolbar
434 + * dropdown has always offered all eleven names while
435 + * darkify_apply_palette() defines only five, so picking one of
436 + * these silently rendered Carbon Mist — they looked broken
437 + * rather than gated. Marking them is what makes that honest.
438 + *
439 + * `pro_only` is the whole mechanism: locked_option_keys() turns
440 + * it into the `pro_options` stamp the React admin renders as a
441 + * disabled, badged row, and strip_pro_keys() refuses to persist
442 + * the value even if a crafted request sends it.
443 + */
444 + 'set2' => array(
445 + 'text' => esc_html__('Glacier Drift', 'darkify'),
446 + 'swatch' => '#123d52',
447 + 'pro_only' => true,
448 + ),
449 + 'set4' => array(
450 + 'text' => esc_html__('Indigo Veil', 'darkify'),
451 + 'swatch' => '#46598c',
452 + 'pro_only' => true,
453 + ),
454 + 'set5' => array(
455 + 'text' => esc_html__('Duskmire', 'darkify'),
456 + 'swatch' => '#403953',
457 + 'pro_only' => true,
458 + ),
459 + 'set7' => array(
460 + 'text' => esc_html__('Tidal Frost', 'darkify'),
461 + 'swatch' => '#286f8d',
462 + 'pro_only' => true,
463 + ),
464 + 'set8' => array(
465 + 'text' => esc_html__('Blue Bastion', 'darkify'),
466 + 'swatch' => '#244892',
467 + 'pro_only' => true,
468 + ),
469 + 'set11' => array(
470 + 'text' => esc_html__('Crimson Veil', 'darkify'),
471 + 'swatch' => '#440649',
472 + 'pro_only' => true,
473 + ),
474 + ),
475 + 'dependency' => array('block_editor_dark_mode', '==', 'true'),
476 + ),
477 +
288 478 array(
289 479 'id' => 'classic_editor_dark_mode',
290 480 'type' => 'switcher',
291 481 'title' => esc_html__('Classic Editor Dark Mode', 'darkify'),