Code Duplication    Length = 9-9 lines in 9 locations

class.jetpack.php 9 locations

@@ 1137-1145 (lines=9) @@
1134
	 * @deprecated since 7.7.0
1135
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1136
	 */
1137
	public function require_jetpack_authentication() {
1138
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1139
1140
		if ( ! $this->connection_manager ) {
1141
			$this->connection_manager = new Connection_Manager();
1142
		}
1143
1144
		$this->connection_manager->require_jetpack_authentication();
1145
	}
1146
1147
	/**
1148
	 * Register assets for use in various modules and the Jetpack admin page.
@@ 913-921 (lines=9) @@
910
	 * @deprecated since 7.7.0
911
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
912
	 */
913
	public function initialize_rest_api_registration_connector() {
914
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
915
916
		if ( ! $this->connection_manager ) {
917
			$this->connection_manager = new Connection_Manager();
918
		}
919
920
		$this->connection_manager->initialize_rest_api_registration_connector();
921
	}
922
923
	/**
924
	 * This is ported over from the manage module, which has been deprecated and baked in here.
@@ 1039-1047 (lines=9) @@
1036
	 * @param array $methods A list of registered WordPress XMLRPC methods.
1037
	 * @return array Filtered $methods
1038
	 */
1039
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
1040
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
1041
1042
		if ( ! $this->connection_manager ) {
1043
			$this->connection_manager = new Connection_Manager();
1044
		}
1045
1046
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1047
	}
1048
1049
	/**
1050
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1059-1067 (lines=9) @@
1056
	 * @deprecated since 7.7.0
1057
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1058
	 */
1059
	public function alternate_xmlrpc() {
1060
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1061
1062
		if ( ! $this->connection_manager ) {
1063
			$this->connection_manager = new Connection_Manager();
1064
		}
1065
1066
		$this->connection_manager->alternate_xmlrpc();
1067
	}
1068
1069
	/**
1070
	 * The callback for the JITM ajax requests.
@@ 5611-5619 (lines=9) @@
5608
	 * @param int    $timestamp Timestamp of the request.
5609
	 * @param string $nonce     Nonce string.
5610
	 */
5611
	public function add_nonce( $timestamp, $nonce ) {
5612
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::add_nonce' );
5613
5614
		if ( ! $this->connection_manager ) {
5615
			$this->connection_manager = new Connection_Manager();
5616
		}
5617
5618
		return $this->connection_manager->add_nonce( $timestamp, $nonce );
5619
	}
5620
5621
	/**
5622
	 * In some setups, $HTTP_RAW_POST_DATA can be emptied during some IXR_Server paths since it is passed by reference to various methods.
@@ 5631-5639 (lines=9) @@
5628
	 * @param array $methods XMLRPC methods.
5629
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5630
	 */
5631
	public function xmlrpc_methods( $methods ) {
5632
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5633
5634
		if ( ! $this->connection_manager ) {
5635
			$this->connection_manager = new Connection_Manager();
5636
		}
5637
5638
		return $this->connection_manager->xmlrpc_methods( $methods );
5639
	}
5640
5641
	/**
5642
	 * Register additional public XMLRPC methods.
@@ 5650-5658 (lines=9) @@
5647
	 * @param array $methods Public XMLRPC methods.
5648
	 * @return array Public XMLRPC methods, with the getOptions one.
5649
	 */
5650
	public function public_xmlrpc_methods( $methods ) {
5651
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5652
5653
		if ( ! $this->connection_manager ) {
5654
			$this->connection_manager = new Connection_Manager();
5655
		}
5656
5657
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5658
	}
5659
5660
	/**
5661
	 * Handles a getOptions XMLRPC method call.
@@ 5669-5677 (lines=9) @@
5666
	 * @param array $args method call arguments.
5667
	 * @return array an amended XMLRPC server options array.
5668
	 */
5669
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5670
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5671
5672
		if ( ! $this->connection_manager ) {
5673
			$this->connection_manager = new Connection_Manager();
5674
		}
5675
5676
		return $this->connection_manager->jetpack_getOptions( $args );
5677
	}
5678
5679
	/**
5680
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5688-5696 (lines=9) @@
5685
	 * @param array $options Standard Core options.
5686
	 * @return array Amended options.
5687
	 */
5688
	public function xmlrpc_options( $options ) {
5689
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5690
5691
		if ( ! $this->connection_manager ) {
5692
			$this->connection_manager = new Connection_Manager();
5693
		}
5694
5695
		return $this->connection_manager->xmlrpc_options( $options );
5696
	}
5697
5698
	/**
5699
	 * Cleans nonces that were saved when calling ::add_nonce.