Code Duplication    Length = 9-9 lines in 9 locations

class.jetpack.php 9 locations

@@ 888-896 (lines=9) @@
885
	 * @deprecated since 7.7.0
886
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
887
	 */
888
	public function initialize_rest_api_registration_connector() {
889
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
890
891
		if ( ! $this->connection_manager ) {
892
			$this->connection_manager = new Connection_Manager();
893
		}
894
895
		$this->connection_manager->initialize_rest_api_registration_connector();
896
	}
897
898
	/**
899
	 * This is ported over from the manage module, which has been deprecated and baked in here.
@@ 1018-1026 (lines=9) @@
1015
	 * @param array $methods A list of registered WordPress XMLRPC methods.
1016
	 * @return array Filtered $methods
1017
	 */
1018
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
1019
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
1020
1021
		if ( ! $this->connection_manager ) {
1022
			$this->connection_manager = new Connection_Manager();
1023
		}
1024
1025
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1026
	}
1027
1028
	/**
1029
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1038-1046 (lines=9) @@
1035
	 * @deprecated since 7.7.0
1036
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1037
	 */
1038
	public function alternate_xmlrpc() {
1039
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1040
1041
		if ( ! $this->connection_manager ) {
1042
			$this->connection_manager = new Connection_Manager();
1043
		}
1044
1045
		$this->connection_manager->alternate_xmlrpc();
1046
	}
1047
1048
	/**
1049
	 * The callback for the JITM ajax requests.
@@ 1116-1124 (lines=9) @@
1113
	 * @deprecated since 7.7.0
1114
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1115
	 */
1116
	public function require_jetpack_authentication() {
1117
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1118
1119
		if ( ! $this->connection_manager ) {
1120
			$this->connection_manager = new Connection_Manager();
1121
		}
1122
1123
		$this->connection_manager->require_jetpack_authentication();
1124
	}
1125
1126
	/**
1127
	 * Load language files
@@ 5663-5671 (lines=9) @@
5660
	 * @param int    $timestamp Timestamp of the request.
5661
	 * @param string $nonce     Nonce string.
5662
	 */
5663
	public function add_nonce( $timestamp, $nonce ) {
5664
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::add_nonce' );
5665
5666
		if ( ! $this->connection_manager ) {
5667
			$this->connection_manager = new Connection_Manager();
5668
		}
5669
5670
		return $this->connection_manager->add_nonce( $timestamp, $nonce );
5671
	}
5672
5673
	/**
5674
	 * In some setups, $HTTP_RAW_POST_DATA can be emptied during some IXR_Server paths since it is passed by reference to various methods.
@@ 5683-5691 (lines=9) @@
5680
	 * @param array $methods XMLRPC methods.
5681
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5682
	 */
5683
	public function xmlrpc_methods( $methods ) {
5684
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5685
5686
		if ( ! $this->connection_manager ) {
5687
			$this->connection_manager = new Connection_Manager();
5688
		}
5689
5690
		return $this->connection_manager->xmlrpc_methods( $methods );
5691
	}
5692
5693
	/**
5694
	 * Register additional public XMLRPC methods.
@@ 5702-5710 (lines=9) @@
5699
	 * @param array $methods Public XMLRPC methods.
5700
	 * @return array Public XMLRPC methods, with the getOptions one.
5701
	 */
5702
	public function public_xmlrpc_methods( $methods ) {
5703
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5704
5705
		if ( ! $this->connection_manager ) {
5706
			$this->connection_manager = new Connection_Manager();
5707
		}
5708
5709
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5710
	}
5711
5712
	/**
5713
	 * Handles a getOptions XMLRPC method call.
@@ 5721-5729 (lines=9) @@
5718
	 * @param array $args method call arguments.
5719
	 * @return array an amended XMLRPC server options array.
5720
	 */
5721
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5722
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5723
5724
		if ( ! $this->connection_manager ) {
5725
			$this->connection_manager = new Connection_Manager();
5726
		}
5727
5728
		return $this->connection_manager->jetpack_getOptions( $args );
5729
	}
5730
5731
	/**
5732
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5740-5748 (lines=9) @@
5737
	 * @param array $options Standard Core options.
5738
	 * @return array Amended options.
5739
	 */
5740
	public function xmlrpc_options( $options ) {
5741
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5742
5743
		if ( ! $this->connection_manager ) {
5744
			$this->connection_manager = new Connection_Manager();
5745
		}
5746
5747
		return $this->connection_manager->xmlrpc_options( $options );
5748
	}
5749
5750
	/**
5751
	 * Cleans nonces that were saved when calling ::add_nonce.