Code Duplication    Length = 9-9 lines in 9 locations

class.jetpack.php 9 locations

@@ 865-873 (lines=9) @@
862
	 * @deprecated since 7.7.0
863
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
864
	 */
865
	public function initialize_rest_api_registration_connector() {
866
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
867
868
		if ( ! $this->connection_manager ) {
869
			$this->connection_manager = new Connection_Manager();
870
		}
871
872
		$this->connection_manager->initialize_rest_api_registration_connector();
873
	}
874
875
	/**
876
	 * This is ported over from the manage module, which has been deprecated and baked in here.
@@ 985-993 (lines=9) @@
982
	 * @param array $methods A list of registered WordPress XMLRPC methods.
983
	 * @return array Filtered $methods
984
	 */
985
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
986
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
987
988
		if ( ! $this->connection_manager ) {
989
			$this->connection_manager = new Connection_Manager();
990
		}
991
992
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
993
	}
994
995
	/**
996
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1005-1013 (lines=9) @@
1002
	 * @deprecated since 7.7.0
1003
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1004
	 */
1005
	public function alternate_xmlrpc() {
1006
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1007
1008
		if ( ! $this->connection_manager ) {
1009
			$this->connection_manager = new Connection_Manager();
1010
		}
1011
1012
		$this->connection_manager->alternate_xmlrpc();
1013
	}
1014
1015
	/**
1016
	 * The callback for the JITM ajax requests.
@@ 1113-1121 (lines=9) @@
1110
	 * @deprecated since 7.7.0
1111
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1112
	 */
1113
	public function require_jetpack_authentication() {
1114
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1115
1116
		if ( ! $this->connection_manager ) {
1117
			$this->connection_manager = new Connection_Manager();
1118
		}
1119
1120
		$this->connection_manager->require_jetpack_authentication();
1121
	}
1122
1123
	/**
1124
	 * Load language files
@@ 5559-5567 (lines=9) @@
5556
	 * @param int    $timestamp Timestamp of the request.
5557
	 * @param string $nonce     Nonce string.
5558
	 */
5559
	public function add_nonce( $timestamp, $nonce ) {
5560
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::add_nonce' );
5561
5562
		if ( ! $this->connection_manager ) {
5563
			$this->connection_manager = new Connection_Manager();
5564
		}
5565
5566
		return $this->connection_manager->add_nonce( $timestamp, $nonce );
5567
	}
5568
5569
	/**
5570
	 * In some setups, $HTTP_RAW_POST_DATA can be emptied during some IXR_Server paths since it is passed by reference to various methods.
@@ 5579-5587 (lines=9) @@
5576
	 * @param array $methods XMLRPC methods.
5577
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5578
	 */
5579
	public function xmlrpc_methods( $methods ) {
5580
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5581
5582
		if ( ! $this->connection_manager ) {
5583
			$this->connection_manager = new Connection_Manager();
5584
		}
5585
5586
		return $this->connection_manager->xmlrpc_methods( $methods );
5587
	}
5588
5589
	/**
5590
	 * Register additional public XMLRPC methods.
@@ 5598-5606 (lines=9) @@
5595
	 * @param array $methods Public XMLRPC methods.
5596
	 * @return array Public XMLRPC methods, with the getOptions one.
5597
	 */
5598
	public function public_xmlrpc_methods( $methods ) {
5599
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5600
5601
		if ( ! $this->connection_manager ) {
5602
			$this->connection_manager = new Connection_Manager();
5603
		}
5604
5605
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5606
	}
5607
5608
	/**
5609
	 * Handles a getOptions XMLRPC method call.
@@ 5617-5625 (lines=9) @@
5614
	 * @param array $args method call arguments.
5615
	 * @return array an amended XMLRPC server options array.
5616
	 */
5617
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5618
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5619
5620
		if ( ! $this->connection_manager ) {
5621
			$this->connection_manager = new Connection_Manager();
5622
		}
5623
5624
		return $this->connection_manager->jetpack_getOptions( $args );
5625
	}
5626
5627
	/**
5628
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5636-5644 (lines=9) @@
5633
	 * @param array $options Standard Core options.
5634
	 * @return array Amended options.
5635
	 */
5636
	public function xmlrpc_options( $options ) {
5637
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5638
5639
		if ( ! $this->connection_manager ) {
5640
			$this->connection_manager = new Connection_Manager();
5641
		}
5642
5643
		return $this->connection_manager->xmlrpc_options( $options );
5644
	}
5645
5646
	/**
5647
	 * Cleans nonces that were saved when calling ::add_nonce.