Code Duplication    Length = 3-5 lines in 2 locations

modules/stats.php 2 locations

@@ 1584-1586 (lines=3) @@
1581
	} while ( 0 );
1582
1583
	// Expire old keys.
1584
	foreach ( $stats_cache as $k => $cache ) {
1585
		if ( ! is_array( $cache ) || 300 < time() - key( $cache ) ) {
1586
			unset( $stats_cache[ $k ] );
1587
		}
1588
	}
1589
@@ 1699-1703 (lines=5) @@
1696
	$data = json_decode( wp_remote_retrieve_body( $response ) );
1697
1698
	// Expire old keys.
1699
	foreach ( $stats_cache as $k => $cache ) {
1700
		if ( ! is_array( $cache ) || ( 5 * MINUTE_IN_SECONDS ) < time() - key( $cache ) ) {
1701
			unset( $stats_cache[ $k ] );
1702
		}
1703
	}
1704
1705
	// Set cache.
1706
	$stats_cache[ $cache_key ] = array(