Support » Plugins » Trying to identify plugin

  • There’s a plugin at, in the sidebar on the top, telling the user how many new items (posts and comments) have been published, and uses a cookie to track the user’s last visit. I am not sure if this is publicly available plugin or a personal hack (the webmaster there is very talented, but doesn’t openly give his email or I would have asked personally) so if anyone knows if it is, please help me put this on my website as well. Thanks in advance.

Viewing 15 replies - 1 through 15 (of 27 total)
  • There is Alex King’s Since Last Visit. I’m using a JavaScript-less one but can’t remember how to get it off his site… I think I had to search for it in the archives.

    Thank you. I tried to install this script, but I started getting errors after I started adding the first lines of code. it says:

    Step 3.

    Add this line within the <head> tags of your index.php and wp-comments-popup.php pages.

    <?php require(bloginfo(‘url;’).’/wp-content/plugins/wp-last-visit.php?type=js’); ?>

    Kubrik doesn’t have head in index.php so I tried putting it in the header.php file… then errors started coming out.

    ?ŸÑ€?¸?¼?°Ñ‚?¸?²?½?¸ ? ?°?·?¼?¸Ñ??»?¸ Ñ? RaynerApe
    Warning: main(/wp-content/plugins/wp-last-visit.php?type=js): failed to open stream: No such file or directory in c:\program files\easyphp1-7\www\wordpress\wp-content\themes\default\header.php on line 5

    Fatal error: main(): Failed opening required ‘/wp-content/plugins/wp-last-visit.php?type=js’ (include_path=’.;C:\Program Files\EasyPHP1-7\php\pear\’) in c:\program files\easyphp1-7\www\wordpress\wp-content\themes\default\header.php on line 5

    What if you tried the non-JS one (that’s a link to the zip file). I’ve got that working on my WP1.5 site (don’t remember if I ever got the JS version working…)

    Ah you found it – many thanks. But I guess I will be requiring your help a little more here, because I have near zero PHP skills. While I don’t ask for verbose step by step explanation – I guess I need some hints how to format these commands. The readme with the plugin says:


    include this code in your main page
    this must appear before any HTML has been sent


    // include functions in my-hacks.php or index.php and wp-comments-popup.php

    // set lastvisit cookie


    this functions should be called outside the posts loop:


    // show # new posts/comments banner


    these functions should be called within the posts loop:


    // show indicator if post is new

    // show indicator if comment(s) are new


    this functions should be called within the posts comments loop:


    // show indicator if a comment is new on main page

    // show indicator if a comment is new in comments pop-up page

    Yup, I remember being quite baffled about the readme. I’ll check my files to see where I’ve put the code bits… Be patient, it’s going to take a while to write the reply 🙂

    I have require_once("wp-last_visit.php"); in myhacks.php. If you don’t use myhacks.php, you can put it in header.php (before the next one — ak_set_last_visit_cookie)

    I have this in my header.php:
    <?php // set lastvisit cookie
    ak_set_last_visit_cookie(); ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    so the ak_set_last_visit_cookie() goes before everything (keep your doctype intact)

    If you don’t use popup comments you don’t need to put that “require” bit in there.

    <?php ak_since_last_visit(); ?> could go in sidebar, for example

    <?php ak_new_post(); ?> I have in my post’s metadata (date and things), you can put it anywhere inside the if(have_posts()) loop (in index.php/Main template)

    <?php ak_new_comments();?> is next to my Comments link inside the post loop, just like the previous code

    I assume <?php ak_new_comment(); ?> would go somewhere inside the commentlist (for example before “Comment by” or whatever there is), but I don’t use it so I can’t be sure of its function.

    Hope this helps 🙂

    Okay I did it. I had to <?php ?> each function, without any other changes. It went perfectly clean. I also tested it and noticed it shows a new sign even for the admin and also it doesn’t seem to disappear immediately after the topic is checked – what is the algorithm used, if you know it, and when will “new” posts and comments lose their status?

    I assume it compares the cookie timestamp to the post/comment timestamps and if post/comment stamps are newer it shows the sign. I don’t know how often the cookie is set but it’s something like ‘on every visit’ so you’d have to close the page and come back later. The interval could be longer than that, though. You can see the last set cookie in the message so you can do some research on that 🙂

    Edit It could be on hour intervals… I haven’t explored the world of cookies

    I ask because I am not sure if all is set well and if I won’t run into “permanent new” status… you know, the usual paranoia from someone who’s not very content with hacking PHP code.

    I’m sure it’s alright. That feature of not losing the New signs right away is the way it should work. Think if you lost all the new signs the instant you browsed to a site and there had been loads of new comments and posts. Not good. 🙂 Check it again tomorrow (or later today — depending on the current time of day) and I’m sure it’ll work well.

    Thanks a lot for your help. This is one of my favourite plugins – the second I saw it on I knew this is what I need for visitors who come rarely.

    I’m glad this was posted because I was trying just a few days ago and got baffled myself.

    After uploading this plugin to my plugins directory, it won’t even show in my plugin panel. Any ideas as to why that’s happening? Thinking maybe it didn’t require such activation (unusual though) I went ahead and inserted:

    <?php ak_since_last_visit(); ?>
    <?php ak_new_post(); ?>

    in my sidebar just to see what it would do. All I got was this error:

    Fatal error: Call to undefined function: ak_since_last_visit() in /hsphere/local/home/galen5/ on line 44

    So obviously I’m missing something. 🙁

    Minna – you seem to have whittled this stuff down pretty well. Does that mean users need only put the code they’re interested in where they want and still have it work?

    Actually, I think it’s not a plugin. I have it in my blog root. I have no idea where it says where to put the file, though… I must’ve seen it somewhere. Maybe with the instructions for the JS version…

    Did you remember that require_once bit as the first thing on your page (header.php) — or in myhacks.php?

    There are some restrictions as to where to put the code bits. You see them in the read me.

    Thanks, Minna. I’ll try putting it in the blog root to see if that helps. 🙂

Viewing 15 replies - 1 through 15 (of 27 total)
  • The topic ‘Trying to identify plugin’ is closed to new replies.