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

equalizedigital / accessibility-checker / 18020373221

25 Sep 2025 08:51PM UTC coverage: 59.385%. First build
18020373221

Pull #1242

github

web-flow
Merge c905d753e into b5cdcd793
Pull Request #1242: Release v1.33.0

29 of 36 new or added lines in 6 files covered. (80.56%)

4154 of 6995 relevant lines covered (59.39%)

3.56 hits per line

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

0.0
/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\WPCLI\BootstrapCLI;
14
use EqualizeDigital\AccessibilityChecker\Fixes\FixesManager;
15

16
/**
17
 * Main plugin functionality class.
18
 */
19
class Plugin {
20

21
        /**
22
         * Class constructor.
23
         */
24
        public function __construct() {
25
                if ( \is_admin() ) {
×
26
                        $meta_boxes = new Meta_Boxes();
×
27
                        $admin      = new Admin( $meta_boxes );
×
28
                        $admin->init();
×
29
                } else {
30
                        $this->init();
×
31
                }
32

33
                // The REST api must load if admin or not.
34
                $rest_api = new REST_Api();
×
35
                $rest_api->init_hooks();
×
36

37
                // Initialize the admin toolbar.
38
                $admin_toolbar = new Admin_Toolbar();
×
39
                $admin_toolbar->init();
×
40

41
                $cleanup = new Orphaned_Issues_Cleanup();
×
42
                $cleanup->init_hooks();
×
43

44
                $this->register_fixes_manager();
×
45

46
                // When WP CLI is enabled, load the CLI commands.
47
                if ( defined( 'WP_CLI' ) && WP_CLI ) {
×
NEW
48
                        add_action(
×
NEW
49
                                'init',
×
NEW
50
                                function () {
×
NEW
51
                                        $cli = new BootstrapCLI();
×
NEW
52
                                        $cli->register();
×
NEW
53
                                }
×
NEW
54
                        );
×
55
                }
56
        }
57

58
        /**
59
         * Initialize.
60
         *
61
         * @return void
62
         */
63
        private function init() {
64

65
                add_action( 'wp_enqueue_scripts', [ 'EDAC\Inc\Enqueue_Frontend', 'enqueue' ] );
×
66

67
                $accessibility_statement = new Accessibility_Statement();
×
68
                $accessibility_statement->init_hooks();
×
69

70
                $simplified_summary = new Simplified_Summary();
×
71
                $simplified_summary->init_hooks();
×
72

73
                $lazyload_filter = new Lazyload_Filter();
×
74
                $lazyload_filter->init_hooks();
×
75
        }
76

77
        /**
78
         * Register the FixesManager.
79
         *
80
         * @return void
81
         */
82
        public function register_fixes_manager() {
83
                add_action( 'plugins_loaded', [ $this, 'init_fixes_manager' ], 20 );
×
84
        }
85

86
        /**
87
         * Init the FixesManager.
88
         *
89
         * This is done on the plugins_loaded hook with a priority of 20 to ensure that fixes that
90
         * rely on running early, like on init or before init, can be hooked in and ready to go.
91
         * Fixes should be registered to the manager using the the plugins_loaded hook with a
92
         * priority of less than 20.
93
         *
94
         * @return void
95
         */
96
        public function init_fixes_manager() {
97
                $fixes_manager = FixesManager::get_instance();
×
98
                $fixes_manager->register_fixes();
×
99
                add_action( 'rest_api_init', [ $fixes_manager, 'register_rest_routes' ] );
×
100
        }
101
}
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