'font-size', 'name' => 'Font Size', 'desc' => 'Resize text across the page', 'icon' => 'type', 'default_on' => true, 'pro' => false, 'stepped' => true, 'type' => 'simple', ), array( 'id' => 'hide-images', 'name' => 'Hide Images', 'desc' => 'Remove all decorative images', 'icon' => 'imageoff', 'default_on' => false, 'pro' => false, 'stepped' => false, 'type' => 'simple', ), array( 'id' => 'highlight-links', 'name' => 'Highlight Links', 'desc' => 'Make every link stand out', 'icon' => 'link', 'default_on' => true, 'pro' => false, 'stepped' => false, 'type' => 'simple', ), array( 'id' => 'line-height', 'name' => 'Line Height', 'desc' => 'Increase spacing between lines', 'icon' => 'alignjustify', 'default_on' => false, 'pro' => false, 'stepped' => true, 'type' => 'simple', ), array( 'id' => 'readable-font', 'name' => 'Readable Font', 'desc' => 'Switch to a high-legibility font', 'icon' => 'bookopen', 'default_on' => false, 'pro' => false, 'stepped' => false, 'type' => 'simple', ), array( 'id' => 'big-cursor', 'name' => 'Big Cursor', 'desc' => 'Enlarge the mouse cursor', 'icon' => 'cursor', 'default_on' => false, 'pro' => false, 'stepped' => true, 'type' => 'simple', ), array( 'id' => 'text-magnifier', 'name' => 'Text Magnifier', 'desc' => 'Magnify text on hover', 'icon' => 'zoomin', 'default_on' => false, 'pro' => false, 'stepped' => false, 'type' => 'simple', ), array( 'id' => 'dyslexic-font', 'name' => 'Dyslexic Font', 'desc' => 'Apply a dyslexia-friendly font', 'icon' => 'brain', 'default_on' => false, 'pro' => false, 'stepped' => false, 'type' => 'simple', ), array( 'id' => 'align-text', 'name' => 'Align Text', 'desc' => 'Left, center or justify content', 'icon' => 'alignleft', 'default_on' => false, 'pro' => false, 'stepped' => true, 'type' => 'simple', ), array( 'id' => 'letter-spacing', 'name' => 'Letter Spacing', 'desc' => 'Expand spacing between letters', 'icon' => 'spline', 'default_on' => false, 'pro' => false, 'stepped' => true, 'type' => 'simple', ), array( 'id' => 'font-weight', 'name' => 'Font Weight', 'desc' => 'Make all text bolder', 'icon' => 'bold', 'default_on' => false, 'pro' => false, 'stepped' => false, 'type' => 'simple', ), array( 'id' => 'contrast', 'name' => 'Contrast', 'desc' => 'High contrast color modes', 'icon' => 'contrast', 'default_on' => true, 'pro' => false, 'stepped' => true, 'type' => 'simple', ), array( 'id' => 'daltonize', 'name' => 'Color Blindness Filter', 'desc' => 'Separate colours that are hard to tell apart', 'icon' => 'contrast', 'default_on' => false, 'pro' => false, 'stepped' => true, 'type' => 'simple', ), array( 'id' => 'color-invert', 'name' => 'Color Invert (full)', 'desc' => 'Invert all colors on the page, including photos and media', 'icon' => 'contrast', 'default_on' => false, 'pro' => false, 'stepped' => false, 'type' => 'simple', ), array( 'id' => 'monochrome', 'name' => 'Monochrome', 'desc' => 'Remove color saturation', 'icon' => 'circledashed', 'default_on' => false, 'pro' => false, 'stepped' => false, 'type' => 'simple', ), array( 'id' => 'saturation', 'name' => 'Saturation', 'desc' => 'Adjust color saturation', 'icon' => 'droplets', 'default_on' => false, 'pro' => false, 'stepped' => true, 'type' => 'simple', ), array( 'id' => 'reading-line', 'name' => 'Reading Line', 'desc' => 'Add a guided reading line', 'icon' => 'minus', 'default_on' => false, 'pro' => false, 'stepped' => false, 'type' => 'simple', ), array( 'id' => 'read-page', 'name' => 'Text to Speech', 'desc' => 'Read content aloud', 'icon' => 'volume', 'default_on' => false, 'pro' => false, 'stepped' => false, 'type' => 'simple', ), array( 'id' => 'keyboard-nav', 'name' => 'Keyboard Navigation', 'desc' => 'Jump between landmarks and headings, close dialogs with Esc, press ? for shortcuts', 'icon' => 'keyboard', 'default_on' => false, 'pro' => false, 'stepped' => false, 'type' => 'simple', ), array( 'id' => 'mute-sounds', 'name' => 'Mute Sounds', 'desc' => 'Mute all on-page audio', 'icon' => 'volumex', 'default_on' => false, 'pro' => false, 'stepped' => false, 'type' => 'simple', ), array( 'id' => 'highlight-titles', 'name' => 'Highlight Titles', 'desc' => 'Outline all heading tags', 'icon' => 'heading', 'default_on' => false, 'pro' => false, 'stepped' => false, 'type' => 'simple', ), array( 'id' => 'highlight-content', 'name' => 'Highlight Content', 'desc' => 'Outline main content blocks', 'icon' => 'filetext', 'default_on' => false, 'pro' => false, 'stepped' => false, 'type' => 'simple', ), array( 'id' => 'stop-animations', 'name' => 'Stop Animations', 'desc' => 'Pause motion and transitions', 'icon' => 'pause', 'default_on' => false, 'pro' => false, 'stepped' => false, 'type' => 'simple', ), array( 'id' => 'dictionary', 'name' => 'Dictionary', 'desc' => 'Definitions on selected words', 'icon' => 'book', 'default_on' => false, 'pro' => false, 'stepped' => false, 'type' => 'simple', ), array( 'id' => 'brightness', 'name' => 'Brightness', 'desc' => 'Dim or brighten the page', 'icon' => 'sun', 'default_on' => false, 'pro' => false, 'stepped' => true, 'type' => 'simple', ), array( 'id' => 'page-structure', 'name' => 'Page Structure', 'desc' => 'Skip-to summary navigator', 'icon' => 'layoutlist', 'default_on' => false, 'pro' => false, 'stepped' => false, 'type' => 'simple', ), array( 'id' => 'profile-seizure-safe', 'name' => 'Reduced Motion & Flash', 'desc' => 'Reduce motion and flashing effects', 'icon' => 'sparkles', 'default_on' => true, 'pro' => false, 'stepped' => false, 'type' => 'profile', ), array( 'id' => 'profile-vision-impaired', 'name' => 'Vision Impaired', 'desc' => 'Improve visibility and readability', 'icon' => 'eye', 'default_on' => true, 'pro' => false, 'stepped' => false, 'type' => 'profile', ), array( 'id' => 'profile-dyslexia-friendly', 'name' => 'Dyslexia Friendly', 'desc' => 'Improve reading accessibility', 'icon' => 'brain', 'default_on' => true, 'pro' => false, 'stepped' => false, 'type' => 'profile', ), array( 'id' => 'profile-low-vision', 'name' => 'Low Vision', 'desc' => 'Enhanced support for low vision users', 'icon' => 'zoomin', 'default_on' => true, 'pro' => false, 'stepped' => false, 'type' => 'profile', ), array( 'id' => 'profile-color-vision-support', 'name' => 'Color Vision Support', 'desc' => 'Adjust contrast and color for visitors with color vision deficiency', 'icon' => 'contrast', 'default_on' => false, 'pro' => false, 'stepped' => false, 'type' => 'profile', ), array( 'id' => 'cognitive-load', 'name' => 'Cognitive Load', 'desc' => 'Enhances readability using visual text and link cues.', 'icon' => 'brain', 'type' => 'simple', 'pro' => false, 'default_on' => false, ), array( 'id' => 'zoom', 'name' => 'Zoom', 'desc' => 'Zoom the entire page for better visibility.', 'icon' => 'zoomin', 'type' => 'simple', 'pro' => false, 'default_on' => false, ), array( 'id' => 'focus-highlight', 'name' => 'Focus Highlight', 'desc' => 'Outline the keyboard-focused element in the active theme color', 'icon' => 'crosshair', 'default_on' => false, 'pro' => false, 'stepped' => false, 'type' => 'simple', ), array( 'id' => 'skip-content', 'name' => 'Skip to Content', 'desc' => 'Jump straight to the main content, navigation or footer', 'icon' => 'layoutlist', 'default_on' => false, 'pro' => false, 'stepped' => false, 'type' => 'simple', ), ); // Assign a UX category to each simple module (drives the Modules-tab accordions). $welcoma_widget_cat = array( 'vision' => array( 'contrast', 'daltonize', 'color-invert', 'monochrome', 'saturation', 'brightness', 'big-cursor', 'text-magnifier', 'zoom', 'hide-images', 'text-color', 'title-color', 'bg-color' ), 'reading' => array( 'font-size', 'line-height', 'letter-spacing', 'readable-font', 'dyslexic-font', 'font-weight', 'align-text', 'reading-line', 'reading-mask', 'highlight-titles', 'highlight-content' ), 'motor' => array( 'keyboard-nav', 'on-screen-keyboard', 'highlight-links', 'highlight-hover', 'stop-animations', 'focus-highlight', 'skip-content' ), 'audio' => array( 'read-page', 'selected-text-reader', 'mute-sounds' ), 'cognitive' => array( 'cognitive-load', 'dictionary', 'tooltips', 'page-structure', 'interactive-highlight', 'translator' ), ); $welcoma_widget_id2cat = array(); foreach ( $welcoma_widget_cat as $cat => $ids ) { foreach ( $ids as $id ) { $welcoma_widget_id2cat[ $id ] = $cat; } } foreach ( $modules as &$welcoma_widget_mod ) { if ( ! isset( $welcoma_widget_mod['category'] ) ) { $welcoma_widget_mod['category'] = $welcoma_widget_id2cat[ $welcoma_widget_mod['id'] ] ?? 'other'; } } unset( $welcoma_widget_mod ); // Localise built-in module names/descriptions for the current admin locale. // Custom labels are supplied by the separate Pro add-on via the module filter below. if ( is_admin() && class_exists( 'Welcoma_Translator' ) ) { $welcoma_widget_admin_lang = Welcoma_Translator::current_source_lang(); foreach ( $modules as &$welcoma_widget_mod ) { $safe_id = str_replace( '-', '_', $welcoma_widget_mod['id'] ); $name_cached = Welcoma_Translator::get_string( 'mod__' . $safe_id . '__name', $welcoma_widget_admin_lang ); if ( '' !== $name_cached ) { $welcoma_widget_mod['name'] = $name_cached; } $desc_cached = Welcoma_Translator::get_string( 'mod__' . $safe_id . '__desc', $welcoma_widget_admin_lang ); if ( '' !== $desc_cached ) { $welcoma_widget_mod['desc'] = $desc_cached; } } unset( $welcoma_widget_mod ); } /** * Filter the module catalogue so add-ons can register more modules. * * @param array[] $modules The module list. */ return apply_filters( 'welcoma_widget_modules', $modules ); } /** * Convenience: counts of total / free / pro modules. * * @return array{total:int,free:int,pro:int} */ function welcoma_widget_get_module_counts() { $modules = welcoma_widget_get_modules(); $pro = count( array_filter( $modules, static function ( $m ) { return ! empty( $m['pro'] ); } ) ); return array( 'total' => count( $modules ), 'pro' => $pro, 'free' => count( $modules ) - $pro, ); }