Code Duplication    Length = 3-5 lines in 2 locations

modules/stats.php 2 locations

@@ 1216-1218 (lines=3) @@
1213
	} while( 0 );
1214
1215
	// Expire old keys
1216
	foreach ( $stats_cache as $k => $cache )
1217
		if ( !is_array( $cache ) || 300 < time() - key($cache) )
1218
			unset( $stats_cache[$k] );
1219
1220
	// Set cache
1221
	$stats_cache[$key] = array( time() => $stats_rows );
@@ 1314-1318 (lines=5) @@
1311
	$data = json_decode( wp_remote_retrieve_body( $response ) );
1312
1313
	// Expire old keys
1314
	foreach ( $stats_cache as $k => $cache ) {
1315
		if ( ! is_array( $cache ) || ( 5 * MINUTE_IN_SECONDS ) < time() - key( $cache ) ) {
1316
			unset( $stats_cache[ $k ] );
1317
		}
1318
	}
1319
1320
	// Set cache
1321
	$stats_cache[ $cache_key ] = array(