Skip to content

Commit b370a3d

Browse files
committed
Fix uninstall failing
Uninstall attempts to call StaticDeploy\Db, but at this point the plugin is deactivated and the code cannot be loaded.
1 parent 7588c47 commit b370a3d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
- Fix a security issue where the nonce was not verified
5353
for some actions until after the action had been performed.
5454
- Cache option values. BLOB values are not cached.
55+
- Fix an issue where uninstall failed.
5556

5657
## 9.3.2 (2025-07-29)
5758

uninstall.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77

88
global $wpdb;
99

10-
$tables_to_drop = [
10+
// Note that the plugin is deactivated at this point, so we
11+
// can't call code in any of our other files.
12+
13+
$table_slugs = [
1114
'crawled_files',
1215
'deploy_cache', // An older version of deployed_files
1316
'deployed_files',
@@ -17,8 +20,8 @@
1720
'options',
1821
];
1922

20-
foreach ( $tables_to_drop as $table_to_drop ) {
21-
$table_name = StaticDeploy\Db::getTableName( $table_to_drop );
23+
foreach ( $table_slugs as $table_slug ) {
24+
$table_name = $wpdb->prefix . 'static_deploy_' . $table_slug;
2225

2326
// phpcs:ignore WordPress.DB.DirectDatabaseQuery
2427
$wpdb->query( $wpdb->prepare( 'DROP TABLE IF EXISTS %i', $table_name ) );

0 commit comments

Comments
 (0)