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

Yoast / wordpress-seo / 7004843404

27 Nov 2023 11:48AM UTC coverage: 49.206% (-0.03%) from 49.232%
7004843404

push

github

web-flow
Merge pull request #20858 from Yoast/improve-copy-in-the-ftc-57

15305 of 31104 relevant lines covered (49.21%)

4.03 hits per line

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

69.57
/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
        public function render_page() {
×
52
                // This page is never to be displayed.
53
        }
×
54

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

© 2025 Coveralls, Inc