                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ductions ) {
			// Bail when there are no introductions to show.
			return;
		}
		// Update user meta to have "seen" these introductions.
		$this->update_user_introductions( $user_id, $introductions );

		$this->admin_asset_manager->enqueue_script( self::SCRIPT_HANDLE );
		$this->admin_asset_manager->localize_script(
			self::SCRIPT_HANDLE,
			'wpseoIntroductions',
			[
				'introductions'         => $introductions,
				'isPremium'             => $this->product_helper->is_premium(),
				'isRtl'                 => \is_rtl(),
				'linkParams'            => $this->short_link_helper->get_query_params(),
				'pluginUrl'             => \plugins_url( '', \WPSEO_FILE ),
				'wistiaEmbedPermission' => $this->wistia_embed_permission_repository->get_value_for_user( $user_id ),
				'isWooEnabled'          => $this->woocommerce_conditional->is_met(),
			],
		);
		$this->admin_asset_manager->enqueue_style( 'introductions' );
	}

	/**
	 * Updates the user metadata to have "seen" the introductions.
	 *
	 * @param int   $user_id       The user ID.
	 * @param array $introductions The introductions.
	 *
	 * @return void
	 */
	private function update_user_introductions( $user_id, $introductions ) {
		$metadata = $this->user_helper->get_meta( $user_id, Introductions_Seen_Repository::USER_META_KEY, true );
		if ( ! \is_array( $metadata ) ) {
			$metadata = [];
		}

		if ( empty( $introductions ) || ! \is_array( $introductions ) ) {
			return;
		}

		// Find the introduction with the highest priority, because JS will only show that one.
		$highest_priority_intro = \array_reduce(
			$introductions,
			static function ( $carry, $item ) {
				return ( $carry === null || $item['priority'] < $carry['priority'] ) ? $item : $carry;
			},
			null,
		);

		if ( $highest_priority_intro === null ) {
			return;
		}

		// Mark the introduction with the highest priority as seen.
		$metadata[ $highest_priority_intro['id'] ]['is_seen'] = true;
		$metadata[ $highest_priority_intro['id'] ]['seen_on'] = \time();

		$this->user_helper->update_meta( $user_id, Introductions_Seen_Repository::USER_META_KEY, $metadata );
	}

	/**
	 * Updates the introductions metadata format for the user
	 * This is needed because we're introducing timestamps for introductions that have been seen, thus changing the format.
	 *
	 * @param int $user_id The user ID.
	 *
	 * @return void
	 */
	private function update_metadata_for( int $user_id ) {
		$metadata = $this->introductions_collector->get_metadata( $user_id );
		foreach ( $metadata as $introduction_name => $introduction_data ) {
			if ( \is_bool( $introduction_data ) ) {
				$metadata[ $introduction_name ] = [
					'is_seen' => $introduction_data,
					'seen_on' => ( $introduction_data === true ) ? \time() : 0,
				];
			}
		}
		$this->user_helper->update_meta( $user_id, Introductions_Seen_Repository::USER_META_KEY, $metadata );
	}
}
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/wp-content/plugins/xml-sitemap-feed/assets/sitemap-news.xsl?ver=5.7.7"?>
<!-- generated-on="2026-09-30T19:42:03+00:00" -->
<!-- generator="XML Sitemap & Google News for WordPress" -->
<!-- generator-url="https://status301.net/wordpress-plugins/xml-sitemap-feed/" -->
<!-- generator-version="5.7.7" -->
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" >
<url><loc>https://motoristika.cz/evropske-silnice-maji-sve-favority-nejprodavanejsi-automobily-roku-2026/</loc><news:news><news:publication><news:name>Auto-moto portál, magazín</news:name><news:language>cs</news:language></news:publication><news:publication_date>2026-09-29T22:42:20+02:00</news:publication_date><news:title>Evropské silnice mají své favority – nejprodávanější automobily roku 2026</news:title></news:news></url>
</urlset>
