Code Duplication    Length = 3-5 lines in 2 locations

modules/stats.php 2 locations

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