Check how many people use my plugin

Discussion in 'Plugin Development' started by vcazan, Jul 27, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    vcazan

    Title pretty much says it all, is there anyway to know how many people are using my plugin on their servers?

    Has anyone written any code I can use to put in my plugin to show me how many people start servers with my plugin.

    I can use # of downloads but I still don't know how many people actually use it.

    Thanks!
     
  2. Offline

    wwsean08

    the best idea I have for this is to have a database, and on the server startup, while your plugin is being enabled it sends the server name or something like that to the database, and if it doesn't exist already, add it. Then every once in a while you could clear the database and find out how many people are using your plugin and be able to remove ones that aren't with the clearing of the database. This may not be the best method, but it's the best I can come up with off the top of my head.
     
  3. Offline

    EternityCoder

    Well, you could do it with a PHP web backend... Here's some general code:

    In your plugin, you could just use the following Java in onLoad:
    PHP:
    URL url = new Url("http://www.mysite.net/registerPluginUsage.php");
    url.openConnection();
    And for the PHP page, just have it get the IP the request is coming from (The IP of the server) and if it's new, add it to a list, or use a database, or something like that.

    Hope that helped!
     
  4. Offline

    vcazan

    Thanks for your help, I will try and implement this ASAP and share with all.
     
  5. Offline

    desht

    Seriously bad idea - this is a privacy violation. Don't do it, especially if you haven't made it VERY clear to your plugin users exactly what is being sent, and give an option not to send anything.
     
    cholo71796 likes this.
  6. Offline

    vcazan

    I dont understand what privacy violation this makes. There are tons of plugins that takes your geo data and puts it on a real world map. Now isn't that a privacy violation? I just want to have a hit counter on the plugin load. I dont want to send any other data except the number 1;
     
  7. Offline

    nickguletskii

    Statistics should be optional. Learn from Google.
     
    chernobyl360 likes this.
  8. Offline

    desht

    If you are just sending aynonymized usage stats with user consent, that's ok. But unauthorized collection of any personal data (including server IP's) is a problem, not to mention illegal in certain jurisdictions.
     
  9. Offline

    vcazan

    You have a plugin called Spyer, if thats not a privacy issue then I dont know what is.

    Yes all calls will be aynonymized, I wont know what server it will come from only that it loaded. On unload I will take away a 1 from the total connected servers.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  10. Offline

    desht

    Won't you? Where is your published privacy policy on what your web server does with the logged connection data?
     
  11. Offline

    cholo71796

    @vcazan The Spyer plugin allows you to turn invisible. That argument is so poor.
     
  12. Offline

    vcazan

    So spying on people is not a privacy issue to you? I dont want people spying on me?

    Your right there will have to be some message somewhere in the plugin saying that this data(ip,locaion etc.) will not be logged.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  13. Offline

    Taco

    Out of curiosity, does using a goo.gl url to keep track of downloads violate that whole "No url shorteners" rule? If It doesn't, then I seriously want to implement that. I'm curious as to how many downloads my plugins get.
     
  14. Offline

    Supersam654

    @Taco I believe in that post about adf.ly, they said that adf.ly is forbidden, and they strongly discourage the use of URL shorteners. However, it is not forbidden (yet)
     
  15. Offline

    CptSausage

    Back to the topic: Beside that I don't understand why you would need such data, I don't see any way to get reliable statistics. If you just parse your "1" what does it mean?
    Just that someone with your plugin started his server. So if you count 100 in an hour... well, that could have been my testserver 100 times or 100 diffrent servers.

    Even if you log the ip. There are still tons of ppl who have a little private server with a non-static ip. Really... I don't see the point.
     
  16. Offline

    Supersam654

    I have to agree with @CptSausage on this one. Although it would be nice to know who is using your plugin, it really is a pain to track when you think about it. Besides, as everyone here has expressed, it is also a HUGE privacy issue as @nickguletskii put is "Statistics should be optional. Learn from Google." Perhaps you should just get a rough estimate of how many people use your plugin based on how many comments have been made on it. (take a look at permissions and realize that almost every bukkit server ever has used it - I believe the thread is roughly 200 pages).
     
  17. Offline

    vcazan

    To explain, I will have a mySQL database with one value. When the plugin gets enabled, I will add 1 to that number in the database, when the plugin gets disabled, I will take 1 from that value. That way that number will represent the number of current servers using my plugin.

    Does that make sense? No I.P no statistics will be stored, they don't need to be.
     
  18. Offline

    Supersam654

    Plugins don't always get disabled. Basically, when a server is force restarted, its like the power goes out and comes back on. This will cause your counter to always be higher than what the actual statistic is and the gap between your number and the real number will continue to increase as time goes on.
     
  19. If your concerned about privacy then you could just digest the server IP into an MD5 hash or another 1 way hashing algorithm. This way you could still track usage and anonymity would be preserved.
     
  20. Offline

    cholo71796

    It's for maintaining order.
     
  21. Offline

    Drakia

    Just be warned, if you are going to do this, you have to state EXPLICITLY in your plugin topic that you do. And you should most definitely give an option of disabling this phone-home feature.
     
  22. Offline

    nickguletskii

    Ha ha, you didn't even read what it does. All it does is makes the administrators invisible to users.
     
  23. Offline

    mindless728

    I agree with all of you that are saying that this should be explicitly stated in the plugin topic, however he shouldn't have to make it optional as its his plugin, as long as he tells the people what he is collecting then it is their choice to download the plugin or not

    personally i don't like collecting data like this, though i have been thinking about it to help fix problems in the plugin
     
  24. Offline

    DrBowe

    Honestly, this wouldn't even be an issue if DropBox would take 5mins one day and implement download-tracking...
    It's kind of ridiculous that they haven't already. >.>

    EDIT:
    And yes, I know this is about 'usage', not downloads. But I feel like a download-tracker would be sufficient. I suppose the google url-shortener method works.
     
  25. Agree 200% :D

    EDIT: I've even e-mailed them about this before :p
     
  26. Offline

    DrBowe

    @Adamki11s
    Yeah, every time I get my new shipment of votes, it goes straight to the one suggestion for stat-tracking

    I honestly DO NOT understand why they haven't implemented (what I think would be) such an easy-to-add feature.
     
  27. I know, all they would need is a few php scripts and a database which they already have.
     
  28. Offline

    CptSausage

    Hm I think that's still not the best solution, because if you shut down your server with the "X" it won't run through the "onDisabled" method.
    Maybe request a unique code from your server at the first start up. Save it and track this number. There is still a way this can screw up, but it's better than the +1 -1 thing imho.
     
  29. Offline

    vcazan

    Thanks for the suggestion, This with a MD5 hash is something that I am considering.
     
  30. Offline

    Nitnelave

    You should still provide a wget friendly link. Some people only use that, and it is crucial for CraftBukkitUpToDate, if you want to be referenced. and I think the the new BukkitUpToDate plugin wouldn't appreciate either.
     
Thread Status:
Not open for further replies.

Share This Page