Code Duplication    Length = 3-5 lines in 2 locations

modules/stats.php 2 locations

@@ 1542-1544 (lines=3) @@
1539
	} while ( 0 );
1540
1541
	// Expire old keys.
1542
	foreach ( $stats_cache as $k => $cache ) {
1543
		if ( ! is_array( $cache ) || 300 < time() - key( $cache ) ) {
1544
			unset( $stats_cache[ $k ] );
1545
		}
1546
	}
1547
@@ 1657-1661 (lines=5) @@
1654
	$data = json_decode( wp_remote_retrieve_body( $response ) );
1655
1656
	// Expire old keys.
1657
	foreach ( $stats_cache as $k => $cache ) {
1658
		if ( ! is_array( $cache ) || ( 5 * MINUTE_IN_SECONDS ) < time() - key( $cache ) ) {
1659
			unset( $stats_cache[ $k ] );
1660
		}
1661
	}
1662
1663
	// Set cache.
1664
	$stats_cache[ $cache_key ] = array(