Hi,
This is not a known issue (at least not for me 🙂 ), so thanks for reporting. I don’t have a solution for you, but i will definitely look into this before releasing next version. Hopefully in the beginning of next week. Will let you know.
It’s bizarre – when I look at administer_stats in wp_postmeta, the unserialized data does not have a ‘c’ (clicks) element. It does have the ‘i’ element
When I create my own $administer_stats array, with ‘i’ and ‘c’ elements and update the wp_postmeta entry, it is soon overwritten by the plugin and replaced with an empty value or serialized data that does not have a ‘c’ element.
BTW, the data written by the plugin is:
$stats[$ad_id][i] = 1
for all the active ads. The impressions/clicks are displayed as zero in the WP Ad Manager Content tab.
I might simply deactivate the plugin, clear the db of administer data and start again.
I deactivated the plugin and cleared the wp_postmeta info and then reactivated but no change.
I added some code to administer_do_redirect() to write $administer_stats to a file before doing the redirect. It only records one element for each click e.g.
Array
(
[15] => Array
(
[c] => 1
)
)
My code is:
$ams_handle = fopen("administer.log", "a");
if ($ams_handle) {
fwrite($ams_handle, print_r($administer_stats, TRUE));
fclose($ams_handle);
}
I can confirm that I’ve seen this as well.
Cheers,
Nick
I have looked at my home-made administer log file a few times. Sometimes $administer_stats only has one element but can have 7 elements and I even saw impressions being recorded for one ad.
For example, here is the first bit of my log – note that in one instance $administer_stats has 6 elements, one element in the next and then back up to 2 and then 1 and then 7!
Array
(
[0] => Array
(
[i] => 1
)
[4] => Array
(
[i] => 2
)
[1] => Array
(
[i] => 2
)
[5] => Array
(
[i] => 2
)
[3] => Array
(
[i] => 2
)
[6] => Array
(
[i] => 1
[c] => 1
)
)
Array
(
[6] => Array
(
[c] => 1
)
)
Array
(
[6] => Array
(
[c] => 1
)
[2] => Array
(
[c] => 1
)
)
Array
(
[14] => Array
(
[c] => 1
)
)
Array
(
[6] => Array
(
[i] => 1
[c] => 1
)
[2] => Array
(
[i] => 1
)
[4] => Array
(
[i] => 2
)
[5] => Array
(
[i] => 2
)
[3] => Array
(
[i] => 2
)
[0] => Array
(
[i] => 1
)
[1] => Array
(
[i] => 1
)
)
Maybe WordPress is caching data from the db and this is messing things up.