Code Duplication    Length = 3-5 lines in 2 locations

modules/stats.php 2 locations

@@ 1535-1537 (lines=3) @@
1532
	} while ( 0 );
1533
1534
	// Expire old keys.
1535
	foreach ( $stats_cache as $k => $cache ) {
1536
		if ( ! is_array( $cache ) || 300 < time() - key( $cache ) ) {
1537
			unset( $stats_cache[ $k ] );
1538
		}
1539
	}
1540
@@ 1650-1654 (lines=5) @@
1647
	$data = json_decode( wp_remote_retrieve_body( $response ) );
1648
1649
	// Expire old keys.
1650
	foreach ( $stats_cache as $k => $cache ) {
1651
		if ( ! is_array( $cache ) || ( 5 * MINUTE_IN_SECONDS ) < time() - key( $cache ) ) {
1652
			unset( $stats_cache[ $k ] );
1653
		}
1654
	}
1655
1656
	// Set cache.
1657
	$stats_cache[ $cache_key ] = array(