Code Duplication    Length = 3-5 lines in 2 locations

modules/stats.php 2 locations

@@ 1630-1632 (lines=3) @@
1627
	} while ( 0 );
1628
1629
	// Expire old keys.
1630
	foreach ( $stats_cache as $k => $cache ) {
1631
		if ( ! is_array( $cache ) || 300 < time() - key( $cache ) ) {
1632
			unset( $stats_cache[ $k ] );
1633
		}
1634
	}
1635
@@ 1745-1749 (lines=5) @@
1742
	$data = json_decode( wp_remote_retrieve_body( $response ) );
1743
1744
	// Expire old keys.
1745
	foreach ( $stats_cache as $k => $cache ) {
1746
		if ( ! is_array( $cache ) || ( 5 * MINUTE_IN_SECONDS ) < time() - key( $cache ) ) {
1747
			unset( $stats_cache[ $k ] );
1748
		}
1749
	}
1750
1751
	// Set cache.
1752
	$stats_cache[ $cache_key ] = array(