|
Views Counter (VC) is a small plugin for WordPress that helps you to easily track how many times your post page was viewed and by what quantity of visitors.
You can see it in action at this blog right under every post:
It’s very flexible and you can tune it easily. No more words, but instructions.
Hooray! Hooray! Views Counter v. 0.10 by Cryonyx is available now. Download →
Attention: Please, read carefully migration instruction and release notes for this version of VC if you are upgrading from previous ones!
Installation
- Download ZIP archive of the latest version;
- Unpack it on your computer;
- Upload folder ‘vc‘ to your plugins directory (usually situated in /wp-content/plugins);
- Turn VC on at your ‘Plugins’ page
- Tune it and enjoy
A couple of words about upgrading VC from version 0.0x to 0.1x:
- Deactivate VC at plugins page
- Backup table “<table_prefix>views_counter”
- Remove viewscounter.php and folder “vc” from your plugins directory
- Unzip this archive and place folder “vc” to your plugins directory
- Activate VC at plugins page
That’s all about installation. Let’s go for…
Tuning
At the ‘Options’ page go to the ‘Views Counter‘ subpage. There you can set up most common options of the plugin. Tweaking of VC could be performed through the usage of vc_get_stats function, but about this a bit more later.
General options
- Do you want statistics to be displayed at your weblog?
This option determines whether you use standard mechanism of inserting VC’s code into the page or much advanced, with the usage of vc_get_stats. If a standard approach is being used, then VC inserts its statistics’ string directly below the content of every post.
Important: No matter what method you use, VC will register every visitor until being turned off at the ‘Plugins’ page. This option only helps you to tweak the output of VC.
- Should I also display and track views of posts on the main page?
This one lets you to display statistics not only at post’s single pages, but at the main one, too, just below the excerpts of posts (this way I do at my own blog).
- May I place the small logo icon at the beginning of the line to thank the author of the plugin?
If you want to support this project, please turn this option on and just in the beginning of every VC’s statistic line you’ll see a small pretty arrow – logo icon of VC (see it in the picture above). Also you if you use VC you may email a link to your weblog and I place it in a page of VC’s users ))
Text parsing options
In this section you can define how the VC’s statistic line will be displayed. Normally, the line consists of the following elements:
- Beginning
- Views counter
- Views counter’s text
- Prepositions
- Visitors counter
- Visitors counter’s text
You can see it in the image below:
Of course, some elements may be omitted in settngs. It depends on the language. E.g., in English, we have to place a preposition ‘by’, but in Russian there won’t be any preposition. That’s why you may leave nearly all the fields in this section of options empty.
Additional options
In this section some additional options are listed.
Tweaking
This section if for those who are able to write a WP-Theme by themselves or at least make corrections to the existing one. The talk is about the vc_get_stats function. The declaration of it is as following:
function vc_get_stats(
$text_before = 'Viewed',
$human_count_text = 'times',
$human_ct_function = NULL,
$preposition = 'by',
$human_viewers_text = 'visitors',
$human_vt_function = NULL,
$with_icon = 0
)
As you can see, many of the parameters are optional. But I strongly recommend you to set your own values for them. Let’s walk around them and explain what thay mean.
- $text_before – corresponds to the ‘beginning‘ in the above mentioned scheme of statistic line.
- $human_count_text – corresponds to the ‘views counter’s text‘. Important: sets only one caption for all possible values of counter. To change this you may use the following parameter.
- $human_ct_function – lets you to assign your own handler to the views counter. In many languages to different numbers correspond different words, e.g., 1 view, but 7 views. Through this param you should pass the name of your function, which has the following format:
function your_handler( $the_number_of_views )
- $preposition – think there’s no need to explain.
- $human_viewers_text and $human_vt_function – the same situation as with $human_count_text and $human_ct_function.
- $with_icon – you should pass ’1′ for to display the logo icon and help the project, or something else or just leave is empty for not to display. Note: you can place the logo in any place by calling the vc_get_icon function, which has no params to pass to.
Well, this is all. No so difficult, yeah? I have a lot of plans for developing this small project, so check this page regularly.
Important notes
- VC uses its own table in database called ‘table_prefixvc_data’ (depends on system settings. E.g., on my blog this one is ‘wp_vc_data‘). It consists of two columns: posts’s id and compressed statistical data (it can be easily deciphered, as it has following format: [Number_Of_Views_in_HEX]/[IP1_in_HEX]/…/[IPn_in_HEX]). If your weblog is popular, please take care that you have enough diskspace on server to keep the database.
- VC is developed under GNU GPL license, so you can help me to improve it. But, please, inform me if you want to do something rather great with VC, because it may be non-compatible with the newer version of VC.
Notes on releases
Viewed 46103 times by 18668 viewers
|
March 27th, 2007 at 8:54 am
i get this error when i activate it. whaaaahaaapend
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /home/chirpthi/public_html/wp-content/plugins/vc/vc.class.php on line 9
March 27th, 2007 at 4:17 pm
What version of VC do you use?
What version of PHP is installed on your server?
March 27th, 2007 at 5:30 pm
I got the same error.. i am runing php 4.4.4 and the newest version of wordpress 2.1.2
March 27th, 2007 at 8:10 pm
Please pay attention that VC 0.10 works only with PHP 5 and higher. If you use an older version, you should choose VC 0.07
March 29th, 2007 at 5:52 pm
I found out about that later and imm glad it works ^^
March 29th, 2007 at 9:36 pm
That’s good
April 23rd, 2007 at 2:56 pm
This is a very nice plugin, thanks.
April 23rd, 2007 at 6:42 pm
Thank you for using it :[
April 26th, 2007 at 1:49 am
thanks heaps for making this plugin!
May 15th, 2007 at 11:07 pm
Hello, I’d like to know how this plugin handles logged in users? Will visits from different users that come from the same IP show up as unique visits?
May 18th, 2007 at 6:49 pm
Manne, by the moment it just excludes these users from statistics, but if you want, I can add the functionality of separate tracking of different types of users
June 3rd, 2007 at 10:13 pm
Thanks for this great plug-in! One question though:
When I want to use the vc_get_stats function (reason: private stats), in which theme file should I include the function?
June 3rd, 2007 at 10:17 pm
On my blog it is just included in the Loop of posts in index.php file of theme…
June 6th, 2007 at 11:01 pm
Привет в версии 2.2 плагин вызывает фатальную о?ибку.
June 7th, 2007 at 8:42 am
Привет!
Обязательно проверю на этих выходных. Я ещё просто не ставил версию 2.2.
Спасибо за сообщение!
June 23rd, 2007 at 7:42 am
I liked this plugin the best. I used it but then I upgraded my blog and when I try to activate the plugin, i get “Plugin could not be activated because it triggered a fatal error.”
Before upgrading my blog I deactivated the plugin and backed up my tables.
Any ideas? Thanks
June 23rd, 2007 at 8:13 am
sunnyt
VC doesn’t count administrators’ views of the post. Try to log off the WordPress and reload the page with your posts.
Rich
I tested VC 0.10 on WP 2.2 at my local server, but everything worked fine. Could you please provide me with information on your configuration?
Hmm. This new WordPress functionality is a complete headache
June 23rd, 2007 at 11:58 am
I was debating whether or not to do the upgrade, but since I had some time off I went for it. I think it may be with the tables in the database or a permissions issue. I am using WP 2.2 with mySQL 4. I upgraded the blog template to use the K2 code. I have it working with my other blog no problems (blog.800hightech.com) and found this to be a very easy but powerful installation the first time around.
I’ll tinker with it on Sunday and see if I can get it working. Maybe it is a conflict with another plugin I have installed. Thanks for the quick response!
June 25th, 2007 at 12:52 am
Hi, I’m getting the same fatal error as rich.. I’m using wordpress 2.2.
July 16th, 2007 at 8:09 pm
Great plugin. I would however, like the counter to show at the bottom of the page. Just like how the counter is set for every post, I’d like just one for the page. Help?
July 17th, 2007 at 4:42 pm
Dave
In WP 2.2 initial run of VC is somewhy rather problematic and it is quite difficult to catch the error… I haven’t installed WP on my own site yet, but promise to do it as soon as possible and debug the plugin.
PS
What page do you mean? Home? Or the substance that WP calls “page” (like the one you stay at at the moment)? If the former, then I’m afraid the answer is “no”, because statistics is gathered on the basis of posts’ identifiers, and the home page, as you understand, doesn’t have such ID.
September 11th, 2007 at 10:20 pm
Hi,
I have tried the plugin today, php v5.2.4 and wordpress v2.0.10.
I think it is not working properly. With the option Do you want statistics to be displayed at your weblog? set to no (to gather statistics the first day) and seeing the stats in the Manage/Posts menu, my first 7 posts have 1/1 the rests are N/A. This is really strange, because I received visited today to some of my posts.
After 10 hours of testing, the numbers stay the same…
September 11th, 2007 at 10:46 pm
Some lines from the log that may be are a clue:
—
[21:40:12, 11.09.2007] [DEBUG] increase(): Increasing counter
[21:40:12, 11.09.2007] [DEBUG] increase(): Checking that it is the main page and we permitted to count it
[21:40:12, 11.09.2007] [DEBUG] increase(): Checking post ID
[21:40:12, 11.09.2007] [DEBUG] increase(): Checking that we are permitted to count views and that the content exists
[21:40:12, 11.09.2007] [DEBUG] increase(): Increasing counter
[21:40:12, 11.09.2007] [DEBUG] increase(): Checking that it is the main page and we permitted to count it
[21:40:12, 11.09.2007] [DEBUG] increase(): Checking post ID
[21:40:12, 11.09.2007] [DEBUG] increase(): Checking that we are permitted to count views and that the content exists
[21:40:12, 11.09.2007] [DEBUG] increase(): Increasing counter
[21:40:12, 11.09.2007] [DEBUG] increase(): Checking that it is the main page and we permitted to count it
[21:40:12, 11.09.2007] [DEBUG] increase(): Checking post ID
—
[21:42:21, 11.09.2007] [DEBUG] getStats(): Consts:
NEW_TYPE_STATS=0
OLD_TYPE_STATS=1
[21:42:21, 11.09.2007] [DEBUG] getStats(): Got data in old format:
[21:42:21, 11.09.2007] [DEBUG] getStats(): Getting data from DB
[21:42:21, 11.09.2007] [DEBUG] getStats(): Got stats in raw format:
Array
(
[0] => 0
[1] => 01/452E1453
)
[21:42:21, 11.09.2007] [DEBUG] getStats(): Consts:
NEW_TYPE_STATS=0
OLD_TYPE_STATS=1
[21:42:21, 11.09.2007] [DEBUG] getStats(): Got data in new format:
Array
(
[0] => 1
[1] => 1
)
—
September 12th, 2007 at 9:58 pm
Hi Ent,
I will look it up on holidays. Unfortunately, nearest two days I’m completely busy and even don’t have time to sleep
I think it will be something like VC 0.11 especially for WP 2.x, cus, as I think, there are some peculiarities that prevent the plugin to work correctly…
Anyway, thanx for your comment, I’ll check it up.
September 13th, 2007 at 12:11 am
September 20th, 2007 at 7:49 pm
ent
I’ve revised VC 0.10 and found several bugs in the logics of the plugin. I even wonder how it is working on my WordPress
Thus it is quite difficult and time-consuming to fix this in the current modification. Truly saying, it is easier now to grow new VC
It will be not for WordPress only, but easy integrating into any site using PHP. Moreover I plan to rewrite its API for to make it more usable for developers and owners of sites. That’s it
Comments? Improvements? Wishes?
September 20th, 2007 at 7:54 pm
By the way, development can be monitored at Google Code’s repo
September 27th, 2007 at 9:26 pm
Hello, I really like this plugin. Since my server is running PHP4, I use the vc.0.07 version. I write a post about this plugin on http://tim.diary.tw/2007/09/28/wp-counter-vc/, and the function get_stats($id) can be improved in only one statement:
return $wpdb->get_row(“SELECT sum(views),COUNT(*) FROM ” . $table_prefix . “views_counter WHERE (id=’$id’)”,ARRAY_N);
And I also tune some code to let the plugin more efficient and I put the code on http://tim.diary.tw/files/2007/09/viewscounter-modified.zip , and if you accept these change, you can merge them into your next version to get the plugin powerful. Really thanks for your plugin.
September 28th, 2007 at 7:03 am
Hello, Tim
I’m very pleased to see that someone else is interested in developing VC. As you know, I finished developing VC branch for PHP 4 as I have no place where to test it and switched to developing completely object-oriented plugin. But with your help we can now support plugin for PHP 4.
If you want, I can include you in the project on Google’s repo, but you need a Gmail account to do this. Write me if you’re interested in it.
P.S. I’ll place your version of VC to repo a bit later, now I have to go
October 26th, 2007 at 12:47 pm
Great plugin, I have only one question, how can I show only the number of views and not the visitors?
The tweaking part is confusing for me, by the way I have to use vc.0.07.
Thank you.
December 16th, 2007 at 1:08 pm
i got this error
WordPress database error: [Table 'webring_wrdp1.wp_views_counter' doesn't exist]
SELECT views FROM wp_views_counter WHERE (id=’67′)
WordPress database error: [Table 'webring_wrdp1.wp_views_counter' doesn't exist]
SELECT COUNT(*) FROM wp_views_counter WHERE (id=’67′)
N/A
i use vc 0.07
December 16th, 2007 at 1:52 pm
This means that somewhy database table was not created at the moment of intallation of VC. Try turning VC on and off at “Plugins” page. This may help. If not, you’ll have to run a MySQL installation script manually.
December 16th, 2007 at 2:38 pm
i can’t see installation script on my sever, where should find it?
i just see ‘create database’ and not ‘create table’
December 22nd, 2007 at 9:52 am
Im considering installing this add on my Blog_
http://footu.blogspot.com
December 22nd, 2007 at 11:12 am
Footu
Sorry, but VC can be installed only on WordPress CMS.
December 22nd, 2007 at 11:22 am
webringnet.com
You should do the following:
December 23rd, 2007 at 5:15 pm
thanks cryonyx, finaly i made it,i create the table manually via phpmyadmin
February 12th, 2008 at 12:52 pm
I am in the process of hiring writers for my blog network, whom I would like to pay by visit counts on their posts (ie 1000 views = $2, like gizmodo/gawker media pays to it’s writers). It is important for me to have a full-proof view counting system so that the view-count cannot be artificially inflated to get paid more.
Presently I am using a hacked version of the script/plugin “Daily Top 10 Posts”, available here: http://www.alleba.com/blog/2007/03/27/wordpress-plugin-daily-top-10-posts/
This does the job by tracking views per posts. And it seems preety tamper proof, as it counts per session and reloading your browser wont add a view count to the total.
What a need is a “view count” –> “author” –> “posts from last 30 days”. Which boils down to “view counts of a single author’s posts made in last 30 days”. I can do it manually, but it will end up being a hell of a job when post counts increases. I need an automated system for this.
I don’t know of any other plugins that does the job the way I need it.
I appreciate any help and willing to compensate for the service if demanded.
Thanks for any help.
February 15th, 2008 at 3:28 pm
is v0.07 working for wordpress 2.3.3?
i have try but not functioning. i got 0 view by 0 visitor all the time.
i used php4 engine
February 17th, 2008 at 8:27 pm
exinco
I didn’t check it, because 0.07 was the last version for PHP 4 and is now not supported. You can try the 0.071 version by Tim which is available there: http://code.google.com/p/views-counter/
February 17th, 2008 at 8:32 pm
pavel
Do you mean you want VC to separate statistics also by authors and by time?
Well, if so, then I’ll try to implement this in the ongoing version of VC, but I cannot say anything about the time when it releases. I simply don’t have enough time to deal with it.
P. S. VC is absolutely free tool and I don’t require any money paid for it even if it is used for commercial purposes.
February 17th, 2008 at 8:35 pm
thanks cryonyx, i’ll do my best
cheers1
March 18th, 2008 at 1:21 am
Отлично!
March 20th, 2008 at 4:15 pm
Плагин выдаёт фатальную о?ибку и пи?ет
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /home/clients/ftp0/domains/rumature.info/html/wp-content/plugins/vc/vc.class.php on line 9
это на верси ВП 2,3
что делать? как это лечиться?
March 20th, 2008 at 10:41 pm
Какая версия плагина?
March 25th, 2008 at 9:22 pm
стоит версия 0.10
April 2nd, 2008 at 7:58 pm
так как это лечится?
April 2nd, 2008 at 9:17 pm
Скорее всего, у тебя стоит PHP 4. В таком случае данная версия VC не подходит. Следует использовать VC 0.071 от Тима. Скачать её можно здесь: http://code.google.com/p/views-counter/
April 2nd, 2008 at 9:38 pm
hi cryonyx
did you fixed this plugin for wordpress 2.3.3?
April 4th, 2008 at 2:59 pm
Hi skyscraper,
And wassup is with VC on WP 2.3.3?
April 4th, 2008 at 4:14 pm
i use wp 2.3.3 and not work.
April 4th, 2008 at 8:37 pm
What are the symptoms?
April 4th, 2008 at 8:51 pm
hi, cryonyx
i don’t know the symptoms. there is no error. installation is ok but no result on the page.
here http://paidperreview.com
sorry.
April 14th, 2008 at 7:56 am
Hi Cryonyx,
Thx for making this plugin available for everyone.
Unfortunately I get this erro on WP 2.3.3 (I hv replaced my website with “xyz” for privacy purpose)
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /home/xyz/public_html/xyz.com/wp-content/plugins/vc/vc.class.php on line 9
Any advise on how what I might be doing wrong?
Thanks!
April 14th, 2008 at 3:10 pm
Hi, Australia!
The problem 90% probability is that you use PHP 4, which doesn’t support classes in the way the latest version of VC requires. Try using VC 0.071 (look the comment #40 above).
April 14th, 2008 at 4:25 pm
Thank U for your prompt reply, Cryonyx!
I downloaded VC v.0.07 as per your advice and it worked straight away.
Thanks again!
April 14th, 2008 at 6:31 pm
i use wp 2.3.3 too and not work.
April 15th, 2008 at 9:45 pm
Heh, what means “not work”? How exactly it doesn’t work?
April 16th, 2008 at 4:47 am
To Canadian Pharmacy, did u try downloading the older version as per Cryonyx ie http://blog.cerebrate.ru/files/vc/vc.0.07.zip
VC 0.07 worked fine for me on WP2.3.3
April 16th, 2008 at 6:58 pm
Just a couple of questions, is it compatible with wp 2.5?
Can I edit the views count for each post so counting doesn’t start from 0?
thanks
April 17th, 2008 at 7:14 pm
James
1. Saying truth, I haven’t test it. Probably. In WP 2.5, as far as I know, only admin-pane has changed dramatically. The basic functionality remained the same. Then all should work good;
2. Yes, 4 sure. But it’s not that easy: you should know the HEX encoding and be acquainted with MySQL. If you are that guy, then open the table
wp_vc_data, find the entry with the necessary ID and edit the first block of symbols before slash. For example:Entry ID: 1
Views: 1
IPs: doesn’t matter (should be at least one)
You want to change the indicator to, say, 2500. Then you should change the “data” field to:
9C4/…
(where “…” should be replaced with encoded IPs).
That’s it. The indicator shows now 2500 views.
May 28th, 2008 at 6:03 pm
I implemented this plugin on WP 2.5.1 and it works. Thanks a lot.
May 28th, 2008 at 9:57 pm
Kombor
Thank you!
Really? That’s good news
BTW, the new version of VC is ongoing. I plan to release it in the middle of June.
August 2nd, 2008 at 4:09 pm
thx for visiting
August 19th, 2008 at 6:38 am
На локалке работает отлично! Спасибо за чудесный плагин!
August 23rd, 2008 at 3:15 pm
Hello, have you planed an update for wordpress 2.6.1?
August 23rd, 2008 at 7:02 pm
2 k|torz
Right, but now I don’t have time to develop and test it…
August 25th, 2008 at 9:35 am
hello…
i have benefited by using vc0.02 for the last two years.
however it does not display on ‘pages’ like it does in ‘posts’.
any reason this is so?
…pR
August 25th, 2008 at 3:41 pm
Great plugin. I would however, like the counter to show at the bottom of the page. Just like how the counter is set for every post, I’d like just one for the page. Help?
October 6th, 2008 at 4:10 pm
Is there any news on a new version of this plugin? I would like to use it. I have wordpress version 2.6.2. It’s a great plugin , i can’t find anybody who has a simular plugin.
October 27th, 2009 at 2:31 pm
Hi,
I love the plugin and got the easy option to show in the posts management.
But I am trying to add a line to the post next to the author showing the views and can not seem to get it to display.
is this all I need to add to my theme ?
function vc_get_stats(
$text_before = ‘Viewed’,
$human_count_text = ‘times’,
$human_ct_function = NULL,
$preposition = ‘by’,
$human_viewers_text = ‘visitors’,
$human_vt_function = NULL,
$with_icon = 0
)
When I do I get no output.
Thanks in advance
Lewis
November 27th, 2009 at 3:23 am
PS: И по моему для всех постов показывает одно и тоже значение, какую последнею версию вордпресса ты юзал?
November 27th, 2009 at 3:24 am
прощу прощения, первый пост не опубликовался, иконка справа от счетчика не отображается (в меню выбрал показывать) но там просто ссылка на ваш блог. Версия вордпресса WordPress 2.8.5.
не подскажете как быть?
November 30th, 2009 at 2:57 pm
Хм. Странно, что иконка не отображается. Убедись, что она находится в папке с плагином.
Что касается версии WP, то плагин работает на любой начиная с 1.2 – он использует только базисный функционал WP, который не менялся уже очень давно.
Что касается одного и того же значения для всех постов – просто нужно немного времени подождать, пока пользователи перестанут читать только главную страницу и полезут по самим постам. Ещё счётчик может не отображаться вовсе сразу после установки, поскольку просмотры админа не учитываются.
December 10th, 2009 at 2:50 pm
WordPress 2.8.6. тема WordPress Constructor Theme 0.6.2
вроде сделал все как написано.
создал папочку. скопировал. активировал.
а статистику так и не показывает
уже и в темплейт пытался функцию тыкать.
есть идеи что я делаю не так?
January 3rd, 2010 at 3:58 pm
how to display the number of visits without displaying the number of visitors?
January 20th, 2010 at 11:41 pm
Версия WP 2.9.1 после добавления отображает <<<<<<>>>>>> .r740
после деактивации эти знаки не исчезли ….. плиз, помогите, как быть?
February 19th, 2010 at 5:14 am
“Ещё счётчик может не отображаться вовсе сразу после установки, поскольку просмотры админа не учитываются” Если выйти из браузера или открыть в другом браузере незалогинившись то можно увидеть.
February 19th, 2010 at 5:35 pm
@jasmine
Скорее всего, это глюк не этого плагина. Какой адрес ресурса? Какие ещё плагины установлены?
2 Брен
В первом случае это возможно только, если броузер стирает куки.