: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* @package WPSEO\Admin\Tracking
* Collects anonymized settings data.
class WPSEO_Tracking_Settings_Data implements WPSEO_Collection {
* The options that need to be anonymized before they can be sent elsewhere.
* @var array All of the option_names which need to be
* anonymized before they can be sent elsewhere.
private $anonymous_settings = [
'alternate_website_name',
'company_alternate_name',
'open_graph_frontpage_title',
'open_graph_frontpage_desc',
'open_graph_frontpage_image',
'open_graph_frontpage_image_id',
'least_readability_ignore_list',
'least_seo_score_ignore_list',
'most_linked_ignore_list',
'least_linked_ignore_list',
'indexables_page_reading_list',
'publishing_principles_id',
'ownership_funding_info_id',
'actionable_feedback_policy_id',
'diversity_staffing_report_id',
* The options we want to track.
* @var array The option_names for the options we want to track.
private $include_list = [
'content_analysis_active',
'keyword_analysis_active',
'inclusive_language_analysis_active',
'enable_cornerstone_content',
'enable_text_link_counter',
'show_onboarding_notice',
'alternate_website_name',
'metadesc-archive-wpseo',
'noindex-author-noposts-wpseo',
'breadcrumbs-display-blog-page',
'breadcrumbs-archiveprefix',
'breadcrumbs-searchprefix',
'company_or_person_user_id',
'display-metabox-pt-post',
'display-metabox-pt-page',
'display-metabox-pt-attachment',
'display-metabox-tax-category',
'display-metabox-tax-post_tag',
'display-metabox-tax-post_format',
'noindex-tax-post_format',
'taxonomy-category-ptparent',
'taxonomy-post_tag-ptparent',
'taxonomy-post_format-ptparent',
'breadcrumbs-blog-remove',
'hideeditbox-attachment',
'hideeditbox-tax-category',
'hideeditbox-tax-post_tag',
'hideeditbox-tax-post_format',
'open_graph_frontpage_title',
'open_graph_frontpage_desc',
'open_graph_frontpage_image',
'open_graph_frontpage_image_id',
'indexables_indexing_completed',
'semrush_integration_active',
'enable_enhanced_slack_sharing',
'zapier_integration_active',
'enable_metabox_insights',
'enable_link_suggestions',
'wincher_integration_active',
'wincher_automatically_add_keyphrases',
'remove_feed_global_comments',
'remove_feed_post_comments',
'remove_feed_categories',
'remove_feed_custom_taxonomies',
'remove_feed_post_types',
'remove_powered_by_header',
'remove_pingback_header',
'clean_campaign_tracking_urls',
'clean_permalinks_extra_variables',
'search_cleanup_patterns',
'search_character_limit',
'redirect_search_pretty_urls',
'indexables_overview_state',
'deny_google_extended_crawling',
'last_known_no_unindexed',
* Returns the collection data.
* @return array The collection data.
* Filter: 'wpseo_tracking_settings_include_list' - Allow filtering the settings included in tracking.
* @param string $include_list The list with included setting names.
$this->include_list = apply_filters( 'wpseo_tracking_settings_include_list', $this->include_list );
$options = WPSEO_Options::get_all();
// Returns the settings of which the keys intersect with the values of the include list.
$options = array_intersect_key( $options, array_flip( $this->include_list ) );
'settings' => $this->anonymize_settings( $options ),
* Anonimizes the WPSEO_Options array by replacing all $anonymous_settings values to 'used'.
* @param array $settings The settings.
* @return array The anonymized settings.
private function anonymize_settings( $settings ) {
foreach ( $this->anonymous_settings as $setting ) {
if ( ! empty( $settings[ $setting ] ) ) {
$settings[ $setting ] = 'used';