Title: Bug in Delete Script
Last modified: August 20, 2016

---

# Bug in Delete Script

 *  Resolved [bmc38119](https://wordpress.org/support/users/bmc38119/)
 * (@bmc38119)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/bug-in-delete-script/)
 * I wanted to send a quick note on a bug i discovered in the Delete Files script
   when uninstalling the plugin.
 * Line 1333
    $wpdb->query( “DROP TABLE IF EXISTS $code_snippets->table” );
 * this causes private class access failure.
 * Should be:
    $wpdb->query( “DROP TABLE IF EXISTS $code_snippets_table” );
 * this new code tested out correctly. although i am not running Multi-site, the
   same change may need to be added to line 1329.
 * Thanks for the awesome plugin.
 * [http://wordpress.org/extend/plugins/code-snippets/](http://wordpress.org/extend/plugins/code-snippets/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/bug-in-delete-script/#post-3307280)
 * Thanks for telling me. In 1.6 I made the table name variables private and switched
   over to the new `$code_snippets->get_table_name()` function. Unfortunately, the
   uninstall method seems to be the one part I missed.
 * I’m not sure why `$wpdb->query( "DROP TABLE IF EXISTS $code_snippets_table" );`
   works, because there is no variable named `$code_snippets_table`. I will update
   this function to use the `$code_snippets->get_table_name()` function to retrieve
   the table name instead.
 * I’ll have this fixed in the next update. Thanks again for drawing it to my attention.
 *  Thread Starter [bmc38119](https://wordpress.org/support/users/bmc38119/)
 * (@bmc38119)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/bug-in-delete-script/#post-3307289)
 * now that i look at it closer, you are right. i never checked the database to 
   see if the tables were actually deleted – just that i did not get an error when
   running the delete script after making this change. since the IF EXISTS statement
   is there, it never found the table but did not throw an error. it looks like 
   i got that variable name from the filter name on line 145.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Bug in Delete Script’ is closed to new replies.

 * ![](https://ps.w.org/code-snippets/assets/icon.svg?rev=2148878)
 * [Code Snippets](https://wordpress.org/plugins/code-snippets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/code-snippets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/code-snippets/)
 * [Active Topics](https://wordpress.org/support/plugin/code-snippets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/code-snippets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/code-snippets/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [bmc38119](https://wordpress.org/support/users/bmc38119/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/bug-in-delete-script/#post-3307289)
 * Status: resolved