Code Duplication    Length = 9-9 lines in 9 locations

class.jetpack.php 9 locations

@@ 1010-1018 (lines=9) @@
1007
	 * @param array $methods A list of registered WordPress XMLRPC methods.
1008
	 * @return array Filtered $methods
1009
	 */
1010
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
1011
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
1012
1013
		if ( ! $this->connection_manager ) {
1014
			$this->connection_manager = new Connection_Manager();
1015
		}
1016
1017
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1018
	}
1019
1020
	/**
1021
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1030-1038 (lines=9) @@
1027
	 * @deprecated since 7.7.0
1028
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1029
	 */
1030
	public function alternate_xmlrpc() {
1031
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1032
1033
		if ( ! $this->connection_manager ) {
1034
			$this->connection_manager = new Connection_Manager();
1035
		}
1036
1037
		$this->connection_manager->alternate_xmlrpc();
1038
	}
1039
1040
	/**
1041
	 * The callback for the JITM ajax requests.
@@ 1138-1146 (lines=9) @@
1135
	 * @deprecated since 7.7.0
1136
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1137
	 */
1138
	public function require_jetpack_authentication() {
1139
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1140
1141
		if ( ! $this->connection_manager ) {
1142
			$this->connection_manager = new Connection_Manager();
1143
		}
1144
1145
		$this->connection_manager->require_jetpack_authentication();
1146
	}
1147
1148
	/**
1149
	 * Load language files
@@ 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.
@@ 5609-5617 (lines=9) @@
5606
	 * @param int    $timestamp Timestamp of the request.
5607
	 * @param string $nonce     Nonce string.
5608
	 */
5609
	public function add_nonce( $timestamp, $nonce ) {
5610
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::add_nonce' );
5611
5612
		if ( ! $this->connection_manager ) {
5613
			$this->connection_manager = new Connection_Manager();
5614
		}
5615
5616
		return $this->connection_manager->add_nonce( $timestamp, $nonce );
5617
	}
5618
5619
	/**
5620
	 * In some setups, $HTTP_RAW_POST_DATA can be emptied during some IXR_Server paths since it is passed by reference to various methods.
@@ 5629-5637 (lines=9) @@
5626
	 * @param array $methods XMLRPC methods.
5627
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5628
	 */
5629
	public function xmlrpc_methods( $methods ) {
5630
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5631
5632
		if ( ! $this->connection_manager ) {
5633
			$this->connection_manager = new Connection_Manager();
5634
		}
5635
5636
		return $this->connection_manager->xmlrpc_methods( $methods );
5637
	}
5638
5639
	/**
5640
	 * Register additional public XMLRPC methods.
@@ 5648-5656 (lines=9) @@
5645
	 * @param array $methods Public XMLRPC methods.
5646
	 * @return array Public XMLRPC methods, with the getOptions one.
5647
	 */
5648
	public function public_xmlrpc_methods( $methods ) {
5649
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5650
5651
		if ( ! $this->connection_manager ) {
5652
			$this->connection_manager = new Connection_Manager();
5653
		}
5654
5655
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5656
	}
5657
5658
	/**
5659
	 * Handles a getOptions XMLRPC method call.
@@ 5667-5675 (lines=9) @@
5664
	 * @param array $args method call arguments.
5665
	 * @return array an amended XMLRPC server options array.
5666
	 */
5667
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5668
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5669
5670
		if ( ! $this->connection_manager ) {
5671
			$this->connection_manager = new Connection_Manager();
5672
		}
5673
5674
		return $this->connection_manager->jetpack_getOptions( $args );
5675
	}
5676
5677
	/**
5678
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5686-5694 (lines=9) @@
5683
	 * @param array $options Standard Core options.
5684
	 * @return array Amended options.
5685
	 */
5686
	public function xmlrpc_options( $options ) {
5687
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5688
5689
		if ( ! $this->connection_manager ) {
5690
			$this->connection_manager = new Connection_Manager();
5691
		}
5692
5693
		return $this->connection_manager->xmlrpc_options( $options );
5694
	}
5695
5696
	/**
5697
	 * Cleans nonces that were saved when calling ::add_nonce.