Code Duplication    Length = 3-5 lines in 2 locations

modules/stats.php 2 locations

@@ 1634-1636 (lines=3) @@
1631
	} while ( 0 );
1632
1633
	// Expire old keys.
1634
	foreach ( $stats_cache as $k => $cache ) {
1635
		if ( ! is_array( $cache ) || 300 < time() - key( $cache ) ) {
1636
			unset( $stats_cache[ $k ] );
1637
		}
1638
	}
1639
@@ 1749-1753 (lines=5) @@
1746
	$data = json_decode( wp_remote_retrieve_body( $response ) );
1747
1748
	// Expire old keys.
1749
	foreach ( $stats_cache as $k => $cache ) {
1750
		if ( ! is_array( $cache ) || ( 5 * MINUTE_IN_SECONDS ) < time() - key( $cache ) ) {
1751
			unset( $stats_cache[ $k ] );
1752
		}
1753
	}
1754
1755
	// Set cache.
1756
	$stats_cache[ $cache_key ] = array(