Code Duplication    Length = 9-9 lines in 9 locations

class.jetpack.php 9 locations

@@ 878-886 (lines=9) @@
875
	 * @deprecated since 7.7.0
876
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
877
	 */
878
	public function initialize_rest_api_registration_connector() {
879
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
880
881
		if ( ! $this->connection_manager ) {
882
			$this->connection_manager = new Connection_Manager();
883
		}
884
885
		$this->connection_manager->initialize_rest_api_registration_connector();
886
	}
887
888
	/**
889
	 * This is ported over from the manage module, which has been deprecated and baked in here.
@@ 1008-1016 (lines=9) @@
1005
	 * @param array $methods A list of registered WordPress XMLRPC methods.
1006
	 * @return array Filtered $methods
1007
	 */
1008
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
1009
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
1010
1011
		if ( ! $this->connection_manager ) {
1012
			$this->connection_manager = new Connection_Manager();
1013
		}
1014
1015
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1016
	}
1017
1018
	/**
1019
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1028-1036 (lines=9) @@
1025
	 * @deprecated since 7.7.0
1026
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1027
	 */
1028
	public function alternate_xmlrpc() {
1029
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1030
1031
		if ( ! $this->connection_manager ) {
1032
			$this->connection_manager = new Connection_Manager();
1033
		}
1034
1035
		$this->connection_manager->alternate_xmlrpc();
1036
	}
1037
1038
	/**
1039
	 * The callback for the JITM ajax requests.
@@ 1136-1144 (lines=9) @@
1133
	 * @deprecated since 7.7.0
1134
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1135
	 */
1136
	public function require_jetpack_authentication() {
1137
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1138
1139
		if ( ! $this->connection_manager ) {
1140
			$this->connection_manager = new Connection_Manager();
1141
		}
1142
1143
		$this->connection_manager->require_jetpack_authentication();
1144
	}
1145
1146
	/**
1147
	 * Load language files
@@ 5626-5634 (lines=9) @@
5623
	 * @param int    $timestamp Timestamp of the request.
5624
	 * @param string $nonce     Nonce string.
5625
	 */
5626
	public function add_nonce( $timestamp, $nonce ) {
5627
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::add_nonce' );
5628
5629
		if ( ! $this->connection_manager ) {
5630
			$this->connection_manager = new Connection_Manager();
5631
		}
5632
5633
		return $this->connection_manager->add_nonce( $timestamp, $nonce );
5634
	}
5635
5636
	/**
5637
	 * In some setups, $HTTP_RAW_POST_DATA can be emptied during some IXR_Server paths since it is passed by reference to various methods.
@@ 5646-5654 (lines=9) @@
5643
	 * @param array $methods XMLRPC methods.
5644
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5645
	 */
5646
	public function xmlrpc_methods( $methods ) {
5647
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5648
5649
		if ( ! $this->connection_manager ) {
5650
			$this->connection_manager = new Connection_Manager();
5651
		}
5652
5653
		return $this->connection_manager->xmlrpc_methods( $methods );
5654
	}
5655
5656
	/**
5657
	 * Register additional public XMLRPC methods.
@@ 5665-5673 (lines=9) @@
5662
	 * @param array $methods Public XMLRPC methods.
5663
	 * @return array Public XMLRPC methods, with the getOptions one.
5664
	 */
5665
	public function public_xmlrpc_methods( $methods ) {
5666
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5667
5668
		if ( ! $this->connection_manager ) {
5669
			$this->connection_manager = new Connection_Manager();
5670
		}
5671
5672
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5673
	}
5674
5675
	/**
5676
	 * Handles a getOptions XMLRPC method call.
@@ 5684-5692 (lines=9) @@
5681
	 * @param array $args method call arguments.
5682
	 * @return array an amended XMLRPC server options array.
5683
	 */
5684
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5685
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5686
5687
		if ( ! $this->connection_manager ) {
5688
			$this->connection_manager = new Connection_Manager();
5689
		}
5690
5691
		return $this->connection_manager->jetpack_getOptions( $args );
5692
	}
5693
5694
	/**
5695
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5703-5711 (lines=9) @@
5700
	 * @param array $options Standard Core options.
5701
	 * @return array Amended options.
5702
	 */
5703
	public function xmlrpc_options( $options ) {
5704
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5705
5706
		if ( ! $this->connection_manager ) {
5707
			$this->connection_manager = new Connection_Manager();
5708
		}
5709
5710
		return $this->connection_manager->xmlrpc_options( $options );
5711
	}
5712
5713
	/**
5714
	 * Cleans nonces that were saved when calling ::add_nonce.