Code Duplication    Length = 9-9 lines in 9 locations

class.jetpack.php 9 locations

@@ 1141-1149 (lines=9) @@
1138
	 * @deprecated since 7.7.0
1139
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1140
	 */
1141
	public function require_jetpack_authentication() {
1142
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1143
1144
		if ( ! $this->connection_manager ) {
1145
			$this->connection_manager = new Connection_Manager();
1146
		}
1147
1148
		$this->connection_manager->require_jetpack_authentication();
1149
	}
1150
1151
	/**
1152
	 * Register assets for use in various modules and the Jetpack admin page.
@@ 1043-1051 (lines=9) @@
1040
	 * @param array $methods A list of registered WordPress XMLRPC methods.
1041
	 * @return array Filtered $methods
1042
	 */
1043
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
1044
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
1045
1046
		if ( ! $this->connection_manager ) {
1047
			$this->connection_manager = new Connection_Manager();
1048
		}
1049
1050
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1051
	}
1052
1053
	/**
1054
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1063-1071 (lines=9) @@
1060
	 * @deprecated since 7.7.0
1061
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1062
	 */
1063
	public function alternate_xmlrpc() {
1064
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1065
1066
		if ( ! $this->connection_manager ) {
1067
			$this->connection_manager = new Connection_Manager();
1068
		}
1069
1070
		$this->connection_manager->alternate_xmlrpc();
1071
	}
1072
1073
	/**
1074
	 * The callback for the JITM ajax requests.
@@ 917-925 (lines=9) @@
914
	 * @deprecated since 7.7.0
915
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
916
	 */
917
	public function initialize_rest_api_registration_connector() {
918
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
919
920
		if ( ! $this->connection_manager ) {
921
			$this->connection_manager = new Connection_Manager();
922
		}
923
924
		$this->connection_manager->initialize_rest_api_registration_connector();
925
	}
926
927
	/**
928
	 * This is ported over from the manage module, which has been deprecated and baked in here.
@@ 5601-5609 (lines=9) @@
5598
	 * @param int    $timestamp Timestamp of the request.
5599
	 * @param string $nonce     Nonce string.
5600
	 */
5601
	public function add_nonce( $timestamp, $nonce ) {
5602
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::add_nonce' );
5603
5604
		if ( ! $this->connection_manager ) {
5605
			$this->connection_manager = new Connection_Manager();
5606
		}
5607
5608
		return $this->connection_manager->add_nonce( $timestamp, $nonce );
5609
	}
5610
5611
	/**
5612
	 * In some setups, $HTTP_RAW_POST_DATA can be emptied during some IXR_Server paths since it is passed by reference to various methods.
@@ 5621-5629 (lines=9) @@
5618
	 * @param array $methods XMLRPC methods.
5619
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5620
	 */
5621
	public function xmlrpc_methods( $methods ) {
5622
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5623
5624
		if ( ! $this->connection_manager ) {
5625
			$this->connection_manager = new Connection_Manager();
5626
		}
5627
5628
		return $this->connection_manager->xmlrpc_methods( $methods );
5629
	}
5630
5631
	/**
5632
	 * Register additional public XMLRPC methods.
@@ 5640-5648 (lines=9) @@
5637
	 * @param array $methods Public XMLRPC methods.
5638
	 * @return array Public XMLRPC methods, with the getOptions one.
5639
	 */
5640
	public function public_xmlrpc_methods( $methods ) {
5641
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5642
5643
		if ( ! $this->connection_manager ) {
5644
			$this->connection_manager = new Connection_Manager();
5645
		}
5646
5647
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5648
	}
5649
5650
	/**
5651
	 * Handles a getOptions XMLRPC method call.
@@ 5659-5667 (lines=9) @@
5656
	 * @param array $args method call arguments.
5657
	 * @return array an amended XMLRPC server options array.
5658
	 */
5659
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5660
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5661
5662
		if ( ! $this->connection_manager ) {
5663
			$this->connection_manager = new Connection_Manager();
5664
		}
5665
5666
		return $this->connection_manager->jetpack_getOptions( $args );
5667
	}
5668
5669
	/**
5670
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5678-5686 (lines=9) @@
5675
	 * @param array $options Standard Core options.
5676
	 * @return array Amended options.
5677
	 */
5678
	public function xmlrpc_options( $options ) {
5679
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5680
5681
		if ( ! $this->connection_manager ) {
5682
			$this->connection_manager = new Connection_Manager();
5683
		}
5684
5685
		return $this->connection_manager->xmlrpc_options( $options );
5686
	}
5687
5688
	/**
5689
	 * Cleans nonces that were saved when calling ::add_nonce.