WordPress.org

Ready to get started?Download WordPress

Forums

WP SlimStat
[resolved] Need help with widget (16 posts)

  1. Moogle Stiltzkin
    Member
    Posted 3 years ago #

    this is my website http://mognet.no-ip.info

    If you look to the bottom right in the side bar, i added your sidebar widget plugin for slimstats using a php widget.

    I saw your manual for the codes to use, but i am unsure which ones to use for output i need.

    Mind telling me which to put please :}

    Total Visitors: ?
    Visitors Today: ?
    Currently Online: ?

    Also because i want to show the total visitors ever to come to my site, you said something about it being cut off ? Is there any solution to that so that the total visitors doesn't get reset after time ?

  2. camu
    Member
    Plugin Author

    Posted 3 years ago #

    Hi there,

    sorry for the confusion, the manual on my forum is outdated, I need to rewrite it to reflect the changes I've done to the library. Do you want to display "human" visitors or visitors in general, including bots?

    As for the "total visitors ever", WP SlimStat does not keep a separate counter for that, it relies on what it's in the main database. You may want to customize the source code to do that, storing the information in an option field.

    Camu

  3. Moogle Stiltzkin
    Member
    Posted 3 years ago #

    Yo waddup ?

    Oh, all just humans only.

    Hm .... ok so i get that it can only show whatever is available in the database, so can we set the database to keep the stats indefinitely ?

    Well i guess that may not be the best thing to do, since it keeps all sorts of info like where they came from yada yada .... so for those kinds of info i don't mind purging every year, but the data i want to keep is such a headcount of how many visitors ever visited the site.

    Like e.g. say this year i got 5000 visits, then at the end of the year the purge action happens, then your starting from 0 !!! i don't like that. I suggest that we keep the headcount values, but we purge everything else associated with those people. We may want to also keep the data such as

    1. IP ADDRESS
    2. countries these people are from in the World map graph
    3. the values in the slimstats chart showing how many people visited on that day, week, month, year etc

    Would it be possible for the purge option to have a filter what values to keep ?

    Best regards,

    - Moogle

  4. camu
    Member
    Plugin Author

    Posted 3 years ago #

    Would it be possible for the purge option to have a filter what values to keep ?

    Hi there,

    unfortunately this is not how my plugin works. As I said, you may want to customize my plugin to keep track of that information in a separate place, so that it doesn't get removed when the database is purged. If you do that, please post your solution, I may decide to implement it in the next version!

    Camu

  5. Moogle Stiltzkin
    Member
    Posted 3 years ago #

    i would but sadly i'm not a programmer :{

    clicking from wordpress to add a plugin and enable is one thing, and programming some feature is another thing entirely :{

  6. camu
    Member
    Plugin Author

    Posted 3 years ago #

    I see, unfortunately this is not a priority right now, unless a lot more users will request it. I'm currently working on other aspects of my plugin, like color-coded rows, jquery integration, etc.

    Best,
    Camu

    PS: a vote for my plugin would be a nice way to show your appreciation!

  7. Moogle Stiltzkin
    Member
    Posted 3 years ago #

    No rush man, take your time :}

    For the most part i am very happy with slimstats.

    Keep in mind i came from using Kstats Reloaded which was a resource hog. So slimstats was a very nice change.

    I just wish i could update the widget to show the currently only visitors :{

    *voted

  8. camu
    Member
    Plugin Author

    Posted 3 years ago #

    I will update the online docs as soon as I get back to work on Tuesday :) stay tuned!
    Camu

  9. Moogle Stiltzkin
    Member
    Posted 3 years ago #

    No rush bro :} take your time.

    I'm also kinda working on my download section. Almost got it ...

  10. camu
    Member
    Plugin Author

    Posted 3 years ago #

    Cool. That's kind of easy, just add some javascript code to the download links you want to track and you're done.

    Camu

  11. camu
    Member
    Plugin Author

    Posted 3 years ago #

    Hi there,

    I just updated the online documentation that describes how to use my library to retrieve the information from the database and display it on your site.

    Total Visitors: ?
    Visitors Today: ?
    Currently Online: ?

    Solution:

    // Instantiate a copy of the class:
    $wp_slimstat_view = new wp_slimstat_view();
    
    // Today = from midnight to midnight
    $today_from = strtotime(date_i18n('Y').'-'.date_i18n('m').'-'.date_i18n('d').' 00:00');
    $today_to = $today_from + 86399;
    
    echo 'Total: '.$wp_slimstat_view->count_records('visit_id > 0');
    echo 'Today: '.$wp_slimstat_view->count_records("visit_id > 0 AND dt BETWEEN $today_from AND $today_to");

    As for 'currently online', as you may know that's something that technically cannot be tracked, because HTTP is a stateless protocol. What you can do is to define an interval, let's say 5 minutes, and show how many visits have been done in the last 5 minutes.

    Camu

  12. Moogle Stiltzkin
    Member
    Posted 3 years ago #

    You mean here ?

    http://lab.duechiacchiere.it/index.php?topic=2.0

    Just read it.

    It says you have to edit template, where it doesn't quite tell you o.o;

    I just only want to add it as a widget.

    I'm using php widget that allows adding code, but using that code you just posted, apparently it doesn't work :{

    I have the following installed

    WP SlimStat 2.4.2
    http://wordpress.org/extend/plugins/wp-slimstat/

    WP SlimStat Dashboard Widgets 2.4.2
    http://lab.duechiacchiere.it/index.php?board=1.0

    WP SlimStat ShortCodes
    http://lab.duechiacchiere.it/index.php?topic=2.msg2#post_shortcodes

    slimstats has widget done separately by means of the shortcodes add on.

    But even then, it doesn't quite give you a widget, it only adds support to use code to display widget. You need to add the regular wordpress text widget, then add the code.

    For me i use another plugin that also accepts php/txt and other coding to be used.

    Problem is i need to know the short code to add the stuff mentioned.

    Dashboard plugin doesn't seem to display anything :/

  13. Moogle Stiltzkin
    Member
    Posted 3 years ago #

    This is the code i am currently using

     
    <p>
    Total Visitors: <!--slimstat:count_all_visitors-->
    <p>
    Visitors Today: <!--slimstat:count_new_visitors-->

    The total count is straight forward, although maybe i will need the filter method to display visits all time without being cut off eventually.

    The visitors today, i don't think it is accurately giving me the unique visitors for today :[

    As for the Currently online users, i understand that there are limitations, so best that can be done is to show how many users were online in the last 5 minutes or so. This is fine, except that i have no clue how to add this.

  14. camu
    Member
    Plugin Author

    Posted 3 years ago #

    It says you have to edit template, where it doesn't quite tell you o.o;

    I can't tell you WHERE, because each template is different. There are thousands of themes out there, it would take years to write a manual to include all of them :) Unless you can borrow me your magic crystal ball so that I can see users' themes without having access to them.

    Anyway, jokes aside, if you're using WP SlimStat Shortcodes, you don't need a PHP widget, a text widget will suffice. You will need to create a filter in order to display the number of visitors for the day. But you actually gave me a good idea: I will add this new shortcode to the plugin (visitors today), so that it will be easier to use, ok?

    As for Current Users Online, same thing, it's not currently supported in WP SlimStat Shortcodes, but I can add that too! :)

    Stay tuned, I may release a new version later today.

    Best
    Camu

  15. Moogle Stiltzkin
    Member
    Posted 3 years ago #

    Camu i found a plugin which adds current visitors

    http://codecanyon.net/item/5sec-whos-online/156016

    But your solution like visitors in last 5 seconds is the same i reckon.

    But their plugin they already add the code as a default widget template.
    [img]http://s3.envato.com/files/1517775/02_5sec_whos_online.png[/img]

    I eagerly await your releases *deep bow

  16. camu
    Member
    Plugin Author

    Posted 3 years ago #

    Yes, the new version will do the exact same thing :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic