Code Duplication    Length = 3-5 lines in 2 locations

modules/stats.php 2 locations

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