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

Yoast / wordpress-seo / 56db0408fe2a0dbffe1c2c6cfad9b5c2f6941e34

14 Apr 2025 12:24PM UTC coverage: 52.454% (-2.1%) from 54.594%
56db0408fe2a0dbffe1c2c6cfad9b5c2f6941e34

Pull #22077

github

enricobattocchi
Adjust carryforward in Coveralls action
Pull Request #22077: Drop compatibility with PHP 7.2 and 7.3

7827 of 13877 branches covered (56.4%)

Branch coverage included in aggregate %.

29025 of 56379 relevant lines covered (51.48%)

42277.18 hits per line

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

0.0
/admin/views/tool-bulk-editor.php
1
<?php
2
/**
3
 * WPSEO plugin file.
4
 *
5
 * @package WPSEO\Admin
6
 * @since   1.5.0
7
 */
8

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

15
/**
16
 * Sanitizes the parameters that have been sent.
17
 *
18
 * @return array The sanitized fields.
19
 */
20
function yoast_free_bulk_sanitize_input_fields() {
21
        $possible_params = [
×
22
                'type',
×
23
                'paged',
×
24
                'post_type_filter',
×
25
                'post_status',
×
26
                'order',
×
27
                'orderby',
×
28
        ];
×
29

30
        $input_get = [];
×
31
        foreach ( $possible_params as $param_name ) {
×
32
                if ( isset( $_GET[ $param_name ] ) ) {
×
33
                        $input_get[ $param_name ] = sanitize_text_field( wp_unslash( $_GET[ $param_name ] ) );
×
34
                }
35
        }
36

37
        return $input_get;
×
38
}
39

40
$yoast_free_input_fields = yoast_free_bulk_sanitize_input_fields();
×
41

42
// Verifies the nonce.
43
if ( ! empty( $yoast_free_input_fields ) ) {
×
44
        check_admin_referer( 'bulk-editor-table', 'nonce' );
×
45
}
46

47
// If type is empty, fill it with value of first tab (title).
48
if ( ! isset( $yoast_free_input_fields['type'] ) ) {
×
49
        $yoast_free_input_fields['type'] = 'title';
×
50
}
51

52
$yoast_bulk_editor_arguments = [
×
53
        'input_fields' => $yoast_free_input_fields,
×
54
        'nonce'        => wp_create_nonce( 'bulk-editor-table' ),
×
55
];
×
56

57
$wpseo_bulk_titles_table      = new WPSEO_Bulk_Title_Editor_List_Table( $yoast_bulk_editor_arguments );
×
58
$wpseo_bulk_description_table = new WPSEO_Bulk_Description_List_Table( $yoast_bulk_editor_arguments );
×
59

60
$yoast_free_screen_reader_content = [
×
61
        'heading_views'      => __( 'Filter posts list', 'wordpress-seo' ),
×
62
        'heading_pagination' => __( 'Posts list navigation', 'wordpress-seo' ),
×
63
        'heading_list'       => __( 'Posts list', 'wordpress-seo' ),
×
64
];
×
65
get_current_screen()->set_screen_reader_content( $yoast_free_screen_reader_content );
×
66

67
if ( ! empty( $_REQUEST['_wp_http_referer'] ) && isset( $_SERVER['REQUEST_URI'] ) ) {
×
68
        $request_uri = sanitize_file_name( wp_unslash( $_SERVER['REQUEST_URI'] ) );
×
69

70
        wp_redirect(
×
71
                remove_query_arg(
×
72
                        [ '_wp_http_referer', '_wpnonce' ],
×
73
                        $request_uri
×
74
                )
×
75
        );
×
76
        exit;
×
77
}
78

79
/**
80
 * Renders a bulk editor tab.
81
 *
82
 * @param WPSEO_Bulk_List_Table $table The table to render.
83
 * @param string                $id    The id for the tab.
84
 *
85
 * @return void
86
 */
87
function wpseo_get_rendered_tab( $table, $id ) {
88
        ?>
89
        <div id="<?php echo esc_attr( $id ); ?>" class="wpseotab">
×
90
                <?php
91
                $table->show_page();
×
92
                ?>
93
        </div>
×
94
        <?php
×
95
}
96

97
?>
98
<script>
×
99
        <?php /* phpcs:ignore WordPress.Security.EscapeOutput -- WPSEO_Utils::format_json_encode is safe. */ ?>
×
100
        var wpseoBulkEditorNonce = <?php echo WPSEO_Utils::format_json_encode( wp_create_nonce( 'wpseo-bulk-editor' ) ); ?>;
×
101

102
        // eslint-disable-next-line
103
        var wpseo_bulk_editor_nonce = wpseoBulkEditorNonce;
104
</script>
105

106
<br/><br/>
107

108
<div class="wpseo_table_page">
109

110
        <h2 class="nav-tab-wrapper" id="wpseo-tabs">
111
                <a class="nav-tab" id="title-tab" href="#top#title"><?php esc_html_e( 'Title', 'wordpress-seo' ); ?></a>
×
112
                <a class="nav-tab" id="description-tab"
113
                        href="#top#description"><?php esc_html_e( 'Description', 'wordpress-seo' ); ?></a>
×
114
        </h2>
115

116
        <div class="tabwrapper">
117
                <?php wpseo_get_rendered_tab( $wpseo_bulk_titles_table, 'title' ); ?>
×
118
                <?php wpseo_get_rendered_tab( $wpseo_bulk_description_table, 'description' ); ?>
×
119
        </div>
×
120
</div>
×
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