YD Profile Visitor Tracker WP plugin
Who has visited your profile?
This simple WordPress plugin tracks and displays who has been visiting your profile or other personal pages in a WordPress / BuddyPress / WP+bbPress installation. An important “social” add-on to community-oriented sites.
Use one template tag for the tracking, and another template tag (or shortcode) for the display.
Compatible with PHP5.
Active support
Drop me a comment on the bottom of this page to report bugs, ask for specific feature or improvement, or just tell me how you’re using it.
Funding Credits
Original and additional developments of this plugin has been paid for by Selliance. Please visit their site!
Le développement d’origine et les améliorations de cette extension ont été financés par Selliance. Allez visiter leur site !
Links to actual working examples :
http://bp.celyan.com/members/ydubois/profile/ (BuddyPress, template tag)
http://bp.celyan.com/toutes-les-visites/ (BuddyPress, shortcodes)
http://bp.celyan.com/visiteurs/ (BuddyPress, shortcodes + cookie-based tracking and filtering)
http://www.nogent-citoyen.com/forum/profile/ydubois (bbPress regular profile page, no BuddyPress. Using template tags.)
Detailed installation/test instructions
1) Install and activate plugin as available here:
http://wordpress.org/extend/plugins/yd-profile-visitor-tracker/
2) In Settings > YD Profile Visitor Tracker check that the first checkbox “Auto track visitors on all profile pages” is ticked.
3) Create a regular WordPress page, and put this shortcode in the page content:
[yd_visitor_profiles profile_id="1" fields="visitor,last_visit,visit_count"]
4) If you go make some hits on the sites’ first user account profile page as a logged-on user, you will now see a list of visitors displayed on the above created page.
Advanced usage examples
* Display BuddyPress extended profile fields:
[yd_visitor_profiles profile_id="1" fields="visitor,xp_First Name,xp_Name,xp_City,last_visit,visit_count"]
* Stylesheet:
You can use specific CSS styles to customize rendering.
* Other options:
[yd_visitor_profiles profile_id="1" fields="visitor,last_visit,visit_count" style="ul" after_text="More..." after_link="?more" limit="4"]
[yd_visitor_profiles profile_id="1" fields="visitor,last_visit,visit_count,visit_pv,total_pv" show_tableh="true"]
* Use of a custom cookie
For example, if your cookie is named “customcookie”: put “optcookie=customcookie” in the “Default tracking attributes” field and save the plugin settings.
From there on, the value of the cookie will be available in a tracking field named “opt_data”.
You can filter on that tracking field as follows:
[yd_visitor_profiles profile_id="1" filter="opt_data=value" style="ul" fields="visitor,last_visit,visit_count"]
* Avatar size
[yd_visitor_profiles profile_id="1" style="ul" fields="visitor,last_visit,visit_count" avatar_size="100"]
* Other installation instructions and notes:
Please also look at the installation page.
It shows the available template tags and shortcode and their basic syntax. All parameters/attributes/arguments are available both in the shortcode syntax an template tag syntax.
le 1 April 2011 à 15:02 h
[…] visiting your profile or other personal pages on a BuddyPress website. Check out the plugin’s homepage for advanced usage and customization […]
le 1 April 2011 à 19:04 h
This looks great but when I add it to my site and then add the Buddypress php code I get it showing up but I also get a string of errors which say:
Warning: strip_tags() expects parameter 1 to be string, array given in MYPATH/wp-content/plugins/yd-profile-visitor-tracker/inc/pvt.inc.php on line 392
This repeats many times down the page, any idea how to fix this?
le 1 April 2011 à 19:10 h
@Frizzo:
You’ve got a very touchy PHP setup. Please modify line 392 like this:
$data[‘wp_’ . $key] = strip_tags( (string) $value );
If this fixes it, I’ll put it in the next release.
le 1 April 2011 à 19:17 h
That worked! Thanks!
le 1 April 2011 à 19:19 h
@Frizzo: in fact you’re probably using some other plugin that tweaks user data in an unexpected way, can you please tell me which user-related plugin(s) you’re using in addition to BuddyPress? It would be interesting for me to investigate a bit further. Thanks.
le 1 April 2011 à 20:32 h
[…] visiting your profile or other personal pages on a BuddyPress website. Check out the plugin’s homepage for advanced usage and customization […]
le 3 April 2011 à 2:17 h
How can I add the template tag for buddypress profiles like you showed in your 3rd screenshot (which file, and which line) ? Thanks!
le 5 April 2011 à 0:18 h
The template tag is given on this page.
The file is members/single/profile.php
Put the template tag code (the one with ‘profile_id’ = $bp->displayed_user->id ) just before the “do_action( ‘bp_after_profile_content’ )” tag.
le 5 April 2011 à 20:34 h
Thanks! it works, but I’m getting an error just above the visitors:
Warning: Invalid argument supplied for foreach() in /storage/content/33/104833/authentic-pictures.com/public_html/wp-content/plugins/yd-profile-visitor-tracker/inc/pvt.inc.php on line 391
le 7 April 2011 à 12:28 h
@edinchez:
Please modify line 391 as follows:
foreach( (array) $visitor_data as $key => $value ) {
this fix will be included in the next release.
le 15 April 2011 à 20:20 h
Thanks for the plugin.
A great feature set, but I only need one aspect.
All I need to do is display the total visits to a profile page.
So on a person’s profile page it might say “Visits: 103”.
Any hints on the most efficient way to do this?
Thanks.
le 16 April 2011 à 17:25 h
Client says they aren’t interested in meta-data re visitors.
So I just wrote a simple non-unique counter.
How long will it be before they ask for meta-data?
LOL, I’ll be back and glad this plugin is available.
le 30 April 2011 à 15:31 h
how can we set a limit to how many it shows?
le 30 April 2011 à 17:38 h
@Frizzo: use the limit= argument.
le 30 April 2011 à 17:43 h
I am using the buddypress template tag (php) could you show me an example how I could add the limiter, sorry very new at php
le 6 May 2011 à 6:18 h
Nothing on the using the limiter with the buddypress template tag? What is the limit by default anyway?
Also, I found a glitch. When clicking usernames (the text not the avatar) it will sometimes take you to the person who’s profile it is instead of their profile.
Not sure that made sense, hope you understand.
le 13 May 2011 à 10:53 h
Hi Yann,
Thank you for this great plugin.
I have found that the “Last visit date” appears to be wrong, probably because WordPress ignores “date_default_timezone_set” and sets it to ‘UTC’.
Thus, I changed the line 264 of pvt.inc.php as following:
[ Original ]
$field_value = date( $date_format, $data[‘last_visit’] );
=>
[ Changed to ]
$field_value = date( $date_format, $data[‘last_visit’] + (get_option(‘gmt_offset’) * 60 * 60) );
And now the date shows correctly.
By the way, I am now struggling to find the way to hide “myself” from the visitor list.
It is sometimes strange to see myself as one of “Visitors” to my profile page.
It is ok that access log of myself is recorded, but I would like to “hide” myself from the list that is set in “my” profile page.
Are there any ways to make it? Otherwise, I would like this feature to be included in the future version.
Thanks in advance,
Chestnut
P.S.: As I mentioned in buddypress.org site, I am now making Japanese lang files. I will send them by email on completion.
le 13 May 2011 à 11:02 h
@Chestnut: thank you very much for the code contribution and for the upcoming translation. I’m looking forward to that and include it in the next release. As for the feature suggestion to hide oneself, I will consider it also. Thanks.
le 16 May 2011 à 15:31 h
Hi Yann,
I have just sent you, via e-mail, the zipped file which contains Japanese translation for the plugin.
Please check and see it, thank you.
By the way, I have almost completed my original customized to hide oneself on the list at his/her profile page.
I have just one question, so please advise me.
In pvt.inc.php, I have changed the setting of “block_self” from true to false, because the default setting is show “Send Private Message” button to other members that visited my profile page. But my customization is that I can see the visitor list but not other members that visited my page. So I need to see “Send Private Message” button for myself.
And I made it by changing the setting of “block_self” from true to false.
However, I still cannot see “Friendship Requested” or “Add Friend” button that are still displayed to other members not me myself.
So here is my question. Is there a way to display “Add Friend” related button or message to oneself just like “Send Private Message” button as mentioned above?
le 17 May 2011 à 10:25 h
@Chestnut: Thanks a lot. I received the translation and will be including it in the next release.
As for the button issues, those are core BuddyPress functions, so there is not much I can do: BuddyPress considers that you can’t be friend with yourself. However, I don’t exactly understand the issue, because the buttons are hidden for your own profile, but they will show for all other visitors that are listed.
le 17 May 2011 à 14:18 h
Hi Yann,
Sorry for my poor English explanation.
I will try again to explain what I am doing now:
I am customizing your script in order to meet my “special” needs.
1: Visitor list, located in one’s profile page, is shown only to the owner of the profile page, while the original plugin shows the list to everyone.
2: Since the list is shown only to the owner, the owner itself is excluded from the list.
3: The top of the table, as I display the “visit list” in the style of “table”, the total access count is shown. The total access count is the sum of each value of “Total visitor PV” excluding that of the owner, so that the owner can easily see how may PV is recorded since the plugin is introduced.
In these circumstances, I changed the setting of “block_self” from true to false. As a result, I can use “Send Private Message” button in my own profile page. Otherwise, I did not use the button in my own profile page.
Yes, I know that I cannot be friend with myself. My current goal is to display “Add Friend” button in my profile page, which is not shown in my own profile page.
Since I have customized the plugin in a such way that the user can see Visitor List only in his/her own profile page, not in other’s profile page. So, “Add Friend” button is currently not able to be used.
Reading your explanation, I understand that I might not be able to show the “Add Friend” button in my own profile page, as long as it is limited by BuddyPress’ core function.
le 27 May 2011 à 23:21 h
Hi
how can I get this working inside a widget? I tried to paste those shortcodes in a text widget, but it’s not working …
Thanks!
le 28 May 2011 à 16:35 h
@Candy: a shortcode will never work in a text widget. You need a PHP execution widget, and paste the template function code.
le 30 May 2011 à 13:49 h
Hi Yann,
sorry for my English!
I would like to add as your plug-in on my site, but I can not …. they are still in their infancy with BP + WP (default template).
Could you help me with a step by step to the first installation?
I do not understand how to bring up the “who visited my profile” in the Profile tab of my subscribers.
Can you help me?
Thank you very much
Michell
le 8 June 2011 à 5:00 h
Hey,
how can i make it so that it automatically brings up the visitors of the logged in user? using the shortcode with the part
profile_id=”1″
seems to bring up the same profiles visitors no matter what account i check it from.
so how do i make it to where it will automatically pull the stats of the logged in user checking his visitors?
Thanks a million
le 8 June 2011 à 10:51 h
@Doug: you cannot do it that way, because the shortcode arguments are static. To get the logged-in user ID you must use the template tag as explained here: http://wordpress.org/extend/plugins/yd-profile-visitor-tracker/installation/
le 8 June 2011 à 14:38 h
okay thank you, where do i insert the template tag though?
le 8 June 2011 à 14:55 h
ok i installed it in my theme’s index.php, after the endwhile statement.
it is now a blank page. ive titled the page
my visitors
whats the next step?
thanks a lot for walking me through this
le 17 June 2011 à 4:03 h
….hello?
le 17 June 2011 à 9:00 h
@Doug: sorry, I have no time to do step-by-step instructions for everyone for free. All necessary information is available in the installation documentation page, with code examples.
le 4 September 2011 à 8:59 h
Bonjour Yann,
Merci infiniment pour ce superbe plugin. J’aurais juste voulu savoir s’il y avait un moyen d’empêcher de voir ses propres visites dans les statistiques ? A savoir que si je me visite moi-même, je ne me vois pas dans le tracker.
Merci bien.
le 5 September 2011 à 15:18 h
@Job: normalement c’est déjà le cas, on ne doit pas voir ses propres visites.
le 5 September 2011 à 16:19 h
Après avoir testé le plugin sur une deuxième installation Buddypress, je confirme que l’on voit bien ses propres visites, que ce soit via le shortcode ou la fonction PHP :/ Pardon du dérangement, peut-être ai-je oublié quelque chose mais je ne vois pas. Merci.
le 9 September 2011 à 13:18 h
hello Yann,
hanks for this great plugin.
i have a problem.
if i delete a user, the avatar is still shown with the url: http://mywebsite/members//
what can i do?
greetings from germany,
michaela
le 9 September 2011 à 19:18 h
@Jasmin
The plugin will not delete data for a deleted user automatically. So if you want to make it disappear, you would have to manually edit usermeta data in the database. Visitor tracking data is stored in the usermeta of the visited user: so you would have to delete it in all accounts that have been visited. If I get funding for an updated version, I might add a “delete user” hook that takes care of this automatically. Right now that feature does not exist.
le 9 September 2011 à 21:20 h
@ Y.Dubois
Thanks for for your quick response!!!! 🙂
le 8 October 2011 à 16:34 h
Great plugin! Thanks. Would like to give it a try, but not sure will it work on WP 3.2.1 & BP 1.2.9. , wouldn’t want to break my hard work.
Any references?
le 9 October 2011 à 16:36 h
I took a risk and installed the plugin, but got an error:
Fatal error: Maximum execution time of 30 seconds exceeded in /home/dom/public_html/wp-includes/plugin.php on line 168
Besides I got a full page with the same repeated result over 30 times or so. Any hint what I am doing wrong? Installed just default samples.
Thank you in advance.
le 21 November 2011 à 19:11 h
Hi, I tried to use this plugins.
For showing just the user “1” works fine,
[yd_visitor_profiles profile_id=”1″ fields=”visitor,last_visit,visit_count” style=”ul” after_text=”More…” after_link=”?more” limit=”4″]
But I would like to use it shwoing all the visitors of my profile
What I´m doing bad???
if( is_callable( array( ‘pvtPlugin’, ‘track’ ) ) ) pvtPlugin::track( array( ‘profile_id’ => $user_id ) );
if( is_callable( array( ‘pvtPlugin’, ‘display_visitors’ ) ) ) {
global $pvt_o, $bp;
echo $pvt_o->display_visitors(
array(
‘profile_id’ => $bp->displayed_user->id
)
);
}
le 22 November 2011 à 17:51 h
Hi, i haven’t got your plugin to work, i tried to add the The tracking template tag to the buddypress members_header.php and the
The template tag for use in a BuddyPress profile page..
I’m sure there is something i am missing, but i have found out that your plugin in active it interfers with my post image gallery uploader..
Strange .. any tips?
regards Chris
le 8 January 2012 à 0:09 h
Great plugin
I had same issue as Frisso “Warning: strip_tags() expects parameter 1 to be string, array given in MYPATH/wp-content/plugins/yd-profile-visitor-tracker/inc/pvt.inc.php on line 392”.
I deleted the line 392, and it sorted it out, works great. Thanks
le 12 January 2012 à 7:23 h
Hello Yann, thanks for great plugin i installed that and i got error look here
Catchable fatal error: Object of class stdClass could not be converted to string in /home/peejii/public_html/wp-content/plugins/yd-profile-visitor-tracker/inc/pvt.inc.php on line 392
If i deleted that line 392 it works, but i really wanna delewted anything so do you have trick for this
Im translating your plugin to Finnish so if your a intrested i can send it to you, thanks
Petri
le 12 January 2012 à 9:54 h
One more question, is it possible to make link in profile sub navigation bar ( ie. whos looked me) and that sub page will open a new page, like a friends link now opens a new page called friends.
And how i can make that it not show myself if im visiting my own profile page
Ok, there was a two question, so thank you again for a great plugin
and million thanks
-Petri
le 13 January 2012 à 16:36 h
Hi Yann,
Great little plugin – really works well for what it does.
Is there any way to set this up so I can track activity on posts? Essentially I want to be able to put a blog out then check that people are reading it on the local intranet.
I’ve implemented the current edition so that it shows up on every post, but obviously the shortcode only tracks the user profile page. Is there a shortcode I can put in that will track the current post?
Cheers,
Nick
le 13 January 2012 à 18:02 h
@Nick: not sure I understand well what you need. But I think you can put a “tracker” on any page or post template. Activating it on one specific post only would necessitate a bit of PHP. I don’t remember if there’s a tracking shortcode, did you look at the documentation page? It would be indicated there if there’s one. Otherwise surrounding the tracking template function with an “if” statement to activate it on your specific page ID is the way to go.
le 16 March 2012 à 13:20 h
Hello,
First, thank you for this great plugin. It works fine for me except with style=”ul” but it’s not a problem for me.
As ask before by Job, I want to hide my own visits on my profile and I don’t know how to do. If someone have an idea.
Thanks,
Arystark
le 18 April 2012 à 8:38 h
Catchable fatal error: Object of class stdClass could not be converted to string in D:\xampp\htdocs\project\wp-content\plugins\yd-profile-visitor-tracker\inc\pvt.inc.php on line 393
le 18 April 2012 à 8:40 h
can u help me for this!
le 21 April 2012 à 12:02 h
Catchable fatal error: Object of class stdClass could not be converted to string in D:\xampp\htdocs\project\wp-content\plugins\yd-profile-visitor-tracker\inc\pvt.inc.php on line 393
plz can u take me out of this?
le 2 July 2012 à 10:38 h
Hello,
I’ve added your plugin to my site and it throws the following error:
Warning: strip_tags() expects parameter 1 to be string, array given in MYPATH/wp-content/plugins/yd-profile-visitor-tracker/inc/pvt.inc.php on line 392
According to your instructions I’ve modified line 392 like this:
$data[‘wp_’ . $key] = strip_tags( (string) $value );
But now it’s throwing this error:
Catchable fatal error: Object of class stdClass could not be converted to string in D:\xampp\htdocs\project\wp-content\plugins\yd-profile-visitor-tracker\inc\pvt.inc.php
Please can you provide us with a solution?
Kookidooki.
le 28 August 2012 à 16:19 h
Hello,
Thank you for this great job, the plugin works perfectly on my website with buddypress 1.6.2. The plugin do exactly what I want : see members who have visited my profil.
I want to hide or remove my user of the list of users who visited my profile. I have try by myself but I don’t find how to do it.
Thanks again,
Julien
le 19 September 2012 à 1:13 h
If you want to contribute to a translation of this plugin, please drop me a line by e-mail or leave a comment on the plugin’s page. You will get credit for your translation in the plugin file and the documentation page, as well as a link on this page and on my developers’ blog.
==================================================
If it is right, tell me, I will help you to translate. for English – Russian, French – Russian. Send the job to my mail. gafforov.hamid @ mail.ru
le 18 October 2012 à 16:59 h
Is it possible to delete my own username of the list of members who has vidited my profile ?
Ary
le 24 October 2012 à 16:03 h
Hello Yann,
Great plugin! I’m using the template code for the profile page.
Can you please provide us the php-code for the template tag just like you did on the third screenshot.
Just like your 3rd screenshot I would like to display the visitor’s avatar, First and Last name, date, number of visits and the friendship- and message buttons.
And how do I add the header: “Visitors of my profile” on top of the box?
Thanks,
Kookidooki
le 28 October 2012 à 4:31 h
Yann, je suis un utilisateur de base et créé avec grande difficulté un site Web. J’ai installé le plugin, mais je ne peux pas le mettre au travail. J’ai tout essayé, mais en vain. Vous pourriez me montrer une "étape par étape"? Je vous remercie! Mauro Blanco.
le 4 December 2012 à 16:54 h
bonjour, voila le message que je recois apres avoir cree la page visites
Catchable fatal error: Object of class stdClass could not be converted to string in /home/peoplewi/public_html/wp-content/plugins/yd-profile-visitor-tracker/inc/pvt.inc.php on line 392
que dois je faire?? merci
le 4 December 2012 à 17:38 h
@nathou
C’est une incompatibilité, soit avec un autre plugin, soit avec une version récente de BuddyPress.
Je peux vous proposer d’essayer cette correction, juste avant la ligne 392 du fichier pvt.inc.php, insérer :
if( !is_object( $value ) )
le 9 February 2013 à 20:42 h
Hi,
How can I exclude the current user from being displayed?
Thanks for your help!
le 9 March 2013 à 2:26 h
Hello Yann,
I’ve just found your plugin for tracking profile views, and i’m wondering if it can be used on a standalone WP site to track/show logged-in user visits to either posts or pages created by other users?
I’d be happy enough to start looking at the code if it’s feasible with some modifications? but thought i’d run the idea past you first.
All the best,
Mick
le 12 March 2013 à 17:27 h
@Michael:
I have not looked into the code of this plugin for a long time, but I believe it is indeed feasible with some modifications. If I remember well, the plugin was designed to support both regular WordPress users and BuddyPress/bbPress community or forum members, so there’s a good chance that part of what you need is already available “out-of-the-box”. You should give it a try.
le 29 September 2013 à 0:12 h
I have problem with functionallity. I created a page named visitors, and placed shortcode, but plugin lists me all visitors who browsed activity page, even if they weren’t opening anybodys profile page. any idea how to fix this?
le 19 November 2013 à 15:51 h
Fatal error: Call-time pass-by-reference has been removed in /data/home/miamourd/public_html/wp-content/plugins/yd-profile-visitor-tracker/yd-profile-visitor-tracker.php on line 174
le 19 November 2013 à 15:57 h
@alok: yes, this version of the plugin is not compatible with PHP 5.4. you can make it compatible easily by removing the “&” sign before variable names in function calls.
For exemple on line 174 replace &$op with $op.
You will get the same error on other lines of this file and of inc/yd-widget-framework.inc.php. The fix is the same: remove the & sign eg. &$this -> $this, etc.
Future versions of the plugin will be made compatible with PHP 5.4, but I have no time to release a new version right now.
le 21 November 2013 à 15:24 h
Hi can i know are you using any table to not , if yes so what is the table name … Can i have details on this ?
le 22 November 2013 à 13:02 h
@Alok : no specific tables. All data is stored in WP/BP native data structure.
le 7 January 2014 à 14:43 h
Hi!
It works like a charm when using it with admin-profile (or any other “paid profiles” using Paid Memberships Pro). Otherwise it says that “you need xxx -level membership…”… Is there any easy solution which forces it to be shown to everyone?
Thank you!
le 11 June 2014 à 16:43 h
Bonjour,
Merci pour ce plugin ! J’aurais aimer savoir si il est possible d’avoir des notifications dans buddypress des dernières visites ? avec le nombre qui s’affiche ? Ah et j’ai aussi un problème je ne sais pas pourquoi mais le plugin prend en compte mes propres visites sur le profil ! Comment faire pour qu’il ne le fasse plus ?
Merci beaucoup,
Nick
le 31 July 2014 à 9:43 h
Hi, has anyone an idea to include a notification, if anyone visits my profile?
Sorry for my english.
Best regards, Hymza
le 12 December 2014 à 5:38 h
Hi,
I like the idea of your plugin and wanted to use it for my site, but when I tried to activate it, it gave me an error:
Plugin could not be activated because it triggered a fatal error.
Fatal error: Call-time pass-by-reference has been removed in /home/themajes/public_html/thelovezone/wp-content/plugins/yd-profile-visitor-tracker/yd-profile-visitor-tracker.php on line 174
Any suggestions?
le 12 December 2014 à 12:31 h
Hi Da’Ron.
This plugin is a bit old now and it has not been maintained for years due to lack of time. This is why it has become incompatible with the latest versions of PHP. However, you can easily make it compatible by editing the plugin’s php files and remove the & sign each time you find a variable like this:
&$this
replace it with:
$this
(just remove the & sign at the beginning)
A search and replace can do this quickly.
Once the &$ have been replaced by simple $ this error will disappear.
However the plugin has not been tested wis recent versions of WP / BP. So if you do it please let us know if this is successful.
Thanks.