HEX
Server: nginx
System: Linux pool195-106-36.bur.atomicsites.net 6.12.57+deb12-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.57-1~bpo12+1 (2025-11-17) x86_64
User: (0)
PHP: 8.3.32
Disabled: pcntl_fork
Upload Files
File: /wordpress/plugins/jetpack/16.0/_inc/lib/core-api/wpcom-endpoints/hello.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
/**
 * Example of a WP.com endpoint.
 *
 * @package automattic/jetpack
 */

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

/**
 * Example endpoint.
 */
class WPCOM_REST_API_V2_Endpoint_Hello {
	/**
	 * Constructor.
	 */
	public function __construct() {
		add_action( 'rest_api_init', array( $this, 'register_routes' ) );
	}

	/**
	 * Register endpoint route.
	 */
	public function register_routes() {
		register_rest_route(
			'wpcom/v2',
			'/hello',
			array(
				array(
					'methods'             => WP_REST_Server::READABLE,
					'callback'            => array( $this, 'get_data' ),
					'permission_callback' => '__return_true',
				),
			)
		);
	}

	/**
	 * Get data in response to the endpoint request.
	 *
	 * @param WP_REST_Request $request API request.
	 */
	public function get_data( $request ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
		return array( 'hello' => 'world' );
	}
}
wpcom_rest_api_v2_load_plugin( 'WPCOM_REST_API_V2_Endpoint_Hello' );