protected function _is_admin_request() {
		if ( ! isset( $_SERVER['REQUEST_URI'] ) ) {
			return false;
		}

		$request_uri = wp_unslash( $_SERVER['REQUEST_URI'] ); // WPCS: sanitization ok.

		if ( false !== strpos( $request_uri, '/wp-admin/admin-ajax.php' ) ) {
			return false === strpos( $request_uri, 'action=wp_oembed_blog_card_render' );
		}

		if ( false !== strpos( $request_uri, '/wp-json/' ) ) {
			return false === strpos( $request_uri, '/wp-json/oembed/' );
		}

		if ( false !== strpos( $request_uri, '/wp-cron.php' ) ) {
			return true;
		}

		return false;
	}
protected function _is_admin_request() {
		if ( ! isset( $_SERVER['REQUEST_URI'] ) ) {
			return false;
		}

		$request_uri = wp_unslash( $_SERVER['REQUEST_URI'] ); // WPCS: sanitization ok.

		if ( false !== strpos( $request_uri, '/wp-admin/admin-ajax.php' ) ) {
			return false === strpos( $request_uri, 'action=wp_oembed_blog_card_render' );
		}

		if ( false !== strpos( $request_uri, '/wp-json/' ) ) {
			return false === strpos( $request_uri, '/wp-json/oembed/' );
		}

		if ( false !== strpos( $request_uri, '/wp-cron.php' ) ) {
			return true;
		}

		return false;
	}
protected function _is_admin_request ( ) { if ( ! isset ( $ _SERVER [ 'REQUEST_URI' ] ) ) { return false ; } $ request_uri = wp_unslash ( $ _SERVER [ 'REQUEST_URI' ] ) ; // WPCS: sanitization ok. if ( false !== strpos ( $ request_uri , '/wp-admin/admin-ajax.php' ) ) { return false === strpos ( $ request_uri , 'action=wp_oembed_blog_card_render' ) ; } if ( false !== strpos ( $ request_uri , '/wp-json/' ) ) { return false === strpos ( $ request_uri , '/wp-json/oembed/' ) ; } if ( false !== strpos ( $ request_uri , '/wp-cron.php' ) ) { return true ; } return false ; }
Return true when requested from admin-ajax.php, wp-cron.php, wp-json

@return boolean
Return true when requested from admin - ajax . php wp - cron . php wp - json