Skip to content

Commit 52ba70d

Browse files
authored
Merge pull request #67 from awesomemotive/release/2.0.2
Release 2.0.2
2 parents 60575a7 + 6459aa1 commit 52ba70d

File tree

3 files changed

+20
-91
lines changed

3 files changed

+20
-91
lines changed

deploy.sh

Lines changed: 0 additions & 78 deletions
This file was deleted.

readme.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Tags: cron, tool, transient
99
Requires PHP: 5.6.20
1010
Requires at least: 5.3
1111
Tested up to: 5.9
12-
Stable Tag: 2.0.1
12+
Stable Tag: 2.0.2
1313

1414
Provides a familiar interface to view, search, edit, and delete Transients.
1515

@@ -90,6 +90,12 @@ No. It only works when transients are stored in the database.
9090

9191
== Changelog ==
9292

93+
= 2.0.2 - December 23, 2021 =
94+
95+
* Fixed: "Delete All" bulk action works again
96+
* Fixed: Add "Delete All" button to table actions
97+
* Improved: More value types now visible in List Table (up to 100 characters)
98+
9399
= 2.0.1 - December 21, 2021 =
94100

95101
* Fix: PHP fatal error when guessing JSON value type

transients-manager.php

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
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-
: '&mdash;';
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

Comments
 (0)