WordPress.org

Support

Support » Plugins and Hacks » [Plugin: WP-Ad-Manager] Clicks zeroed on page load

[Plugin: WP-Ad-Manager] Clicks zeroed on page load

  • Using wp-ad-manager 0.7.5.

    Looking at the WP-Ad-Manager I can see when a user clicks on an ad. It is correctly set to 1. The impressions counters do not change.

    When the page is next loaded the clicks return to 0.

    I had this issue with Ad-minister so I decided to move to wp-ad-manager.

    Is this a known issue? Is there anything I can do to fix it while you are working on changing the code to use update_option()?

    As there is no impressions/click data in my db, I am okay with deactivating the plugin and deleting the administer post and the postmeta data.

    http://wordpress.org/extend/plugins/wp-ad-manager/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author valentinas

    @valentinas

    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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: WP-Ad-Manager] Clicks zeroed on page load’ is closed to new replies.