2 error in code it was returning empty variable $vars, should query_vars
source | link

Try adding 'source' as an custom query var, rather than defining it as a rewrite tag.

function wpse162627_add_query_vars( $query_vars ){
    $query_vars[] = "source";
    return $vars;$query_vars;
}
add_filter( 'query_vars', 'wpse162627_add_query_vars' );    

function custom_url_source() {

     add_rewrite_rule(
         '^source/([^/]*)$',
         'index.php?source=$matches[1]',
         'top'
     );

}
add_action('init', 'custom_url_source');

Try adding 'source' as an custom query var, rather than defining it as a rewrite tag.

function wpse162627_add_query_vars( $query_vars ){
    $query_vars[] = "source";
    return $vars;
}
add_filter( 'query_vars', 'wpse162627_add_query_vars' );    

function custom_url_source() {

     add_rewrite_rule(
         '^source/([^/]*)$',
         'index.php?source=$matches[1]',
         'top'
     );

}
add_action('init', 'custom_url_source');

Try adding 'source' as an custom query var, rather than defining it as a rewrite tag.

function wpse162627_add_query_vars( $query_vars ){
    $query_vars[] = "source";
    return $query_vars;
}
add_filter( 'query_vars', 'wpse162627_add_query_vars' );    

function custom_url_source() {

     add_rewrite_rule(
         '^source/([^/]*)$',
         'index.php?source=$matches[1]',
         'top'
     );

}
add_action('init', 'custom_url_source');
1
source | link

Try adding 'source' as an custom query var, rather than defining it as a rewrite tag.

function wpse162627_add_query_vars( $query_vars ){
    $query_vars[] = "source";
    return $vars;
}
add_filter( 'query_vars', 'wpse162627_add_query_vars' );    

function custom_url_source() {

     add_rewrite_rule(
         '^source/([^/]*)$',
         'index.php?source=$matches[1]',
         'top'
     );

}
add_action('init', 'custom_url_source');