You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it would be a good idea if the plugin only showed tables related to current site in the multiselect by default. Maybe with a checkbox option to show all tables. That could prevent or at least reduce the possibility to accidentally doing a replace on another site's tables when you have multiple sites using the same database.
Here's a quick mockup:
I can try to make a pull request if you think this is a good idea. I've now done a really quick and dirty test by changing the get_tables SQL in class BSR_DB, line 64 from
$tables = $wpdb->get_col( 'SHOW TABLES' );
to $tables = $wpdb->get_col( "SHOW TABLES LIKE '{$wpdb->base_prefix}_%'" );
and that seems to do the trick for single sites at least. Didn't have the time to see what needs to be done for the checkbox yet.
EDIT: Looked into it a bit more and it (surprisingly) wasn't quite as straightforward as I first thought. The table filtering should probably be done by editing the returned table list (maybe add a data-attribute to check if a table is for current site?) and some javascript to show / hide the options, but still shouldn't be too hard to implement.
The text was updated successfully, but these errors were encountered:
I think it would be a good idea if the plugin only showed tables related to current site in the multiselect by default. Maybe with a checkbox option to show all tables. That could prevent or at least reduce the possibility to accidentally doing a replace on another site's tables when you have multiple sites using the same database.
Here's a quick mockup:
I can try to make a pull request if you think this is a good idea. I've now done a really quick and dirty test by changing the get_tables SQL in class BSR_DB, line 64 from
$tables = $wpdb->get_col( 'SHOW TABLES' );
to
$tables = $wpdb->get_col( "SHOW TABLES LIKE '{$wpdb->base_prefix}_%'" );
and that seems to do the trick for single sites at least. Didn't have the time to see what needs to be done for the checkbox yet.
EDIT: Looked into it a bit more and it (surprisingly) wasn't quite as straightforward as I first thought. The table filtering should probably be done by editing the returned table list (maybe add a data-attribute to check if a table is for current site?) and some javascript to show / hide the options, but still shouldn't be too hard to implement.
The text was updated successfully, but these errors were encountered: