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
@@ 5789-5797 (lines=9) @@
5786
	 * @param int    $timestamp Timestamp of the request.
5787
	 * @param string $nonce     Nonce string.
5788
	 */
5789
	public function add_nonce( $timestamp, $nonce ) {
5790
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::add_nonce' );
5791
5792
		if ( ! $this->connection_manager ) {
5793
			$this->connection_manager = new Connection_Manager();
5794
		}
5795
5796
		return $this->connection_manager->add_nonce( $timestamp, $nonce );
5797
	}
5798
5799
	/**
5800
	 * In some setups, $HTTP_RAW_POST_DATA can be emptied during some IXR_Server paths since it is passed by reference to various methods.
@@ 5809-5817 (lines=9) @@
5806
	 * @param array $methods XMLRPC methods.
5807
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5808
	 */
5809
	public function xmlrpc_methods( $methods ) {
5810
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5811
5812
		if ( ! $this->connection_manager ) {
5813
			$this->connection_manager = new Connection_Manager();
5814
		}
5815
5816
		return $this->connection_manager->xmlrpc_methods( $methods );
5817
	}
5818
5819
	/**
5820
	 * Register additional public XMLRPC methods.
@@ 5828-5836 (lines=9) @@
5825
	 * @param array $methods Public XMLRPC methods.
5826
	 * @return array Public XMLRPC methods, with the getOptions one.
5827
	 */
5828
	public function public_xmlrpc_methods( $methods ) {
5829
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5830
5831
		if ( ! $this->connection_manager ) {
5832
			$this->connection_manager = new Connection_Manager();
5833
		}
5834
5835
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5836
	}
5837
5838
	/**
5839
	 * Handles a getOptions XMLRPC method call.
@@ 5847-5855 (lines=9) @@
5844
	 * @param array $args method call arguments.
5845
	 * @return array an amended XMLRPC server options array.
5846
	 */
5847
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5848
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5849
5850
		if ( ! $this->connection_manager ) {
5851
			$this->connection_manager = new Connection_Manager();
5852
		}
5853
5854
		return $this->connection_manager->jetpack_getOptions( $args );
5855
	}
5856
5857
	/**
5858
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5866-5874 (lines=9) @@
5863
	 * @param array $options Standard Core options.
5864
	 * @return array Amended options.
5865
	 */
5866
	public function xmlrpc_options( $options ) {
5867
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5868
5869
		if ( ! $this->connection_manager ) {
5870
			$this->connection_manager = new Connection_Manager();
5871
		}
5872
5873
		return $this->connection_manager->xmlrpc_options( $options );
5874
	}
5875
5876
	/**
5877
	 * Cleans nonces that were saved when calling ::add_nonce.