Code Duplication    Length = 9-9 lines in 9 locations

class.jetpack.php 9 locations

@@ 1009-1017 (lines=9) @@
1006
	 * @param array $methods A list of registered WordPress XMLRPC methods.
1007
	 * @return array Filtered $methods
1008
	 */
1009
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
1010
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
1011
1012
		if ( ! $this->connection_manager ) {
1013
			$this->connection_manager = new Connection_Manager();
1014
		}
1015
1016
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1017
	}
1018
1019
	/**
1020
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1029-1037 (lines=9) @@
1026
	 * @deprecated since 7.7.0
1027
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1028
	 */
1029
	public function alternate_xmlrpc() {
1030
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1031
1032
		if ( ! $this->connection_manager ) {
1033
			$this->connection_manager = new Connection_Manager();
1034
		}
1035
1036
		$this->connection_manager->alternate_xmlrpc();
1037
	}
1038
1039
	/**
1040
	 * The callback for the JITM ajax requests.
@@ 5697-5705 (lines=9) @@
5694
	 * @param int    $timestamp Timestamp of the request.
5695
	 * @param string $nonce     Nonce string.
5696
	 */
5697
	public function add_nonce( $timestamp, $nonce ) {
5698
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::add_nonce' );
5699
5700
		if ( ! $this->connection_manager ) {
5701
			$this->connection_manager = new Connection_Manager();
5702
		}
5703
5704
		return $this->connection_manager->add_nonce( $timestamp, $nonce );
5705
	}
5706
5707
	/**
5708
	 * In some setups, $HTTP_RAW_POST_DATA can be emptied during some IXR_Server paths since it is passed by reference to various methods.
@@ 5717-5725 (lines=9) @@
5714
	 * @param array $methods XMLRPC methods.
5715
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5716
	 */
5717
	public function xmlrpc_methods( $methods ) {
5718
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5719
5720
		if ( ! $this->connection_manager ) {
5721
			$this->connection_manager = new Connection_Manager();
5722
		}
5723
5724
		return $this->connection_manager->xmlrpc_methods( $methods );
5725
	}
5726
5727
	/**
5728
	 * Register additional public XMLRPC methods.
@@ 5736-5744 (lines=9) @@
5733
	 * @param array $methods Public XMLRPC methods.
5734
	 * @return array Public XMLRPC methods, with the getOptions one.
5735
	 */
5736
	public function public_xmlrpc_methods( $methods ) {
5737
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5738
5739
		if ( ! $this->connection_manager ) {
5740
			$this->connection_manager = new Connection_Manager();
5741
		}
5742
5743
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5744
	}
5745
5746
	/**
5747
	 * Handles a getOptions XMLRPC method call.
@@ 5755-5763 (lines=9) @@
5752
	 * @param array $args method call arguments.
5753
	 * @return array an amended XMLRPC server options array.
5754
	 */
5755
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5756
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5757
5758
		if ( ! $this->connection_manager ) {
5759
			$this->connection_manager = new Connection_Manager();
5760
		}
5761
5762
		return $this->connection_manager->jetpack_getOptions( $args );
5763
	}
5764
5765
	/**
5766
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5774-5782 (lines=9) @@
5771
	 * @param array $options Standard Core options.
5772
	 * @return array Amended options.
5773
	 */
5774
	public function xmlrpc_options( $options ) {
5775
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5776
5777
		if ( ! $this->connection_manager ) {
5778
			$this->connection_manager = new Connection_Manager();
5779
		}
5780
5781
		return $this->connection_manager->xmlrpc_options( $options );
5782
	}
5783
5784
	/**
5785
	 * Cleans nonces that were saved when calling ::add_nonce.
@@ 879-887 (lines=9) @@
876
	 * @deprecated since 7.7.0
877
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
878
	 */
879
	public function initialize_rest_api_registration_connector() {
880
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
881
882
		if ( ! $this->connection_manager ) {
883
			$this->connection_manager = new Connection_Manager();
884
		}
885
886
		$this->connection_manager->initialize_rest_api_registration_connector();
887
	}
888
889
	/**
890
	 * This is ported over from the manage module, which has been deprecated and baked in here.
@@ 1132-1140 (lines=9) @@
1129
	 * @deprecated since 7.7.0
1130
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1131
	 */
1132
	public function require_jetpack_authentication() {
1133
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1134
1135
		if ( ! $this->connection_manager ) {
1136
			$this->connection_manager = new Connection_Manager();
1137
		}
1138
1139
		$this->connection_manager->require_jetpack_authentication();
1140
	}
1141
1142
	/**
1143
	 * Load language files