PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 18.3
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v18.3
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / admin / pages / tools.php

tools.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 18.3, at admin/pages/tools.php

84 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 = (string) filter_input( INPUT_GET, 'tool' );
15
16 $yform = Yoast_Form::get_instance();
17 $yform->admin_header( false );
18
19 if ( $tool_page === '' ) {
20
21 $tools = [];
22
23 $tools['import-export'] = [
24 'title' => __( 'Import and Export', 'wordpress-seo' ),
25 'desc' => __( 'Import settings from other SEO plugins and export your settings for re-use on (another) site.', 'wordpress-seo' ),
26 ];
27
28 if ( WPSEO_Utils::allow_system_file_edit() === true && ! is_multisite() ) {
29 $tools['file-editor'] = [
30 'title' => __( 'File editor', 'wordpress-seo' ),
31 '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' ),
32 ];
33 }
34
35 $tools['bulk-editor'] = [
36 'title' => __( 'Bulk editor', 'wordpress-seo' ),
37 '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' ),
38 ];
39
40 echo '<p>';
41 printf(
42 /* translators: %1$s expands to Yoast SEO */
43 esc_html__( '%1$s comes with some very powerful built-in tools:', 'wordpress-seo' ),
44 'Yoast SEO'
45 );
46 echo '</p>';
47
48 echo '<ul class="ul-disc">';
49
50 $admin_url = admin_url( 'admin.php?page=wpseo_tools' );
51
52 foreach ( $tools as $slug => $tool ) {
53 $href = ( ! empty( $tool['href'] ) ) ? $admin_url . $tool['href'] : add_query_arg( [ 'tool' => $slug ], $admin_url );
54 $attr = ( ! empty( $tool['attr'] ) ) ? $tool['attr'] : '';
55
56 echo '<li>';
57 echo '<strong><a href="', esc_url( $href ), '" ', esc_attr( $attr ), '>', esc_html( $tool['title'] ), '</a></strong><br/>';
58 echo esc_html( $tool['desc'] );
59 echo '</li>';
60 }
61
62 /**
63 * Action: 'wpseo_tools_overview_list_items' - Hook to add additional tools to the overview.
64 */
65 do_action( 'wpseo_tools_overview_list_items' );
66
67 echo '</ul>';
68 }
69 else {
70 echo '<a href="', esc_url( admin_url( 'admin.php?page=wpseo_tools' ) ), '">', esc_html__( '&laquo; Back to Tools page', 'wordpress-seo' ), '</a>';
71
72 $tool_pages = [ 'bulk-editor', 'import-export' ];
73
74 if ( WPSEO_Utils::allow_system_file_edit() === true && ! is_multisite() ) {
75 $tool_pages[] = 'file-editor';
76 }
77
78 if ( in_array( $tool_page, $tool_pages, true ) ) {
79 require_once WPSEO_PATH . 'admin/views/tool-' . $tool_page . '.php';
80 }
81 }
82
83 $yform->admin_footer( false );
84