Code Duplication    Length = 9-9 lines in 9 locations

class.jetpack.php 9 locations

@@ 869-877 (lines=9) @@
866
	 * @deprecated since 7.7.0
867
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
868
	 */
869
	public function initialize_rest_api_registration_connector() {
870
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
871
872
		if ( ! $this->connection_manager ) {
873
			$this->connection_manager = new Connection_Manager();
874
		}
875
876
		$this->connection_manager->initialize_rest_api_registration_connector();
877
	}
878
879
	/**
880
	 * This is ported over from the manage module, which has been deprecated and baked in here.
@@ 989-997 (lines=9) @@
986
	 * @param array $methods A list of registered WordPress XMLRPC methods.
987
	 * @return array Filtered $methods
988
	 */
989
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
990
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
991
992
		if ( ! $this->connection_manager ) {
993
			$this->connection_manager = new Connection_Manager();
994
		}
995
996
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
997
	}
998
999
	/**
1000
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1009-1017 (lines=9) @@
1006
	 * @deprecated since 7.7.0
1007
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1008
	 */
1009
	public function alternate_xmlrpc() {
1010
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1011
1012
		if ( ! $this->connection_manager ) {
1013
			$this->connection_manager = new Connection_Manager();
1014
		}
1015
1016
		$this->connection_manager->alternate_xmlrpc();
1017
	}
1018
1019
	/**
1020
	 * The callback for the JITM ajax requests.
@@ 1117-1125 (lines=9) @@
1114
	 * @deprecated since 7.7.0
1115
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1116
	 */
1117
	public function require_jetpack_authentication() {
1118
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1119
1120
		if ( ! $this->connection_manager ) {
1121
			$this->connection_manager = new Connection_Manager();
1122
		}
1123
1124
		$this->connection_manager->require_jetpack_authentication();
1125
	}
1126
1127
	/**
1128
	 * Load language files
@@ 5563-5571 (lines=9) @@
5560
	 * @param int    $timestamp Timestamp of the request.
5561
	 * @param string $nonce     Nonce string.
5562
	 */
5563
	public function add_nonce( $timestamp, $nonce ) {
5564
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::add_nonce' );
5565
5566
		if ( ! $this->connection_manager ) {
5567
			$this->connection_manager = new Connection_Manager();
5568
		}
5569
5570
		return $this->connection_manager->add_nonce( $timestamp, $nonce );
5571
	}
5572
5573
	/**
5574
	 * In some setups, $HTTP_RAW_POST_DATA can be emptied during some IXR_Server paths since it is passed by reference to various methods.
@@ 5583-5591 (lines=9) @@
5580
	 * @param array $methods XMLRPC methods.
5581
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5582
	 */
5583
	public function xmlrpc_methods( $methods ) {
5584
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5585
5586
		if ( ! $this->connection_manager ) {
5587
			$this->connection_manager = new Connection_Manager();
5588
		}
5589
5590
		return $this->connection_manager->xmlrpc_methods( $methods );
5591
	}
5592
5593
	/**
5594
	 * Register additional public XMLRPC methods.
@@ 5602-5610 (lines=9) @@
5599
	 * @param array $methods Public XMLRPC methods.
5600
	 * @return array Public XMLRPC methods, with the getOptions one.
5601
	 */
5602
	public function public_xmlrpc_methods( $methods ) {
5603
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5604
5605
		if ( ! $this->connection_manager ) {
5606
			$this->connection_manager = new Connection_Manager();
5607
		}
5608
5609
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5610
	}
5611
5612
	/**
5613
	 * Handles a getOptions XMLRPC method call.
@@ 5621-5629 (lines=9) @@
5618
	 * @param array $args method call arguments.
5619
	 * @return array an amended XMLRPC server options array.
5620
	 */
5621
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5622
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5623
5624
		if ( ! $this->connection_manager ) {
5625
			$this->connection_manager = new Connection_Manager();
5626
		}
5627
5628
		return $this->connection_manager->jetpack_getOptions( $args );
5629
	}
5630
5631
	/**
5632
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5640-5648 (lines=9) @@
5637
	 * @param array $options Standard Core options.
5638
	 * @return array Amended options.
5639
	 */
5640
	public function xmlrpc_options( $options ) {
5641
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5642
5643
		if ( ! $this->connection_manager ) {
5644
			$this->connection_manager = new Connection_Manager();
5645
		}
5646
5647
		return $this->connection_manager->xmlrpc_options( $options );
5648
	}
5649
5650
	/**
5651
	 * Cleans nonces that were saved when calling ::add_nonce.