Skip to:
Content
Pages
Categories
Search
Top
Bottom

Problem with the Forum Statistics widget


  • Chuckie
    Participant

    @ajtruckle

    At the bottom of my forum page I am using the Advanced Statistics plugin and it shows the following statistics:

    View post on imgur.com

    I wanted to try and display this widget in my second sidebar but for some reason it refused to display. So I thought I would try the bbPress Statistics widget instead in my aisebar and that works:

    View post on imgur.com

    I don’t understand some of these statistics though.

    Registered Users – the same 189
    Threads – the same 163
    Topics / Replies – I understand this to be the split down equivalent of Pots 556.
    Forums – why does it say 2?

    Does not make sense.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Usually for forums, ‘posts’ count includes both topics and replies, and in this case, that is true (163+393 = 556). As for the forums, do you have more than 2 forums created? This is an official bbPress widget, so the count should be correct.


    Chuckie
    Participant

    @ajtruckle

    These are my forums:

    View post on imgur.com

    General Information is public.
    Frequently Asked Questions is public

    That amounts to 2.

    The rest are all private. But even when I am logged in it says to.

    Even the At a Glance area says 2:

    View post on imgur.com

    Yeah, that is correct, the widget uses WordPress function that counts only published forums (in this case, that is only public visibility), the rest is not counted for this widget statistics.


    Chuckie
    Participant

    @ajtruckle

    But is simply does not make sense. WordPress / bbPress should return public count if not logged on and complete count if logged on – surely. It is false and misleading.

    If they are only listing just the public content then the rest of the figures should match that.

    Not to worry.

    Can we change the terms at all so that they are more consistent with the advanced stats?

    Side point: I put a query in your GD Power Search forum 🙂

    Thanks!

    My GD bbPress Toolbox Pro has a more advanced statistics widget, but I have checked there, and I did the same thing, so only public forums are counted. And, some in case of hidden forums, they are visible to keymasters only. Your idea about logged and not logged-in users is great, and I will update my plugin to reflect that better for the release next week, and I will expand list of statistical information to include different variations of this count.


    Chuckie
    Participant

    @ajtruckle

    Sounds cool. Unfortunately I am not in a position to purchase the pro versions at the time. But it will be a good change for your users. Well done. 🙂


    Chuckie
    Participant

    @ajtruckle

    I used bbp style pack to rename Registered Users as Members. 🙂

    Yeah, ‘members’ sounds much better, I never liked the ‘users’ that is the norm in WordPress. I have created a plugin GD Members Directory that adds a new page listing all forum members with options to filter and order the list of members, and it would be good to have the change from users to members done in bbPress core too.


    Chuckie
    Participant

    @ajtruckle

    I checked the functions.php file, line 353:

    	// Forums
    	$forum_count = ! empty( $r['count_forums'] )
    		? wp_count_posts( bbp_get_forum_post_type() )->publish
    		: 0;

    So this is a bbPress issue, part of the function bbp_get_statistics. Is there anyway for me to correct this logic without modifying the core …?

    That function has a filter at the very end ‘bbp_get_statistics’ where all the data gets filtered, so you can hook that filter, and modify what you need.

    For my plugin, I have written a new function, because I needed more data, and I implemented short term cache to avoid expensive calculation each time it needs to be displayed.


    Chuckie
    Participant

    @ajtruckle

    That is interesting to know. I didn’t realise there was a filter.

    The logic you describe sounds sensible. I have had to cache values in my InnoSetup installers for performance reasons too.

    Maybe one day I will have a look at this and see if I can write a hook. Is it documented? For example, how do we know what the function definition should be in the php file?

    Some of my plugins really heavily on different caching methods to make sure that things are optimized and fast. And, many things in bbPress are not very optimized due to the nature of data storage used by WordPress, so whenever I can use the cache, I do it.

    As for the statistics function, I am not sure exactly what it returns, I use my function which is quite different, but from what I remember, it returns an array with pairs including labels and values.

    Milan

Viewing 12 replies - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.
Skip to toolbar