advanced-import
Last commit date
admin
3 weeks ago
assets
3 weeks ago
build
3 weeks ago
includes
3 weeks ago
languages
6 years ago
LICENSE.txt
6 years ago
advanced-import.php
3 weeks ago
index.php
5 years ago
readme.txt
3 weeks ago
uninstall.php
3 weeks ago
uninstall.php
50 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Fired when the plugin is uninstalled. |
| 5 | * |
| 6 | * When populating this file, consider the following |
| 7 | * of control: |
| 8 | * |
| 9 | * - This method should be static |
| 10 | * - Check if the $_REQUEST content actually is the plugin name |
| 11 | * - Run an admin referrer check to make sure it goes through authentication |
| 12 | * - Verify the output of $_GET makes sense |
| 13 | * - Repeat with other user roles. Best directly by using the links/query string parameters. |
| 14 | * - Repeat things for multisite. Once for a single site in the network, once sitewide. |
| 15 | * |
| 16 | * @link https://addonspress.com/ |
| 17 | * @since 1.0.0 |
| 18 | * |
| 19 | * @package Advanced_Import |
| 20 | */ |
| 21 | |
| 22 | // If uninstall not called from WordPress, then exit. |
| 23 | if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
| 24 | exit; |
| 25 | } |
| 26 | |
| 27 | global $wpdb; |
| 28 | |
| 29 | delete_option( 'advanced_import_settings_options' ); |
| 30 | delete_option( 'advanced_import_reset_notice' ); |
| 31 | |
| 32 | $advanced_import_transients = array( |
| 33 | 'content.json', |
| 34 | 'widgets.json', |
| 35 | 'options.json', |
| 36 | 'delayed_posts', |
| 37 | 'imported_term_ids', |
| 38 | 'imported_post_ids', |
| 39 | 'post_orphans', |
| 40 | 'adi_elementor_data_posts', |
| 41 | ); |
| 42 | |
| 43 | foreach ( $advanced_import_transients as $advanced_import_transient ) { |
| 44 | delete_transient( $advanced_import_transient ); |
| 45 | } |
| 46 | |
| 47 | // Clean up the single dynamic tracking option row. |
| 48 | $advanced_import_plugin_slug = defined( 'ADVANCED_IMPORT_PLUGIN_NAME' ) ? ADVANCED_IMPORT_PLUGIN_NAME : 'advanced-import'; |
| 49 | delete_option( $advanced_import_plugin_slug . '-agent-' . md5( 'https://tracking.acmeit.org/' ) ); |
| 50 |