| @@ -10,10 +10,16 @@ | ||
| 10 | 10 | header( 'HTTP/1.1 403 Forbidden' ); |
| 11 | 11 | exit(); |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | -$tool_page = (string) filter_input( INPUT_GET, 'tool' ); | |
| 14 | +$tool_page = ''; | |
| 15 | 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 | + | |
| 16 | 22 | $yform = Yoast_Form::get_instance(); |
| 17 | 23 | $yform->admin_header( false ); |
| 18 | 24 | |
| 19 | 25 | if ( $tool_page === '' ) { |
| @@ -34,8 +40,9 @@ | ||
| 34 | 40 | |
| 35 | 41 | $tools['bulk-editor'] = [ |
| 36 | 42 | 'title' => __( 'Bulk editor', 'wordpress-seo' ), |
| 37 | 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 | + 'url' => admin_url( 'admin.php?page=wpseo_page_bulk_edit' ), | |
| 38 | 45 | ]; |
| 39 | 46 | |
| 40 | 47 | echo '<p>'; |
| 41 | 48 | printf( |
| @@ -40,9 +47,9 @@ | ||
| 40 | 47 | echo '<p>'; |
| 41 | 48 | printf( |
| 42 | 49 | /* translators: %1$s expands to Yoast SEO */ |
| 43 | 50 | esc_html__( '%1$s comes with some very powerful built-in tools:', 'wordpress-seo' ), |
| 44 | - 'Yoast SEO' | |
| 51 | + 'Yoast SEO', | |
| 45 | 52 | ); |
| 46 | 53 | echo '</p>'; |
| 47 | 54 | |
| 48 | 55 | echo '<ul class="ul-disc">'; |
| @@ -49,9 +56,17 @@ | ||
| 49 | 56 | |
| 50 | 57 | $admin_url = admin_url( 'admin.php?page=wpseo_tools' ); |
| 51 | 58 | |
| 52 | 59 | foreach ( $tools as $slug => $tool ) { |
| 53 | - $href = ( ! empty( $tool['href'] ) ) ? $admin_url . $tool['href'] : add_query_arg( [ 'tool' => $slug ], $admin_url ); | |
| 60 | + if ( ! empty( $tool['url'] ) ) { | |
| 61 | + $href = $tool['url']; | |
| 62 | + } | |
| 63 | + elseif ( ! empty( $tool['href'] ) ) { | |
| 64 | + $href = $admin_url . $tool['href']; | |
| 65 | + } | |
| 66 | + else { | |
| 67 | + $href = add_query_arg( [ 'tool' => $slug ], $admin_url ); | |
| 68 | + } | |
| 54 | 69 | $attr = ( ! empty( $tool['attr'] ) ) ? $tool['attr'] : ''; |
| 55 | 70 | |
| 56 | 71 | echo '<li>'; |
| 57 | 72 | echo '<strong><a href="', esc_url( $href ), '" ', esc_attr( $attr ), '>', esc_html( $tool['title'] ), '</a></strong><br/>'; |
| @@ -59,11 +74,12 @@ | ||
| 59 | 74 | echo '</li>'; |
| 60 | 75 | } |
| 61 | 76 | |
| 62 | 77 | /** |
| 63 | - * Action: 'wpseo_tools_overview_list_items' - Hook to add additional tools to the overview. | |
| 78 | + * WARNING: This hook is intended for internal use only. | |
| 79 | + * Don't use it in your code as it will be removed shortly. | |
| 64 | 80 | */ |
| 65 | - do_action( 'wpseo_tools_overview_list_items' ); | |
| 81 | + do_action( 'wpseo_tools_overview_list_items_internal' ); | |
| 66 | 82 | |
| 67 | 83 | echo '</ul>'; |
| 68 | 84 | } |
| 69 | 85 | else { |
| @@ -68,9 +84,9 @@ | ||
| 68 | 84 | } |
| 69 | 85 | else { |
| 70 | 86 | echo '<a href="', esc_url( admin_url( 'admin.php?page=wpseo_tools' ) ), '">', esc_html__( '« Back to Tools page', 'wordpress-seo' ), '</a>'; |
| 71 | 87 | |
| 72 | - $tool_pages = [ 'bulk-editor', 'import-export' ]; | |
| 88 | + $tool_pages = [ 'import-export' ]; | |
| 73 | 89 | |
| 74 | 90 | if ( WPSEO_Utils::allow_system_file_edit() === true && ! is_multisite() ) { |
| 75 | 91 | $tool_pages[] = 'file-editor'; |
| 76 | 92 | } |