Code Duplication    Length = 10-12 lines in 3 locations

includes/admin/add-ons/actions.php 3 locations

@@ 206-217 (lines=12) @@
203
		) );
204
	}
205
206
	if(
207
		$is_activating_single_license
208
		&& ! empty( $check_license_res['plugin_slug'] )
209
		&& $plugin_slug !== $check_license_res['plugin_slug']
210
	) {
211
		wp_send_json_error( array(
212
			'errorMsg' => sprintf(
213
				__( 'Sorry, we are unable to activate this license because this key does not belong to this add-on. Please visit your <a href="%1$s" target="_blank">license dashboard</a> to check the details and access priority support.' ),
214
				Give_License::get_account_url()
215
			),
216
		) );
217
	}
218
219
	// Activate license.
220
	$activate_license_res = Give_License::request_license_api( array(
@@ 233-242 (lines=10) @@
230
	}
231
232
	// Return error if license activation is not success and admin is not reactivating add-on.
233
	if ( ! $is_reactivating_license && ! $activate_license_res['success']  ) {
234
235
		$response['errorMsg'] = sprintf(
236
			__( 'Sorry, this license was unable to activate because the license status returned as <code>%2$s</code>. Please visit your <a href="%1$s" target="_blank">license dashboard</a> to check the details and access priority support.' ),
237
			Give_License::get_account_url(),
238
			$check_license_res['license']
239
		);
240
241
		wp_send_json_error( $response );
242
	}
243
244
	$check_license_res['license']          = $activate_license_res['license'];
245
	$check_license_res['site_count']       = $activate_license_res['site_count'];
@@ 258-267 (lines=10) @@
255
		: Give_License::render_licenses_list();
256
257
	// Return error if license activation is not success and admin is reactivating add-on.
258
	if ( $is_reactivating_license && ! $activate_license_res['success'] ) {
259
260
		$response['errorMsg'] = sprintf(
261
			__( 'Sorry, this license was unable to activate because the license status returned as <code>%2$s</code>. Please visit your <a href="%1$s" target="_blank">license dashboard</a> to check the details and access priority support.' ),
262
			Give_License::get_account_url(),
263
			$check_license_res['license']
264
		);
265
266
		wp_send_json_error( $response );
267
	}
268
269
270
	// Tell WordPress to look for updates.