nitropack
Last commit date
classes
2 months ago
languages
4 months ago
nitropack-sdk
3 months ago
view
2 months ago
advanced-cache.php
1 year ago
batcache-compat.php
1 year ago
constants.php
2 months ago
functions.php
2 months ago
helpers.php
1 year ago
main.php
2 months ago
readme.txt
2 months ago
uninstall.php
7 months ago
uninstall.php
42 lines
| 1 | <?php |
| 2 | if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
| 3 | die; |
| 4 | } |
| 5 | |
| 6 | global $wpdb; |
| 7 | |
| 8 | $custom_options = [ |
| 9 | 'nitropack_minimumLogLevel', |
| 10 | 'np_warmup_sitemap' |
| 11 | ]; |
| 12 | |
| 13 | if ( defined( 'MULTISITE' ) && MULTISITE ) { |
| 14 | foreach ( get_sites( [ 'fields' => 'ids' ] ) as $blogId ) { |
| 15 | switch_to_blog( $blogId ); |
| 16 | |
| 17 | // Delete options with 'nitropack-' prefix and transients |
| 18 | $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE 'nitropack-%' OR option_name LIKE '_transient%nitropack-%'" ); |
| 19 | |
| 20 | // Delete custom options |
| 21 | foreach ( $custom_options as $option_name ) { |
| 22 | delete_option( $option_name ); |
| 23 | } |
| 24 | |
| 25 | restore_current_blog(); |
| 26 | } |
| 27 | } else { |
| 28 | // Delete options with 'nitropack-' prefix and transients |
| 29 | $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE 'nitropack-%' OR option_name LIKE '_transient%nitropack-%'" ); |
| 30 | |
| 31 | // Delete custom options |
| 32 | foreach ( $custom_options as $option_name ) { |
| 33 | delete_option( $option_name ); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | wp_cache_flush(); |
| 38 | |
| 39 | require_once 'nitropack-sdk/autoload.php'; |
| 40 | require_once 'constants.php'; |
| 41 | NitroPack\SDK\Filesystem::deleteDir( NITROPACK_DATA_DIR ); |
| 42 | NitroPack\SDK\Filesystem::deleteDir( NITROPACK_PLUGIN_DATA_DIR ); |