Code Duplication    Length = 9-9 lines in 8 locations

projects/plugins/jetpack/class.jetpack.php 8 locations

@@ 963-971 (lines=9) @@
960
	 * @deprecated since 7.7.0
961
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
962
	 */
963
	public function initialize_rest_api_registration_connector() {
964
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
965
966
		if ( ! $this->connection_manager ) {
967
			$this->connection_manager = new Connection_Manager();
968
		}
969
970
		$this->connection_manager->initialize_rest_api_registration_connector();
971
	}
972
973
	/**
974
	 * This is ported over from the manage module, which has been deprecated and baked in here.
@@ 1145-1153 (lines=9) @@
1142
	 * @param array $methods A list of registered WordPress XMLRPC methods.
1143
	 * @return array Filtered $methods
1144
	 */
1145
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
1146
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
1147
1148
		if ( ! $this->connection_manager ) {
1149
			$this->connection_manager = new Connection_Manager();
1150
		}
1151
1152
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1153
	}
1154
1155
	/**
1156
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1165-1173 (lines=9) @@
1162
	 * @deprecated since 7.7.0
1163
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1164
	 */
1165
	public function alternate_xmlrpc() {
1166
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1167
1168
		if ( ! $this->connection_manager ) {
1169
			$this->connection_manager = new Connection_Manager();
1170
		}
1171
1172
		$this->connection_manager->alternate_xmlrpc();
1173
	}
1174
1175
	/**
1176
	 * The callback for the JITM ajax requests.
@@ 1243-1251 (lines=9) @@
1240
	 * @deprecated since 7.7.0
1241
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1242
	 */
1243
	public function require_jetpack_authentication() {
1244
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1245
1246
		if ( ! $this->connection_manager ) {
1247
			$this->connection_manager = new Connection_Manager();
1248
		}
1249
1250
		$this->connection_manager->require_jetpack_authentication();
1251
	}
1252
1253
	/**
1254
	 * Register assets for use in various modules and the Jetpack admin page.
@@ 5678-5686 (lines=9) @@
5675
	 * @param array $methods XMLRPC methods.
5676
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5677
	 */
5678
	public function xmlrpc_methods( $methods ) {
5679
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5680
5681
		if ( ! $this->connection_manager ) {
5682
			$this->connection_manager = new Connection_Manager();
5683
		}
5684
5685
		return $this->connection_manager->xmlrpc_methods( $methods );
5686
	}
5687
5688
	/**
5689
	 * Register additional public XMLRPC methods.
@@ 5697-5705 (lines=9) @@
5694
	 * @param array $methods Public XMLRPC methods.
5695
	 * @return array Public XMLRPC methods, with the getOptions one.
5696
	 */
5697
	public function public_xmlrpc_methods( $methods ) {
5698
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5699
5700
		if ( ! $this->connection_manager ) {
5701
			$this->connection_manager = new Connection_Manager();
5702
		}
5703
5704
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5705
	}
5706
5707
	/**
5708
	 * Handles a getOptions XMLRPC method call.
@@ 5716-5724 (lines=9) @@
5713
	 * @param array $args method call arguments.
5714
	 * @return array an amended XMLRPC server options array.
5715
	 */
5716
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5717
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5718
5719
		if ( ! $this->connection_manager ) {
5720
			$this->connection_manager = new Connection_Manager();
5721
		}
5722
5723
		return $this->connection_manager->jetpack_getOptions( $args );
5724
	}
5725
5726
	/**
5727
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5735-5743 (lines=9) @@
5732
	 * @param array $options Standard Core options.
5733
	 * @return array Amended options.
5734
	 */
5735
	public function xmlrpc_options( $options ) {
5736
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5737
5738
		if ( ! $this->connection_manager ) {
5739
			$this->connection_manager = new Connection_Manager();
5740
		}
5741
5742
		return $this->connection_manager->xmlrpc_options( $options );
5743
	}
5744
5745
	/**
5746
	 * State is passed via cookies from one request to the next, but never to subsequent requests.