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.
@@ 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
@@ 5735-5743 (lines=9) @@
5732
	 * @param int    $timestamp Timestamp of the request.
5733
	 * @param string $nonce     Nonce string.
5734
	 */
5735
	public function add_nonce( $timestamp, $nonce ) {
5736
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::add_nonce' );
5737
5738
		if ( ! $this->connection_manager ) {
5739
			$this->connection_manager = new Connection_Manager();
5740
		}
5741
5742
		return $this->connection_manager->add_nonce( $timestamp, $nonce );
5743
	}
5744
5745
	/**
5746
	 * In some setups, $HTTP_RAW_POST_DATA can be emptied during some IXR_Server paths since it is passed by reference to various methods.
@@ 5755-5763 (lines=9) @@
5752
	 * @param array $methods XMLRPC methods.
5753
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5754
	 */
5755
	public function xmlrpc_methods( $methods ) {
5756
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5757
5758
		if ( ! $this->connection_manager ) {
5759
			$this->connection_manager = new Connection_Manager();
5760
		}
5761
5762
		return $this->connection_manager->xmlrpc_methods( $methods );
5763
	}
5764
5765
	/**
5766
	 * Register additional public XMLRPC methods.
@@ 5774-5782 (lines=9) @@
5771
	 * @param array $methods Public XMLRPC methods.
5772
	 * @return array Public XMLRPC methods, with the getOptions one.
5773
	 */
5774
	public function public_xmlrpc_methods( $methods ) {
5775
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5776
5777
		if ( ! $this->connection_manager ) {
5778
			$this->connection_manager = new Connection_Manager();
5779
		}
5780
5781
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5782
	}
5783
5784
	/**
5785
	 * Handles a getOptions XMLRPC method call.
@@ 5793-5801 (lines=9) @@
5790
	 * @param array $args method call arguments.
5791
	 * @return array an amended XMLRPC server options array.
5792
	 */
5793
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5794
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5795
5796
		if ( ! $this->connection_manager ) {
5797
			$this->connection_manager = new Connection_Manager();
5798
		}
5799
5800
		return $this->connection_manager->jetpack_getOptions( $args );
5801
	}
5802
5803
	/**
5804
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5812-5820 (lines=9) @@
5809
	 * @param array $options Standard Core options.
5810
	 * @return array Amended options.
5811
	 */
5812
	public function xmlrpc_options( $options ) {
5813
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5814
5815
		if ( ! $this->connection_manager ) {
5816
			$this->connection_manager = new Connection_Manager();
5817
		}
5818
5819
		return $this->connection_manager->xmlrpc_options( $options );
5820
	}
5821
5822
	/**
5823
	 * Cleans nonces that were saved when calling ::add_nonce.