Skip to content

Commit bf308e8

Browse files
committed
Remove GLUE_LINK_DELETE_DATA constant definition and add runtime check
- Remove hardcoded GLUE_LINK_DELETE_DATA constant definition from uninstall.php - Add defined() check before using GLUE_LINK_DELETE_DATA constant - Allows users to define constant in wp-config.php without default fallback - Prevents data deletion unless explicitly enabled by user
1 parent 598f6eb commit bf308e8

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

uninstall.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@
1010
exit;
1111
}
1212

13-
/**
14-
* Define GLUE_LINK_DELETE_DATA as true in wp-config.php to delete all data on uninstall.
15-
*/
16-
if ( ! defined( 'GLUE_LINK_DELETE_DATA' ) ) {
17-
define( 'GLUE_LINK_DELETE_DATA', false );
18-
}
19-
2013
/**
2114
* Delete options and data for a single site.
2215
*
@@ -39,7 +32,7 @@ function glue_link_delete_site_options( int $site_id = 0 ): void {
3932
delete_option( $option_name );
4033
}
4134

42-
if ( GLUE_LINK_DELETE_DATA ) {
35+
if ( defined( 'GLUE_LINK_DELETE_DATA' ) && GLUE_LINK_DELETE_DATA ) {
4336

4437
// Delete the subscribers table.
4538
$table_name = $wpdb->prefix . 'glue_link_subscribers';

0 commit comments

Comments
 (0)