Code Duplication    Length = 9-9 lines in 9 locations

class.jetpack.php 9 locations

@@ 899-907 (lines=9) @@
896
	 * @deprecated since 7.7.0
897
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
898
	 */
899
	public function initialize_rest_api_registration_connector() {
900
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
901
902
		if ( ! $this->connection_manager ) {
903
			$this->connection_manager = new Connection_Manager();
904
		}
905
906
		$this->connection_manager->initialize_rest_api_registration_connector();
907
	}
908
909
	/**
910
	 * This is ported over from the manage module, which has been deprecated and baked in here.
@@ 1019-1027 (lines=9) @@
1016
	 * @param array $methods A list of registered WordPress XMLRPC methods.
1017
	 * @return array Filtered $methods
1018
	 */
1019
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
1020
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
1021
1022
		if ( ! $this->connection_manager ) {
1023
			$this->connection_manager = new Connection_Manager();
1024
		}
1025
1026
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1027
	}
1028
1029
	/**
1030
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1039-1047 (lines=9) @@
1036
	 * @deprecated since 7.7.0
1037
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1038
	 */
1039
	public function alternate_xmlrpc() {
1040
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1041
1042
		if ( ! $this->connection_manager ) {
1043
			$this->connection_manager = new Connection_Manager();
1044
		}
1045
1046
		$this->connection_manager->alternate_xmlrpc();
1047
	}
1048
1049
	/**
1050
	 * The callback for the JITM ajax requests.
@@ 1147-1155 (lines=9) @@
1144
	 * @deprecated since 7.7.0
1145
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1146
	 */
1147
	public function require_jetpack_authentication() {
1148
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1149
1150
		if ( ! $this->connection_manager ) {
1151
			$this->connection_manager = new Connection_Manager();
1152
		}
1153
1154
		$this->connection_manager->require_jetpack_authentication();
1155
	}
1156
1157
	/**
1158
	 * Load language files
@@ 5593-5601 (lines=9) @@
5590
	 * @param int    $timestamp Timestamp of the request.
5591
	 * @param string $nonce     Nonce string.
5592
	 */
5593
	public function add_nonce( $timestamp, $nonce ) {
5594
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::add_nonce' );
5595
5596
		if ( ! $this->connection_manager ) {
5597
			$this->connection_manager = new Connection_Manager();
5598
		}
5599
5600
		return $this->connection_manager->add_nonce( $timestamp, $nonce );
5601
	}
5602
5603
	/**
5604
	 * In some setups, $HTTP_RAW_POST_DATA can be emptied during some IXR_Server paths since it is passed by reference to various methods.
@@ 5613-5621 (lines=9) @@
5610
	 * @param array $methods XMLRPC methods.
5611
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5612
	 */
5613
	public function xmlrpc_methods( $methods ) {
5614
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5615
5616
		if ( ! $this->connection_manager ) {
5617
			$this->connection_manager = new Connection_Manager();
5618
		}
5619
5620
		return $this->connection_manager->xmlrpc_methods( $methods );
5621
	}
5622
5623
	/**
5624
	 * Register additional public XMLRPC methods.
@@ 5632-5640 (lines=9) @@
5629
	 * @param array $methods Public XMLRPC methods.
5630
	 * @return array Public XMLRPC methods, with the getOptions one.
5631
	 */
5632
	public function public_xmlrpc_methods( $methods ) {
5633
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5634
5635
		if ( ! $this->connection_manager ) {
5636
			$this->connection_manager = new Connection_Manager();
5637
		}
5638
5639
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5640
	}
5641
5642
	/**
5643
	 * Handles a getOptions XMLRPC method call.
@@ 5651-5659 (lines=9) @@
5648
	 * @param array $args method call arguments.
5649
	 * @return array an amended XMLRPC server options array.
5650
	 */
5651
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5652
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5653
5654
		if ( ! $this->connection_manager ) {
5655
			$this->connection_manager = new Connection_Manager();
5656
		}
5657
5658
		return $this->connection_manager->jetpack_getOptions( $args );
5659
	}
5660
5661
	/**
5662
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5670-5678 (lines=9) @@
5667
	 * @param array $options Standard Core options.
5668
	 * @return array Amended options.
5669
	 */
5670
	public function xmlrpc_options( $options ) {
5671
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5672
5673
		if ( ! $this->connection_manager ) {
5674
			$this->connection_manager = new Connection_Manager();
5675
		}
5676
5677
		return $this->connection_manager->xmlrpc_options( $options );
5678
	}
5679
5680
	/**
5681
	 * Cleans nonces that were saved when calling ::add_nonce.