WordPress.org

Ready to get started?Download WordPress

Forums

WP-Ad-Manager
Clicks zeroed on page load (6 posts)

  1. daymobrew
    Member
    Posted 3 years ago #

    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/

  2. valentinas
    Member
    Plugin Author

    Posted 3 years ago #

    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.

  3. daymobrew
    Member
    Posted 3 years ago #

    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.

  4. daymobrew
    Member
    Posted 3 years ago #

    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);
    
    }
  5. NicholasPerkins
    Member
    Posted 3 years ago #

    I can confirm that I've seen this as well.

    Cheers,
    Nick

  6. daymobrew
    Member
    Posted 3 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic