Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

View Counter


Recommended Posts

@@Jack_mcs thank you kindly for your quick reply.

 

I've checked and all view_counter table are InnoDB. I've checked the raw access log and it is already too late...

 

Going through the IP's in the count report there is only 1 that stands out to me... that is not a main search engine. I did get lots of visits from google, bing, msn & baidu (which I guess I'm safe to ban... as I'm not in China).

 

However, the traffic doesn't seem extreme - maybe a couple hundred visits. I should qualify... I'm not sure if a couple hundred page views would be considered extreme - I guess if all 4 bots hit all at the same time it would be extreme, however the "slowness" seem to linger most of the day while in general traffic was high.

 

The one IP that I mentioned "stands out", because it was a singular IP - not a range of IP's. This IP hit 500 links (I'm not sure without the access logs in what time frame) - all links were product_reviews and the IP is located in Korea.

 

Obviously this addon has tremendous value, however, I just want to make sure; 1) I'm using/understanding it correctly & 2)it does not use more resources than the problems I'm finding (if that makes sense).

Link to comment
Share on other sites

As mentioned previously, traffic occurring at one time will hurt more than if it is spread out. So if the 500 hits were the only ones for that time, they probably wouldn't make a difference. But if all of the search engines and your customers were looking around at the same time, it could be enough to cause a problem.

 

Regarding baidu, you can block them from within View Counter by entering the domain names baidu.com and baidu.jp in the Block Range box on the monitor page.

 

On the monitor page where it shows the language, it also shows the number of hits for the last 24 hours. I just checked my site and the count was a little over 15,500. As far as I know there have not be any significant slow-downs on it. Of course, I do sleep once in a while so it is possible. :) But that number may give you something to compare against.

 

It does record all of the connections so it has to add some overhead. But I've not noticed anything significant. Maybe other users can state what they see.

 

As for the Korean IP, I suggest you block the whole country if you do not intend to sell to them (same for any country). There's no reason they should be on the site if you have no intention of filling any order they might make. It is better to use the GeoIP country blocking code if your host has that installed since it blocks at the server level. But if that is not available to you, the block country option in View Counter is a better choice than blocking whole countries in the .htaccess file.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Let's see what tomorrow holds surprise me with installing osCommerce_VTS_2_0_6. Do you think this addon?.

 

 

@@Cheloki

 

I used to use this a lot a couple of years ago.

 

It was very useful when trying to find infected files.

 

HTH

 

G

 

(But I would say that!!!)

Edited by geoffreywalton

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

Jack, I'm getting this SQL error.

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-20, 20' at line 1

select *, TIME_TO_SEC( UNIX_TIMESTAMP( now( ) ) - UNIX_TIMESTAMP( last_date ) ) as time, DATE_FORMAT(last_date, '%a, %D %T') as date_time from view_counter where ip_active=1 and language_id = 1 and (isadmin = '' or (isadmin = '/catalogo/admin/' and INET_NTOA(ip_number) NOT in (''))) order by file_name asc limit -20, 20

[TEP STOP]

post-292081-0-65039500-1402514303_thumb.png

E-commerce?

No external links please.

Link to comment
Share on other sites

That's a common problem with older versions of oscommerce. If your shop is pre-2.3 and was never patched then that is what the problem is. If you search the forums from google for something that failure, you will find a lot of results. In google, put this in the search box

 

site:www.oscommerce.com/forums You have an error  limit

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 3 weeks later...
Jack,
 
You are AMAZING! This contribution is fantastic! The Who's Online tool has always been a tease.
 
I'm having a couple of issues that I can't seem to figure out.
  1. Within the Tools menu, I have blocked about 10 countries and all of them remain highlighted but none of them are in the right hand list for me to unblock.
     
  2. On the Monitor, when I click on a product, it fails to open the proper URL by leaving out the "product_info.php". Also notice the question mark at the end of the URL.
  3. As with others, I am not able get the messages to appear to the visitors when sending through the Tools option.  The admin panel says it was successfuly sent.  I have version 1.4 installed which already has your fix to  admin/includes/view_counter_header.php.  Any ideas?
     
  4. Many others have referred to the refresh "counter". I have looked everywhere for this but do not find. Where is this counter?
 
Thanks,
Dave

Anthony David

AllThingsTrendy.com

Link to comment
Share on other sites

@@AllThingsTrendy Thank you. I appreciate the kind words.

 

1 - This can be a little misleading. The View Counter code doesn't have access to the server so it can only block by IP. So when you highlight a country, or countries, from the list on the left, you are telling the code that if any IP from that country visits the site, that IP should be blocked. If that happens, the country will appear in the list on the right followed by a (1), meaning one IP from that country was blocked. If another person visits from that country, their IP will also be blocked and the count will be (2). So the list on the right only shows when someone has been blocked. If you choose the US in the list on the left and no one from the US ever visits your site, it will never show up in the list on the right.

 

2 - Please try turning off your url rewriter to see if that makes a difference.

 

3 - No, no ideas. I'm not seeing this in any of the shops I installed it in, though I don't always check that option. Does it fail with both the kick off and the message or just the message?

 

4 - I don't recall any mention about the refresh counter. If you are talking about the counter that counts down and then refreshes the page, there is a setting for that and it appears in the header of the monitor on the right side.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Jack,

 

Thank you for the quick reply!

 

Jack,

  1. Thanks for the explanation. It makes sense to me now.
     
  2. You are correct. When I disable SEO URL feature, the links work properly.  Is this just an inconvenience within the Monitor or could it be causing issues elsewhere later when I dig into the data?  If just on the Monitor, it's no big deal.
     
  3. I am able to kick a user and the message does appear when they make their next click. But, once they do, they are allowed to continue on the site as if nothing happened.  Is this the normal behavior?
     
  4. Wow... I just need to quite fighting it and admit I need to wear these glasses.  Aging sucks!

Thanks,
Dave

Anthony David

AllThingsTrendy.com

Link to comment
Share on other sites

2 - The code in View Counter just uses normal oscommerce variables to build the link. The rewriter you are using should be able to interpret that. I don't know why it can't. If it one of the common ones it shouldn't be causing problems elsewhere in the shop. Though there are other addons that build links like this so you may run across the problem again if you install one of those. Which rewriter is it, just out of curiosity?

 

3 - The kick option just removes their session ID. So if they have things added to the cart or are signed in, the cart items would be removed and they would be logged off. But they will not be blocked. If you want to do that, you would need to block their IP.

 

4 - Indeed! :)

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Jack,

 

Regarding #2 - I just installed OSC 2.3.3.4 as I am preparing to migrate my site over the next several weeks.  The SEO URL feature is the one that comes standard with this version.  I have only installed a few of the pertinent addons in preparation for the migration; certainly no addon related to SEO URLs.

 

Dave

Anthony David

AllThingsTrendy.com

Link to comment
Share on other sites

The url you showed was a rewritten one and there isn't a version of oscommerce that comes with the code to do that, at least that I am aware of. If you purchased a template, it may have come with it installed already. I've seen a few that have.

 

By the way, the latest version of oscommerce is 2.3.4 so you may want to use it instead.

Edited by Jack_mcs

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 5 months later...

Hi Jack,

 

I'm not sure if anyone else's site has been getting brought to it's knees as a result of the following connection issue within View Counter?  Our site was very slow and after it finally loaded, the following php error is shown.  This error continued all morning.  I had to comment out the View Counter code within includes/application_top.php.  Is there a way around this so that if http://api.hostip.info is unreachable?

 

Warning: file_get_contents(http://api.hostip.info/?ip=213.145.98.218) [function.file-get-contents]: failed to open stream: Connection timed out in /home/allthing/www/www/includes/modules/view_counter_country_block.php on line 79

 

Thanks!

Anthony David

AllThingsTrendy.com

Link to comment
Share on other sites

Hi Jack,

 

I'm not sure if anyone else's site has been getting brought to it's knees as a result of the following connection issue within View Counter?  Our site was very slow and after it finally loaded, the following php error is shown.  This error continued all morning.  I had to comment out the View Counter code within includes/application_top.php.  Is there a way around this so that if http://api.hostip.info is unreachable?

 

Warning: file_get_contents(http://api.hostip.info/?ip=213.145.98.218) [function.file-get-contents]: failed to open stream: Connection timed out in /home/allthing/www/www/includes/modules/view_counter_country_block.php on line 79

 

Thanks!

I am having a similar issue. The site never loads, it just eventually goes to an error. I can load my admin screen and have disabled View Counter so the site will run.

 

This is the error I get:

 

Warning: file_get_contents(http://api.hostip.info/?ip=206.63.xxx.xxx): failed to open stream: Connection timed out in /homepages/25/d238487425/htdocs/includes/modules/view_counter_country_block.php on line 79
2006 - MySQL server has gone away

select 1 from view_counter_block_list where name_to_block = ''

[TEP STOP]

2006 - MySQL server has gone away

select count(*) as total from sessions where sesskey = 'x2bx4b8xa6x3a1xx84x0e10xc83x13d77c'

[TEP STOP]
Link to comment
Share on other sites

@@AllThingsTrendy In the includes/modules/view_counter_country_block.php file, please make the following change and see if that fixes it.

$xml = file_get_contents("http://api.hostip.info/?ip=".$ipAddr);  //may be disabled on the server

to this

$xml = @file_get_contents("http://api.hostip.info/?ip=".$ipAddr);  //may be disabled on the server

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@@Snarg The kind of error you mention generally means the sessions table is corrupted. Someone else reported a similar problem and repairing the sessions table fixed it, though it shouldn't happen in the first place. But I can't cause it to fail so I don't have a fix for it if it is due to View Counter. You can try the same change I mentioned above or the one below. The code below is from the next version and is better since the file_get_contents may not work on all servers but I haven't had time to thoroughly test it, though I don't expect a problem. To try this, change

  $xml = @file_get_contents("http://api.hostip.info/?ip=".$ipAddr);  //may be disabled on the server
  if ($xml === FALSE) {
     $curl = curl_init();
     curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
     curl_setopt($curl, CURLOPT_URL, "http://api.hostip.info/?ip=".$ipAddr);
     $xml = curl_exec($curl);
     curl_close($curl);
  } 

to this

  $curl = curl_init();
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($curl, CURLOPT_URL, "http://api.hostip.info/?ip=".$ipAddr);
  $xml = curl_exec($curl);
  curl_close($curl);
  
  if (curl_errno($curl)) {
      $xml = @file_get_contents("http://api.hostip.info/?ip=".$ipAddr);  //may be disabled on the server
  } 

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I've gotten calls and emails from many users of View Counter with this problem. It turns out that the reason for the failure is that host.info is no longer working and that site is used to find the country code. I've tried to contact them but haven't gotten a reply. It might be that their server is down and things will return to normal once it is up. Or maybe they just closed up shop.

 

For now, in the includes/modules/view_counter.php file, find this line

 if (strpos($_SERVER['PHP_SELF'], DIR_WS_ADMIN) === FALSE) {

and change it to

 //if (strpos($_SERVER['PHP_SELF'], DIR_WS_ADMIN) === FALSE) {
 if (false) {

The above will prevent the country code from working. I hadn't realized there wasn't a way to turn country blocking off until now. Once I have a fix for the above problem, I will upload a new version.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Jack,

 

Thank you so much for quick reply.  I have modified as suggested and everything seems to be working well.

 

Now that the code is not checking the visitor's country code, does this mean that previously blocked country IPs now have access again?  The code has blocked one specific country 47 times since I deployed our new site 10 days ago.  That is a bit scary as I would not expect (nor send products to) visitors from that country.  Will they now be able to get through?

 

Thanks!!!

David

Anthony David

AllThingsTrendy.com

Link to comment
Share on other sites

Yes, they can get through now. You can block those IP's using the blocking box in the monitor section and that will stop them. But no future blocks of other IP's will be made until a fix is done.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 3 weeks later...

For those that have disabled the country blocking code, the site that was causing the failure is working again so it is safe to re-enable that code.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I searched the web for an explanation but couldn't find one. That site is provided by a company and maintained by volunteers. My guess is that the either the company forgot to pay the bill, or something like that, or the server it is on crashed and it took a few days to restore, which is possible for large servers.

 

I still plan on changing the code to provide a different solution to, hopefully, prevent a problem like this in the future.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@@Jack_mcs , it seems this just isn't my week!  

 

Have you had anyone encounter conflicts between View Counter and the Newsletter & Subscribers add-on; or more specifically, the Advanced Bulk Mailer that is now embedded?  When I kicked off my newsletter, after a few moments, I received a nasty looking error that specifically identified View Counter and Newsletter.  When I went to grab the error, I closed the window by mistake.  I turned off View Counter and executed the newsletter distribution again and it seems to be running fine.  Once t is done (will take several hours to complete), I'll turn View Counter back on and try to reproduce so I can grab the error.  I can not reproduce within my development environment.  Perhaps because I am only sending a few emails from that system rather than thousands.

 

Thanks,

Dave

Anthony David

AllThingsTrendy.com

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...