Code Duplication    Length = 9-9 lines in 9 locations

class.jetpack.php 9 locations

@@ 1027-1035 (lines=9) @@
1024
	 * @param array $methods A list of registered WordPress XMLRPC methods.
1025
	 * @return array Filtered $methods
1026
	 */
1027
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
1028
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
1029
1030
		if ( ! $this->connection_manager ) {
1031
			$this->connection_manager = new Connection_Manager();
1032
		}
1033
1034
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1035
	}
1036
1037
	/**
1038
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1047-1055 (lines=9) @@
1044
	 * @deprecated since 7.7.0
1045
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1046
	 */
1047
	public function alternate_xmlrpc() {
1048
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1049
1050
		if ( ! $this->connection_manager ) {
1051
			$this->connection_manager = new Connection_Manager();
1052
		}
1053
1054
		$this->connection_manager->alternate_xmlrpc();
1055
	}
1056
1057
	/**
1058
	 * The callback for the JITM ajax requests.
@@ 1125-1133 (lines=9) @@
1122
	 * @deprecated since 7.7.0
1123
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1124
	 */
1125
	public function require_jetpack_authentication() {
1126
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1127
1128
		if ( ! $this->connection_manager ) {
1129
			$this->connection_manager = new Connection_Manager();
1130
		}
1131
1132
		$this->connection_manager->require_jetpack_authentication();
1133
	}
1134
1135
	/**
1136
	 * Register assets for use in various modules and the Jetpack admin page.
@@ 5599-5607 (lines=9) @@
5596
	 * @param int    $timestamp Timestamp of the request.
5597
	 * @param string $nonce     Nonce string.
5598
	 */
5599
	public function add_nonce( $timestamp, $nonce ) {
5600
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::add_nonce' );
5601
5602
		if ( ! $this->connection_manager ) {
5603
			$this->connection_manager = new Connection_Manager();
5604
		}
5605
5606
		return $this->connection_manager->add_nonce( $timestamp, $nonce );
5607
	}
5608
5609
	/**
5610
	 * In some setups, $HTTP_RAW_POST_DATA can be emptied during some IXR_Server paths since it is passed by reference to various methods.
@@ 5619-5627 (lines=9) @@
5616
	 * @param array $methods XMLRPC methods.
5617
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5618
	 */
5619
	public function xmlrpc_methods( $methods ) {
5620
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5621
5622
		if ( ! $this->connection_manager ) {
5623
			$this->connection_manager = new Connection_Manager();
5624
		}
5625
5626
		return $this->connection_manager->xmlrpc_methods( $methods );
5627
	}
5628
5629
	/**
5630
	 * Register additional public XMLRPC methods.
@@ 5638-5646 (lines=9) @@
5635
	 * @param array $methods Public XMLRPC methods.
5636
	 * @return array Public XMLRPC methods, with the getOptions one.
5637
	 */
5638
	public function public_xmlrpc_methods( $methods ) {
5639
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5640
5641
		if ( ! $this->connection_manager ) {
5642
			$this->connection_manager = new Connection_Manager();
5643
		}
5644
5645
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5646
	}
5647
5648
	/**
5649
	 * Handles a getOptions XMLRPC method call.
@@ 5657-5665 (lines=9) @@
5654
	 * @param array $args method call arguments.
5655
	 * @return array an amended XMLRPC server options array.
5656
	 */
5657
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5658
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5659
5660
		if ( ! $this->connection_manager ) {
5661
			$this->connection_manager = new Connection_Manager();
5662
		}
5663
5664
		return $this->connection_manager->jetpack_getOptions( $args );
5665
	}
5666
5667
	/**
5668
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5676-5684 (lines=9) @@
5673
	 * @param array $options Standard Core options.
5674
	 * @return array Amended options.
5675
	 */
5676
	public function xmlrpc_options( $options ) {
5677
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5678
5679
		if ( ! $this->connection_manager ) {
5680
			$this->connection_manager = new Connection_Manager();
5681
		}
5682
5683
		return $this->connection_manager->xmlrpc_options( $options );
5684
	}
5685
5686
	/**
5687
	 * Cleans nonces that were saved when calling ::add_nonce.
@@ 901-909 (lines=9) @@
898
	 * @deprecated since 7.7.0
899
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
900
	 */
901
	public function initialize_rest_api_registration_connector() {
902
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
903
904
		if ( ! $this->connection_manager ) {
905
			$this->connection_manager = new Connection_Manager();
906
		}
907
908
		$this->connection_manager->initialize_rest_api_registration_connector();
909
	}
910
911
	/**
912
	 * This is ported over from the manage module, which has been deprecated and baked in here.