Code Duplication    Length = 6-7 lines in 2 locations

_inc/lib/class.core-rest-api-endpoints.php 1 location

@@ 947-953 (lines=7) @@
944
		}
945
946
		// If all Jumpstart modules were activated
947
		if ( empty( $result['failed_modules'] ) ) {
948
			return rest_ensure_response( array(
949
				'code' 	  => 'success',
950
				'message' => esc_html__( 'Jumpstart done.', 'jetpack' ),
951
				'data'    => $result,
952
			) );
953
		}
954
955
		return new WP_Error( 'jumpstart_failed', esc_html( sprintf( _n( 'Jumpstart failed activating this module: %s.', 'Jumpstart failed activating these modules: %s.', count( $result['failed_modules'] ), 'jetpack' ), join( ', ', $result['failed_modules'] ) ) ), array( 'status' => 400 ) );
956
	}

_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php 1 location

@@ 216-221 (lines=6) @@
213
			}
214
		}
215
216
		if ( empty( $failed ) ) {
217
			return rest_ensure_response( array(
218
				'code' 	  => 'success',
219
				'message' => esc_html__( 'All modules activated.', 'jetpack' ),
220
			) );
221
		}
222
223
		$error = '';
224