1111 * Text Domain: transients-manager
1212 * Requires PHP: 5.6.20
1313 * Requires at least: 5.3
14- * Version: 2.0.1
14+ * Version: 2.0.2
1515 */
1616
1717// Exit if accessed directly
@@ -265,7 +265,7 @@ protected function page_show_transients() {
265265 </p>
266266 </form>
267267
268- <form method="post">
268+ <form method="post" id="transients-delete" >
269269 <input type="hidden" name="transient" value="all" />
270270 <?php wp_nonce_field ( 'transients_manager ' ); ?>
271271
@@ -292,6 +292,10 @@ protected function page_show_transients() {
292292 <input type="submit" class="button secondary" value="<?php esc_attr_e ( 'Apply ' , 'transients-manager ' ); ?> " />
293293 </div>
294294
295+ <div class="alignleft actions">
296+ <input type="button" class="button secondary" value="<?php esc_attr_e ( 'Delete All ' , 'transients-manager ' ); ?> " onclick="const select = document.getElementById('bulk-action-selector-top'); select.value='delete_all_transients'; select.dispatchEvent(new Event('change')); document.getElementById('transients-delete').submit();" />
297+ </div>
298+
295299 <div class="tablenav-pages <?php echo esc_attr ( $ one_page ); ?> ">
296300 <span class="displaying-num"><?php printf ( _n ( '%s Transient ' , '%s Transients ' , $ count , 'transients-manager ' ), number_format_i18n ( $ count ) ); ?> </span>
297301 <span class="pagination-links"><?php echo $ pagination ; // HTML OK ?> </span>
@@ -794,13 +798,11 @@ private function get_transient_value( $transient ) {
794798 // Get the value type
795799 $ type = $ this ->get_transient_value_type ( $ transient );
796800
797- // Maybe unserialize
798- $ value = maybe_unserialize ( $ transient ->option_value );
801+ // Trim value to 100 chars
802+ $ value = substr ( $ transient ->option_value , 0 , 100 );
799803
800- // Trim or dash
801- $ value = is_scalar ( $ value )
802- ? '<code> ' . wp_trim_words ( $ value , 5 ) . '</code> '
803- : '— ' ;
804+ // Escape & wrap in <code> tag
805+ $ value = '<code> ' . esc_html ( $ value ) . '</code> ' ;
804806
805807 // Return
806808 return $ value . '<br><span class="transient-type badge"> ' . esc_html ( $ type ) . '</span> ' ;
@@ -1279,10 +1281,9 @@ public function delete_all_transients() {
12791281 // Query
12801282 $ count = $ wpdb ->query (
12811283 $ wpdb ->prepare (
1282- "DELETE FROM {$ wpdb ->options }
1283- WHERE option_name LIKE %s "
1284- ),
1285- $ esc_name
1284+ "DELETE FROM {$ wpdb ->options } WHERE option_name LIKE %s " ,
1285+ $ esc_name
1286+ )
12861287 );
12871288
12881289 // Return count
0 commit comments