Code Duplication    Length = 9-9 lines in 9 locations

class.jetpack.php 9 locations

@@ 891-899 (lines=9) @@
888
	 * @deprecated since 7.7.0
889
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
890
	 */
891
	public function initialize_rest_api_registration_connector() {
892
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
893
894
		if ( ! $this->connection_manager ) {
895
			$this->connection_manager = new Connection_Manager();
896
		}
897
898
		$this->connection_manager->initialize_rest_api_registration_connector();
899
	}
900
901
	/**
902
	 * This is ported over from the manage module, which has been deprecated and baked in here.
@@ 1021-1029 (lines=9) @@
1018
	 * @param array $methods A list of registered WordPress XMLRPC methods.
1019
	 * @return array Filtered $methods
1020
	 */
1021
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
1022
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
1023
1024
		if ( ! $this->connection_manager ) {
1025
			$this->connection_manager = new Connection_Manager();
1026
		}
1027
1028
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1029
	}
1030
1031
	/**
1032
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1041-1049 (lines=9) @@
1038
	 * @deprecated since 7.7.0
1039
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1040
	 */
1041
	public function alternate_xmlrpc() {
1042
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1043
1044
		if ( ! $this->connection_manager ) {
1045
			$this->connection_manager = new Connection_Manager();
1046
		}
1047
1048
		$this->connection_manager->alternate_xmlrpc();
1049
	}
1050
1051
	/**
1052
	 * The callback for the JITM ajax requests.
@@ 1149-1157 (lines=9) @@
1146
	 * @deprecated since 7.7.0
1147
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1148
	 */
1149
	public function require_jetpack_authentication() {
1150
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1151
1152
		if ( ! $this->connection_manager ) {
1153
			$this->connection_manager = new Connection_Manager();
1154
		}
1155
1156
		$this->connection_manager->require_jetpack_authentication();
1157
	}
1158
1159
	/**
1160
	 * Load language files
@@ 5793-5801 (lines=9) @@
5790
	 * @param int    $timestamp Timestamp of the request.
5791
	 * @param string $nonce     Nonce string.
5792
	 */
5793
	public function add_nonce( $timestamp, $nonce ) {
5794
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::add_nonce' );
5795
5796
		if ( ! $this->connection_manager ) {
5797
			$this->connection_manager = new Connection_Manager();
5798
		}
5799
5800
		return $this->connection_manager->add_nonce( $timestamp, $nonce );
5801
	}
5802
5803
	/**
5804
	 * In some setups, $HTTP_RAW_POST_DATA can be emptied during some IXR_Server paths since it is passed by reference to various methods.
@@ 5813-5821 (lines=9) @@
5810
	 * @param array $methods XMLRPC methods.
5811
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5812
	 */
5813
	public function xmlrpc_methods( $methods ) {
5814
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5815
5816
		if ( ! $this->connection_manager ) {
5817
			$this->connection_manager = new Connection_Manager();
5818
		}
5819
5820
		return $this->connection_manager->xmlrpc_methods( $methods );
5821
	}
5822
5823
	/**
5824
	 * Register additional public XMLRPC methods.
@@ 5832-5840 (lines=9) @@
5829
	 * @param array $methods Public XMLRPC methods.
5830
	 * @return array Public XMLRPC methods, with the getOptions one.
5831
	 */
5832
	public function public_xmlrpc_methods( $methods ) {
5833
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5834
5835
		if ( ! $this->connection_manager ) {
5836
			$this->connection_manager = new Connection_Manager();
5837
		}
5838
5839
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5840
	}
5841
5842
	/**
5843
	 * Handles a getOptions XMLRPC method call.
@@ 5851-5859 (lines=9) @@
5848
	 * @param array $args method call arguments.
5849
	 * @return array an amended XMLRPC server options array.
5850
	 */
5851
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5852
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5853
5854
		if ( ! $this->connection_manager ) {
5855
			$this->connection_manager = new Connection_Manager();
5856
		}
5857
5858
		return $this->connection_manager->jetpack_getOptions( $args );
5859
	}
5860
5861
	/**
5862
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5870-5878 (lines=9) @@
5867
	 * @param array $options Standard Core options.
5868
	 * @return array Amended options.
5869
	 */
5870
	public function xmlrpc_options( $options ) {
5871
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5872
5873
		if ( ! $this->connection_manager ) {
5874
			$this->connection_manager = new Connection_Manager();
5875
		}
5876
5877
		return $this->connection_manager->xmlrpc_options( $options );
5878
	}
5879
5880
	/**
5881
	 * Cleans nonces that were saved when calling ::add_nonce.