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

equalizedigital / accessibility-checker / 16448964817

22 Jul 2025 03:38PM UTC coverage: 31.548% (+0.5%) from 31.082%
16448964817

push

github

web-flow
Merge pull request #1088 from equalizedigital/steve/pro-200-add-additional-rule-information-in-the-open-issues-summary

added: additional rule information and modified rule structure for better maintainability

1597 of 3937 new or added lines in 48 files covered. (40.56%)

2828 of 8964 relevant lines covered (31.55%)

1.56 hits per line

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

0.0
/includes/classes/Rules/Rule/ExampleNewRule.php
1
<?php
2
/**
3
 * Example New Rule - demonstrates how to add a new rule to the system.
4
 *
5
 * @package EqualizeDigital\AccessibilityChecker
6
 */
7

8
namespace EqualizeDigital\AccessibilityChecker\Rules\Rule;
9

10
use EqualizeDigital\AccessibilityChecker\Rules\RuleInterface;
11

12
/**
13
 * Example New Rule class - demonstrates the structure for adding new rules.
14
 * 
15
 * To add this rule to the system:
16
 * 1. Add the class name to RuleRegistry::load_rules() method
17
 * 2. Or rely on the auto-discovery method RuleRegistry::load_rules_auto()
18
 */
19
class ExampleNewRule implements RuleInterface {
20
        /**
21
         * Get the rule definition.
22
         *
23
         * @return array The rule definition array.
24
         */
25
        public static function get_rule(): array {
NEW
26
                return [
×
NEW
27
                        'title'                 => esc_html__( 'Example New Rule', 'accessibility-checker' ),
×
NEW
28
                        'info_url'              => 'https://a11ychecker.com/help-new-rule',
×
NEW
29
                        'slug'                  => 'example_new_rule',
×
NEW
30
                        'rule_type'             => 'warning',
×
NEW
31
                        'summary'               => esc_html__( 'This is an example of a new rule added to the system.', 'accessibility-checker' ),
×
NEW
32
                        'summary_plural'        => esc_html__( 'These are examples of new rules added to the system.', 'accessibility-checker' ),
×
NEW
33
                        'why_it_matters'        => esc_html__( 'This example demonstrates how easy it is to add new accessibility rules to the checker using the class-based system.', 'accessibility-checker' ),
×
NEW
34
                        'how_to_fix'            => esc_html__( 'To implement this rule, you would add the actual accessibility checking logic and provide specific remediation steps.', 'accessibility-checker' ),
×
NEW
35
                        'references'            => [
×
NEW
36
                                [
×
NEW
37
                                        'text' => __( 'WCAG Guidelines', 'accessibility-checker' ),
×
NEW
38
                                        'url'  => 'https://www.w3.org/WAI/WCAG21/quickref/',
×
NEW
39
                                ],
×
NEW
40
                        ],
×
NEW
41
                        'ruleset'               => 'js',
×
NEW
42
                        'wcag'                  => '0.0.0', // Would be a real WCAG reference like '1.1.1'.
×
NEW
43
                        'severity'              => 3, // Medium.
×
NEW
44
                        'affected_disabilities' => [
×
NEW
45
                                esc_html__( 'Example disability impact', 'accessibility-checker' ),
×
NEW
46
                        ],
×
NEW
47
                ];
×
48
        }
49
}
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