Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/wordpres.../admin/views
File: tool-import-export.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* WPSEO plugin file.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WPSEO\Admin
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
if ( ! defined( 'WPSEO_VERSION' ) ) {
[7] Fix | Delete
header( 'Status: 403 Forbidden' );
[8] Fix | Delete
header( 'HTTP/1.1 403 Forbidden' );
[9] Fix | Delete
exit();
[10] Fix | Delete
}
[11] Fix | Delete
[12] Fix | Delete
$yform = Yoast_Form::get_instance();
[13] Fix | Delete
$yoast_seo_import = false;
[14] Fix | Delete
[15] Fix | Delete
/**
[16] Fix | Delete
* The import method is used to determine if there should be something imported.
[17] Fix | Delete
*
[18] Fix | Delete
* In case of POST the user is on the Yoast SEO import page and in case of the GET the user sees a notice from
[19] Fix | Delete
* Yoast SEO that we can import stuff for that plugin.
[20] Fix | Delete
*/
[21] Fix | Delete
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are only comparing the variable so no need to sanitize.
[22] Fix | Delete
if ( isset( $_POST['import_external'] ) && wp_unslash( $_POST['import_external'] ) === 'Import' ) {
[23] Fix | Delete
check_admin_referer( 'wpseo-import-plugins' );
[24] Fix | Delete
if ( isset( $_POST['import_external_plugin'] ) && is_string( $_POST['import_external_plugin'] ) ) {
[25] Fix | Delete
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are using the variable as a class name.
[26] Fix | Delete
$yoast_seo_class = wp_unslash( $_POST['import_external_plugin'] );
[27] Fix | Delete
if ( class_exists( $yoast_seo_class ) ) {
[28] Fix | Delete
$yoast_seo_import = new WPSEO_Import_Plugin( new $yoast_seo_class(), 'import' );
[29] Fix | Delete
}
[30] Fix | Delete
}
[31] Fix | Delete
}
[32] Fix | Delete
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are only comparing the variable so no need to sanitize.
[33] Fix | Delete
elseif ( isset( $_POST['clean_external'] ) && wp_unslash( $_POST['clean_external'] ) === 'Clean up' ) {
[34] Fix | Delete
check_admin_referer( 'wpseo-clean-plugins' );
[35] Fix | Delete
if ( isset( $_POST['clean_external_plugin'] ) && is_string( $_POST['clean_external_plugin'] ) ) {
[36] Fix | Delete
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are using the variable as a class name.
[37] Fix | Delete
$yoast_seo_class = wp_unslash( $_POST['clean_external_plugin'] );
[38] Fix | Delete
if ( class_exists( $yoast_seo_class ) ) {
[39] Fix | Delete
$yoast_seo_import = new WPSEO_Import_Plugin( new $yoast_seo_class(), 'cleanup' );
[40] Fix | Delete
}
[41] Fix | Delete
}
[42] Fix | Delete
}
[43] Fix | Delete
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are only comparing to an empty string.
[44] Fix | Delete
elseif ( isset( $_POST['settings_import'] ) && wp_unslash( $_POST['settings_import'] ) !== '' ) {
[45] Fix | Delete
$yoast_seo_import = new WPSEO_Import_Settings();
[46] Fix | Delete
$yoast_seo_import->import();
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
/**
[50] Fix | Delete
* Allow custom import actions.
[51] Fix | Delete
*
[52] Fix | Delete
* @param WPSEO_Import_Status $yoast_seo_import Contains info about the handled import.
[53] Fix | Delete
*/
[54] Fix | Delete
$yoast_seo_import = apply_filters( 'wpseo_handle_import', $yoast_seo_import );
[55] Fix | Delete
[56] Fix | Delete
if ( $yoast_seo_import ) {
[57] Fix | Delete
[58] Fix | Delete
$yoast_seo_message = '';
[59] Fix | Delete
if ( $yoast_seo_import->status instanceof WPSEO_Import_Status ) {
[60] Fix | Delete
$yoast_seo_message = $yoast_seo_import->status->get_msg();
[61] Fix | Delete
}
[62] Fix | Delete
[63] Fix | Delete
/**
[64] Fix | Delete
* Allow customization of import/export message.
[65] Fix | Delete
*
[66] Fix | Delete
* @param string $yoast_seo_msg The message.
[67] Fix | Delete
*/
[68] Fix | Delete
$yoast_seo_msg = apply_filters( 'wpseo_import_message', $yoast_seo_message );
[69] Fix | Delete
[70] Fix | Delete
if ( ! empty( $yoast_seo_msg ) ) {
[71] Fix | Delete
$yoast_seo_status = 'error';
[72] Fix | Delete
if ( $yoast_seo_import->status->status ) {
[73] Fix | Delete
$yoast_seo_status = 'updated';
[74] Fix | Delete
}
[75] Fix | Delete
[76] Fix | Delete
$yoast_seo_class = 'message ' . $yoast_seo_status;
[77] Fix | Delete
[78] Fix | Delete
echo '<div id="message" class="', esc_attr( $yoast_seo_status ), '"><p>', esc_html( $yoast_seo_msg ), '</p></div>';
[79] Fix | Delete
}
[80] Fix | Delete
}
[81] Fix | Delete
[82] Fix | Delete
$yoast_seo_tabs = [
[83] Fix | Delete
'wpseo-import' => [
[84] Fix | Delete
'label' => __( 'Import settings', 'wordpress-seo' ),
[85] Fix | Delete
],
[86] Fix | Delete
'wpseo-export' => [
[87] Fix | Delete
'label' => __( 'Export settings', 'wordpress-seo' ),
[88] Fix | Delete
],
[89] Fix | Delete
'import-seo' => [
[90] Fix | Delete
'label' => __( 'Import from other SEO plugins', 'wordpress-seo' ),
[91] Fix | Delete
],
[92] Fix | Delete
];
[93] Fix | Delete
[94] Fix | Delete
?>
[95] Fix | Delete
<br/><br/>
[96] Fix | Delete
[97] Fix | Delete
<h2 class="nav-tab-wrapper" id="wpseo-tabs">
[98] Fix | Delete
<?php foreach ( $yoast_seo_tabs as $identifier => $tab ) : ?>
[99] Fix | Delete
<a class="nav-tab" id="<?php echo esc_attr( $identifier . '-tab' ); ?>" href="<?php echo esc_url( '#top#' . $identifier ); ?>"><?php echo esc_html( $tab['label'] ); ?></a>
[100] Fix | Delete
<?php endforeach; ?>
[101] Fix | Delete
[102] Fix | Delete
<?php
[103] Fix | Delete
/**
[104] Fix | Delete
* Allow adding a custom import tab header.
[105] Fix | Delete
*/
[106] Fix | Delete
do_action( 'wpseo_import_tab_header' );
[107] Fix | Delete
?>
[108] Fix | Delete
</h2>
[109] Fix | Delete
[110] Fix | Delete
<?php
[111] Fix | Delete
[112] Fix | Delete
foreach ( $yoast_seo_tabs as $identifier => $tab ) {
[113] Fix | Delete
printf( '<div id="%s" class="wpseotab">', esc_attr( $identifier ) );
[114] Fix | Delete
require_once WPSEO_PATH . 'admin/views/tabs/tool/' . $identifier . '.php';
[115] Fix | Delete
echo '</div>';
[116] Fix | Delete
}
[117] Fix | Delete
[118] Fix | Delete
/**
[119] Fix | Delete
* Allow adding a custom import tab.
[120] Fix | Delete
*/
[121] Fix | Delete
do_action( 'wpseo_import_tab_content' );
[122] Fix | Delete
[123] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function