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

Yoast / wordpress-seo / 5066322038

pending completion
5066322038

push

github

GitHub
Merge pull request #20316 from Yoast/JRF/ghactions-run-more-selectively

2550 of 29012 relevant lines covered (8.79%)

0.32 hits per line

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

0.0
/src/integrations/admin/redirects-page-integration.php
1
<?php
2

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

5
use Yoast\WP\SEO\Conditionals\Admin_Conditional;
6
use Yoast\WP\SEO\Conditionals\Premium_Inactive_Conditional;
7
use Yoast\WP\SEO\Integrations\Integration_Interface;
8

9
/**
10
 * Redirects_Page_Integration class.
11
 */
12
class Redirects_Page_Integration implements Integration_Interface {
13

14
        /**
15
         * Sets up the hooks.
16
         *
17
         * @return void
18
         */
19
        public function register_hooks() {
20
                \add_filter( 'wpseo_submenu_pages', [ $this, 'add_submenu_page' ], 9 );
×
21
        }
22

23
        /**
24
         * Returns the conditionals based on which this loadable should be active.
25
         *
26
         * In this case: only when on an admin page and Premium is not active.
27
         *
28
         * @return array The conditionals.
29
         */
30
        public static function get_conditionals() {
31
                return [
×
32
                        Admin_Conditional::class,
×
33
                        Premium_Inactive_Conditional::class,
×
34
                ];
×
35
        }
36

37
        /**
38
         * Adds the redirects submenu page.
39
         *
40
         * @param array $submenu_pages The Yoast SEO submenu pages.
41
         *
42
         * @return array The filtered submenu pages.
43
         */
44
        public function add_submenu_page( $submenu_pages ) {
45
                $submenu_pages[] = [
×
46
                        'wpseo_dashboard',
×
47
                        '',
×
48
                        \__( 'Redirects', 'wordpress-seo' ) . ' <span class="yoast-badge yoast-premium-badge"></span>',
×
49
                        'edit_others_posts',
×
50
                        'wpseo_redirects',
×
51
                        [ $this, 'display' ],
×
52
                ];
×
53

54
                return $submenu_pages;
×
55
        }
56

57
        /**
58
         * Displays the redirects page.
59
         *
60
         * @return void
61
         */
62
        public function display() {
63
                require \WPSEO_PATH . 'admin/pages/redirects.php';
×
64
        }
65
}
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