Code Duplication    Length = 9-9 lines in 9 locations

class.jetpack.php 9 locations

@@ 884-892 (lines=9) @@
881
	 * @deprecated since 7.7.0
882
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
883
	 */
884
	public function initialize_rest_api_registration_connector() {
885
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
886
887
		if ( ! $this->connection_manager ) {
888
			$this->connection_manager = new Connection_Manager();
889
		}
890
891
		$this->connection_manager->initialize_rest_api_registration_connector();
892
	}
893
894
	/**
895
	 * This is ported over from the manage module, which has been deprecated and baked in here.
@@ 5707-5715 (lines=9) @@
5704
	 * @param int    $timestamp Timestamp of the request.
5705
	 * @param string $nonce     Nonce string.
5706
	 */
5707
	public function add_nonce( $timestamp, $nonce ) {
5708
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::add_nonce' );
5709
5710
		if ( ! $this->connection_manager ) {
5711
			$this->connection_manager = new Connection_Manager();
5712
		}
5713
5714
		return $this->connection_manager->add_nonce( $timestamp, $nonce );
5715
	}
5716
5717
	/**
5718
	 * In some setups, $HTTP_RAW_POST_DATA can be emptied during some IXR_Server paths since it is passed by reference to various methods.
@@ 5727-5735 (lines=9) @@
5724
	 * @param array $methods XMLRPC methods.
5725
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5726
	 */
5727
	public function xmlrpc_methods( $methods ) {
5728
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5729
5730
		if ( ! $this->connection_manager ) {
5731
			$this->connection_manager = new Connection_Manager();
5732
		}
5733
5734
		return $this->connection_manager->xmlrpc_methods( $methods );
5735
	}
5736
5737
	/**
5738
	 * Register additional public XMLRPC methods.
@@ 5746-5754 (lines=9) @@
5743
	 * @param array $methods Public XMLRPC methods.
5744
	 * @return array Public XMLRPC methods, with the getOptions one.
5745
	 */
5746
	public function public_xmlrpc_methods( $methods ) {
5747
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5748
5749
		if ( ! $this->connection_manager ) {
5750
			$this->connection_manager = new Connection_Manager();
5751
		}
5752
5753
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5754
	}
5755
5756
	/**
5757
	 * Handles a getOptions XMLRPC method call.
@@ 5765-5773 (lines=9) @@
5762
	 * @param array $args method call arguments.
5763
	 * @return array an amended XMLRPC server options array.
5764
	 */
5765
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5766
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5767
5768
		if ( ! $this->connection_manager ) {
5769
			$this->connection_manager = new Connection_Manager();
5770
		}
5771
5772
		return $this->connection_manager->jetpack_getOptions( $args );
5773
	}
5774
5775
	/**
5776
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5784-5792 (lines=9) @@
5781
	 * @param array $options Standard Core options.
5782
	 * @return array Amended options.
5783
	 */
5784
	public function xmlrpc_options( $options ) {
5785
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5786
5787
		if ( ! $this->connection_manager ) {
5788
			$this->connection_manager = new Connection_Manager();
5789
		}
5790
5791
		return $this->connection_manager->xmlrpc_options( $options );
5792
	}
5793
5794
	/**
5795
	 * Cleans nonces that were saved when calling ::add_nonce.
@@ 1014-1022 (lines=9) @@
1011
	 * @param array $methods A list of registered WordPress XMLRPC methods.
1012
	 * @return array Filtered $methods
1013
	 */
1014
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
1015
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
1016
1017
		if ( ! $this->connection_manager ) {
1018
			$this->connection_manager = new Connection_Manager();
1019
		}
1020
1021
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1022
	}
1023
1024
	/**
1025
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1034-1042 (lines=9) @@
1031
	 * @deprecated since 7.7.0
1032
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1033
	 */
1034
	public function alternate_xmlrpc() {
1035
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1036
1037
		if ( ! $this->connection_manager ) {
1038
			$this->connection_manager = new Connection_Manager();
1039
		}
1040
1041
		$this->connection_manager->alternate_xmlrpc();
1042
	}
1043
1044
	/**
1045
	 * The callback for the JITM ajax requests.
@@ 1142-1150 (lines=9) @@
1139
	 * @deprecated since 7.7.0
1140
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1141
	 */
1142
	public function require_jetpack_authentication() {
1143
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1144
1145
		if ( ! $this->connection_manager ) {
1146
			$this->connection_manager = new Connection_Manager();
1147
		}
1148
1149
		$this->connection_manager->require_jetpack_authentication();
1150
	}
1151
1152
	/**
1153
	 * Load language files