easydigitaldownloads/Easy-Digital-Downloads — pull request #2243 by leewillis77 (2014-04-29 20:47:34+00:00)
Title: Use a non-broken cache key

Currently earnings stats retrieved by calling get_earnings() on an instance of EDD_Payment_Stats are cached in a transient. Unfortunately the cache key is incorrect causing conflicts. The current cache key is:

```
$key = md5( 'edd_earnings_' . $start_date . $start_date );
```

Note the double use of $start_date. I expect that the second of these was intended to be $end_date. However as the code stood then incorrect results could be returned as cached values would be returned for an enquiry that shared the same start time as a previous query even if the end time was different.

This PR replaces this cache key with ```md5( serialize( $args ) );``` which is the same cache keying approach used elsewhere and correctly caches in the base case. It also has the advantage that it will cache correctly even the start/end date are identical but other query args are changed by other plugins via the provided filters