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

equalizedigital / accessibility-checker / 16153461478

08 Jul 2025 08:16PM UTC coverage: 30.724% (+0.3%) from 30.378%
16153461478

push

github

web-flow
Merge pull request #1061 from equalizedigital/steve/pro-198-custom-wp-toolbar-menu

added: admin toolbar functionality and corresponding tests

33 of 46 new or added lines in 2 files covered. (71.74%)

1 existing line in 1 file now uncovered.

1688 of 5494 relevant lines covered (30.72%)

1.98 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 EqualizeDigital\AccessibilityChecker\WPCLI\BootstrapCLI;
13
use EqualizeDigital\AccessibilityChecker\Fixes\FixesManager;
14

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

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

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

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

UNCOV
40
                $this->register_fixes_manager();
×
41

42
                // When WP CLI is enabled, load the CLI commands.
43
                if ( defined( 'WP_CLI' ) && WP_CLI ) {
×
44
                        $cli = new BootstrapCLI();
×
45
                        $cli->register();
×
46
                }
47
        }
48

49
        /**
50
         * Initialize.
51
         *
52
         * @return void
53
         */
54
        private function init() {
55

56
                add_action( 'wp_enqueue_scripts', [ 'EDAC\Inc\Enqueue_Frontend', 'enqueue' ] );
×
57

58
                $accessibility_statement = new Accessibility_Statement();
×
59
                $accessibility_statement->init_hooks();
×
60

61
                $simplified_summary = new Simplified_Summary();
×
62
                $simplified_summary->init_hooks();
×
63

64
                $lazyload_filter = new Lazyload_Filter();
×
65
                $lazyload_filter->init_hooks();
×
66
        }
67

68
        /**
69
         * Register the FixesManager.
70
         *
71
         * @return void
72
         */
73
        public function register_fixes_manager() {
74
                add_action( 'plugins_loaded', [ $this, 'init_fixes_manager' ], 20 );
×
75
        }
76

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

© 2025 Coveralls, Inc