WordPress.org

Ready to get started?Download WordPress

Forums

Having trouble w/too many hits/StatTraq help (9 posts)

  1. thepete
    Member
    Posted 9 years ago #

    Lately I've been noticing the amount of hits and users on my site growing. It's been fairly gradual and sometimes my hits/users drop off only to slowly rise back up. However, I was checking my StatTraq page and found that I had gotten 3000 users in about 8 hours. This is completely unheard of for my site during the week and today is Saturday. I've been getting hit by some referral spammers, but they haven't managed to post any comment spam thanks to the Spam Stopgap plugin that I use. I also managed to block a good number of referral spam sites with an htaccess file but doing it that way is a literal game of whack-a-mole. I was wondering if anyone would mind looking at my stats by going here:
    http://thepete.com/wp-stattraq/index.php

    I set it so that anyone can view it. Anyway, my guess at this point is that I've got the same referral spammer hitting a buttload of pages on my site all at once for a single time from different IPs. The thing that I don't know is--how can the spammer have so many unique IPs? When StatTraq refers to "users" it does mean unique users, right?

    Could it be that I'm getting that much actual traffic? On a Saturday morning, no less?? ANY advice would be greatly appreciated. Thanks in advance!!

  2. lawtai
    Member
    Posted 9 years ago #

    wow that's really slow. you should go into your database and clear out some of the database for stattraq as it tends to get very large very quickly. i looked at december and it seemed like you were getting hits in the 1000's so maybe it's not too unrealistic for you to be actually getting that much traffic?

  3. Glo
    Member
    Posted 9 years ago #

    All of the referrals with the tecrep-inc.net/ domain (IP 219.150.118.16
    ) are from one spammer as is the 12.163.72.13/. Just put this code at the top of your index.php between the < ?php and the ?>

    if (strpos($HTTP_REFERER, ‘ttp://’) > 0)
    {
    $pieces=explode("/", $HTTP_REFERER);
    $lookup = gethostbyname($pieces[2]);
    if ($lookup == “12.163.72.13″)
    {
    syslog(LOG_ALERT,"redirected $pieces[2]");
    header("Location: � . $HTTP_REFERER);
    exit();
    }
    if ($lookup == “219.150.118.16″)
    {
    syslog(LOG_ALERT,"redirected $pieces[2]");
    header("Location: � . $HTTP_REFERER);
    exit();
    }

    }


    This code is supposed to redirect the referral back to the spammers domain. Don't know if it works but it has stop the spammer from using my bandwidth. He/she has stopped trying to hit my index page and is now hitting my static, feeds and login pages. I added the same code to those pages and he isn't getting any of my bandwidth. The same is true for several other blogs I manage.

  4. thepete
    Member
    Posted 9 years ago #

    Thanks for the advice Lawtai, I'll see if I can try to clear out the StatTraq db--but doesn't that mean I lose the stats for earlier months? I guess I should ask exactly what you mean by clear out before I go and do something stupid.

    Thanks for the code, Glo--not sure what's up, but I keep getting parse errors when I put it in my index.php. Does it go in the head or the body? Would the proper format be like this:
    <?php

    if (strpos($HTTP_REFERER, ‘ttp://’) > 0)
    {
    $pieces=explode("/", $HTTP_REFERER);
    $lookup = gethostbyname($pieces[2]);
    if ($lookup == “12.163.72.13)
    {
    syslog(LOG_ALERT,"redirected $pieces[2]");
    header("Location: � . $HTTP_REFERER);
    exit();
    }
    if ($lookup == “219.150.118.16)
    {
    syslog(LOG_ALERT,"redirected $pieces[2]");
    header("Location: � . $HTTP_REFERER);
    exit();
    }

    }

    ?>

    Or should I stick it inside this tag:

    <?php
    /* Don't remove this line. */

    require('./wp-blog-header.php');

    ?>

    Sorry, these feel like n00bie questions to me, which I always apologize for. Thanks again for the help from both of you!

  5. Glo
    Member
    Posted 9 years ago #

    thepete, you need to put the code between the existing <?php and ?> the way you have it there are 2 <?php and ?> Just put the code after
    require('./wp-blog-header.php');
    Do not add another <?php and ?> in the code.

  6. thepete
    Member
    Posted 9 years ago #

    Alas, that still doesn't work. I did exactly as you said and got a parse error on line 5. Looks like it's back to whack-a-mole! Thanks anyway, though. I do appreciate it!

  7. Joshua Sigar
    Member
    Posted 9 years ago #

    missing closing quotes for the ip address here

    if ($lookup == “12.163.72.13)

    and here

    if ($lookup == “219.150.118.16)

  8. thepete
    Member
    Posted 9 years ago #

    Cool, thanks for your help! I'm trying to find specific instructions on what to delete from stattraq, but can't find any...

  9. John
    Member
    Posted 9 years ago #

    Install my wp-advacned-stats 0.7, it will show your the ip of online users so you can block them.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.