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

Yoast / wordpress-seo / 6987097851

25 Nov 2023 04:49AM UTC coverage: 49.206% (-0.1%) from 49.302%
6987097851

push

github

web-flow
Merge pull request #20878 from Yoast/JRF/ghactions-minor-tweak

GH Actions: update a few links in inline comments

15305 of 31104 relevant lines covered (49.21%)

4.03 hits per line

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

0.0
/src/presenters/admin/beta-badge-presenter.php
1
<?php
2

3
namespace Yoast\WP\SEO\Presenters\Admin;
4

5
use Yoast\WP\SEO\Presenters\Abstract_Presenter;
6

7
/**
8
 * Represents the presenter class for "Beta" badges.
9
 */
10
class Beta_Badge_Presenter extends Abstract_Presenter {
11

12
        /**
13
         * Identifier of the badge.
14
         *
15
         * @var string
16
         */
17
        private $id;
18

19
        /**
20
         * Optional link of the badge.
21
         *
22
         * @var string
23
         */
24
        private $link;
25

26
        /**
27
         * Beta_Badge_Presenter constructor.
28
         *
29
         * @param string $id   Id of the badge.
30
         * @param string $link Optional link of the badge.
31
         */
32
        public function __construct( $id, $link = '' ) {
×
33
                $this->id   = $id;
×
34
                $this->link = $link;
×
35
        }
36

37
        /**
38
         * Presents the Beta Badge. If a link has been passed, the badge is presented with the link.
39
         * Otherwise a static badge is presented.
40
         *
41
         * @return string The styled Beta Badge.
42
         */
43
        public function present() {
×
44
                if ( $this->link !== '' ) {
×
45
                        return \sprintf(
×
46
                                '<a class="yoast-badge yoast-badge__is-link yoast-beta-badge" id="%1$s-beta-badge" href="%2$s">%3$s</a>',
×
47
                                \esc_attr( $this->id ),
×
48
                                \esc_url( $this->link ),
×
49
                                'Beta' // We don't want this string to be translatable.
×
50
                        );
×
51
                }
52

53
                return \sprintf(
×
54
                        '<span class="yoast-badge yoast-beta-badge" id="%1$s-beta-badge">%2$s</span>',
×
55
                        \esc_attr( $this->id ),
×
56
                        'Beta' // We don't want this string to be translatable.
×
57
                );
×
58
        }
59
}
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