Note to self: do not use non prefixed global variables in your wordpress plugin.
It causes all sorts of chaos. For example – gett the error “You do not have sufficient permissions to access this page.” whenever you load a page that is not your plugins.
For those playing at home, this is the code that I used to cause me headaches:
$plugin_page = add_action('admin_menu', function() {...});
Note that $plugin_page is used by wordpress, and overwriting it, well, makes things not work!
#FeelingLikeATurkey