BeAPI / bea-media-analytics

Find where and how media are used across your site.
https://wordpress.org/plugins/bea-media-analytics/
Other
15 stars 2 forks source link

Problem table after delete plugin #86

Open NicolasKulka opened 5 years ago

NicolasKulka commented 5 years ago

When removing the plugin, it remains the plugin table in database.

MaximeCulea commented 5 years ago

Hello @NicolasKulka,

Thank you for the report 😄

Normally it should do the trick : https://github.com/BeAPI/bea-media-analytics/blob/master/classes/plugin.php#L27

Are you on multisite ?

Thx

NicolasKulka commented 5 years ago

No, single site.

This function delete row in table for blog_id => 1

But doesn't have this : "register_uninstall_hook" and

"global $wpdb; $table_name = $wpdb->prefix . 'bea_media_analytics'; $sql = "DROP TABLE IF EXISTS $table_name"; $wpdb->query($sql);"

MaximeCulea commented 5 years ago

Ok thx, got it, duly noted for todo.

When the plugin is deleted, add a process on the register_uninstall_hook to delete the table's structure.