Code Duplication    Length = 9-9 lines in 9 locations

class.jetpack.php 9 locations

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