deadlyhifi
Forum Replies Created
-
Forum: Plugins
In reply to: [hitcounter] hitcounter plugin counts are outrageousYou’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…
Forum: Plugins
In reply to: [hitcounter] hitcounter plugin counts are outrageousHI 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 withadd_filter('the_excerpt', 'detectAgent');
oradd_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.Forum: Fixing WordPress
In reply to: 3.1.1 Network Admin redirect loopAt 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.
Forum: Plugins
In reply to: [hitcounter] [Plugin: hitcounter] Must be inside the loopHi 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.
Forum: Plugins
In reply to: [Plugin: hitcounter] Double Count@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 thethe_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 changingthe_post
tothe_excerpt
orthe_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.
Forum: Plugins
In reply to: [Plugin: hitcounter] Double CountHi 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: HitcounterOK, tell me this:
when you visit one of your blog posts does the counter increase by one?
Forum: Plugins
In reply to: HitcounterSo 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.
Forum: Fixing WordPress
In reply to: Custom Post Type with TagsAdding
'taxonomies' => array('post_tag')
worked for me.Forum: Plugins
In reply to: HitcounterThe 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?Forum: Plugins
In reply to: [Plugin: hitcounter] Double CountHi DigitalAlias, could you post your single.php code on https://pastebin.com/ or some service like that so I could have a look?
Forum: Plugins
In reply to: [Plugin: W3 Total Cache] W3TC hitcounter pluginsI don’t use w3-total-cache but if there’s anything I can add to hitcounter to support it then let me know.
Forum: Plugins
In reply to: [Plugin: hitcounter] Double CountHi 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?Forum: Plugins
In reply to: [Plugin: hitcounter] Double CountThere 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.
Forum: Plugins
In reply to: [Plugin: hitcounter] Double CountI’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.