Forum Replies Created

Viewing 15 replies - 1 through 15 (of 34 total)
  • You’re right. I’ve removed the plugin. I’ll contact www.remarpro.com to remove it from the listings.

    I’ll most likely release a new version in the future…

    HI jtpedersen.

    Just to warn you I wrote this plugin many years ago and I no longer use it; But, during that time I have received various reports of counting hits multiple times – although that never happened to me or any of the sites I used it on.

    The plugin fires on “the_post“.

    It seems sometimes “the_post” is called more than once in certain themes and therefore the “count” gets fired more than once.

    If you look at line 147 of the plugin it states add_filter('the_post', 'detectAgent');
    You might want to experiment by replacing this with add_filter('the_excerpt', 'detectAgent'); or add_filter('the_content', 'detectAgent'); to see if that makes any difference – but in the past when these were options I got many more reports of false readings. the_post appeared to be the most reliable hook.

    Thread Starter deadlyhifi

    (@tomdebruin)

    At the moment I am just running it with no access to the network admin page – if I do need to get there I temporarily do the DOMAIN_CURRENT_SITE switch.

    Plans are afoot to change all URL references to their non www version which does appear to solve the problem – since the sandbox.example.com site we use for testing and has exactly the same setup does not have the problem.

    Hi tobifjellner. Yes, the userViews must appear within the loop because it acts on the post id of the current post.

    I’m not entirely sure what you mean by

    differentiate between type of views short/full?)

    Do you mean to count if a view is the_excerpt() or the_content()?

    The plugin originally acted upon the_content() and caused problems for many people so it also seemed to fire on the_excerpt() if no excerpt was written in (i.e. the excerpt box was left blank within the post writing page). Now the function fires on the_post.

    Any suggestions for functionality are welcome, though I don’t want it to become bloated.

    deadlyhifi

    (@tomdebruin)

    @blueboxed, sorry for the delay in getting back to you, I’ve been away.

    Just had a look at your site, and had another look at the single.php code and it might possibly have something to do with line 42 – if (have_posts()) : while (have_posts()) : the_post(); ?>. Maybe the the_post is getting called again even if a valid post has been found – therefore counting for a second time.

    If you look at line 147 in hitcounter.php you’ll see add_filter('the_post', 'hc_detectAgent');. Experiment by changing the_post to the_excerpt or the_content (e.g. add_filter('the_content', 'hc_detectAgent');) and see if one of those options changes it for you.

    Alternatively take out the else statement in your single.php and create a 404.php file to handle errors.

    Let me know how it goes.

    Hi blueboxed,

    I just used your code on a site and I’m just getting one count increment. Are you using the latest version of the plugin?

    Forum: Plugins
    In reply to: Hitcounter

    OK, tell me this:

    when you visit one of your blog posts does the counter increase by one?

    Forum: Plugins
    In reply to: Hitcounter

    So yeah, the owner of the program has a job that takes up a lot of his time.

    I did respond to you, but I was also waiting for any other reports from people because your descriptions of the problem aren’t clear and don’t go into any technical detail or what you’ve tested and how you’ve tested the results.

    Just saying the data is wrong doesn’t allow me to get to the root of the problem. It works on all my servers so how could I possibly understand your setup and troubleshoot it?

    Go through each of these scenarios and answer yes or no.

    1. When an unregistered user (not logged in) visits does it increment by one?
    2. When a registered user visits does it increment by one?
    3. When the author visits does it increment by one?
    4. Having checked “ignore author” and the author visits does it not increment?
    5. Setting ignore user-level does the count increment, or not, as dictated in the settings?

    Think very logically and go through each step.

    I also advise you make regular backups of your data so that it can be restored if required. Plugins are authored by enthusiasts – their coding standards are not monitored, and neither can a plugin author test on every server environment and WP setup. Problems shouldn’t arise in most scenarios but there will always be a problem that crops up. If you want help then you need to be willing to provide that data. And finally, I immediately helped you, even on Twitter I responded within 30 minutes. So yeah.

    Adding 'taxonomies' => array('post_tag') worked for me.

    Forum: Plugins
    In reply to: Hitcounter

    The latest update doesn’t make any changes to how the views are calculated. Just that the counter fires on the_post() rather than the_content() which was unreliable in previous versions.

    It detects for registered, non registered, and robots.
    For views it adds up registered and non registered to give total ‘human’ views.

    Does the counter increment by one when you visit a post?
    Are you saying that it now lists twice as many views per post than before the update?

    Hi DigitalAlias, could you post your single.php code on https://pastebin.com/ or some service like that so I could have a look?

    I don’t use w3-total-cache but if there’s anything I can add to hitcounter to support it then let me know.

    Hi TadeuszD, thanks for your feedback. You’re right about the DEFAULT 0 value. That’s easily sorted.

    Deleting view count: I’ve been thinking about this. If I have the reset button within the post edit page it needs to not refresh the page when clicked (and lose any changes you’ve made that havent saved) so I need to get my head around using AJAX in plugins. It doesn’t look too complex but I need to have a mess around with it.

    Regarding the ‘theoretical problem’. Are you saying that if you look at a deleted post, or a post revision, it counts as a view? I could do a check on post_status but it would require another database lookup.

    Hitcounter was never meant to be the be all and end all in viewing statistics. It was just to act as a guide as to the popularity of a post.
    Do you think it’s worth doing .1 release to add the DEFAULT status (you’re the first to mention it) or wait until I figure out the AJAX thing?

    There isn’t. I’ll add it to the “things to do” list.

    Perhaps have the reset post count on the post edit page itself, and a reset entire site in the setting page (with an “are you sure?” check)?

    I’ll have a think about it.

    I’ve come up with a fix for this by offering an option on the settings page.

    Version 1.2 will be with you shortly. Just a bit more testing to do.

Viewing 15 replies - 1 through 15 (of 34 total)