Including wp-config.php, wp-blog-header.php, wp-load.php, or pretty much any other WordPress core file that you have to call directly via an include is not a good idea and we cannot approve a plugin that does so unless it has a very good reason to load the file(s). It is prone to failure since not all WordPress installs have the exact same file structure.
Usually plugins will include wp-config.php or wp-load.php in order to gain access to core WordPress functions, but there are much better ways to do this. It's best if you tie your processing functions (the ones that need but don't have access to core functions) into an action hook, such as "init" or "admin_init".
If you're trying to use it because you need to access WordPress functions outside of WordPress, we'd actually much rather you didn't do that at all. Your plugin should be inside WordPress, only accessible to people who are logged in and authorized, if it needs that kind of access. Your plugin's pages should be called via the dashboard like all the other settings panels, and in that way, they'll always have access to WordPress functions.
but that produced a Call to undefined function trailingslashit() error when I perform a database query using wpdb as above, which appears to be [a known limitation][2] of using the SHORTINIT version of wp-load.
I've received a response which jives with comments I've seen on related questions, suggesting we need to create a custom endpoint. I started working on that but got bogged down.
From the Wordpress plugin directory reviewers:
I think this requirement presents some difficulties in our context. I've tried one possible solution without success. I have described a little in this statck overflow post: http://wordpress.stackexchange.com/questions/246447/accessing-the-database-from-a-plugin-outside-of-action-hooks
Namely:
I've received a response which jives with comments I've seen on related questions, suggesting we need to create a custom endpoint. I started working on that but got bogged down.