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.
@@ 992-1000 (lines=9) @@
989
	 * @param array $methods A list of registered WordPress XMLRPC methods.
990
	 * @return array Filtered $methods
991
	 */
992
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
993
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
994
995
		if ( ! $this->connection_manager ) {
996
			$this->connection_manager = new Connection_Manager();
997
		}
998
999
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1000
	}
1001
1002
	/**
1003
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1012-1020 (lines=9) @@
1009
	 * @deprecated since 7.7.0
1010
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1011
	 */
1012
	public function alternate_xmlrpc() {
1013
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1014
1015
		if ( ! $this->connection_manager ) {
1016
			$this->connection_manager = new Connection_Manager();
1017
		}
1018
1019
		$this->connection_manager->alternate_xmlrpc();
1020
	}
1021
1022
	/**
1023
	 * The callback for the JITM ajax requests.
@@ 1120-1128 (lines=9) @@
1117
	 * @deprecated since 7.7.0
1118
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1119
	 */
1120
	public function require_jetpack_authentication() {
1121
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1122
1123
		if ( ! $this->connection_manager ) {
1124
			$this->connection_manager = new Connection_Manager();
1125
		}
1126
1127
		$this->connection_manager->require_jetpack_authentication();
1128
	}
1129
1130
	/**
1131
	 * Load language files
@@ 5552-5560 (lines=9) @@
5549
	 * @param int    $timestamp Timestamp of the request.
5550
	 * @param string $nonce     Nonce string.
5551
	 */
5552
	public function add_nonce( $timestamp, $nonce ) {
5553
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::add_nonce' );
5554
5555
		if ( ! $this->connection_manager ) {
5556
			$this->connection_manager = new Connection_Manager();
5557
		}
5558
5559
		return $this->connection_manager->add_nonce( $timestamp, $nonce );
5560
	}
5561
5562
	/**
5563
	 * In some setups, $HTTP_RAW_POST_DATA can be emptied during some IXR_Server paths since it is passed by reference to various methods.
@@ 5572-5580 (lines=9) @@
5569
	 * @param array $methods XMLRPC methods.
5570
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5571
	 */
5572
	public function xmlrpc_methods( $methods ) {
5573
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5574
5575
		if ( ! $this->connection_manager ) {
5576
			$this->connection_manager = new Connection_Manager();
5577
		}
5578
5579
		return $this->connection_manager->xmlrpc_methods( $methods );
5580
	}
5581
5582
	/**
5583
	 * Register additional public XMLRPC methods.
@@ 5591-5599 (lines=9) @@
5588
	 * @param array $methods Public XMLRPC methods.
5589
	 * @return array Public XMLRPC methods, with the getOptions one.
5590
	 */
5591
	public function public_xmlrpc_methods( $methods ) {
5592
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5593
5594
		if ( ! $this->connection_manager ) {
5595
			$this->connection_manager = new Connection_Manager();
5596
		}
5597
5598
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5599
	}
5600
5601
	/**
5602
	 * Handles a getOptions XMLRPC method call.
@@ 5610-5618 (lines=9) @@
5607
	 * @param array $args method call arguments.
5608
	 * @return array an amended XMLRPC server options array.
5609
	 */
5610
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5611
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5612
5613
		if ( ! $this->connection_manager ) {
5614
			$this->connection_manager = new Connection_Manager();
5615
		}
5616
5617
		return $this->connection_manager->jetpack_getOptions( $args );
5618
	}
5619
5620
	/**
5621
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5629-5637 (lines=9) @@
5626
	 * @param array $options Standard Core options.
5627
	 * @return array Amended options.
5628
	 */
5629
	public function xmlrpc_options( $options ) {
5630
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5631
5632
		if ( ! $this->connection_manager ) {
5633
			$this->connection_manager = new Connection_Manager();
5634
		}
5635
5636
		return $this->connection_manager->xmlrpc_options( $options );
5637
	}
5638
5639
	/**
5640
	 * Cleans nonces that were saved when calling ::add_nonce.