Advanced search  


cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.

Pages: [1]   Go Down

Author Topic: Bot Check Mod - Checks if Bots are visiting your site  (Read 13460 times)

0 Members and 1 Guest are viewing this topic.


  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 35
    • Ship Modeling Forum
Bot Check Mod - Checks if Bots are visiting your site
« on: January 07, 2007, 02:55:24 pm »

Bot Check mod Coppermine V1.4.10 (should work with other versions)

Checks to see if a USER AGENT visiting a page is a Bot as listed in a bot_array (you can add or subtract bots if you want). You can select to write to a log, botcheck (viewed in the Admin CP), send an email to Admin or do both.
Has a link in the log and in the email to check the Whois of the ip address of the agent (may be a simulator).

I originally wrote the script as a plugin. After installing the plugin, you would have to point to the bot_check.php file by including in a custom footer. But then it would be included in every copperemine page. Including ones where it really doesn't make sense to have a bot recorded page hit (like message boxes, etc,). While I generally don't like to add mods to core files, I added this to the top of include/ so it's easy to locate later in case of an upgrade. And this way, you can be very specific as to where to add the bot_check function call. I found that index.php, displayimage.php, thumbnails.php and some of my custom pages are enough. If bots are hitting those main pages a lot, changes are they are hitting others too.

A funny thing happened when I was writing the script and testing it out numerous times. After getting it to work properly, I went to view my botcheck log and check my emails. Expecting to see page hits and emails from the bot simulator I was using for testing purposes (which I did get), guess what? The real Yahoo and Google Bots showed up! (See attatachment below). They haven't stopped yet. Got a little tired of the emails after awhile, so I disabled the SEND_MAIL and just kept the log.

Now, how do you know if it's a real bot or is it a simulator? In the log file and in the emails, you can click a link to DNS Stuff for each bot and actually see if the IP is of a real bot or not.

Modification is to include/ file and adding the function call - bot_check(); to pages you want to monitor.

A downloadable file, with instructions and the script is available at the end of this post.

So, Download the zip file at the end of this post and follow the instructions.

A little note about getting indexed by the Bots. Since Coppermine is a image gallery, I can't stress enough the importance of having text descriptions for the displayimage pages. Bots loved textual content! They may see the link to an image, but they can't 'read' an image. The more (key)words you have in the image descriptions, the better! Also, try and create some custom pages. Like a site map, policy page, maybe some article pages related to your sites' theme and add the bot_check function to them.

A well written robots.txt file that steers the bots away from files you don't want them to index, to ones you do want indexed.

Meanwhile, enjoy using the bot_check mod. May the Bots be with you!

If Devs like, move accordingly. Thanks

« Last Edit: January 08, 2007, 08:23:56 am by GauGau »
Pages: [1]   Go Up

Page created in 0.023 seconds with 20 queries.