Code Snippets
[resolved] Bug in Delete Script (3 posts)

  1. bmc38119
    Posted 3 years ago #

    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.


  2. Shea Bunge
    Plugin Author

    Posted 3 years ago #

    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.

  3. bmc38119
    Posted 3 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic


No tags yet.