HEX
Server: Apache
System: Linux linplesk41.pumo.com.tw 3.10.0-962.3.2.lve1.5.27.el7.x86_64 #1 SMP Sat Nov 30 02:18:52 EST 2019 x86_64
User: rajlaw (10192)
PHP: 7.4.24
Disabled: phpinfo,passthru,exec,shell_exec,system,popen,proc_open,proc_close,show_source,pcntl_exec,escapeshellcmd,proc_get_status,proc_nice,proc_terminate,escapeshellarg
Upload Files
File: /home/httpd/vhosts/rajlaw.com.tw/httpdocs/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,
			)
		);
	}
}