How to fix the WordPress plugin WP-SpamFree to avoid the “Your location has been identified as part of a reported spam network” error

My wife Kim is the successful editor behind At Home with Kim Vallee. She uses the WordPress platform.

With success and a popular platform, problems with comment and contact form spam becomes quickly a pain to manage. That’s why you need a good toolset to keep your sanity intact. Good WordPress plugins to protect against spamming and keep your installation secure include:

  • Akismet – protects against spam
  • Login LockDown – adds extra security to your login form
  • WP Security Scan – security
  • WP-SpamFree – extra spam protection

WP-SpamFree is quite invaluable against robots and contact form spam. However, it came to our attention that some people would see the following message instead of the contact form:

Your location has been identified as part of a reported spam network. Contact form has been disabled to prevent spam.

See the message when it would appear instead of Kim’s contact form:

image

This was really annoying. People were telling Kim they couldn’t send comments.

By chance, one PC at our office had this bug. The unique IP address assigned to our network by Videotron seemed clean. So I dug further and looked at the plugin code to understand and debug what’s happening. It seems some browsers in some configurations (in our case a particular Firefox installation on Windows XP) do not transmit the HTTP_ACCEPT_LANGUAGE variable to servers. There is a check in the WP-SpamFree plugin that identifies the visitor as a spammer if this variable is empty.

Once the problem identified, the fix is easy: simply disable this verification. The quick fix to the plugin is to modify the wp-spamfree.php file in the plugin directory to put this condition in comment. See my changes in red:

/*
            $user_http_accept_language = trim($_SERVER['HTTP_ACCEPT_LANGUAGE']);
            if ( !$user_http_accept_language ) {
                $contact_form_blacklist_status = ‘2’;
                $spamfree_error_code .= ‘ CF-HAL1001′;
                }
*/
            // Add blacklist check – IP’s only though.

            if ( $contact_form_blacklist_status ) {
                $spamfree_contact_form_content = ‘<strong>Your location has been identified as part of a reported spam network. Contact form has been disabled to prevent spam.</strong>';
                }
            $content_new = str_replace(‘<!–spamfree-contact–>’, $spamfree_contact_form_content, $content);

That’s it. No more false positives for Kim’s visitors!

I’ll send this issues to the WP-SpamFree devs.

9 thoughts on “How to fix the WordPress plugin WP-SpamFree to avoid the “Your location has been identified as part of a reported spam network” error

  1. Alan

    Hi Jerome,

    Thanks for the tip to correct the WP Spam Free Contact Form glitch! The one that warns visitors that they are part of a spam network. Anyway, at risk of appearing ungrateful, have you found a way to prevent this from happening in Safari? :-)

    The fix may have corrected the problem in FF, but while using Safari on my Mac tonight, it happened again. Any ideas? The guys from poleposition sent me here as they presently have no programmer & have not updated Spam Free! Bummer.

    Well, thanks for your time!

    • Jerome Paradis

      Hi don’t see why it happens in Safari. I don’t think it does not happen to my wife’s Safari on the same network.
      I will see what I can find out, but I can’t get to it for a couple of days.

      Cheers

  2. jo

    Many thanks for putting this fix online. When I looked to see if my site was indexed in google by using site:domainname.com, the contact form was showing with this spam network message. When I searched in google on the message, I found this page, which was a relief as I had no idea why that message was there. I have added the fix you mention to the plugin, so hopefully that will sort it.

  3. Thanks for taking the time to post this you saved me a ton of time. I had to fix my wife’s website for this issue. Aren’t they lucky to have us!

  4. alfred robinson

    Thanks a lot!
    Note, that some users (yeah, I’m among them) clears Accept-Language list just to prevent a machine-translation on some “too friendly” sites (which makes these sites almost unreadable).

  5. alfred robinson

    Huh! Your blog is checking for a presence of Accept-Language either! Why don’t you like to use your suggestions? ;)

  6. The this with these Anti Spam measures is that some times they block legit users, which will reduce your audience in the long run.

    For example today I tried to comment on a website and it blocked me with the comment “Your location has been identified as part of a reported spam network. Contact form has been disabled to prevent spam.”

    I tried commenting from IE8 since I found out from this page that it might be that, but no luck. I was again identified as part of spam network.

    And guess what, even when I submitted this comment to your website I was again presented with the same text.

    I guess I am led to believe that 4 computers at my home are a spam network after all :D

  7. I forgot to tell, you must be thinking how did I made the above comment, the answer is a VPS. :) Sorry for the spelling mistakes.

  8. Thanks this really helps. This fix helps!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>