• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

equalizedigital / accessibility-checker / 24683125413

20 Apr 2026 06:22PM UTC coverage: 57.497% (-3.0%) from 60.51%
24683125413

push

github

web-flow
Merge pull request #1315 from equalizedigital/william/pro-286-update-the-free-plugin-to-be-able-to-handle-licence

Add support for registering sites with myDot and exchanging a jwt token that can be used to share site stats

440 of 1210 new or added lines in 9 files covered. (36.36%)

2 existing lines in 2 files now uncovered.

5426 of 9437 relevant lines covered (57.5%)

4.5 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

19.57
/includes/classes/class-plugin.php
1
<?php
2
/**
3
 * Class file for the Accessibility Checker plugin.
4
 *
5
 * @package Accessibility_Checker
6
 */
7

8
namespace EDAC\Inc;
9

10
use EDAC\Admin\Admin;
11
use EDAC\Admin\Meta_Boxes;
12
use EDAC\Admin\Orphaned_Issues_Cleanup;
13
use EqualizeDigital\AccessibilityChecker\Admin\AdminPage\AccessibilityReportsPage;
14
use EqualizeDigital\AccessibilityChecker\MyDot\Connector;
15
use EqualizeDigital\AccessibilityChecker\WPCLI\BootstrapCLI;
16
use EqualizeDigital\AccessibilityChecker\Fixes\FixesManager;
17

18
if ( ! defined( 'ABSPATH' ) ) {
19
        exit;
20
}
21

22
/**
23
 * Main plugin functionality class.
24
 */
25
class Plugin {
26

27
        /**
28
         * Class constructor.
29
         */
30
        public function __construct() {
31
                if ( \is_admin() ) {
×
32
                        $meta_boxes = new Meta_Boxes();
×
33
                        $admin      = new Admin( $meta_boxes );
×
34
                        $admin->init();
×
35
                } else {
36
                        $this->init();
×
37
                }
38

39
                // The REST api must load if admin or not.
40
                $rest_api = new REST_Api();
×
41
                $rest_api->init_hooks();
×
42

43
                // Initialize the admin toolbar.
44
                $admin_toolbar = new Admin_Toolbar();
×
45
                $admin_toolbar->init();
×
46

47
                $cleanup = new Orphaned_Issues_Cleanup();
×
48
                $cleanup->init_hooks();
×
49

50
                $this->register_fixes_manager();
×
51
                $this->register_sr_only_meta_hooks();
×
52

NEW
53
                $accessibility_reports = new AccessibilityReportsPage( 'manage_options' );
×
NEW
54
                $accessibility_reports->add_page();
×
55

NEW
56
                $connector = new Connector();
×
NEW
57
                $connector->init();
×
58

59
                // When WP CLI is enabled, load the CLI commands.
60
                if ( defined( 'WP_CLI' ) && WP_CLI ) {
×
61
                        add_action(
×
62
                                'init',
×
63
                                function () {
×
64
                                        $cli = new BootstrapCLI();
×
65
                                        $cli->register();
×
66
                                }
×
67
                        );
×
68
                }
69
        }
70

71
        /**
72
         * Initialize.
73
         *
74
         * @return void
75
         */
76
        private function init() {
77

78
                add_action( 'wp_enqueue_scripts', [ 'EDAC\Inc\Enqueue_Frontend', 'enqueue' ] );
×
79

80
                $accessibility_statement = new Accessibility_Statement();
×
81
                $accessibility_statement->init_hooks();
×
82

83
                $simplified_summary = new Simplified_Summary();
×
84
                $simplified_summary->init_hooks();
×
85

86
                $lazyload_filter = new Lazyload_Filter();
×
87
                $lazyload_filter->init_hooks();
×
88
        }
89

90
        /**
91
         * Register hooks for the screen reader only user meta.
92
         *
93
         * @return void
94
         */
95
        public function register_sr_only_meta_hooks(): void {
96
                add_action( 'init', [ $this, 'register_sr_only_user_meta' ] );
×
97
        }
98

99
        /**
100
         * Register user meta for the screen reader text always-show preference.
101
         *
102
         * @return void
103
         */
104
        public function register_sr_only_user_meta(): void {
105
                register_meta(
20✔
106
                        'user',
20✔
107
                        'show_sr_text_in_editor',
20✔
108
                        [
20✔
109
                                'type'         => 'boolean',
20✔
110
                                'single'       => true,
20✔
111
                                'show_in_rest' => true,
20✔
112
                        ]
20✔
113
                );
20✔
114
        }
115

116
        /**
117
         * Register the FixesManager.
118
         *
119
         * @return void
120
         */
121
        public function register_fixes_manager() {
122
                add_action( 'plugins_loaded', [ $this, 'init_fixes_manager' ], 20 );
×
123
        }
124

125
        /**
126
         * Init the FixesManager.
127
         *
128
         * This is done on the plugins_loaded hook with a priority of 20 to ensure that fixes that
129
         * rely on running early, like on init or before init, can be hooked in and ready to go.
130
         * Fixes should be registered to the manager using the the plugins_loaded hook with a
131
         * priority of less than 20.
132
         *
133
         * @return void
134
         */
135
        public function init_fixes_manager() {
136
                $fixes_manager = FixesManager::get_instance();
×
137
                $fixes_manager->register_fixes();
×
138
                add_action( 'rest_api_init', [ $fixes_manager, 'register_rest_routes' ] );
×
139
        }
140
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc