Code Duplication    Length = 9-9 lines in 9 locations

class.jetpack.php 9 locations

@@ 890-898 (lines=9) @@
887
	 * @deprecated since 7.7.0
888
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
889
	 */
890
	public function initialize_rest_api_registration_connector() {
891
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
892
893
		if ( ! $this->connection_manager ) {
894
			$this->connection_manager = new Connection_Manager();
895
		}
896
897
		$this->connection_manager->initialize_rest_api_registration_connector();
898
	}
899
900
	/**
901
	 * This is ported over from the manage module, which has been deprecated and baked in here.
@@ 1020-1028 (lines=9) @@
1017
	 * @param array $methods A list of registered WordPress XMLRPC methods.
1018
	 * @return array Filtered $methods
1019
	 */
1020
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
1021
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
1022
1023
		if ( ! $this->connection_manager ) {
1024
			$this->connection_manager = new Connection_Manager();
1025
		}
1026
1027
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1028
	}
1029
1030
	/**
1031
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1040-1048 (lines=9) @@
1037
	 * @deprecated since 7.7.0
1038
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1039
	 */
1040
	public function alternate_xmlrpc() {
1041
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1042
1043
		if ( ! $this->connection_manager ) {
1044
			$this->connection_manager = new Connection_Manager();
1045
		}
1046
1047
		$this->connection_manager->alternate_xmlrpc();
1048
	}
1049
1050
	/**
1051
	 * The callback for the JITM ajax requests.
@@ 1148-1156 (lines=9) @@
1145
	 * @deprecated since 7.7.0
1146
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1147
	 */
1148
	public function require_jetpack_authentication() {
1149
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1150
1151
		if ( ! $this->connection_manager ) {
1152
			$this->connection_manager = new Connection_Manager();
1153
		}
1154
1155
		$this->connection_manager->require_jetpack_authentication();
1156
	}
1157
1158
	/**
1159
	 * Load language files
@@ 5636-5644 (lines=9) @@
5633
	 * @param int    $timestamp Timestamp of the request.
5634
	 * @param string $nonce     Nonce string.
5635
	 */
5636
	public function add_nonce( $timestamp, $nonce ) {
5637
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::add_nonce' );
5638
5639
		if ( ! $this->connection_manager ) {
5640
			$this->connection_manager = new Connection_Manager();
5641
		}
5642
5643
		return $this->connection_manager->add_nonce( $timestamp, $nonce );
5644
	}
5645
5646
	/**
5647
	 * In some setups, $HTTP_RAW_POST_DATA can be emptied during some IXR_Server paths since it is passed by reference to various methods.
@@ 5656-5664 (lines=9) @@
5653
	 * @param array $methods XMLRPC methods.
5654
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5655
	 */
5656
	public function xmlrpc_methods( $methods ) {
5657
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5658
5659
		if ( ! $this->connection_manager ) {
5660
			$this->connection_manager = new Connection_Manager();
5661
		}
5662
5663
		return $this->connection_manager->xmlrpc_methods( $methods );
5664
	}
5665
5666
	/**
5667
	 * Register additional public XMLRPC methods.
@@ 5675-5683 (lines=9) @@
5672
	 * @param array $methods Public XMLRPC methods.
5673
	 * @return array Public XMLRPC methods, with the getOptions one.
5674
	 */
5675
	public function public_xmlrpc_methods( $methods ) {
5676
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5677
5678
		if ( ! $this->connection_manager ) {
5679
			$this->connection_manager = new Connection_Manager();
5680
		}
5681
5682
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5683
	}
5684
5685
	/**
5686
	 * Handles a getOptions XMLRPC method call.
@@ 5694-5702 (lines=9) @@
5691
	 * @param array $args method call arguments.
5692
	 * @return array an amended XMLRPC server options array.
5693
	 */
5694
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5695
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5696
5697
		if ( ! $this->connection_manager ) {
5698
			$this->connection_manager = new Connection_Manager();
5699
		}
5700
5701
		return $this->connection_manager->jetpack_getOptions( $args );
5702
	}
5703
5704
	/**
5705
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5713-5721 (lines=9) @@
5710
	 * @param array $options Standard Core options.
5711
	 * @return array Amended options.
5712
	 */
5713
	public function xmlrpc_options( $options ) {
5714
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5715
5716
		if ( ! $this->connection_manager ) {
5717
			$this->connection_manager = new Connection_Manager();
5718
		}
5719
5720
		return $this->connection_manager->xmlrpc_options( $options );
5721
	}
5722
5723
	/**
5724
	 * Cleans nonces that were saved when calling ::add_nonce.