Code Duplication    Length = 14-18 lines in 2 locations

src/wp-includes/update.php 2 locations

@@ 225-242 (lines=18) @@
222
	$doing_cron = wp_doing_cron();
223
224
	// Check for update on a different schedule, depending on the page.
225
	switch ( current_filter() ) {
226
		case 'upgrader_process_complete' :
227
			$timeout = 0;
228
			break;
229
		case 'load-update-core.php' :
230
			$timeout = MINUTE_IN_SECONDS;
231
			break;
232
		case 'load-plugins.php' :
233
		case 'load-update.php' :
234
			$timeout = HOUR_IN_SECONDS;
235
			break;
236
		default :
237
			if ( $doing_cron ) {
238
				$timeout = 0;
239
			} else {
240
				$timeout = 12 * HOUR_IN_SECONDS;
241
			}
242
	}
243
244
	$time_not_changed = isset( $current->last_checked ) && $timeout > ( time() - $current->last_checked );
245
@@ 410-423 (lines=14) @@
407
	$doing_cron = wp_doing_cron();
408
409
	// Check for update on a different schedule, depending on the page.
410
	switch ( current_filter() ) {
411
		case 'upgrader_process_complete' :
412
			$timeout = 0;
413
			break;
414
		case 'load-update-core.php' :
415
			$timeout = MINUTE_IN_SECONDS;
416
			break;
417
		case 'load-themes.php' :
418
		case 'load-update.php' :
419
			$timeout = HOUR_IN_SECONDS;
420
			break;
421
		default :
422
			$timeout = $doing_cron ? 0 : 12 * HOUR_IN_SECONDS;
423
	}
424
425
	$time_not_changed = isset( $last_update->last_checked ) && $timeout > ( time() - $last_update->last_checked );
426