Code Duplication    Length = 9-9 lines in 8 locations

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

@@ 958-966 (lines=9) @@
955
	 * @deprecated since 7.7.0
956
	 * @see Automattic\Jetpack\Connection\Manager::initialize_rest_api_registration_connector()
957
	 */
958
	public function initialize_rest_api_registration_connector() {
959
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::initialize_rest_api_registration_connector' );
960
961
		if ( ! $this->connection_manager ) {
962
			$this->connection_manager = new Connection_Manager();
963
		}
964
965
		$this->connection_manager->initialize_rest_api_registration_connector();
966
	}
967
968
	/**
969
	 * This is ported over from the manage module, which has been deprecated and baked in here.
@@ 1130-1138 (lines=9) @@
1127
	 * @param array $methods A list of registered WordPress XMLRPC methods.
1128
	 * @return array Filtered $methods
1129
	 */
1130
	public function remove_non_jetpack_xmlrpc_methods( $methods ) {
1131
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::remove_non_jetpack_xmlrpc_methods' );
1132
1133
		if ( ! $this->connection_manager ) {
1134
			$this->connection_manager = new Connection_Manager();
1135
		}
1136
1137
		return $this->connection_manager->remove_non_jetpack_xmlrpc_methods( $methods );
1138
	}
1139
1140
	/**
1141
	 * Since a lot of hosts use a hammer approach to "protecting" WordPress sites,
@@ 1150-1158 (lines=9) @@
1147
	 * @deprecated since 7.7.0
1148
	 * @see Automattic\Jetpack\Connection\Manager::alternate_xmlrpc()
1149
	 */
1150
	public function alternate_xmlrpc() {
1151
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::alternate_xmlrpc' );
1152
1153
		if ( ! $this->connection_manager ) {
1154
			$this->connection_manager = new Connection_Manager();
1155
		}
1156
1157
		$this->connection_manager->alternate_xmlrpc();
1158
	}
1159
1160
	/**
1161
	 * The callback for the JITM ajax requests.
@@ 1228-1236 (lines=9) @@
1225
	 * @deprecated since 7.7.0
1226
	 * @see Automattic\Jetpack\Connection\Manager::require_jetpack_authentication()
1227
	 */
1228
	public function require_jetpack_authentication() {
1229
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::require_jetpack_authentication' );
1230
1231
		if ( ! $this->connection_manager ) {
1232
			$this->connection_manager = new Connection_Manager();
1233
		}
1234
1235
		$this->connection_manager->require_jetpack_authentication();
1236
	}
1237
1238
	/**
1239
	 * Register assets for use in various modules and the Jetpack admin page.
@@ 5701-5709 (lines=9) @@
5698
	 * @param array $methods XMLRPC methods.
5699
	 * @return array XMLRPC methods, with the $HTTP_RAW_POST_DATA one.
5700
	 */
5701
	public function xmlrpc_methods( $methods ) {
5702
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_methods' );
5703
5704
		if ( ! $this->connection_manager ) {
5705
			$this->connection_manager = new Connection_Manager();
5706
		}
5707
5708
		return $this->connection_manager->xmlrpc_methods( $methods );
5709
	}
5710
5711
	/**
5712
	 * Register additional public XMLRPC methods.
@@ 5720-5728 (lines=9) @@
5717
	 * @param array $methods Public XMLRPC methods.
5718
	 * @return array Public XMLRPC methods, with the getOptions one.
5719
	 */
5720
	public function public_xmlrpc_methods( $methods ) {
5721
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::public_xmlrpc_methods' );
5722
5723
		if ( ! $this->connection_manager ) {
5724
			$this->connection_manager = new Connection_Manager();
5725
		}
5726
5727
		return $this->connection_manager->public_xmlrpc_methods( $methods );
5728
	}
5729
5730
	/**
5731
	 * Handles a getOptions XMLRPC method call.
@@ 5739-5747 (lines=9) @@
5736
	 * @param array $args method call arguments.
5737
	 * @return array an amended XMLRPC server options array.
5738
	 */
5739
	public function jetpack_getOptions( $args ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
5740
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::jetpack_getOptions' );
5741
5742
		if ( ! $this->connection_manager ) {
5743
			$this->connection_manager = new Connection_Manager();
5744
		}
5745
5746
		return $this->connection_manager->jetpack_getOptions( $args );
5747
	}
5748
5749
	/**
5750
	 * Adds Jetpack-specific options to the output of the XMLRPC options method.
@@ 5758-5766 (lines=9) @@
5755
	 * @param array $options Standard Core options.
5756
	 * @return array Amended options.
5757
	 */
5758
	public function xmlrpc_options( $options ) {
5759
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::xmlrpc_options' );
5760
5761
		if ( ! $this->connection_manager ) {
5762
			$this->connection_manager = new Connection_Manager();
5763
		}
5764
5765
		return $this->connection_manager->xmlrpc_options( $options );
5766
	}
5767
5768
	/**
5769
	 * State is passed via cookies from one request to the next, but never to subsequent requests.