Ahem. It could be one of those stupid, stupid things that I hate, the basic test that works almost universally, but sometimes doesn’t.
I just noticed that WordPress’s get_var() function returns NULL if no entries are found, rather than 0 or false.
Obviously, if (!get_var($blah $etc)) works sometimes (almost all the time), but technically there should be an is_null() test, or NULL === .
So…
Approximately line 517 in ecstatic.php, this…
if (!$wpdb->get_var($wpdb->prepare(“SELECT count(*) FROM $this->cumulative_table WHERE day=%d”, $today))) //see if the today row has been created
… should be changed to this…
if (NULL === $wpdb->get_var($wpdb->prepare(“SELECT count(*) FROM $this->cumulative_table WHERE day=%d”, $today))) //see if the today row has been created
Basically, replace the ! with NULL === . Three equal signs.
I’ll further test it here, and will roll out a new version with only tiny changes/fixes tomorrow.