PluginProbe
HTTP 410 (Gone) responses / trunk
HTTP 410 (Gone) responses vtrunk
1.2.1 trunk 0.1 0.2 0.3 0.4 0.5 0.6 0.6.1 0.7 0.7.1 0.7.2 0.8.1 0.8.2 1.0.2 1.0.3 1.1.0
wp-410 / uninstall.php

uninstall.php in HTTP 410 (Gone) responses trunk, at uninstall.php

30 lines 829 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Cleanup tasks when uninstalling 410 for WordPress.
4 *
5 * @package MCLV_410_Plugin
6 */
7
8 // Exit if accessed directly or not during uninstall.
9 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
10 exit;
11 }
12
13 /**
14 * Drop the plugin's custom table during uninstall.
15 *
16 * @return void
17 */
18 function mclv_410_remove_table() {
19 global $wpdb;
20
21 $table = esc_sql( $wpdb->prefix . '410_links' );
22
23 // Schema change is intentional during uninstall, caching does not apply here.
24 $wpdb->query( "DROP TABLE IF EXISTS `$table`" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.SchemaChange,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
25 }
26
27 mclv_410_remove_table();
28 delete_option( 'mclv_410_options_version' );
29 delete_option( 'mclv_410_max_404s' );
30