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

equalizedigital / accessibility-checker / 16575452553

28 Jul 2025 05:07PM UTC coverage: 31.456% (-0.1%) from 31.555%
16575452553

push

github

web-flow
Merge pull request #1108 from equalizedigital/codex/run-cleanup-for-orphaned-issues

Implement cron cleanup for orphaned issues

15 of 76 new or added lines in 4 files covered. (19.74%)

1 existing line in 1 file now uncovered.

2843 of 9038 relevant lines covered (31.46%)

1.57 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

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

UNCOV
44
                $this->register_fixes_manager();
×
45

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

53
        /**
54
         * Initialize.
55
         *
56
         * @return void
57
         */
58
        private function init() {
59

60
                add_action( 'wp_enqueue_scripts', [ 'EDAC\Inc\Enqueue_Frontend', 'enqueue' ] );
×
61

62
                $accessibility_statement = new Accessibility_Statement();
×
63
                $accessibility_statement->init_hooks();
×
64

65
                $simplified_summary = new Simplified_Summary();
×
66
                $simplified_summary->init_hooks();
×
67

68
                $lazyload_filter = new Lazyload_Filter();
×
69
                $lazyload_filter->init_hooks();
×
70
        }
71

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

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