HEX
Server: LiteSpeed
System: Linux melbournecleaninggroup 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: www-data (33)
PHP: 7.3.33-1+focal
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: /var/www/html/wp-content/plugins/brizy/compatibilities/rank-math-seo.php
<?php

class Brizy_Compatibilities_RankMathSeo {

	public function __construct() {
		add_action( 'rest_api_init', [ $this, 'init_rest_api' ] );
	}

	/**
	 * Load the REST API endpoints.
	 */
	public function init_rest_api() {
		register_rest_route( 'rankmath/v1', '/briz_post_content', array(
			'methods' => 'GET',
			[
				'methods'  => WP_REST_Server::ALLMETHODS,
				'callback' => [ $this, 'get_post_content' ],
				'args'     => [
					'postId' => [
						'type'     => 'string',
						'required' => true,
					]
				],
			]
		) );
	}

	/**
	 * @param WP_REST_Request $request
	 *
	 * @return mixed|void
	 */
	public function get_post_content( WP_REST_Request $request ) {
		try {
			$post = Brizy_Editor_Post::get( $request->get_param( 'postId' ) );
			if ( $post->uses_editor() ) {
				return wp_send_json_success( [ 'content' => apply_filters( 'brizy_content', $post->get_compiled_page()->get_body(), Brizy_Editor_Project::get(), $post->getWpPost() ) ] );
			} else {
				wp_send_json_error( 'This post does not use Brizy.', 204 );
			}
		} catch ( Exception $e ) {
			Brizy_Logger::instance()->critical( 'Failed to process REST request', [ $e ] );
			wp_send_json_error( 'Failed to process the request', 500 );
		}
	}
}