Code Duplication    Length = 5-5 lines in 2 locations

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

@@ 253-257 (lines=5) @@
250
	protected function deactivate() {
251
		$permission_error = false;
252
		foreach ( $this->plugins as $plugin ) {
253
			if ( ! $this->current_user_can('deactivate_plugin', $plugin ) ) {
254
				$error = $this->log[ $plugin ]['error'] = __( 'Sorry, you are not allowed to deactivate this plugin.', 'jetpack' );
255
				$permission_error = true;
256
				continue;
257
			}
258
259
			if ( ! Jetpack::is_plugin_active( $plugin ) ) {
260
				$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

@@ 150-154 (lines=5) @@
147
	protected function deactivate() {
148
		$permission_error = false;
149
		foreach ( $this->plugins as $plugin ) {
150
			if ( ! $this->current_user_can('deactivate_plugin', $plugin ) ) {
151
				$error = $this->log[ $plugin ]['error'] = __( 'Sorry, you are not allowed to deactivate this plugin.', 'jetpack' );
152
				$permission_error = true;
153
				continue;
154
			}
155
156
			if ( ! Jetpack::is_plugin_active( $plugin ) ) {
157
				continue;