Support » Plugin: Code Snippets » Bug in Delete Script

  • Resolved bmc38119


    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Shea Bunge


    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


    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.