Code Duplication    Length = 9-9 lines in 9 locations

class.jetpack.php 9 locations

@@ 890-898 (lines=9) @@
887
	 * @deprecated since 7.7.0
888
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
889
	 */
890
	public function initialize_rest_api_registration_connector() {
891
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
892
893
		if ( ! $this->connection_manager ) {
894
			$this->connection_manager = new Connection_Manager();
895
		}
896
897
		$this->connection_manager->initialize_rest_api_registration_connector();
898
	}
899
900
	/**
901
	 * 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.
@@ 1118-1126 (lines=9) @@
1115
	 * @deprecated since 7.7.0
1116
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1117
	 */
1118
	public function require_jetpack_authentication() {
1119
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1120
1121
		if ( ! $this->connection_manager ) {
1122
			$this->connection_manager = new Connection_Manager();
1123
		}
1124
1125
		$this->connection_manager->require_jetpack_authentication();
1126
	}
1127
1128
	/**
1129
	 * Load language files
@@ 5665-5673 (lines=9) @@
5662
	 * @param int    $timestamp Timestamp of the request.
5663
	 * @param string $nonce     Nonce string.
5664
	 */
5665
	public function add_nonce( $timestamp, $nonce ) {
5666
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::add_nonce' );
5667
5668
		if ( ! $this->connection_manager ) {
5669
			$this->connection_manager = new Connection_Manager();
5670
		}
5671
5672
		return $this->connection_manager->add_nonce( $timestamp, $nonce );
5673
	}
5674
5675
	/**
5676
	 * In some setups, $HTTP_RAW_POST_DATA can be emptied during some IXR_Server paths since it is passed by reference to various methods.
@@ 5685-5693 (lines=9) @@
5682
	 * @param array $methods XMLRPC methods.
5683
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5684
	 */
5685
	public function xmlrpc_methods( $methods ) {
5686
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5687
5688
		if ( ! $this->connection_manager ) {
5689
			$this->connection_manager = new Connection_Manager();
5690
		}
5691
5692
		return $this->connection_manager->xmlrpc_methods( $methods );
5693
	}
5694
5695
	/**
5696
	 * Register additional public XMLRPC methods.
@@ 5704-5712 (lines=9) @@
5701
	 * @param array $methods Public XMLRPC methods.
5702
	 * @return array Public XMLRPC methods, with the getOptions one.
5703
	 */
5704
	public function public_xmlrpc_methods( $methods ) {
5705
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5706
5707
		if ( ! $this->connection_manager ) {
5708
			$this->connection_manager = new Connection_Manager();
5709
		}
5710
5711
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5712
	}
5713
5714
	/**
5715
	 * Handles a getOptions XMLRPC method call.
@@ 5723-5731 (lines=9) @@
5720
	 * @param array $args method call arguments.
5721
	 * @return array an amended XMLRPC server options array.
5722
	 */
5723
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5724
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5725
5726
		if ( ! $this->connection_manager ) {
5727
			$this->connection_manager = new Connection_Manager();
5728
		}
5729
5730
		return $this->connection_manager->jetpack_getOptions( $args );
5731
	}
5732
5733
	/**
5734
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5742-5750 (lines=9) @@
5739
	 * @param array $options Standard Core options.
5740
	 * @return array Amended options.
5741
	 */
5742
	public function xmlrpc_options( $options ) {
5743
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5744
5745
		if ( ! $this->connection_manager ) {
5746
			$this->connection_manager = new Connection_Manager();
5747
		}
5748
5749
		return $this->connection_manager->xmlrpc_options( $options );
5750
	}
5751
5752
	/**
5753
	 * Cleans nonces that were saved when calling ::add_nonce.