Support » Plugin: bbPress Pencil Unread » Great plugin!

  • The idea is great and the implementation is also very nice. I like the minimalistic simple bar in front of the forums.

    However, it doesn’t seem to work that well on my site. Many board keep the coloured bar (as if there are unread topics) but there are no unread topics left. This happens to me as an admin using Chrome and also to my fanatic test-user and coffeemaker/girlfriend as a regular user using Safari.

    Is there something that needs to be set regarding caching or anything?

    I really would like to get this thing to work!


    Great support. After reporting the problem and troubleshooting a bit, the plugin was updated with a fix within a few hours!

    Doesn’t work for my BuddyPress forums yet, but I’m sure we’ll get that fixed also! 😉

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author grosbouff


    Ruben; thanks for the review.
    It’s working quite fine on my website (
    I’m interested by your feedback. Could you tell me more ?
    Could you read the ‘how does it work’ section of the FAQ and see it it match the way it works on your forums ?
    How much users do u have ?
    Have you custom templates on your forums ?

    Thread Starter Misophoniq


    Hi, thanks for replying.

    My forum is very small, virtually non-existing. There’s just a handfull of users. But I think I’m staring to realise a few things that are causing problems.

    First, I have a mixes setup of regular forum board (bbPress style) and boards that belong to a BuddyPress group.

    Second, I have users authenticating to the site using Facebook or other social networks.

    I also noticed that the plugin doesn’t seem to work for the BuddyPress boards at all, but it does work for bbPress boards.

    For topics, it seems to work only if the user places a reply in the topic, not when just reading it.

    Anyhow, going to do some extensive testing in a few hours. I will then place and read messages in different types of board, using different types of user authentications and monitor exactly what is going on in the SQL regarding values stored in the database.

    BTW, the board is at

    I’ll report back to you what I found out in a few hours.

    Plugin Author grosbouff


    Ok, if you know a little about php and how WP plugins works, please have a look at the function ‘logged_in_user_actions’ in the file bbpress-pencil-unread.php. You will see on which hooks functions are linked to, eg

    • wp
    • loop_end
    • bbp_new_topic_pre_extras
    • bbp_new_topic
    • bbp_new_reply_pre_extras
    • bbp_new_reply

    You need those hooks to run for having the plugin working. On a clean install of WP+BP and with the default templates, it works fine.

    Thread Starter Misophoniq


    I was actually reading through the bbpress-pencil-unread.php file the very moment your message came in. 🙂

    I did extensive testing on my board and so far the markers for topics (on a normal bbPress board) work perfectly fine. The marker for the board itself does not work at all. I’ll let you know when I found out why. 😉

    Thanks for the feedback on the hooks.

    Thread Starter Misophoniq


    I’ll do a test with the default theme first, maybe the problem is just with the theme. 😉

    Thread Starter Misophoniq


    I found it! Oh my God, you’re never going to believe how simple and obvious the problem was! 😀

    After extensive testing I was slightly going out of my mind because both the last activity fields for the board and the last time the visitor visited the board were always updated in the MySQL database. Yet the routine that rendered the read/unread class decided that the board was unread.

    I figured there must have been something wrong in the decision whether or not the visitor visited the board before or after the last time it was updated.

    As a last resort, I decided to modify your script so that it would output all values that were used as HTML remarks inside the source of the page, so I could debug what values were used to make “decisions” in your script.

    Than it finally became clear. It’s a freakin’ timezone problem! 😀

    The routine that updates the time the board was last active is handled by bbPress and takes in account the timezone settings of WordPress.

    The routine that updates when the user was last in a board is handled by your script, which doesn’t account for timezone settings.

    So when I was extensively testing the debug board, I would post a message in the board at around 13:15 local time. So bbPress would update the last activity in the board accordingly, setting is around 13:15.

    However, YOUR script would write my last active time in that board as 11:15. So even when nothing was happening in the board at all, 15 minutes later my last activity might have been 11:30 (according to your script not accounting for the timezone), but the last activity in the forum would still be at 13:15, which would still be much later than the time I last visited the board according to your script so it was decided there was something unread in there.

    This WOULD have been “fixed” if nothing happened in the board at all for at least two hours and I would then visit the board again. THEN my last visit would have been AFTER the last activity, even though the time for my last visit was still two hours off from the REAL time I visited the board. Because I have been testing and moving so much and extensively, there wasn’t any board untouched for at least two hours. I DOES explain though how sometimes the script appeared to work and sometimes it didn’t. The times it DID seem to work would have been after visiting a board with no activity at all for at least two hours.

    I paid a little visit to your board to see your timezone and it seemed that you have none. So that would explain why you don’t have this problem. The time you last visit a board (written by bbPress) will be the same as the last activity for the user in that board (written by your script).

    So, if you’re planning on updating this script, it should read the timezone settings from the WordPress config and take that in account when writing the time a visitor was last active in a board, since this is what bbPress does with the time you use for comparison. If you are noting going to update your script, I’ll see if I can figure it out. For now I just set the timezone of my board to GMT, because it’s an international board anyway, not bound to my local timezone here.

    Next step will be trying to figure out why your script is working okay for the “classic” bbPress style forums but not for my BuddyPress style “group forums”. I’ll keep you posted!

    Plugin Author grosbouff


    Alright !!! Thanks for the debug; waouh !
    Well, I (should) have fixed this in 1.0.2.
    Please update and tell me what !

    Thread Starter Misophoniq


    That was quick! Great support man!

    I’ll test it as soon as I’m finished finding out why it doesn’t work on my BuddyPress forums yet. Don’t want to change my settings now since I know how the plugin behaves so far. I’ll update you as soon as I figured it out. Thanks for the quick response!

    Thread Starter Misophoniq


    Okay, found the problem, just not a solution yet. 🙂

    Even though standard bbPress and BuddyPress forums have the exact same structure in the MySQL database, the function update_topic_read_by() doesn’t get a topic_id returned from the bbp_get_topic_id your script is calling. I took a quick look at the bbPress template-tags.php where this function is loaded, but I can’t really figure out why it’s refusing to return a topic_id for BuddyPress Group Forums.

    Since the topic_id is exactly the same as the WordPress page_id, I tried to write a small code to grab the page_id instead, but I can’t get it to work. Apparently BuddyPress seems to be using it’s own “forum loop” rather than the default WordPress loop, so I couldn’t find any way to grab the page_id for BuddyPress forums. It works for bbPress forum, but that’s useless since that’s also already working using your call for the topic_id. I’m using nice permalinks, so I can’t grab the page_id from the URL.

    I think I’ll dig in a bit deeper when it’s not so freakin’ hot! This isn’t really “your problem” since your plugin seems to be working fine for WordPress and bbPress, for which it is intended. I’m a virgin when it comes to plugins and bbPress and BuddyPress, so this will probably take some time. I think I pretty well know all the ins and out of WordPress, but bbPress and BuddyPress code is still one huge digital maze for me. 😉

    And yes, since your latest update, your plugin is working just perfectly for the standard bbPress forums. Thanks a lot for that! 😀

    Plugin Author grosbouff


    Thanks to you, I will never have figured out…
    Well, I’ll have a look at Buddypress. I just installed the 1.8 beta (there is new stuff about templates in it); i’ll have a look. Maybe it would be better to start off a new topic in the forums..
    PS : thanks for having changed your rating about the plugin !

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Great plugin!’ is closed to new replies.