Code Duplication    Length = 9-9 lines in 8 locations

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

@@ 953-961 (lines=9) @@
950
	 * @deprecated since 7.7.0
951
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
952
	 */
953
	public function initialize_rest_api_registration_connector() {
954
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
955
956
		if ( ! $this->connection_manager ) {
957
			$this->connection_manager = new Connection_Manager();
958
		}
959
960
		$this->connection_manager->initialize_rest_api_registration_connector();
961
	}
962
963
	/**
964
	 * This is ported over from the manage module, which has been deprecated and baked in here.
@@ 1079-1087 (lines=9) @@
1076
	 * @param array $methods A list of registered WordPress XMLRPC methods.
1077
	 * @return array Filtered $methods
1078
	 */
1079
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
1080
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
1081
1082
		if ( ! $this->connection_manager ) {
1083
			$this->connection_manager = new Connection_Manager();
1084
		}
1085
1086
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1087
	}
1088
1089
	/**
1090
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1099-1107 (lines=9) @@
1096
	 * @deprecated since 7.7.0
1097
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1098
	 */
1099
	public function alternate_xmlrpc() {
1100
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1101
1102
		if ( ! $this->connection_manager ) {
1103
			$this->connection_manager = new Connection_Manager();
1104
		}
1105
1106
		$this->connection_manager->alternate_xmlrpc();
1107
	}
1108
1109
	/**
1110
	 * The callback for the JITM ajax requests.
@@ 1177-1185 (lines=9) @@
1174
	 * @deprecated since 7.7.0
1175
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1176
	 */
1177
	public function require_jetpack_authentication() {
1178
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1179
1180
		if ( ! $this->connection_manager ) {
1181
			$this->connection_manager = new Connection_Manager();
1182
		}
1183
1184
		$this->connection_manager->require_jetpack_authentication();
1185
	}
1186
1187
	/**
1188
	 * Register assets for use in various modules and the Jetpack admin page.
@@ 5526-5534 (lines=9) @@
5523
	 * @param array $methods XMLRPC methods.
5524
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5525
	 */
5526
	public function xmlrpc_methods( $methods ) {
5527
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5528
5529
		if ( ! $this->connection_manager ) {
5530
			$this->connection_manager = new Connection_Manager();
5531
		}
5532
5533
		return $this->connection_manager->xmlrpc_methods( $methods );
5534
	}
5535
5536
	/**
5537
	 * Register additional public XMLRPC methods.
@@ 5545-5553 (lines=9) @@
5542
	 * @param array $methods Public XMLRPC methods.
5543
	 * @return array Public XMLRPC methods, with the getOptions one.
5544
	 */
5545
	public function public_xmlrpc_methods( $methods ) {
5546
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5547
5548
		if ( ! $this->connection_manager ) {
5549
			$this->connection_manager = new Connection_Manager();
5550
		}
5551
5552
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5553
	}
5554
5555
	/**
5556
	 * Handles a getOptions XMLRPC method call.
@@ 5564-5572 (lines=9) @@
5561
	 * @param array $args method call arguments.
5562
	 * @return array an amended XMLRPC server options array.
5563
	 */
5564
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5565
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5566
5567
		if ( ! $this->connection_manager ) {
5568
			$this->connection_manager = new Connection_Manager();
5569
		}
5570
5571
		return $this->connection_manager->jetpack_getOptions( $args );
5572
	}
5573
5574
	/**
5575
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5583-5591 (lines=9) @@
5580
	 * @param array $options Standard Core options.
5581
	 * @return array Amended options.
5582
	 */
5583
	public function xmlrpc_options( $options ) {
5584
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5585
5586
		if ( ! $this->connection_manager ) {
5587
			$this->connection_manager = new Connection_Manager();
5588
		}
5589
5590
		return $this->connection_manager->xmlrpc_options( $options );
5591
	}
5592
5593
	/**
5594
	 * State is passed via cookies from one request to the next, but never to subsequent requests.