ePrivacy and GPDR Cookie Consent by Cookie Consent

Spiders txt bug fix

Spiders.txt bug fix

Spiders.txt bug fix Download Summary

  • Language: PHP
  • Platform: Windows / Linux / BSD
  • License: GPL - GNU Public License
  • Databases: MySQL
  • Downloads: 307
  • Released: Jun 15, 2007

Spiders.txt bug fix Description

When the code in includes/application_top.php was written, it was assumed that spiders and bots do not accept cookies. Today, this is no longer true and more and more spiders and bots are accepting cookies in the search for more web content.

When a bot accepts cookies it gets a session and next thing you know it is adding products to your shopping cart. In the worst case the spider or bots can get lost in your shopping cart going round and round in circles. To see this happening I recommend you install the Who's Online Enhancement (homepage The fix to this is simple :-

in includes/application_top.php find the following code :-

$session_started = false;
if (SESSION_FORCE_COOKIE_USE == 'True') {
tep_setcookie('cookie_test', 'please_accept_for_session', time() 60*60*24*30, $cookie_path, $cookie_domain);
if (isset($HTTP_COOKIE_VARS['cookie_test'])) {
tep_session_start();
$session_started = true;
}
} elseif (SESSION_BLOCK_SPIDERS == 'True') {
$user_agent = strtolower(getenv('HTTP_USER_AGENT'));
$spider_flag = false;

if (tep_not_null($user_agent)) {
$spiders = file(DIR_WS_INCLUDES . 'spiders.txt');

for ($i=0, $n=sizeof($spiders); $i<$n; $i ) {
if (tep_not_null($spiders[$i])) {
if (is_integer(strpos($user_agent, trim($spiders[$i])))) {
$spider_flag = true;
break;
}
}
}
}
if ($spider_flag == false) {
tep_session_start();
$session_started = true;
}
} else {
tep_session_start();
$session_started = true;
}

and replace it with the following code :-

$spider_flag = false;
if (SESSION_BLOCK_SPIDERS == 'True') {
$user_agent = strtolower(getenv('HTTP_USER_AGENT'));

if (tep_not_null($user_agent)) {
$spiders = file(DIR_WS_INCLUDES . 'spiders.txt');

for ($i=0, $n=sizeof($spiders); $i<$n; $i ) {
if (tep_not_null($spiders[$i])) {
if (is_integer(strpos($user_agent, trim($spiders[$i])))) {
$spider_flag = true;
break;
}
}
}
}
}

$session_started = false;
if ($spider_flag == false) {
if (SESSION_FORCE_COOKIE_USE == 'True') {
tep_setcookie('cookie_test', 'please_accept_for_session', time() 60*60*24*30, $cookie_path, $cookie_domain);
if (isset($HTTP_COOKIE_VARS['cookie_test'])) {
tep_session_start();
$session_started = true;
}
} else {
tep_session_start();
$session_started = true;
}
}

Thats it!

If they ever change the spiders.txt file to a php array, then it would improve the effiency in a huge way, but until that happens this is the best way to catch all spiders!

Please note: the above code does not ignore comment lines in spiders.txt (even the original code didn't). I would recommend deleting the comments out of the spiders.txt file to speed things up a touch.

free download

Spiders txt bug fix Bookmark

Hyperlink code:
Hyperlink for Forum code:

Spiders.txt bug fix Script Download Notice

Top 4 Download periodically updates information of Spiders.txt bug fix script from the developer, but some information may be slightly out-of-date.

Our script download links are directly from our mirrors or publisher's website. Spiders.txt bug fix torrent files or shared files from free file sharing and free upload services, including Rapidshare, MegaUpload, YouSendIt, MailBigFile, DropSend, HellShare, HotFile, FileServe, MediaMax, zUpload, MyOtherDrive, SendSpace, DepositFiles, Letitbit, LeapFile, DivShare or MediaFire, are not allowed!

admin customers php bug fix

The customers.php in the admin folder has a small bug for those who use ZIP 4 codes in the United States. ZIP 4 codes require a total length of 10 characters. Your customer can type in the full ZIP 4 code without any problem. However if you need to use the ...

Store Name Fix

This fix was mainly intended to be a sugestion for future versions of OSCom. Because the store name does not change often, the fix really is not worth the install but I listed anyways. ...

Whos Online Without Search Engines

This mod prevents search engines and spiders from being displayed in the Who's Online list. ... identify real visitors from the search engines and spiders which constantly filled the list so I created ... this mod should work with most versions of osCommerce. ...

phpMyVisites

phpMyVisites gives a lot of information on websites visitors, visited pages, software/hardware utilization, etc... The GUI Interface is fun and practical. The installation is entirely automated and the possibilities of configuration are extensive and automated also.Main changes and bug corrections: - new languages langues (CZ DE FI HE PL SP) 16 ...

SpamFighter

It is basicaly an attempt to stop robots, spiders and e-mail harvesting programs for grabbing your e-mail address.The code can also be used on ANY webpage you use mailto. ...