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

equalizedigital / accessibility-checker / 16057813270

03 Jul 2025 06:21PM UTC coverage: 28.915% (-0.1%) from 29.05%
16057813270

push

github

web-flow
Merge pull request #1029 from equalizedigital/william/pro-165-urls-missing-utm-parameters-in-plugin

Update some links through the plugin to properly attribute them

32 of 160 new or added lines in 15 files covered. (20.0%)

18 existing lines in 5 files now uncovered.

1527 of 5281 relevant lines covered (28.91%)

1.66 hits per line

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

0.0
/admin/AdminPage/FixesSettingType/Text.php
1
<?php
2
/**
3
 * A class with methods to handle settings text inputs for on the fixes page.
4
 *
5
 * @package accessibility-checker
6
 */
7

8
namespace EqualizeDigital\AccessibilityChecker\Admin\AdminPage\FixesSettingType;
9

10
/**
11
 * A trait to handle settings text inputs for on the fixes page.
12
 */
13
trait Text {
14

15
        /**
16
         * Render a text input.
17
         *
18
         * @param array $args The arguments for the text input. This is expected to have a name and a description.
19
         */
20
        public static function text( $args ) {
21
                // We need a name and a description or the text field is useless.
22
                if ( ! isset( $args['name'], $args['description'] ) ) {
×
23
                        return;
×
24
                }
25

26
                $upsell       = isset( $args['upsell'] ) && $args['upsell'];
×
27
                $option_value = get_option( $args['name'] );
×
28
                ?>
29
                <label
×
30
                        for="<?php echo esc_attr( $args['name'] ); ?>"
×
31
                        style="display: block; margin-bottom: 6px;"
32
                        <?php echo ( $upsell ) ? 'class="edac-fix--disabled edac-fix--upsell"' : ''; ?>
×
33
                >
×
34
                        <?php if ( isset( $args['location'] ) && $upsell ) : ?>
×
35
                                <a class="edac-fix--upsell-link"
×
36
                                        href="<?php echo esc_url( \edac_generate_link_type( [ 'fix' => $args['fix_slug'] ] ) ); ?>"
×
37
                                        aria-label="<?php esc_attr_e( 'Get Pro to unlock this feature, opens in a new window.', 'accessibility-checker' ); ?>"
×
38
                                ><?php esc_html_e( 'Get Pro', 'accessibility-checker' ); ?></a>                        <?php endif; ?>
×
39
                        <?php echo wp_kses( $args['description'], [ 'code' => [] ] ); ?>
×
40
                        <?php
×
41
                        if ( isset( $args['help_id'] ) && ! empty( $args['help_id'] ) && $args['label'] ) :
×
42
                                $link  = \edac_generate_link_type(
×
43
                                        [
×
NEW
44
                                                'utm-campaign' => 'fix-description',
×
NEW
45
                                                'utm-content'  => $args['name'],
×
46
                                        ],
×
47
                                        'help',
×
48
                                        [
×
49
                                                'help_id' => $args['help_id'],
×
50
                                        ]
×
51
                                );
×
52
                                $label = sprintf(
×
53
                                /* translators: %s: the label of the fix */
54
                                        esc_html__( 'Read documentation for %s. Opens in a new window.', 'accessibility-checker' ),
×
55
                                        esc_html( $args['label'] )
×
56
                                );
×
57
                                ?>
58
                                <a
×
59
                                        href="<?php echo esc_url( $link ); ?>"
×
60
                                        class="edac-fix-description-help-link"
61
                                        target="_blank"
62
                                        aria-label="Read documentation for <?php echo esc_attr( $label ); ?>"
×
63
                                >
64
                                        <span class="dashicons dashicons-info"></span>
65
                                </a>
66
                        <?php endif; ?>
67
                </label>
×
68
                <input
×
69
                        type="text"
×
70
                        id="<?php echo esc_attr( $args['name'] ); ?>"
×
71
                        name="<?php echo esc_attr( $args['name'] ); ?>"
×
72
                        value="<?php echo esc_attr( $option_value ); ?>"
×
73
                        <?php echo isset( $args['condition'] ) ? 'data-condition="' . esc_attr( $args['condition'] ) . '"' : ''; ?>
×
74
                        <?php echo isset( $args['required_when'] ) ? 'data-required_when="' . esc_attr( $args['required_when'] ) . '"' : ''; ?>
×
75
                        <?php echo $upsell ? 'disabled' : ''; ?>
×
76
                        <?php echo isset( $args['fix_slug'] ) ? 'data-fix-slug="' . esc_attr( $args['fix_slug'] ) . '"' : ''; ?>
×
77
                />
×
78
                <?php
×
79
        }
80

81
        /**
82
         * Sanitize a text input.
83
         *
84
         * @param mixed $input The input to sanitize.
85
         * @return string
86
         */
87
        public static function sanitize_text( $input ) {
88
                return sanitize_text_field( $input );
×
89
        }
90
}
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