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

Yoast / wordpress-seo / 0d17440f3bae419b0309677152abfeaa8a619c39

29 Sep 2025 12:31PM UTC coverage: 53.216% (-0.02%) from 53.233%
0d17440f3bae419b0309677152abfeaa8a619c39

Pull #22606

github

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

8388 of 15525 branches covered (54.03%)

Branch coverage included in aggregate %.

0 of 24 new or added lines in 3 files covered. (0.0%)

1 existing line in 1 file now uncovered.

31767 of 59931 relevant lines covered (53.01%)

39846.88 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 [ Admin_Conditional::class ];
×
28
        }
29

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

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

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

65
        /**
66
         * The redirects tools page, that redirects to the respective Yoast admin page.
67
         *
68
         * @return void
69
         */
NEW
70
        public function show_redirects_page() {
×
NEW
71
                $this->redirect_helper->do_safe_redirect( \admin_url( 'admin.php?page=wpseo_redirects&from_tools=1' ) );
×
NEW
72
                exit;
×
73
        }
74
}
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