Code Duplication    Length = 9-9 lines in 9 locations

class.jetpack.php 9 locations

@@ 1017-1025 (lines=9) @@
1014
	 * @param array $methods A list of registered WordPress XMLRPC methods.
1015
	 * @return array Filtered $methods
1016
	 */
1017
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
1018
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
1019
1020
		if ( ! $this->connection_manager ) {
1021
			$this->connection_manager = new Connection_Manager();
1022
		}
1023
1024
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1025
	}
1026
1027
	/**
1028
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1037-1045 (lines=9) @@
1034
	 * @deprecated since 7.7.0
1035
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1036
	 */
1037
	public function alternate_xmlrpc() {
1038
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1039
1040
		if ( ! $this->connection_manager ) {
1041
			$this->connection_manager = new Connection_Manager();
1042
		}
1043
1044
		$this->connection_manager->alternate_xmlrpc();
1045
	}
1046
1047
	/**
1048
	 * The callback for the JITM ajax requests.
@@ 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.
@@ 887-895 (lines=9) @@
884
	 * @deprecated since 7.7.0
885
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
886
	 */
887
	public function initialize_rest_api_registration_connector() {
888
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
889
890
		if ( ! $this->connection_manager ) {
891
			$this->connection_manager = new Connection_Manager();
892
		}
893
894
		$this->connection_manager->initialize_rest_api_registration_connector();
895
	}
896
897
	/**
898
	 * This is ported over from the manage module, which has been deprecated and baked in here.
@@ 1115-1123 (lines=9) @@
1112
	 * @deprecated since 7.7.0
1113
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1114
	 */
1115
	public function require_jetpack_authentication() {
1116
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1117
1118
		if ( ! $this->connection_manager ) {
1119
			$this->connection_manager = new Connection_Manager();
1120
		}
1121
1122
		$this->connection_manager->require_jetpack_authentication();
1123
	}
1124
1125
	/**
1126
	 * Load language files