HEX
Server: Apache
System: Linux p3plzcpnl507418.prod.phx3.secureserver.net 4.18.0-553.141.2.lve.el8.x86_64 #1 SMP Wed Jul 8 16:10:02 UTC 2026 x86_64
User: retoti4c1e1s (10075650)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: //proc/thread-self/cwd/wp-content/plugins/link-factory/includes/class-health.php
<?php
/**
 * REST controller for the plugin health check.
 *
 * Exposes an unauthenticated endpoint that reports the plugin and protocol
 * versions, used by the backend to probe plugin presence and compatibility.
 *
 * @package LinkFactory
 */

namespace LinkFactory;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

class Health {

	public function register_routes() {
		register_rest_route(
			LINK_FACTORY_NAMESPACE,
			'/health',
			array(
				'methods'             => 'GET',
				'callback'            => array( $this, 'handle_health' ),
				'permission_callback' => '__return_true',
			)
		);
	}

	public function handle_health() {
		return rest_ensure_response(
			array(
				'status'          => 'ok',
				'version'         => LINK_FACTORY_VERSION,
				'protocolVersion' => LINK_FACTORY_PROTOCOL_VERSION,
			)
		);
	}
}