PluginProbe
WP Smart Import : Import any XML File to WordPress / trunk
WP Smart Import : Import any XML File to WordPress vtrunk
2.0.0 trunk 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6
wp-smart-import / uninstall.php

uninstall.php in WP Smart Import : Import any XML File to WordPress trunk, at uninstall.php

28 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if (!defined('WP_UNINSTALL_PLUGIN')) //if uninstall not called from WordPress exit
3 exit();
4
5 if (get_option('wpsi_delete_data_on_uninstall') === '1') {
6 global $wpdb;
7 // Delete created table when plugin uninstall
8 $tables_to_drop = array( 'files', 'posts', 'imports' );
9 foreach ( $tables_to_drop as $table_name ) {
10 // Construct the table name with prefix
11 $table_name_with_prefix = $wpdb->prefix . 'wpsi_' . $table_name;
12
13 // Execute the query
14 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange
15 $wpdb->query( "DROP TABLE IF EXISTS `$table_name_with_prefix`" );
16 }
17
18 // Delete options when plugin uninstall
19 delete_option('wp-smart-import-settings');
20 delete_option('wp-smart-import-session');
21 delete_option('wpsi_delete_data_on_uninstall');
22 delete_option('wpsi_import_batch_size');
23 delete_option('wpsi_batch_delay');
24 delete_option('wpsi_image_timeout');
25 delete_option('wpsi_file_pruning');
26 delete_option('wpsi_custom_php_code');
27 delete_option('wpsi_cron_batch_size');
28 }