| 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 |
/* translators: %1$s expands to Yoast SEO */ |
| 15 |
$submit_button_value = sprintf( __( 'Export your %1$s settings', 'wordpress-seo' ), 'Yoast SEO' ); |
| 16 |
|
| 17 |
// phpcs:ignore WordPress.Security.NonceVerification.Missing,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: The nonce will be verified in WPSEO_Export below, We are only strictly comparing with '1'. |
| 18 |
if ( isset( $_POST['do_export'] ) && wp_unslash( $_POST['do_export'] ) === '1' ) { |
| 19 |
$export = new WPSEO_Export(); |
| 20 |
$export->export(); |
| 21 |
return; |
| 22 |
} |
| 23 |
|
| 24 |
$wpseo_export_phrase = sprintf( |
| 25 |
/* translators: %1$s expands to Yoast SEO */ |
| 26 |
__( 'Export your %1$s settings here, to copy them on another site.', 'wordpress-seo' ), |
| 27 |
'Yoast SEO', |
| 28 |
); |
| 29 |
?> |
| 30 |
|
| 31 |
<p><?php echo esc_html( $wpseo_export_phrase ); ?></p> |
| 32 |
<form |
| 33 |
action="<?php echo esc_url( admin_url( 'admin.php?page=wpseo_tools&tool=import-export#top#wpseo-export' ) ); ?>" |
| 34 |
method="post" |
| 35 |
accept-charset="<?php echo esc_attr( get_bloginfo( 'charset' ) ); ?>"> |
| 36 |
<?php wp_nonce_field( WPSEO_Export::NONCE_ACTION ); ?> |
| 37 |
<input type="hidden" name="do_export" value="1" /> |
| 38 |
<button type="submit" class="button button-primary" id="export-button"><?php echo esc_html( $submit_button_value ); ?></button> |
| 39 |
</form> |
| 40 |
|