Code Duplication    Length = 9-9 lines in 8 locations

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

@@ 968-976 (lines=9) @@
965
	 * @deprecated since 7.7.0
966
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
967
	 */
968
	public function initialize_rest_api_registration_connector() {
969
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
970
971
		if ( ! $this->connection_manager ) {
972
			$this->connection_manager = new Connection_Manager();
973
		}
974
975
		$this->connection_manager->initialize_rest_api_registration_connector();
976
	}
977
978
	/**
979
	 * This is ported over from the manage module, which has been deprecated and baked in here.
@@ 1150-1158 (lines=9) @@
1147
	 * @param array $methods A list of registered WordPress XMLRPC methods.
1148
	 * @return array Filtered $methods
1149
	 */
1150
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
1151
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
1152
1153
		if ( ! $this->connection_manager ) {
1154
			$this->connection_manager = new Connection_Manager();
1155
		}
1156
1157
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1158
	}
1159
1160
	/**
1161
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1170-1178 (lines=9) @@
1167
	 * @deprecated since 7.7.0
1168
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1169
	 */
1170
	public function alternate_xmlrpc() {
1171
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1172
1173
		if ( ! $this->connection_manager ) {
1174
			$this->connection_manager = new Connection_Manager();
1175
		}
1176
1177
		$this->connection_manager->alternate_xmlrpc();
1178
	}
1179
1180
	/**
1181
	 * The callback for the JITM ajax requests.
@@ 1248-1256 (lines=9) @@
1245
	 * @deprecated since 7.7.0
1246
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1247
	 */
1248
	public function require_jetpack_authentication() {
1249
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1250
1251
		if ( ! $this->connection_manager ) {
1252
			$this->connection_manager = new Connection_Manager();
1253
		}
1254
1255
		$this->connection_manager->require_jetpack_authentication();
1256
	}
1257
1258
	/**
1259
	 * Register assets for use in various modules and the Jetpack admin page.
@@ 5732-5740 (lines=9) @@
5729
	 * @param array $methods XMLRPC methods.
5730
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5731
	 */
5732
	public function xmlrpc_methods( $methods ) {
5733
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5734
5735
		if ( ! $this->connection_manager ) {
5736
			$this->connection_manager = new Connection_Manager();
5737
		}
5738
5739
		return $this->connection_manager->xmlrpc_methods( $methods );
5740
	}
5741
5742
	/**
5743
	 * Register additional public XMLRPC methods.
@@ 5751-5759 (lines=9) @@
5748
	 * @param array $methods Public XMLRPC methods.
5749
	 * @return array Public XMLRPC methods, with the getOptions one.
5750
	 */
5751
	public function public_xmlrpc_methods( $methods ) {
5752
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5753
5754
		if ( ! $this->connection_manager ) {
5755
			$this->connection_manager = new Connection_Manager();
5756
		}
5757
5758
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5759
	}
5760
5761
	/**
5762
	 * Handles a getOptions XMLRPC method call.
@@ 5770-5778 (lines=9) @@
5767
	 * @param array $args method call arguments.
5768
	 * @return array an amended XMLRPC server options array.
5769
	 */
5770
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5771
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5772
5773
		if ( ! $this->connection_manager ) {
5774
			$this->connection_manager = new Connection_Manager();
5775
		}
5776
5777
		return $this->connection_manager->jetpack_getOptions( $args );
5778
	}
5779
5780
	/**
5781
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5789-5797 (lines=9) @@
5786
	 * @param array $options Standard Core options.
5787
	 * @return array Amended options.
5788
	 */
5789
	public function xmlrpc_options( $options ) {
5790
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5791
5792
		if ( ! $this->connection_manager ) {
5793
			$this->connection_manager = new Connection_Manager();
5794
		}
5795
5796
		return $this->connection_manager->xmlrpc_options( $options );
5797
	}
5798
5799
	/**
5800
	 * State is passed via cookies from one request to the next, but never to subsequent requests.