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

Yoast / wordpress-seo / a281fe93e575b8c7849342bf945b139f474b651b

30 Sep 2025 08:00AM UTC coverage: 53.211% (-0.02%) from 53.233%
a281fe93e575b8c7849342bf945b139f474b651b

Pull #22606

github

web-flow
Merge 748c2f3a0 into 8f5eaca29
Pull Request #22606: Add redirection tools page

8388 of 15525 branches covered (54.03%)

Branch coverage included in aggregate %.

1 of 34 new or added lines in 4 files covered. (2.94%)

5 existing lines in 1 file now uncovered.

31768 of 59941 relevant lines covered (53.0%)

39840.23 hits per line

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

0.0
/src/integrations/admin/redirections-tools-page.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\Helpers\Redirect_Helper;
7
use Yoast\WP\SEO\Integrations\Integration_Interface;
8

9
/**
10
 * Redirections_Tools_Page class
11
 */
12
class Redirections_Tools_Page implements Integration_Interface {
13

14
        /**
15
         * The redirect helper.
16
         *
17
         * @var Redirect_Helper
18
         */
19
        private $redirect_helper;
20

21
        /**
22
         * Returns the conditionals based in which this loadable should be active.
23
         *
24
         * @return array<string>
25
         */
NEW
26
        public static function get_conditionals() {
×
NEW
27
                return [
×
NEW
28
                        Admin_Conditional::class,
×
NEW
29
                ];
×
30
        }
31

32
        /**
33
         * Constructor.
34
         *
35
         * @param Redirect_Helper $redirect_helper The redirect helper.
36
         */
NEW
37
        public function __construct(
×
38
                Redirect_Helper $redirect_helper
39
        ) {
NEW
40
                $this->redirect_helper = $redirect_helper;
×
41
        }
42

43
        /**
44
         * Registers all hooks to WordPress.
45
         *
46
         * @return void
47
         */
NEW
48
        public function register_hooks() {
×
NEW
49
                \add_action( 'admin_menu', [ $this, 'register_admin_menu' ] );
×
50
        }
51

52
        /**
53
         * Registers the admin menu.
54
         *
55
         * @return void
56
         */
NEW
57
        public function register_admin_menu() {
×
NEW
58
                \add_management_page(
×
NEW
59
                        \esc_html__( 'Redirects', 'wordpress-seo' ),
×
NEW
60
                        \esc_html__( 'Redirects', 'wordpress-seo' ),
×
NEW
61
                        'edit_others_posts',
×
NEW
62
                        'wpseo_redirects_tools',
×
NEW
63
                        [ $this, 'show_redirects_page' ]
×
NEW
64
                );
×
65
        }
66

67
        /**
68
         * The redirects tools page render function, noop.
69
         *
70
         * @return void
71
         */
NEW
72
        public function show_redirects_page() {
×
73
                // Do nothing and let the redirect happen from the redirect integration.
NEW
74
        }
×
75
}
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