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.../src/actions/importin.../aioseo
File: aioseo-taxonomy-settings-importing-action.php
<?php
[0] Fix | Delete
[1] Fix | Delete
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Given it's a very specific case.
[2] Fix | Delete
namespace Yoast\WP\SEO\Actions\Importing\Aioseo;
[3] Fix | Delete
[4] Fix | Delete
/**
[5] Fix | Delete
* Importing action for AIOSEO taxonomies settings data.
[6] Fix | Delete
*/
[7] Fix | Delete
class Aioseo_Taxonomy_Settings_Importing_Action extends Abstract_Aioseo_Settings_Importing_Action {
[8] Fix | Delete
[9] Fix | Delete
/**
[10] Fix | Delete
* The plugin of the action.
[11] Fix | Delete
*/
[12] Fix | Delete
public const PLUGIN = 'aioseo';
[13] Fix | Delete
[14] Fix | Delete
/**
[15] Fix | Delete
* The type of the action.
[16] Fix | Delete
*/
[17] Fix | Delete
public const TYPE = 'taxonomy_settings';
[18] Fix | Delete
[19] Fix | Delete
/**
[20] Fix | Delete
* The option_name of the AIOSEO option that contains the settings.
[21] Fix | Delete
*/
[22] Fix | Delete
public const SOURCE_OPTION_NAME = 'aioseo_options_dynamic';
[23] Fix | Delete
[24] Fix | Delete
/**
[25] Fix | Delete
* The map of aioseo_options to yoast settings.
[26] Fix | Delete
*
[27] Fix | Delete
* @var array
[28] Fix | Delete
*/
[29] Fix | Delete
protected $aioseo_options_to_yoast_map = [];
[30] Fix | Delete
[31] Fix | Delete
/**
[32] Fix | Delete
* The tab of the aioseo settings we're working with.
[33] Fix | Delete
*
[34] Fix | Delete
* @var string
[35] Fix | Delete
*/
[36] Fix | Delete
protected $settings_tab = 'taxonomies';
[37] Fix | Delete
[38] Fix | Delete
/**
[39] Fix | Delete
* Additional mapping between AiOSEO replace vars and Yoast replace vars.
[40] Fix | Delete
*
[41] Fix | Delete
* @var array
[42] Fix | Delete
*
[43] Fix | Delete
* @see https://yoast.com/help/list-available-snippet-variables-yoast-seo/
[44] Fix | Delete
*/
[45] Fix | Delete
protected $replace_vars_edited_map = [
[46] Fix | Delete
'#breadcrumb_404_error_format' => '', // Empty string, as AIOSEO shows nothing for that tag.
[47] Fix | Delete
'#breadcrumb_archive_post_type_format' => '', // Empty string, as AIOSEO shows nothing for that tag.
[48] Fix | Delete
'#breadcrumb_archive_post_type_name' => '', // Empty string, as AIOSEO shows nothing for that tag.
[49] Fix | Delete
'#breadcrumb_author_display_name' => '', // Empty string, as AIOSEO shows nothing for that tag.
[50] Fix | Delete
'#breadcrumb_author_first_name' => '', // Empty string, as AIOSEO shows nothing for that tag.
[51] Fix | Delete
'#breadcrumb_blog_page_title' => '', // Empty string, as AIOSEO shows nothing for that tag.
[52] Fix | Delete
'#breadcrumb_label' => '', // Empty string, as AIOSEO shows nothing for that tag.
[53] Fix | Delete
'#breadcrumb_link' => '', // Empty string, as AIOSEO shows nothing for that tag.
[54] Fix | Delete
'#breadcrumb_search_result_format' => '', // Empty string, as AIOSEO shows nothing for that tag.
[55] Fix | Delete
'#breadcrumb_search_string' => '', // Empty string, as AIOSEO shows nothing for that tag.
[56] Fix | Delete
'#breadcrumb_separator' => '', // Empty string, as AIOSEO shows nothing for that tag.
[57] Fix | Delete
'#breadcrumb_taxonomy_title' => '', // Empty string, as AIOSEO shows nothing for that tag.
[58] Fix | Delete
'#taxonomy_title' => '%%term_title%%',
[59] Fix | Delete
];
[60] Fix | Delete
[61] Fix | Delete
/**
[62] Fix | Delete
* Builds the mapping that ties AOISEO option keys with Yoast ones and their data transformation method.
[63] Fix | Delete
*
[64] Fix | Delete
* @return void
[65] Fix | Delete
*/
[66] Fix | Delete
protected function build_mapping() {
[67] Fix | Delete
$taxonomy_objects = \get_taxonomies( [ 'public' => true ], 'object' );
[68] Fix | Delete
[69] Fix | Delete
foreach ( $taxonomy_objects as $tax ) {
[70] Fix | Delete
// Use all the public taxonomies.
[71] Fix | Delete
$this->aioseo_options_to_yoast_map[ '/' . $tax->name . '/title' ] = [
[72] Fix | Delete
'yoast_name' => 'title-tax-' . $tax->name,
[73] Fix | Delete
'transform_method' => 'simple_import',
[74] Fix | Delete
];
[75] Fix | Delete
$this->aioseo_options_to_yoast_map[ '/' . $tax->name . '/metaDescription' ] = [
[76] Fix | Delete
'yoast_name' => 'metadesc-tax-' . $tax->name,
[77] Fix | Delete
'transform_method' => 'simple_import',
[78] Fix | Delete
];
[79] Fix | Delete
$this->aioseo_options_to_yoast_map[ '/' . $tax->name . '/advanced/robotsMeta/noindex' ] = [
[80] Fix | Delete
'yoast_name' => 'noindex-tax-' . $tax->name,
[81] Fix | Delete
'transform_method' => 'import_noindex',
[82] Fix | Delete
'type' => 'taxonomies',
[83] Fix | Delete
'subtype' => $tax->name,
[84] Fix | Delete
'option_name' => 'aioseo_options_dynamic',
[85] Fix | Delete
];
[86] Fix | Delete
}
[87] Fix | Delete
}
[88] Fix | Delete
[89] Fix | Delete
/**
[90] Fix | Delete
* Returns a setting map of the robot setting for post category taxonomies.
[91] Fix | Delete
*
[92] Fix | Delete
* @return array The setting map of the robot setting for post category taxonomies.
[93] Fix | Delete
*/
[94] Fix | Delete
public function pluck_robot_setting_from_mapping() {
[95] Fix | Delete
$this->build_mapping();
[96] Fix | Delete
[97] Fix | Delete
foreach ( $this->aioseo_options_to_yoast_map as $setting ) {
[98] Fix | Delete
// Return the first archive setting map.
[99] Fix | Delete
if ( $setting['transform_method'] === 'import_noindex' && isset( $setting['subtype'] ) && $setting['subtype'] === 'category' ) {
[100] Fix | Delete
return $setting;
[101] Fix | Delete
}
[102] Fix | Delete
}
[103] Fix | Delete
[104] Fix | Delete
return [];
[105] Fix | Delete
}
[106] Fix | Delete
}
[107] Fix | Delete
[108] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function