Skip to content

Commit 4458716

Browse files
committed
Merge branch 'develop'
2 parents 2ac4a3d + 8826444 commit 4458716

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

aaa-option-optimizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Plugin Name: AAA Option Optimizer
88
* Plugin URI: https://joost.blog/plugins/aaa-option-optimizer/
99
* Description: Tracks autoloaded options usage and allows the user to optimize them.
10-
* Version: 1.3
10+
* Version: 1.3.1
1111
* License: GPL-3.0+
1212
* Author: Joost de Valk
1313
* Author URI: https://joost.blog/

js/admin-script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ jQuery( document ).ready(
237237
*/
238238
function updateRowOnSuccess(response, table, optionName, action) {
239239
if ( action === 'delete-option' || action === 'create-option-false' ) {
240-
table.row( 'tr#option_' + optionName ).remove().draw( 'page' );
240+
table.row( 'tr#option_' + optionName ).remove().draw( 'full-hold' );
241241
} else if ( action === 'add-autoload' || action === 'remove-autoload' ) {
242242
const autoloadStatus = action === 'add-autoload' ? 'yes' : 'no';
243243
const buttonHTML = action === 'add-autoload' ?

readme.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: options, database, cleanup
44
Requires at least: 6.6
55
Tested up to: 6.7
66
Requires PHP: 7.4
7-
Stable tag: 1.3
7+
Stable tag: 1.3.1
88
License: GPL3+
99
License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
1010

@@ -54,6 +54,10 @@ Please do a pull request via GitHub on [this file](https://github.com/Emilia-Cap
5454

5555
== Changelog ==
5656

57+
= 1.3.1 =
58+
59+
* Fix JS error when deleting an option.
60+
5761
= 1.3 =
5862

5963
* Make plugin work with the latest autoload changes.

src/class-plugin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ public function reset( $should_reset = true ) {
100100
*/
101101
public function monitor_option_accesses( $tag ) {
102102
// Check if the tag is related to an option access.
103-
if ( strpos( $tag, 'option_' ) === 0 ) {
104-
$option_name = substr( $tag, strlen( 'option_' ) );
103+
if ( str_starts_with( $tag, 'option_' ) || str_starts_with( $tag, 'default_option_' ) ) {
104+
$option_name = preg_replace( '#^(default_)?option_#', '', $tag );
105105
$this->add_option_usage( $option_name );
106106
}
107107
}

0 commit comments

Comments
 (0)