scottopolis / edd-metrics

EDD Metrics
46 stars 12 forks source link

Recurring revenue calculation is very very wrong #50

Open clifgriffin opened 4 years ago

clifgriffin commented 4 years ago

Hi Scott,

I know you yanked the recurring revenue estimation from EDD's code, but it's very wrong.

It's pulling in the recurring amount of subscriptions whose expiration date is in the selected date range. However, by its nature, this means it's only including subscription that have expired.

To do this properly, I think it will need to pull all payments that happened in the date range that are associated with subscriptions, excluding first payments so that it's truly only including 'recurring' revenue.

This would need to be tolerant of trials as a trial creates a $0.00 initial payment and then the completion of the trial creates another payment. So it would need to exclude the first payment after the $0.00 trial payment as well.

I know EDD's data is a mess and I may create a PR at some point, but wanted to document the issue here in case someone else is eager for a challenge.

Clif

scottopolis commented 4 years ago

Hmm, good point. I know EDD is redoing all their reporting for 3.0, so I am waiting to see what that will look like. If their reporting is good enough, it might make this plugin moot.

clifgriffin commented 4 years ago

That's a great point. Hadn't thought of that.

Also sorry if this sounded like an attack. I was a little amped up on caffeine at the time I wrote this :)

scottopolis commented 4 years ago

No worries :)