Code Duplication    Length = 3-5 lines in 2 locations

modules/stats.php 2 locations

@@ 1230-1232 (lines=3) @@
1227
	} while( 0 );
1228
1229
	// Expire old keys
1230
	foreach ( $stats_cache as $k => $cache )
1231
		if ( !is_array( $cache ) || 300 < time() - key($cache) )
1232
			unset( $stats_cache[$k] );
1233
1234
	// Set cache
1235
	$stats_cache[$key] = array( time() => $stats_rows );
@@ 1328-1332 (lines=5) @@
1325
	$data = json_decode( wp_remote_retrieve_body( $response ) );
1326
1327
	// Expire old keys
1328
	foreach ( $stats_cache as $k => $cache ) {
1329
		if ( ! is_array( $cache ) || ( 5 * MINUTE_IN_SECONDS ) < time() - key( $cache ) ) {
1330
			unset( $stats_cache[ $k ] );
1331
		}
1332
	}
1333
1334
	// Set cache
1335
	$stats_cache[ $cache_key ] = array(