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

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/docteuh/www/envhttps/application//score-retriever.php
<?php

// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
namespace Yoast\WP\SEO\Abilities\Application;

use WPSEO_Rank;
use Yoast\WP\SEO\Abilities\Domain\Score_Result;
use Yoast\WP\SEO\Repositories\Indexable_Repository;

/**
 * Application service that retrieves SEO, readability, and inclusive language scores
 * for the most recently modified posts.
 */
class Score_Retriever {

	/**
	 * The default number of posts to retrieve.
	 *
	 * @var int
	 */
	private const DEFAULT_NUMBER_OF_POSTS = 10;

	/**
	 * The maximum number of posts to retrieve.
	 *
	 * @var int
	 */
	private const MAX_NUMBER_OF_POSTS = 100;

	/**
	 * The indexable repository.
	 *
	 * @var Indexable_Repository
	 */
	private $indexable_repository;

	/**
	 * Constructor.
	 *
	 * @param Indexable_Repository $indexable_repository The indexable repository.
	 */
	public function __construct(
		Indexable_Repository $indexable_repository
	) {
		$this->indexable_repository = $indexable_repository;
	}

	/**
	 * Retrieves the SEO scores for the most recently modified posts.
	 *
	 * @param array<string, int> $input The input containing optional 'number_of_posts'.
	 *
	 * @return array<int, array<string, string|null>> The SEO score data for each post.
	 */
	public function get_seo_scores( array $input ): array {
		$indexables = $this->get_recent_indexables( $this->get_number_of_posts( $input ) );

		return \array_map( [ $this, 'build_seo_score_for_indexable' ], $indexables );
	}

	/**
	 * Retrieves the readability scores for the most recently modified posts.
	 *
	 * @param array<string, int> $input The input containing optional 'number_of_posts'.
	 *
	 * @return array<int, array<string, string>> The readability score data for each post.
	 */
	public function get_readability_scores( array $input ): array {
		$indexables = $this->get_recent_indexables( $this->get_number_of_posts( $input ) );

		return \array_map( [ $this, 'build_readability_score_for_indexable' ], $indexables );
	}

	/**
	 * Retrieves the inclusive language scores for the most recently modified posts.
	 *
	 * @param array<string, int> $input The input containing optional 'number_of_posts'.
	 *
	 * @return array<int, array<string, string>> The inclusive language score data for each post.
	 */
	public function get_inclusive_language_scores( array $input ): array {
		$indexables = $this->get_recent_indexables( $this->get_number_of_posts( $input ) );

		return \array_map( [ $this, 'build_inclusive_language_score_for_indexable' ], $indexables );
	}

	/**
	 * Builds the SEO score result for a single indexable.
	 *
	 * @param object $indexable The indexable object.
	 *
	 * @return array<string, string|null> The SEO score data.
	 */
	private function build_seo_score_for_indexable( $indexable ): array {
		$title  = $this->get_indexable_title( $indexable );
		$rank   = WPSEO_Rank::from_numeric_score( (int) $indexable->primary_focus_keyword_score );
		$result = ( new Score_Result(
			$title,
			$rank->get_rank(),
			$rank->get_label(),
		) )->to_array();

		$result['focus_keyphrase'] = $indexable->primary_focus_keyword;
		return $result;
	}

	/**
	 * Builds the readability score result for a single indexable.
	 *
	 * @param object $indexable The indexable object.
	 *
	 * @return array<string, string> The readability score data.
	 */
	private function build_readability_score_for_indexable( $indexable ): array {
		$title = $this->get_indexable_title( $indexable );
		$rank  = WPSEO_Rank::from_numeric_score( (int) $indexable->readability_score );

		return ( new Score_Result(
			$title,
			$rank->get_rank(),
			$rank->get_label(),
		) )->to_array();
	}

	/**
	 * Builds the inclusive language score result for a single indexable.
	 *
	 * @param object $indexable The indexable object.
	 *
	 * @return array<string, string> The inclusive language score data.
	 */
	private function build_inclusive_language_score_for_indexable( $indexable ): array {
		$title = $this->get_indexable_title( $indexable );
		$score = (int) $indexable->inclusive_language_score;

		if ( $score === 0 ) {
			return ( new Score_Result(
				$title,
				'na',
				\__( 'Not available', 'wordpress-seo' ),
			) )->to_array();
		}

		$rank = WPSEO_Rank::from_numeric_score( $score );

		return ( new Score_Result(
			$title,
			$rank->get_rank(),
			$rank->get_inclusive_language_label(),
		) )->to_array();
	}

	/**
	 * Returns the title for an indexable, with a fallback.
	 *
	 * @param object $indexable The indexable object.
	 *
	 * @return string The post title.
	 */
	private function get_indexable_title( $indexable ): string {
		if ( ! empty( $indexable->breadcrumb_title ) ) {
			return $indexable->breadcrumb_title;
		}

		return \__( '(no title)', 'wordpress-seo' );
	}

	/**
	 * Retrieves the most recently modified post indexables.
	 *
	 * @param int $number_of_posts The number of posts to retrieve.
	 *
	 * @return array<object> The indexable objects.
	 */
	private function get_recent_indexables( int $number_of_posts ): array {
		return $this->indexable_repository->get_recently_modified_posts( 'post', $number_of_posts, false );
	}

	/**
	 * Extracts and clamps the number of posts from the input.
	 *
	 * @param array<string, int> $input The input array.
	 *
	 * @return int The clamped number of posts.
	 */
	private function get_number_of_posts( array $input ): int {
		$number = ( $input['number_of_posts'] ?? self::DEFAULT_NUMBER_OF_POSTS );

		return \min( self::MAX_NUMBER_OF_POSTS, \max( 1, (int) $number ) );
	}
}


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


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
23 Sep 2026 5.53 PM
docteuh / users
0755
07
--
10 Sep 2026 4.25 PM
docteuh / users
0755
application
--
13 Sep 2026 7.32 PM
docteuh / users
0755
cache
--
13 Sep 2026 11.22 PM
docteuh / users
0755
enhancement
--
12 Sep 2026 1.41 AM
docteuh / users
0755
meta
--
19 Sep 2026 3.06 AM
docteuh / users
0755
aggregate-site-schema-command-handler.php
2.158 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
aggregate-site-schema-command.php
0.917 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
aggregate-site-schema-map-command-handler.php
2.67 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
aggregate-site-schema-map-command.php
0.762 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
background.min-20260912232224.css
2.685 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
background.min.css
2.685 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
bbpress.min.css
16.249 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
block-editor.css
8.336 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
compatibility-20260913173225.php
2.142 KB
18 Jun 2026 6.25 PM
docteuh / users
0644
compatibility.php
2.142 KB
18 Jun 2026 6.25 PM
docteuh / users
0644
contactform7.css
4.555 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
fb.css
0.462 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
footer.php
2.259 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
functions.php
28.734 KB
18 Jun 2026 6.25 PM
docteuh / users
0644
gravityforms.min-20260913212237.css
7.403 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
gravityforms.min.css
7.403 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
icon-redirect-manager-20260827192224-20260829103225-20260831111900-20260901204506-20260902231029-20260903070400-20260903070518.svg
1.299 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
icon-redirect-manager-20260829102432-20260830004210-20260830004246-20260830005248-20260830084048-20260902205819.svg
1.299 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
ilightbox.css
47.553 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
ilightbox.min.css
41.193 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
max-782-adminbar.css
0.44 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
max-cbp.min.css
0.094 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
max-main.min.css
0.569 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
portfolio.min.css
1.53 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
properties-merger.php
5.118 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
schema-aggregator-announcement-20260830141819.php
1.454 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
schema-aggregator-response-composer.php
0.868 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
schema-pieces-aggregator.php
2.238 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
score-retriever.php
5.398 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
scrollbar.css
0.362 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
search.css
1.327 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
shortcodes.min-20260913194623.css
143.674 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
shortcodes.min.css
143.674 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
slidingbar.min.css
9.237 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
ssl-test-page-20260913120332.html
0.155 KB
18 Jun 2026 6.25 PM
docteuh / users
0644
ssl-test-page.html
0.155 KB
18 Jun 2026 6.25 PM
docteuh / users
0644
widgets.min.css
16.425 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
wpml-20260912090726.css
3.596 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
wpml-20260913212155.css
3.596 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
wpml.css
3.596 KB
20 Nov 2023 7.11 PM
docteuh / users
0644

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