Code Duplication    Length = 9-9 lines in 9 locations

class.jetpack.php 9 locations

@@ 872-880 (lines=9) @@
869
	 * @deprecated since 7.7.0
870
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
871
	 */
872
	public function initialize_rest_api_registration_connector() {
873
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
874
875
		if ( ! $this->connection_manager ) {
876
			$this->connection_manager = new Connection_Manager();
877
		}
878
879
		$this->connection_manager->initialize_rest_api_registration_connector();
880
	}
881
882
	/**
883
	 * This is ported over from the manage module, which has been deprecated and baked in here.
@@ 998-1006 (lines=9) @@
995
	 * @param array $methods A list of registered WordPress XMLRPC methods.
996
	 * @return array Filtered $methods
997
	 */
998
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
999
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
1000
1001
		if ( ! $this->connection_manager ) {
1002
			$this->connection_manager = new Connection_Manager();
1003
		}
1004
1005
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1006
	}
1007
1008
	/**
1009
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1018-1026 (lines=9) @@
1015
	 * @deprecated since 7.7.0
1016
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1017
	 */
1018
	public function alternate_xmlrpc() {
1019
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1020
1021
		if ( ! $this->connection_manager ) {
1022
			$this->connection_manager = new Connection_Manager();
1023
		}
1024
1025
		$this->connection_manager->alternate_xmlrpc();
1026
	}
1027
1028
	/**
1029
	 * The callback for the JITM ajax requests.
@@ 1126-1134 (lines=9) @@
1123
	 * @deprecated since 7.7.0
1124
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1125
	 */
1126
	public function require_jetpack_authentication() {
1127
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1128
1129
		if ( ! $this->connection_manager ) {
1130
			$this->connection_manager = new Connection_Manager();
1131
		}
1132
1133
		$this->connection_manager->require_jetpack_authentication();
1134
	}
1135
1136
	/**
1137
	 * Load language files
@@ 5558-5566 (lines=9) @@
5555
	 * @param int    $timestamp Timestamp of the request.
5556
	 * @param string $nonce     Nonce string.
5557
	 */
5558
	public function add_nonce( $timestamp, $nonce ) {
5559
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::add_nonce' );
5560
5561
		if ( ! $this->connection_manager ) {
5562
			$this->connection_manager = new Connection_Manager();
5563
		}
5564
5565
		return $this->connection_manager->add_nonce( $timestamp, $nonce );
5566
	}
5567
5568
	/**
5569
	 * In some setups, $HTTP_RAW_POST_DATA can be emptied during some IXR_Server paths since it is passed by reference to various methods.
@@ 5578-5586 (lines=9) @@
5575
	 * @param array $methods XMLRPC methods.
5576
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5577
	 */
5578
	public function xmlrpc_methods( $methods ) {
5579
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5580
5581
		if ( ! $this->connection_manager ) {
5582
			$this->connection_manager = new Connection_Manager();
5583
		}
5584
5585
		return $this->connection_manager->xmlrpc_methods( $methods );
5586
	}
5587
5588
	/**
5589
	 * Register additional public XMLRPC methods.
@@ 5597-5605 (lines=9) @@
5594
	 * @param array $methods Public XMLRPC methods.
5595
	 * @return array Public XMLRPC methods, with the getOptions one.
5596
	 */
5597
	public function public_xmlrpc_methods( $methods ) {
5598
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5599
5600
		if ( ! $this->connection_manager ) {
5601
			$this->connection_manager = new Connection_Manager();
5602
		}
5603
5604
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5605
	}
5606
5607
	/**
5608
	 * Handles a getOptions XMLRPC method call.
@@ 5616-5624 (lines=9) @@
5613
	 * @param array $args method call arguments.
5614
	 * @return array an amended XMLRPC server options array.
5615
	 */
5616
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5617
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5618
5619
		if ( ! $this->connection_manager ) {
5620
			$this->connection_manager = new Connection_Manager();
5621
		}
5622
5623
		return $this->connection_manager->jetpack_getOptions( $args );
5624
	}
5625
5626
	/**
5627
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5635-5643 (lines=9) @@
5632
	 * @param array $options Standard Core options.
5633
	 * @return array Amended options.
5634
	 */
5635
	public function xmlrpc_options( $options ) {
5636
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5637
5638
		if ( ! $this->connection_manager ) {
5639
			$this->connection_manager = new Connection_Manager();
5640
		}
5641
5642
		return $this->connection_manager->xmlrpc_options( $options );
5643
	}
5644
5645
	/**
5646
	 * Cleans nonces that were saved when calling ::add_nonce.