✘✘ 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/jost/serverhttpson/psr/http-message//indexable-attachment-watcher.php
<?php

namespace Yoast\WP\SEO\Integrations\Watchers;

use Yoast\WP\SEO\Actions\Indexing\Indexable_Post_Indexation_Action;
use Yoast\WP\SEO\Conditionals\Migrations_Conditional;
use Yoast\WP\SEO\Config\Indexing_Reasons;
use Yoast\WP\SEO\Helpers\Attachment_Cleanup_Helper;
use Yoast\WP\SEO\Helpers\Indexable_Helper;
use Yoast\WP\SEO\Helpers\Indexing_Helper;
use Yoast\WP\SEO\Integrations\Cleanup_Integration;
use Yoast\WP\SEO\Integrations\Integration_Interface;
use Yoast_Notification_Center;

/**
 * Watches the disable-attachment key in wpseo_titles, in order to clear the permalink of the category indexables.
 */
class Indexable_Attachment_Watcher implements Integration_Interface {

	/**
	 * The indexing helper.
	 *
	 * @var Indexing_Helper
	 */
	protected $indexing_helper;

	/**
	 * The attachment cleanup helper.
	 *
	 * @var Attachment_Cleanup_Helper
	 */
	protected $attachment_cleanup;

	/**
	 * The indexable helper.
	 *
	 * @var Indexable_Helper
	 */
	protected $indexable_helper;

	/**
	 * The notifications center.
	 *
	 * @var Yoast_Notification_Center
	 */
	private $notification_center;

	/**
	 * Returns the conditionals based on which this loadable should be active.
	 *
	 * @return array<string> The conditionals.
	 */
	public static function get_conditionals() {
		return [ Migrations_Conditional::class ];
	}

	/**
	 * Indexable_Attachment_Watcher constructor.
	 *
	 * @param Indexing_Helper           $indexing_helper     The indexing helper.
	 * @param Attachment_Cleanup_Helper $attachment_cleanup  The attachment cleanup helper.
	 * @param Yoast_Notification_Center $notification_center The notification center.
	 * @param Indexable_Helper          $indexable_helper    The indexable helper.
	 */
	public function __construct(
		Indexing_Helper $indexing_helper,
		Attachment_Cleanup_Helper $attachment_cleanup,
		Yoast_Notification_Center $notification_center,
		Indexable_Helper $indexable_helper
	) {
		$this->indexing_helper     = $indexing_helper;
		$this->attachment_cleanup  = $attachment_cleanup;
		$this->notification_center = $notification_center;
		$this->indexable_helper    = $indexable_helper;
	}

	/**
	 * Initializes the integration.
	 *
	 * This is the place to register hooks and filters.
	 *
	 * @return void
	 */
	public function register_hooks() {
		\add_action( 'update_option_wpseo_titles', [ $this, 'check_option' ], 20, 2 );
	}

	/**
	 * Checks if the disable-attachment key in wpseo_titles has a change in value, and if so,
	 * either it cleans up attachment indexables when it has been toggled to true,
	 * or it starts displaying a notification for the user to start a new SEO optimization.
	 *
	 * @phpcs:disable SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification
	 *
	 * @param array $old_value The old value of the wpseo_titles option.
	 * @param array $new_value The new value of the wpseo_titles option.
	 *
	 * @phpcs:enable
	 * @return void
	 */
	public function check_option( $old_value, $new_value ) {
		// If this is the first time saving the option, in which case its value would be false.
		if ( $old_value === false ) {
			$old_value = [];
		}

		// If either value is not an array, return.
		if ( ! \is_array( $old_value ) || ! \is_array( $new_value ) ) {
			return;
		}

		// If both values aren't set, they haven't changed.
		if ( ! isset( $old_value['disable-attachment'] ) && ! isset( $new_value['disable-attachment'] ) ) {
			return;
		}

		// If a new value has been set for 'disable-attachment', there's two things we might need to do, depending on what's the new value.
		if ( $old_value['disable-attachment'] !== $new_value['disable-attachment'] ) {
			// Delete cache because we now might have new stuff to index or old unindexed stuff don't need indexing anymore.
			\delete_transient( Indexable_Post_Indexation_Action::UNINDEXED_COUNT_TRANSIENT );
			\delete_transient( Indexable_Post_Indexation_Action::UNINDEXED_LIMITED_COUNT_TRANSIENT );

			// Set this core option (introduced in WP 6.4) to ensure consistency.
			if ( \get_option( 'wp_attachment_pages_enabled' ) !== false ) {
				\update_option( 'wp_attachment_pages_enabled', (int) ! $new_value['disable-attachment'] );
			}

			switch ( $new_value['disable-attachment'] ) {
				case false:
					$this->indexing_helper->set_reason( Indexing_Reasons::REASON_ATTACHMENTS_MADE_ENABLED );
					return;
				case true:
					$this->attachment_cleanup->remove_attachment_indexables( false );
					$this->attachment_cleanup->clean_attachment_links_from_target_indexable_ids( false );

					if ( $this->indexable_helper->should_index_indexables() && ! \wp_next_scheduled( Cleanup_Integration::START_HOOK ) ) {
						// This just schedules the cleanup routine cron again.
						\wp_schedule_single_event( ( \time() + ( \MINUTE_IN_SECONDS * 5 ) ), Cleanup_Integration::START_HOOK );
					}
					return;
			}
		}
	}
}


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


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
11 Sep 2026 11.43 AM
docteuh / users
0755
polyfill-intl-idn
--
11 Sep 2026 11.43 AM
docteuh / users
0755
src
--
11 Sep 2026 11.43 AM
docteuh / users
0755
BodySummarizerInterface-20260903155223.php
0.292 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
BodySummarizerInterface.php
0.292 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
Client-20260901093609.php
19.509 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
ClientException.php
0.212 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
ClientExceptionInterface.php
0.183 KB
23 Jun 2026 6.20 PM
docteuh / users
0644
ClientInterface.php
0.602 KB
23 Jun 2026 6.20 PM
docteuh / users
0644
CurlHandler.php
1.469 KB
23 Jun 2026 6.20 PM
docteuh / users
0644
HandlerStack.php
8.665 KB
23 Jun 2026 6.20 PM
docteuh / users
0644
InvalidArgumentException.php
0.191 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
MessageFormatterInterface.php
0.661 KB
23 Jun 2026 6.20 PM
docteuh / users
0644
Middleware.php
11.089 KB
23 Jun 2026 6.20 PM
docteuh / users
0644
NetworkExceptionInterface.php
0.739 KB
23 Jun 2026 6.20 PM
docteuh / users
0644
PrepareBodyMiddleware.php
3.227 KB
23 Jun 2026 6.20 PM
docteuh / users
0644
RequestInterface.php
5.02 KB
23 Jun 2026 6.20 PM
docteuh / users
0644
RequestOptions.php
10.688 KB
23 Jun 2026 6.20 PM
docteuh / users
0644
RetryMiddleware.php
3.659 KB
23 Jun 2026 6.20 PM
docteuh / users
0644
ServerException.php
0.212 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
ServerRequestInterface.php
10.304 KB
23 Jun 2026 6.20 PM
docteuh / users
0644
TransferException.php
0.171 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
TransferStats.php
3.285 KB
23 Jun 2026 6.20 PM
docteuh / users
0644
UploadedFileInterface.php
4.671 KB
23 Jun 2026 6.20 PM
docteuh / users
0644
Utils.php
13.473 KB
23 Jun 2026 6.20 PM
docteuh / users
0644
addon-update-watcher.php
7.142 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
author.php
0.722 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
bust-subscription-cache-route.php
2.146 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
class-yoast-input-validation.php
7.205 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
feature-flag-integration.php
2.932 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
functions.php
5.832 KB
23 Jun 2026 6.20 PM
docteuh / users
0644
functions_include.php
0.203 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
header-1.php
0.411 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
icon-redirect-manager.svg
1.299 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
indexable-attachment-watcher.php
4.767 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
indexable-hierarchy.php
0.571 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
indexable.php
5.261 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
loop-start.php
1.249 KB
20 Nov 2023 7.11 PM
docteuh / users
0644
meta-author-presenter.php
1.345 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
string-helper.php
1.189 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
uninstall-20260831063810.php
3.406 KB
18 Jun 2026 6.25 PM
docteuh / users
0644
xmlrpc.php
1.223 KB
23 Jun 2026 6.19 PM
docteuh / users
0644

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