PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 18.2
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v18.2
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 / views / tabs / tool / import-seo.php

import-seo.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 18.2, at admin/views/tabs/tool/import-seo.php

121 lines 4.3 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\Views
6 */
7
8 if ( ! defined( 'WPSEO_VERSION' ) ) {
9 header( 'Status: 403 Forbidden' );
10 header( 'HTTP/1.1 403 Forbidden' );
11 exit();
12 }
13
14 // Determine if we have plugins we can import from. If so, load that tab. Otherwise, load an empty tab.
15 $import_check = new WPSEO_Import_Plugins_Detector();
16 $import_check->detect();
17 if ( count( $import_check->needs_import ) === 0 ) {
18 echo '<h2>', esc_html__( 'Import from other SEO plugins', 'wordpress-seo' ), '</h2>';
19 echo '<p>';
20 printf(
21 /* translators: %s expands to Yoast SEO */
22 esc_html__( '%s did not detect any plugin data from plugins it can import from.', 'wordpress-seo' ),
23 'Yoast SEO'
24 );
25 echo '</p>';
26
27 return;
28 }
29
30 /**
31 * Creates a select box given a name and plugins array.
32 *
33 * @param string $name Name field for the select field.
34 * @param array $plugins An array of plugins and classes.
35 *
36 * @return void
37 */
38 function wpseo_import_external_select( $name, $plugins ) {
39 esc_html_e( 'Plugin: ', 'wordpress-seo' );
40 echo '<select name="', esc_attr( $name ), '">';
41 foreach ( $plugins as $class => $plugin ) {
42 /* translators: %s is replaced with the name of the plugin we're importing from. */
43 echo '<option value="' . esc_attr( $class ) . '">' . esc_html( $plugin ) . '</option>';
44 }
45 echo '</select>';
46 }
47
48 ?>
49 <h2><?php esc_html_e( 'Import from other SEO plugins', 'wordpress-seo' ); ?></h2>
50 <p>
51 <?php esc_html_e( 'We\'ve detected data from one or more SEO plugins on your site. Please follow the following steps to import that data:', 'wordpress-seo' ); ?>
52 </p>
53
54 <div class="tab-block">
55 <h3><?php esc_html_e( 'Step 1: Create a backup', 'wordpress-seo' ); ?></h3>
56 <p>
57 <?php esc_html_e( 'Please make a backup of your database before starting this process.', 'wordpress-seo' ); ?>
58 </p>
59 </div>
60
61 <div class="tab-block">
62 <h3><?php esc_html_e( 'Step 2: Import', 'wordpress-seo' ); ?></h3>
63 <p class="yoast-import-explanation">
64 <?php
65 printf(
66 /* translators: 1: expands to Yoast SEO */
67 esc_html__( 'This will import the post metadata like SEO titles and descriptions into your %1$s metadata. It will only do this when there is no existing %1$s metadata yet. The original data will remain in place.', 'wordpress-seo' ),
68 'Yoast SEO'
69 );
70 ?>
71 </p>
72 <form action="<?php echo esc_url( admin_url( 'admin.php?page=wpseo_tools&tool=import-export#top#import-seo' ) ); ?>"
73 method="post" accept-charset="<?php echo esc_attr( get_bloginfo( 'charset' ) ); ?>">
74 <?php
75 wp_nonce_field( 'wpseo-import-plugins', '_wpnonce', true, true );
76 wpseo_import_external_select( 'import_external_plugin', $import_check->needs_import );
77 ?>
78 <?php
79 do_action( 'wpseo_import_other_plugins' );
80 ?>
81 <input type="submit" class="button button-primary" name="import_external"
82 value="<?php esc_attr_e( 'Import', 'wordpress-seo' ); ?>"/>
83 </form>
84 </div>
85
86 <div class="tab-block">
87 <h3><?php esc_html_e( 'Step 3: Check your data', 'wordpress-seo' ); ?></h3>
88 <p>
89 <?php esc_html_e( 'Please check your posts and pages and see if the metadata was successfully imported.', 'wordpress-seo' ); ?>
90 </p>
91 </div>
92
93 <div class="tab-block">
94 <h3><?php esc_html_e( 'Step 4: Do the configuration workout', 'wordpress-seo' ); ?></h3>
95 <p>
96 <?php
97 printf(
98 esc_html__( 'You should complete the configuration workout, from the SEO &rarr; Workouts page, to make sure the most important settings for your site are correct and your SEO data has been optimized.', 'wordpress-seo' ),
99 '<a href="' . esc_url( admin_url( 'admin.php?page=wpseo_dashboard' ) ) . '">',
100 '</a>'
101 );
102 ?>
103 </p>
104 </div>
105
106 <div class="tab-block">
107 <h3><?php esc_html_e( 'Step 5: Clean up', 'wordpress-seo' ); ?></h3>
108 <p class="yoast-cleanup-explanation">
109 <?php esc_html_e( 'Once you\'re certain your site is OK, you can clean up. This will remove all the original data.', 'wordpress-seo' ); ?>
110 </p>
111 <form action="<?php echo esc_url( admin_url( 'admin.php?page=wpseo_tools&tool=import-export#top#import-seo' ) ); ?>"
112 method="post" accept-charset="<?php echo esc_attr( get_bloginfo( 'charset' ) ); ?>">
113 <?php
114 wp_nonce_field( 'wpseo-clean-plugins', '_wpnonce', true, true );
115 wpseo_import_external_select( 'clean_external_plugin', $import_check->needs_import );
116 ?>
117 <input type="submit" class="button button-primary" name="clean_external"
118 value="<?php esc_attr_e( 'Clean', 'wordpress-seo' ); ?>"/>
119 </form>
120 </div>
121