Certain functions are undefined when called form mu-plugins

Thanks to diggy from StackOverflow I’ve foudn that in the WordPress cycle, the file vars.php (containing my needed functions) is included after muplugins_loaded executes.

Including wp_is_mobile() and current_user_can() in wrapper functions fixed my problem.

CORRECT

function my_epic_function() {
    if(current_user_can( 'edit_posts' )) {
      if(!wp_is_mobile()) {
        //code to be executed
      }
    }
}
add_action('init', 'my_epic_function');

INCORRECT

function my_epic_function() {
    //code to be executed
}
if(current_user_can( 'edit_posts' )) {
  if(!wp_is_mobile()) {
    add_action('init', 'my_epic_function');
  }
}