Unwanted 60-second Page Reload

Unwanted 60-second Page Reload

Here’s an interesting one: I just noticed that the theme I’m using for this site–a modified version of an old version of Cleanr–doesn’t allow me to leave comments because the page refreshes as I’m typing and the data in the comment form goes away. Maddening! Diagnostic investigation follows below…

Now, I’m not very familiar with web application development, but I’ve been slowly digging into WordPress’s guts. I timed the refresh cycle, and it appears to happen every 60 seconds. First thought: there is some kind of “autosave” going on, so I can try to verify that. Second thought: I’ve never seen a theme that has auto-saving comments; it might be a feature of Cleanr that I didn’t notice, and with the most recent versions of WordPress it may have broken.

First check: let’s see if “autosaving comments” has ever been a problem according to Google. Nope, this hasn’t been a feature as far as I could tell. Next, I checked to see if other instances of my subblogs (which all use this theme) are exhibiting the same behavior. YES. This might explain why there are no comments :)

Second check: I looked at my PHP Error Log, which I have set-up for each website, to see if anything weird was going on. Nope. I also looked at the source HTML code, as rendered by the browser, to see if anything jumped out at me like a META REFRESH property. Nope. That suggested that it was some kind of Javascript event firing.

I know nothing about debugging Javascript, but I opened Chrome’s Javascript Console anyway to see if it showed any errors or notice. I didn’t see any, but I did see a TIMELINE with what looked like an EVENT CAPTURE feature. I turned it on and waited, and indeed a timer event fired…in overlay_js, which appears to be a Google Analytics plugin. Weird. To confirm that this was the issue, I removed the Google Analytics script from my header.php file, after confirming that it was indeed correct. I was able to post a comment normally afterwards.

However, I was suspicious…I checked my main theme, which is a child theme of TwentyTen, to see if comments were misbehaving in a similar way. And they WERE. I wonder how common this problem has been? Is this why I haven’t been seeing as many comments lately? However, it is only happening on this computer, and this is the first time I’ve seen it. I found someone with a similar problem on Stack Overflow. I also grabbed the latest version of the GA script (it removed a _setDomainName parameter). Then the problem went away. I tried putting the setDomainName back in to confirm this, but it still works. Hmm.

There are two things that I did: I looked at the browser cookies set by google as someone elsewhere on the Internet said that clearing cookies fixed his problem. I also I took more than 30 minutes to do all this poking around, which meant perhaps some problematic cookie expired. Since I didn’t actually fix anything, I’m guessing the following:

  • Google fixed something behind my back. Too bad I didn’t save a copy of the script to do a comparison.
  • Looking at the cookies in the browser somehow fixed something, even if I didn’t delete anything. Seems kind of unlikely.
  • A bad cookie expired, or something. Assuming cookies had anything to do with this.

So I’m going to have to file this one as “unsolved”.

1 Comment

  1. Alex Zagoumenov 8 years ago

    David, thanks a great lot for detailing the problem. I just noticed the same 60 seconds reload issue on my WP-based site. So, was it the Google Analytics plugin by Yoast that caused the issue? Thanks again for sharing in so much details!