PluginProbe
Redirection / 2.9
Redirection v2.9
5.10.0 5.9.0 5.8.1 5.8.0 3.7.2 3.7.3 4.0 4.0.1 4.1 4.1.1 4.2 4.2.1 4.2.2 4.2.3 4.3 4.3.1 4.3.2 4.3.3 4.4 4.4.1 4.4.2 4.5 4.5.1 4.6.2 4.7.1 All 130 releases
← All changes | models/flusher.php +5 -5 4.02.9 View file →
@@ -26,15 +26,14 @@
26 26
27 27 private function optimize_logs() {
28 28 global $wpdb;
29 29
30 - $rand = wp_rand( 1, 5000 );
30 + $rand = mt_rand( 1, 5000 );
31 31
32 - if ( $rand === 11 ) {
32 + if ( $rand === 11 )
33 33 $wpdb->query( "OPTIMIZE TABLE {$wpdb->prefix}redirection_logs" );
34 - } elseif ( $rand === 12 ) {
34 + elseif ( $rand === 12 )
35 35 $wpdb->query( "OPTIMIZE TABLE {$wpdb->prefix}redirection_404" );
36 - }
37 36 }
38 37
39 38 private function expire_logs( $table, $expiry_time ) {
40 39 global $wpdb;
@@ -57,9 +56,10 @@
57 56 if ( $options['expire_redirect'] > 0 || $options['expire_404'] > 0 ) {
58 57 if ( ! wp_next_scheduled( self::DELETE_HOOK ) ) {
59 58 wp_schedule_event( time(), self::DELETE_FREQ, self::DELETE_HOOK );
60 59 }
61 - } else {
60 + }
61 + else {
62 62 Red_Flusher::clear();
63 63 }
64 64 }
65 65