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

Yoast / wordpress-seo / ce56606be30c7f5c204f4704a3d0086773be7b8a

05 Nov 2024 09:03AM UTC coverage: 54.637% (+0.08%) from 54.556%
ce56606be30c7f5c204f4704a3d0086773be7b8a

push

github

YoastBot
Bump version to 23.8 on free

7556 of 13543 branches covered (55.79%)

Branch coverage included in aggregate %.

29706 of 54656 relevant lines covered (54.35%)

41703.5 hits per line

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

66.67
/src/integrations/admin/old-configuration-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\Integrations\Integration_Interface;
7

8
/**
9
 * Old_Configuration_Integration class
10
 */
11
class Old_Configuration_Integration implements Integration_Interface {
12

13
        /**
14
         * {@inheritDoc}
15
         */
16
        public static function get_conditionals() {
2✔
17
                return [ Admin_Conditional::class ];
2✔
18
        }
19

20
        /**
21
         * {@inheritDoc}
22
         */
23
        public function register_hooks() {
2✔
24
                \add_filter( 'admin_menu', [ $this, 'add_submenu_page' ], 11 );
2✔
25
                \add_action( 'admin_init', [ $this, 'redirect_to_new_configuration' ] );
2✔
26
        }
1✔
27

28
        /**
29
         * Adds the old configuration submenu page.
30
         *
31
         * @param array $submenu_pages The Yoast SEO submenu pages.
32
         *
33
         * @return array the filtered submenu pages.
34
         */
35
        public function add_submenu_page( $submenu_pages ) {
2✔
36
                \add_submenu_page(
2✔
37
                        '',
2✔
38
                        \__( 'Old Configuration Wizard', 'wordpress-seo' ),
2✔
39
                        '',
2✔
40
                        'manage_options',
2✔
41
                        'wpseo_configurator',
2✔
42
                        [ $this, 'render_page' ]
2✔
43
                );
1✔
44

45
                return $submenu_pages;
2✔
46
        }
47

48
        /**
49
         * Renders the old configuration page.
50
         *
51
         * @return void
52
         */
53
        public function render_page() {
×
54
                // This page is never to be displayed.
55
        }
×
56

57
        /**
58
         * Redirects from the old configuration page to the new configuration page.
59
         *
60
         * @return void
61
         */
62
        public function redirect_to_new_configuration() {
×
63
                // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Data is not processed or saved.
64
                if ( ! isset( $_GET['page'] ) || $_GET['page'] !== 'wpseo_configurator' ) {
×
65
                        return;
×
66
                }
67
                $redirect_url = 'admin.php?page=wpseo_dashboard#/first-time-configuration';
×
68
                \wp_safe_redirect( \admin_url( $redirect_url ), 302, 'Yoast SEO' );
×
69
                exit;
×
70
        }
71
}
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