Code Duplication    Length = 9-9 lines in 9 locations

class.jetpack.php 9 locations

@@ 883-891 (lines=9) @@
880
	 * @deprecated since 7.7.0
881
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
882
	 */
883
	public function initialize_rest_api_registration_connector() {
884
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
885
886
		if ( ! $this->connection_manager ) {
887
			$this->connection_manager = new Connection_Manager();
888
		}
889
890
		$this->connection_manager->initialize_rest_api_registration_connector();
891
	}
892
893
	/**
894
	 * This is ported over from the manage module, which has been deprecated and baked in here.
@@ 1013-1021 (lines=9) @@
1010
	 * @param array $methods A list of registered WordPress XMLRPC methods.
1011
	 * @return array Filtered $methods
1012
	 */
1013
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
1014
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
1015
1016
		if ( ! $this->connection_manager ) {
1017
			$this->connection_manager = new Connection_Manager();
1018
		}
1019
1020
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1021
	}
1022
1023
	/**
1024
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1033-1041 (lines=9) @@
1030
	 * @deprecated since 7.7.0
1031
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1032
	 */
1033
	public function alternate_xmlrpc() {
1034
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1035
1036
		if ( ! $this->connection_manager ) {
1037
			$this->connection_manager = new Connection_Manager();
1038
		}
1039
1040
		$this->connection_manager->alternate_xmlrpc();
1041
	}
1042
1043
	/**
1044
	 * The callback for the JITM ajax requests.
@@ 1141-1149 (lines=9) @@
1138
	 * @deprecated since 7.7.0
1139
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1140
	 */
1141
	public function require_jetpack_authentication() {
1142
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1143
1144
		if ( ! $this->connection_manager ) {
1145
			$this->connection_manager = new Connection_Manager();
1146
		}
1147
1148
		$this->connection_manager->require_jetpack_authentication();
1149
	}
1150
1151
	/**
1152
	 * Load language files
@@ 5614-5622 (lines=9) @@
5611
	 * @param int    $timestamp Timestamp of the request.
5612
	 * @param string $nonce     Nonce string.
5613
	 */
5614
	public function add_nonce( $timestamp, $nonce ) {
5615
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::add_nonce' );
5616
5617
		if ( ! $this->connection_manager ) {
5618
			$this->connection_manager = new Connection_Manager();
5619
		}
5620
5621
		return $this->connection_manager->add_nonce( $timestamp, $nonce );
5622
	}
5623
5624
	/**
5625
	 * In some setups, $HTTP_RAW_POST_DATA can be emptied during some IXR_Server paths since it is passed by reference to various methods.
@@ 5634-5642 (lines=9) @@
5631
	 * @param array $methods XMLRPC methods.
5632
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5633
	 */
5634
	public function xmlrpc_methods( $methods ) {
5635
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5636
5637
		if ( ! $this->connection_manager ) {
5638
			$this->connection_manager = new Connection_Manager();
5639
		}
5640
5641
		return $this->connection_manager->xmlrpc_methods( $methods );
5642
	}
5643
5644
	/**
5645
	 * Register additional public XMLRPC methods.
@@ 5653-5661 (lines=9) @@
5650
	 * @param array $methods Public XMLRPC methods.
5651
	 * @return array Public XMLRPC methods, with the getOptions one.
5652
	 */
5653
	public function public_xmlrpc_methods( $methods ) {
5654
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5655
5656
		if ( ! $this->connection_manager ) {
5657
			$this->connection_manager = new Connection_Manager();
5658
		}
5659
5660
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5661
	}
5662
5663
	/**
5664
	 * Handles a getOptions XMLRPC method call.
@@ 5672-5680 (lines=9) @@
5669
	 * @param array $args method call arguments.
5670
	 * @return array an amended XMLRPC server options array.
5671
	 */
5672
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5673
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5674
5675
		if ( ! $this->connection_manager ) {
5676
			$this->connection_manager = new Connection_Manager();
5677
		}
5678
5679
		return $this->connection_manager->jetpack_getOptions( $args );
5680
	}
5681
5682
	/**
5683
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5691-5699 (lines=9) @@
5688
	 * @param array $options Standard Core options.
5689
	 * @return array Amended options.
5690
	 */
5691
	public function xmlrpc_options( $options ) {
5692
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5693
5694
		if ( ! $this->connection_manager ) {
5695
			$this->connection_manager = new Connection_Manager();
5696
		}
5697
5698
		return $this->connection_manager->xmlrpc_options( $options );
5699
	}
5700
5701
	/**
5702
	 * Cleans nonces that were saved when calling ::add_nonce.