$_POST[ 'when_to_run' ] ) { $options[ 'schedule' ] = $_POST[ 'when_to_run' ]; } else { $options[ 'schedule' ] = '00'; } if ( $options[ 'schedule' ] !== $old_options[ 'schedule' ] ) { wp_clear_scheduled_hook( 'housekeep_transients' ); tc_set_schedule( $options[ 'schedule' ] ); } // Update the options update_option( 'transient_clean_options', $options ); // Run any transient housekeeping, if requested if ( !empty( $_POST[ 'Clean' ] ) ) { $deleted = tc_transient_delete( false ); } if ( !empty( $_POST[ 'Upgrade' ] ) ) { $deleted = tc_transient_delete( true ); } // Write out an appropriate message $text = __( 'Options Saved.', 'artiss-transient-cleaner' ); if ( ( !empty( $_POST[ 'Clean' ] ) ) or ( !empty( $_POST[ 'Upgrade' ] ) ) ) { $text .= ' ' . __( 'Transients cleared.', 'artiss-transient-cleaner' ); } echo '

' . $text . '

' . "\n"; } $options = tc_get_options(); ?>
get_var( "SELECT COUNT(*) FROM $wpdb->options WHERE option_name LIKE '%_transient_%'" ); $total_timed_transients = $wpdb -> get_var( "SELECT COUNT(*) FROM $wpdb->options WHERE option_name LIKE '%_transient_timeout_%'" ); if ( is_multisite() ) { $total_transients += $wpdb -> get_var( "SELECT COUNT(*) FROM $wpdb->sitemeta WHERE meta_key LIKE '_site_transient_%'" ); $total_timed_transients += $wpdb -> get_var( "SELECT COUNT(*) FROM $wpdb->sitemeta WHERE meta_key LIKE '_site_transient_timeout_%'" ); } $transient_number = $total_transients - $total_timed_transients; $text = sprintf( __( 'There are currently %s transients (%s records) in the database.', 'artiss-transient-cleaner' ), $transient_number, $total_transients ); if ( 0 <= $total_transients ) { $expired_transients = $wpdb -> get_var( "SELECT COUNT(*) FROM $wpdb->options WHERE option_name LIKE '%_transient_timeout_%' AND option_value < UNIX_TIMESTAMP()" ); if ( is_multisite() ) { $expired_transients .= $wpdb -> get_var( "SELECT COUNT(*) FROM $wpdb->sitemeta WHERE meta_key LIKE '%_transient_timeout_%' AND meta_value < UNIX_TIMESTAMP()" ); } $text .= ' '; if ( 1 === $expired_transients ) { $text .= sprintf( __( '%s transient has expired.', 'artiss-transient-cleaner' ), $expired_transients ); } else { $text .= sprintf( __( '%s transients have expired.', 'artiss-transient-cleaner' ), $expired_transients ); } } echo '

' . $text . '

'; ?>

' . $text . '

'; ?>
/>

/>

' . sprintf( __( 'All %d transient records were removed on %s at %s.', 'artiss-transient-cleaner' ), $array[ 'records' ], date( 'l, jS F Y', $array[ 'timestamp' ] ), date( 'H:i', $array[ 'timestamp' ] ) ) . '

'; } else { echo '

' . sprintf( __( 'All transient records removed on %s at %s.', 'artiss-transient-cleaner' ), date( 'l, jS F Y', $array[ 'timestamp' ] ), date( 'H:i', $array[ 'timestamp' ] ) ) . '

'; } } ?>
/>
/>