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

Yoast / wordpress-seo / 30c6b14cf72bf2df4c2ac8a578b09d5053a0b516

14 Jul 2025 08:34AM UTC coverage: 53.548% (+0.1%) from 53.412%
30c6b14cf72bf2df4c2ac8a578b09d5053a0b516

Pull #22356

github

kyrylo-polozenko-newfold
fix: lint js
Pull Request #22356: Feature/get redirects

8217 of 14316 branches covered (57.4%)

Branch coverage included in aggregate %.

1 of 23 new or added lines in 9 files covered. (4.35%)

105 existing lines in 8 files now uncovered.

30345 of 57698 relevant lines covered (52.59%)

41381.79 hits per line

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

0.0
/admin/views/redirects.php
1
<?php
2
/**
3
 * WPSEO plugin file.
4
 *
5
 * @package WPSEO\Admin
6
 * @since   19.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
?>
NEW
16
<div class="wrap yoast wpseo-admin-page page-wpseo_redirects">
×
17
        <h1 id="wpseo-title"><?php echo esc_html( get_admin_page_title() ); ?></h1>
×
18
        <div class="wpseo_content_wrapper" style="position: relative;">
19
                <div style="position: absolute;top: 0;bottom: 0;left: 0;right: 0;z-index: 100; display: flex;justify-content: center;align-items: center;background: radial-gradient(#ffffffcf 20%, #ffffff00 50%);">
UNCOV
20
                        <a class="yoast-button-upsell" data-action="load-nfd-ctb" data-ctb-id="f6a84663-465f-4cb5-8ba5-f7a6d72224b2" href="<?php echo esc_url( WPSEO_Shortlinker::get( 'https://yoa.st/redirect-manager-upsell' ) ); ?>" target="_blank">
×
21
                                <?php
UNCOV
22
                                echo esc_html__( 'Unlock with Premium', 'wordpress-seo' )
×
UNCOV
23
                                        // phpcs:ignore WordPress.Security.EscapeOutput -- Already escapes correctly.
×
UNCOV
24
                                        . WPSEO_Admin_Utils::get_new_tab_message();
×
25
                                ?>
UNCOV
26
                                <span aria-hidden="true" class="yoast-button-upsell__caret"></span></a>
×
UNCOV
27
                </div>
×
UNCOV
28
                <div class="wpseo_content_cell" id="wpseo_content_top" style="opacity: 0.5;">
×
UNCOV
29
                        <h2 class="nav-tab-wrapper" id="wpseo-tabs">
×
UNCOV
30
                                <a class="nav-tab nav-tab-active" id="tab-url-tab" href="#" tabindex="-1">
×
UNCOV
31
                                        <?php
×
UNCOV
32
                                        esc_html_e( 'Redirects', 'wordpress-seo' )
×
UNCOV
33
                                        ?>
×
UNCOV
34
                                </a>
×
35
                                <a class="nav-tab" id="tab-url-tab" href="" tabindex="-1">
36
                                        <?php
UNCOV
37
                                        esc_html_e( 'Regex Redirects', 'wordpress-seo' )
×
UNCOV
38
                                        ?>
×
UNCOV
39
                                </a>
×
40
                                <a class="nav-tab" id="tab-url-tab" href="#" tabindex="-1">
41
                                        <?php
UNCOV
42
                                        esc_html_e( 'Settings', 'wordpress-seo' )
×
UNCOV
43
                                        ?>
×
UNCOV
44
                                        </a>
×
45
                        </h2>
46

47
                        <div id="table-plain" class="tab-url redirect-table-tab">
48
                                <h2>
49
                                        <?php
UNCOV
50
                                        esc_html_e( 'Plain redirects', 'wordpress-seo' )
×
UNCOV
51
                                        ?>
×
UNCOV
52
                                </h2>
×
53
                                <form class="wpseo-new-redirect-form" method="post">
54
                                        <div class="wpseo_redirect_form">
55
                                                <div class="redirect_form_row" id="row-wpseo_redirects_type">
56
                                                        <label class="textinput" for="wpseo_redirects_type">
57
                                                                <span class="title">
58
                                                                        <?php
UNCOV
59
                                                                        esc_html_e( 'Type', 'wordpress-seo' )
×
UNCOV
60
                                                                        ?>
×
UNCOV
61
                                                                </span>
×
62
                                                        </label>
63
                                                        <select name="wpseo_redirects_type" id="wpseo_redirects_type" class="select select2-hidden-accessible" data-select2-id="wpseo_redirects_type" tabindex="-1" aria-hidden="true">
64
                                                                <option value="301" data-select2-id="2">
65
                                                                        <?php
UNCOV
66
                                                                        esc_html_e( '301 Moved Permanently', 'wordpress-seo' )
×
UNCOV
67
                                                                        ?>
×
UNCOV
68
                                                                </option>
×
69
                                                        </select>
70
                                                        <span class="select2 select2-container select2-container--default" dir="ltr" data-select2-id="1" style="width: 400px;">
71
                                                                <span class="selection">
72
                                                                        <span class="select2-selection select2-selection--single" role="combobox" aria-haspopup="true" aria-expanded="false" tabindex="-1" aria-disabled="false" aria-labelledby="select2-wpseo_redirects_type-container">
73
                                                                                <span class="select2-selection__rendered" id="select2-wpseo_redirects_type-container" role="textbox" aria-readonly="true" title="301 Moved Permanently">
74
                                                                                        <?php
UNCOV
75
                                                                                        esc_html_e( '301 Moved Permanently', 'wordpress-seo' )
×
UNCOV
76
                                                                                        ?>
×
UNCOV
77
                                                                                </span>
×
78
                                                                                <span class="select2-selection__arrow" role="presentation">
79
                                                                                        <b role="presentation"></b>
80
                                                                                </span>
81
                                                                        </span>
82
                                                                </span>
83
                                                                <span class="dropdown-wrapper" aria-hidden="true"></span>
84
                                                        </span>
85
                                                </div>
86

87
                                                <p class="label desc description wpseo-redirect-clear">
88
                                                        <?php
UNCOV
89
                                                        printf(
×
90
                                                                /* translators: 1: opens a link. 2: closes the link. */
UNCOV
91
                                                                esc_html__( 'The redirect type is the HTTP response code sent to the browser telling the browser what type of redirect is served. %1$sLearn more about redirect types%2$s.', 'wordpress-seo' ),
×
UNCOV
92
                                                                '<a href="#" target="_blank">',
×
UNCOV
93
                                                                '</a>'
×
UNCOV
94
                                                        );
×
95
                                                        ?>
UNCOV
96
                                                <div class="redirect_form_row" id="row-wpseo_redirects_origin">
×
UNCOV
97
                                                        <label class="textinput" for="wpseo_redirects_origin">
×
UNCOV
98
                                                                <span class="title">
×
UNCOV
99
                                                                        <?php
×
UNCOV
100
                                                                        esc_html_e( 'Old URL', 'wordpress-seo' )
×
UNCOV
101
                                                                        ?>
×
UNCOV
102
                                                                </span>
×
103
                                                        </label>
104
                                                        <input type="text" class="textinput" name="wpseo_redirects_origin" id="wpseo_redirects_origin" value="" tabindex="-1">
105
                                                </div>
106
                                                <br class="clear">
107

108
                                                <div class="redirect_form_row wpseo_redirect_target_holder" id="row-wpseo_redirects_target">
109
                                                        <label class="textinput" for="wpseo_redirects_target">
110
                                                                <span class="title">
111
                                                                        <?php
UNCOV
112
                                                                        esc_html_e( 'URL', 'wordpress-seo' )
×
UNCOV
113
                                                                        ?>
×
UNCOV
114
                                                                </span>
×
115
                                                        </label>
116
                                                        <input type="text" class="textinput" name="wpseo_redirects_target" id="wpseo_redirects_target" value="" tabindex="-1">
117
                                                </div>
118
                                                <br class="clear">
119

120
                                                <button type="button" class="button button-primary" tabindex="-1">
121
                                                        <?php
UNCOV
122
                                                        esc_html_e( 'Add Redirect', 'wordpress-seo' )
×
UNCOV
123
                                                        ?>
×
UNCOV
124
                                                </button>
×
125
                                        </div>
126
                                </form>
127
                                <p class="desc">&nbsp;</p>
128
                                <form id="plain" class="wpseo-redirects-table-form" method="post" action="">
129
                                        <input type="hidden" class="wpseo_redirects_ajax_nonce" name="wpseo_redirects_ajax_nonce" value="6ccb86df42">
130
                                        <input type="hidden" id="_wpnonce" name="_wpnonce" value="4b02cca185">
131
                                        <input type="hidden" name="_wp_http_referer" value="/wp-admin/admin.php?page=wpseo_redirects">        <div class="tablenav top">
132

133
                                        <div class="alignleft actions">
134
                                                <select name="redirect-type" id="filter-by-redirect" tabindex="-1">
135
                                                        <option selected="selected" value="0">
136
                                                                <?php
UNCOV
137
                                                                esc_html_e( 'All redirect types', 'wordpress-seo' )
×
UNCOV
138
                                                                ?>
×
UNCOV
139
                                                        </option>
×
140
                                                </select>
UNCOV
141
                                                <input type="button" name="filter_action" id="post-query-submit" class="button" value="<?php esc_attr_e( 'Filter', 'wordpress-seo' ); ?>" tabindex="-1">
×
142
                                        </div>
143
                                                <br class="clear">
144
                                        </div>
145
                                        <table class="wp-list-table widefat fixed striped table-view-list plain">
146
                                                <thead>
147
                                                        <tr>
148
                                                                <td id="cb" class="manage-column column-cb check-column">
149
                                                                        <input id="cb-select-all-1" type="checkbox"  tabindex="-1">
150
                                                                </td>
151
                                                                <th scope="col" id="type" class="manage-column column-type column-primary sortable desc">
152
                                                                        <a href="#" tabindex="-1">
153
                                                                                <span>
154
                                                                                <?php
UNCOV
155
                                                                                esc_html_e( 'Type', 'wordpress-seo' )
×
UNCOV
156
                                                                                ?>
×
UNCOV
157
                                                                                </span>
×
158
                                                                                <span class="sorting-indicator"></span>
159
                                                                        </a>
160
                                                                </th>
161
                                                                <th scope="col" id="old" class="manage-column column-old sortable desc">
162
                                                                        <a href="#" tabindex="-1">
163
                                                                                <span>
164
                                                                                        <?php
UNCOV
165
                                                                                        esc_html_e( 'Old URL', 'wordpress-seo' )
×
UNCOV
166
                                                                                        ?>
×
UNCOV
167
                                                                                </span>
×
168
                                                                                <span class="sorting-indicator"></span>
169
                                                                        </a>
170
                                                                </th>
171
                                                                <th scope="col" id="new" class="manage-column column-new sortable desc">
172
                                                                        <a href="#" tabindex="-1">
173
                                                                                <span>
174
                                                                                        <?php
UNCOV
175
                                                                                        esc_html_e( 'New URL', 'wordpress-seo' )
×
UNCOV
176
                                                                                        ?>
×
UNCOV
177
                                                                                </span>
×
178
                                                                                <span class="sorting-indicator"></span>
179
                                                                        </a>
180
                                                                </th>
181
                                                        </tr>
182
                                                </thead>
183

184
                                                <tbody id="the-list">
185
                                                        <tr class="no-items">
186
                                                                <td class="colspanchange" colspan="4">
187
                                                                        <?php
UNCOV
188
                                                                        esc_html_e( 'No items found.', 'wordpress-seo' )
×
UNCOV
189
                                                                        ?>
×
UNCOV
190
                                                                </td>
×
191
                                                        </tr>
192
                                                </tbody>
193

194
                                                <tfoot>
195
                                                        <tr>
196
                                                                <td class="manage-column column-cb check-column">
197
                                                                        <input id="cb-select-all-2" type="checkbox" tabindex="-1">
198
                                                                </td>
199
                                                                <th scope="col" class="manage-column column-type column-primary sortable desc">
200
                                                                        <a href="#" tabindex="-1">
201
                                                                                <span>
202
                                                                                        <?php
UNCOV
203
                                                                                        esc_html_e( 'Type', 'wordpress-seo' )
×
UNCOV
204
                                                                                        ?>
×
UNCOV
205
                                                                                </span>
×
206
                                                                                <span class="sorting-indicator"></span></a>
207
                                                                </th>
208
                                                                <th scope="col" class="manage-column column-old sortable desc">
209
                                                                        <a href="#" tabindex="-1">
210
                                                                                <span>
211
                                                                                        <?php
UNCOV
212
                                                                                        esc_html_e( 'Old URL', 'wordpress-seo' )
×
UNCOV
213
                                                                                        ?>
×
UNCOV
214
                                                                                </span>
×
215
                                                                                <span class="sorting-indicator"></span>
216
                                                                        </a>
217
                                                                </th>
218
                                                                <th scope="col" class="manage-column column-new sortable desc">
219
                                                                        <a href="#" tabindex="-1">
220
                                                                                <span>
221
                                                                                        <?php
UNCOV
222
                                                                                        esc_html_e( 'New URL', 'wordpress-seo' )
×
UNCOV
223
                                                                                        ?>
×
UNCOV
224
                                                                                </span>
×
225
                                                                                <span class="sorting-indicator"></span></a>
226
                                                                </th>
227
                                                        </tr>
228
                                                </tfoot>
229

230
                                        </table>
231
                                </form>
232
                        </div>
233

234
                        <br class="clear">
235

236
                </div><!-- end of div wpseo_content_top --></div><!-- end of div wpseo_content_wrapper -->
237
</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

© 2025 Coveralls, Inc