Code Duplication    Length = 6-7 lines in 2 locations

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

@@ 942-948 (lines=7) @@
939
		}
940
941
		// If all Jumpstart modules were activated
942
		if ( empty( $result['failed_modules'] ) ) {
943
			return rest_ensure_response( array(
944
				'code' 	  => 'success',
945
				'message' => esc_html__( 'Jumpstart done.', 'jetpack' ),
946
				'data'    => $result,
947
			) );
948
		}
949
950
		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 ) );
951
	}

_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