Also rework edd_get_total_earnings(). #1977