Code Duplication    Length = 3-5 lines in 2 locations

modules/stats.php 2 locations

@@ 1553-1555 (lines=3) @@
1550
	} while ( 0 );
1551
1552
	// Expire old keys.
1553
	foreach ( $stats_cache as $k => $cache ) {
1554
		if ( ! is_array( $cache ) || 300 < time() - key( $cache ) ) {
1555
			unset( $stats_cache[ $k ] );
1556
		}
1557
	}
1558
@@ 1668-1672 (lines=5) @@
1665
	$data = json_decode( wp_remote_retrieve_body( $response ) );
1666
1667
	// Expire old keys.
1668
	foreach ( $stats_cache as $k => $cache ) {
1669
		if ( ! is_array( $cache ) || ( 5 * MINUTE_IN_SECONDS ) < time() - key( $cache ) ) {
1670
			unset( $stats_cache[ $k ] );
1671
		}
1672
	}
1673
1674
	// Set cache.
1675
	$stats_cache[ $cache_key ] = array(