Code Duplication    Length = 5-5 lines in 2 locations

json-endpoints/jetpack/class.jetpack-json-api-plugins-modify-endpoint.php 1 location

@@ 265-269 (lines=5) @@
262
	protected function deactivate() {
263
		$permission_error = false;
264
		foreach ( $this->plugins as $plugin ) {
265
			if ( ! $this->current_user_can( 'deactivate_plugin', $plugin ) ) {
266
				$error = $this->log[$plugin]['error'] = __( 'Sorry, you are not allowed to deactivate this plugin.', 'jetpack' );
267
				$permission_error                     = true;
268
				continue;
269
			}
270
271
			if ( ! Jetpack::is_plugin_active( $plugin ) ) {
272
				$error = $this->log[$plugin]['error'] = __( 'The Plugin is already deactivated.', 'jetpack' );

json-endpoints/jetpack/class.jetpack-json-api-plugins-modify-v1-2-endpoint.php 1 location

@@ 160-164 (lines=5) @@
157
	protected function deactivate() {
158
		$permission_error = false;
159
		foreach ( $this->plugins as $plugin ) {
160
			if ( ! $this->current_user_can( 'deactivate_plugin', $plugin ) ) {
161
				$error = $this->log[$plugin]['error'] = __( 'Sorry, you are not allowed to deactivate this plugin.', 'jetpack' );
162
				$permission_error                     = true;
163
				continue;
164
			}
165
166
			if ( ! Jetpack::is_plugin_active( $plugin ) ) {
167
				continue;