Code Duplication    Length = 3-5 lines in 2 locations

modules/stats.php 2 locations

@@ 1557-1559 (lines=3) @@
1554
	} while ( 0 );
1555
1556
	// Expire old keys.
1557
	foreach ( $stats_cache as $k => $cache ) {
1558
		if ( ! is_array( $cache ) || 300 < time() - key( $cache ) ) {
1559
			unset( $stats_cache[ $k ] );
1560
		}
1561
	}
1562
@@ 1672-1676 (lines=5) @@
1669
	$data = json_decode( wp_remote_retrieve_body( $response ) );
1670
1671
	// Expire old keys.
1672
	foreach ( $stats_cache as $k => $cache ) {
1673
		if ( ! is_array( $cache ) || ( 5 * MINUTE_IN_SECONDS ) < time() - key( $cache ) ) {
1674
			unset( $stats_cache[ $k ] );
1675
		}
1676
	}
1677
1678
	// Set cache.
1679
	$stats_cache[ $cache_key ] = array(