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

Yoast / wordpress-seo / 7246020975

18 Dec 2023 09:20AM UTC coverage: 49.309% (+0.07%) from 49.243%
7246020975

push

github

web-flow
Merge pull request #20951 from Yoast/remove-code-deprecated-up-to-19-2

Remove code deprecated up to 19.12

15377 of 31185 relevant lines covered (49.31%)

4.07 hits per line

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

0.0
/admin/pages/tools.php
1
<?php
2
/**
3
 * WPSEO plugin file.
4
 *
5
 * @package WPSEO\Admin
6
 */
7

8
if ( ! defined( 'WPSEO_VERSION' ) ) {
×
9
        header( 'Status: 403 Forbidden' );
×
10
        header( 'HTTP/1.1 403 Forbidden' );
×
11
        exit();
×
12
}
13

14
$tool_page = '';
×
15

16
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
17
if ( isset( $_GET['tool'] ) && is_string( $_GET['tool'] ) ) {
×
18
        // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
19
        $tool_page = sanitize_text_field( wp_unslash( $_GET['tool'] ) );
×
20
}
21

22
$yform = Yoast_Form::get_instance();
×
23
$yform->admin_header( false );
×
24

25
if ( $tool_page === '' ) {
×
26

27
        $tools = [];
×
28

29
        $tools['import-export'] = [
×
30
                'title' => __( 'Import and Export', 'wordpress-seo' ),
×
31
                'desc'  => __( 'Import settings from other SEO plugins and export your settings for re-use on (another) site.', 'wordpress-seo' ),
×
32
        ];
×
33

34
        if ( WPSEO_Utils::allow_system_file_edit() === true && ! is_multisite() ) {
×
35
                $tools['file-editor'] = [
×
36
                        'title' => __( 'File editor', 'wordpress-seo' ),
×
37
                        'desc'  => __( 'This tool allows you to quickly change important files for your SEO, like your robots.txt and, if you have one, your .htaccess file.', 'wordpress-seo' ),
×
38
                ];
×
39
        }
40

41
        $tools['bulk-editor'] = [
×
42
                'title' => __( 'Bulk editor', 'wordpress-seo' ),
×
43
                'desc'  => __( 'This tool allows you to quickly change titles and descriptions of your posts and pages without having to go into the editor for each page.', 'wordpress-seo' ),
×
44
        ];
×
45

46
        echo '<p>';
×
47
        printf(
×
48
                /* translators: %1$s expands to Yoast SEO */
49
                esc_html__( '%1$s comes with some very powerful built-in tools:', 'wordpress-seo' ),
×
50
                'Yoast SEO'
×
51
        );
×
52
        echo '</p>';
×
53

54
        echo '<ul class="ul-disc">';
×
55

56
        $admin_url = admin_url( 'admin.php?page=wpseo_tools' );
×
57

58
        foreach ( $tools as $slug => $tool ) {
×
59
                $href = ( ! empty( $tool['href'] ) ) ? $admin_url . $tool['href'] : add_query_arg( [ 'tool' => $slug ], $admin_url );
×
60
                $attr = ( ! empty( $tool['attr'] ) ) ? $tool['attr'] : '';
×
61

62
                echo '<li>';
×
63
                echo '<strong><a href="', esc_url( $href ), '" ', esc_attr( $attr ), '>', esc_html( $tool['title'] ), '</a></strong><br/>';
×
64
                echo esc_html( $tool['desc'] );
×
65
                echo '</li>';
×
66
        }
67

68
        /**
69
         * WARNING: This hook is intended for internal use only.
70
         * Don't use it in your code as it will be removed shortly.
71
         */
72
        do_action( 'wpseo_tools_overview_list_items_internal' );
×
73

74
        echo '</ul>';
×
75
}
76
else {
77
        echo '<a href="', esc_url( admin_url( 'admin.php?page=wpseo_tools' ) ), '">', esc_html__( '&laquo; Back to Tools page', 'wordpress-seo' ), '</a>';
×
78

79
        $tool_pages = [ 'bulk-editor', 'import-export' ];
×
80

81
        if ( WPSEO_Utils::allow_system_file_edit() === true && ! is_multisite() ) {
×
82
                $tool_pages[] = 'file-editor';
×
83
        }
84

85
        if ( in_array( $tool_page, $tool_pages, true ) ) {
×
86
                require_once WPSEO_PATH . 'admin/views/tool-' . $tool_page . '.php';
×
87
        }
88
}
89

90
$yform->admin_footer( false );
×
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