When trying to override plugin’s function by theme, my filter executes two times, I want it to run only a single time

Probable cause of double increment:

The plugin function dokan_get_admin_commission_by() executes apply_filters('dokan_order_admin_commission' ... ) twice, but both times it uses return, so the filter is not executing twice.

The probable cause of getting double increment is because, in the following CODE:

if ($saved_admin_fee != '')
{
    return apply_filters('dokan_order_admin_commission', $saved_admin_fee, $order);
}

the plugin is giving your theme filter $saved_admin_fee as $admin_commission, on the other hand, in the following CODE:

$admin_commission = 10;
return apply_filters('dokan_order_admin_commission', $admin_commission, $order);

the plugin is always giving 10 as $admin_commission value to the theme filter.

So, you may need to handle this same condition in your theme function.

Also, if the filter is executing twice, then it must be from somewhere else. In that case, you’ll have to remove the filter once the theme function is executed.

Example CODE fix for functions.php:

So your final theme CODE will be like:

function dokan_get_admin_commission_by_overwrite( $admin_commission, $order) {
    remove_filter( 'dokan_order_admin_commission', 'dokan_get_admin_commission_by_overwrite', 10, 2 );
    if ( $admin_commission === 10 ) {
        return $admin_commission + 1;
    }

    return $admin_commission;
}
add_filter( 'dokan_order_admin_commission', 'dokan_get_admin_commission_by_overwrite', 10, 2 );

Now this function should run only once and also increment with the proper condition checked.

Note: if you are still confused, or need further assistance, then I’d suggest you to contact that plugin’s support team.