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

Yoast / wordpress-seo / abba4d5bc97ae5733ba89412cc79bb357e5d7f21

22 Oct 2024 07:57AM UTC coverage: 54.556% (+0.06%) from 54.494%
abba4d5bc97ae5733ba89412cc79bb357e5d7f21

push

github

YoastBot
Bump version to 23.7 on free

7539 of 13559 branches covered (55.6%)

Branch coverage included in aggregate %.

29669 of 54642 relevant lines covered (54.3%)

41714.3 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\Conditionals\New_Dashboard_Ui_Conditional;
7
use Yoast\WP\SEO\Integrations\Integration_Interface;
8

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

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

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

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

46
                return $submenu_pages;
2✔
47
        }
48

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

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