Code Duplication    Length = 9-9 lines in 9 locations

class.jetpack.php 9 locations

@@ 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
	 * Register assets for use in various modules and the Jetpack admin page.
@@ 1022-1030 (lines=9) @@
1019
	 * @param array $methods A list of registered WordPress XMLRPC methods.
1020
	 * @return array Filtered $methods
1021
	 */
1022
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
1023
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
1024
1025
		if ( ! $this->connection_manager ) {
1026
			$this->connection_manager = new Connection_Manager();
1027
		}
1028
1029
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1030
	}
1031
1032
	/**
1033
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1042-1050 (lines=9) @@
1039
	 * @deprecated since 7.7.0
1040
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1041
	 */
1042
	public function alternate_xmlrpc() {
1043
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1044
1045
		if ( ! $this->connection_manager ) {
1046
			$this->connection_manager = new Connection_Manager();
1047
		}
1048
1049
		$this->connection_manager->alternate_xmlrpc();
1050
	}
1051
1052
	/**
1053
	 * The callback for the JITM ajax requests.
@@ 896-904 (lines=9) @@
893
	 * @deprecated since 7.7.0
894
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
895
	 */
896
	public function initialize_rest_api_registration_connector() {
897
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
898
899
		if ( ! $this->connection_manager ) {
900
			$this->connection_manager = new Connection_Manager();
901
		}
902
903
		$this->connection_manager->initialize_rest_api_registration_connector();
904
	}
905
906
	/**
907
	 * This is ported over from the manage module, which has been deprecated and baked in here.
@@ 5592-5600 (lines=9) @@
5589
	 * @param int    $timestamp Timestamp of the request.
5590
	 * @param string $nonce     Nonce string.
5591
	 */
5592
	public function add_nonce( $timestamp, $nonce ) {
5593
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::add_nonce' );
5594
5595
		if ( ! $this->connection_manager ) {
5596
			$this->connection_manager = new Connection_Manager();
5597
		}
5598
5599
		return $this->connection_manager->add_nonce( $timestamp, $nonce );
5600
	}
5601
5602
	/**
5603
	 * In some setups, $HTTP_RAW_POST_DATA can be emptied during some IXR_Server paths since it is passed by reference to various methods.
@@ 5612-5620 (lines=9) @@
5609
	 * @param array $methods XMLRPC methods.
5610
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5611
	 */
5612
	public function xmlrpc_methods( $methods ) {
5613
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5614
5615
		if ( ! $this->connection_manager ) {
5616
			$this->connection_manager = new Connection_Manager();
5617
		}
5618
5619
		return $this->connection_manager->xmlrpc_methods( $methods );
5620
	}
5621
5622
	/**
5623
	 * Register additional public XMLRPC methods.
@@ 5631-5639 (lines=9) @@
5628
	 * @param array $methods Public XMLRPC methods.
5629
	 * @return array Public XMLRPC methods, with the getOptions one.
5630
	 */
5631
	public function public_xmlrpc_methods( $methods ) {
5632
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5633
5634
		if ( ! $this->connection_manager ) {
5635
			$this->connection_manager = new Connection_Manager();
5636
		}
5637
5638
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5639
	}
5640
5641
	/**
5642
	 * Handles a getOptions XMLRPC method call.
@@ 5650-5658 (lines=9) @@
5647
	 * @param array $args method call arguments.
5648
	 * @return array an amended XMLRPC server options array.
5649
	 */
5650
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5651
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5652
5653
		if ( ! $this->connection_manager ) {
5654
			$this->connection_manager = new Connection_Manager();
5655
		}
5656
5657
		return $this->connection_manager->jetpack_getOptions( $args );
5658
	}
5659
5660
	/**
5661
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5669-5677 (lines=9) @@
5666
	 * @param array $options Standard Core options.
5667
	 * @return array Amended options.
5668
	 */
5669
	public function xmlrpc_options( $options ) {
5670
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5671
5672
		if ( ! $this->connection_manager ) {
5673
			$this->connection_manager = new Connection_Manager();
5674
		}
5675
5676
		return $this->connection_manager->xmlrpc_options( $options );
5677
	}
5678
5679
	/**
5680
	 * Cleans nonces that were saved when calling ::add_nonce.