Code Duplication    Length = 9-9 lines in 8 locations

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

@@ 960-968 (lines=9) @@
957
	 * @deprecated since 7.7.0
958
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
959
	 */
960
	public function initialize_rest_api_registration_connector() {
961
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
962
963
		if ( ! $this->connection_manager ) {
964
			$this->connection_manager = new Connection_Manager();
965
		}
966
967
		$this->connection_manager->initialize_rest_api_registration_connector();
968
	}
969
970
	/**
971
	 * This is ported over from the manage module, which has been deprecated and baked in here.
@@ 1119-1127 (lines=9) @@
1116
	 * @param array $methods A list of registered WordPress XMLRPC methods.
1117
	 * @return array Filtered $methods
1118
	 */
1119
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
1120
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
1121
1122
		if ( ! $this->connection_manager ) {
1123
			$this->connection_manager = new Connection_Manager();
1124
		}
1125
1126
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1127
	}
1128
1129
	/**
1130
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1139-1147 (lines=9) @@
1136
	 * @deprecated since 7.7.0
1137
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1138
	 */
1139
	public function alternate_xmlrpc() {
1140
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1141
1142
		if ( ! $this->connection_manager ) {
1143
			$this->connection_manager = new Connection_Manager();
1144
		}
1145
1146
		$this->connection_manager->alternate_xmlrpc();
1147
	}
1148
1149
	/**
1150
	 * The callback for the JITM ajax requests.
@@ 1217-1225 (lines=9) @@
1214
	 * @deprecated since 7.7.0
1215
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1216
	 */
1217
	public function require_jetpack_authentication() {
1218
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1219
1220
		if ( ! $this->connection_manager ) {
1221
			$this->connection_manager = new Connection_Manager();
1222
		}
1223
1224
		$this->connection_manager->require_jetpack_authentication();
1225
	}
1226
1227
	/**
1228
	 * Register assets for use in various modules and the Jetpack admin page.
@@ 5627-5635 (lines=9) @@
5624
	 * @param array $methods XMLRPC methods.
5625
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5626
	 */
5627
	public function xmlrpc_methods( $methods ) {
5628
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5629
5630
		if ( ! $this->connection_manager ) {
5631
			$this->connection_manager = new Connection_Manager();
5632
		}
5633
5634
		return $this->connection_manager->xmlrpc_methods( $methods );
5635
	}
5636
5637
	/**
5638
	 * Register additional public XMLRPC methods.
@@ 5646-5654 (lines=9) @@
5643
	 * @param array $methods Public XMLRPC methods.
5644
	 * @return array Public XMLRPC methods, with the getOptions one.
5645
	 */
5646
	public function public_xmlrpc_methods( $methods ) {
5647
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5648
5649
		if ( ! $this->connection_manager ) {
5650
			$this->connection_manager = new Connection_Manager();
5651
		}
5652
5653
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5654
	}
5655
5656
	/**
5657
	 * Handles a getOptions XMLRPC method call.
@@ 5665-5673 (lines=9) @@
5662
	 * @param array $args method call arguments.
5663
	 * @return array an amended XMLRPC server options array.
5664
	 */
5665
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5666
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5667
5668
		if ( ! $this->connection_manager ) {
5669
			$this->connection_manager = new Connection_Manager();
5670
		}
5671
5672
		return $this->connection_manager->jetpack_getOptions( $args );
5673
	}
5674
5675
	/**
5676
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5684-5692 (lines=9) @@
5681
	 * @param array $options Standard Core options.
5682
	 * @return array Amended options.
5683
	 */
5684
	public function xmlrpc_options( $options ) {
5685
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5686
5687
		if ( ! $this->connection_manager ) {
5688
			$this->connection_manager = new Connection_Manager();
5689
		}
5690
5691
		return $this->connection_manager->xmlrpc_options( $options );
5692
	}
5693
5694
	/**
5695
	 * State is passed via cookies from one request to the next, but never to subsequent requests.