Code Duplication    Length = 3-5 lines in 2 locations

modules/stats.php 2 locations

@@ 1657-1659 (lines=3) @@
1654
	} while ( 0 );
1655
1656
	// Expire old keys.
1657
	foreach ( $stats_cache as $k => $cache ) {
1658
		if ( ! is_array( $cache ) || 300 < time() - key( $cache ) ) {
1659
			unset( $stats_cache[ $k ] );
1660
		}
1661
	}
1662
@@ 1772-1776 (lines=5) @@
1769
	$data = json_decode( wp_remote_retrieve_body( $response ) );
1770
1771
	// Expire old keys.
1772
	foreach ( $stats_cache as $k => $cache ) {
1773
		if ( ! is_array( $cache ) || ( 5 * MINUTE_IN_SECONDS ) < time() - key( $cache ) ) {
1774
			unset( $stats_cache[ $k ] );
1775
		}
1776
	}
1777
1778
	// Set cache.
1779
	$stats_cache[ $cache_key ] = array(