Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Okay so the website I webmaster for http://www.detroitdungeon.com has been having some analytic issues as of lately. I have the google analytics plugin installed and it was working fine for quite sometime. All of a sudden the plugin caused IE users to crash after the page had loaded. So instead of using the plug in I decided to use the code given to me by google and I placed it in the footer of the website. Doing this caused the webpage to crash with all browsers. after the code has been placed in the footer the source code reads

<b>Parse error</b>: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in <b>/home/content/36/5385336/html/detroitdungeon/wp-content/themes/delighted_black2/footer.php</b> on line <b>5</b>

Here is footer.php

<?php 

include('footer_content.php');$delight_mainfont = get_option('delight_mainfont');echo '<div id="footcopy"><span class="left"><a href="http://zenverse.net/delighted-black-wordpress-theme/">Delighted Black</a> designed by <a href="http://yourchristianspace.com">Christian Myspace</a> & <a href="http://www.digitaldesignzmedia.com">Designed By: Digital Designz Media Group</a></span><span class="right">In conjunction with <a href="http://pingler.com">Ping Services</a>   <span style="font-family:tahoma;">|</span>   <a href="http://frenchteacherjobs.com">French Teacher Jobs</a>   <span style="font-family:tahoma;">|</span>   <a href="http://mathsteacherjobs.com">Maths Teacher Jobs</a> </span>
<div class="clear"></div></div></div>

<!--/page-->

<script type="text/JavaScript">var TFN='';var TFA='';var TFI='0';var TFL='0';var tf_RetServer="rt.trafficfacts.com";var tf_SiteId="254g7d80916f3af3bbc0ac2542301cd153424f1b1aa7h16";var tf_ScrServer=document.location.protocol+"//rt.trafficfacts.com/tf.php?k=254g7d80916f3af3bbc0ac2542301cd153424f1b1aa7h16;c=s;v=5";document.write(unescape('%3Cscript type="text/JavaScript" src="'+tf_ScrServer+'">%3C/script>'));</script><noscript><img src="http://rt.trafficfacts.com/ns.php?k=254g7d80916f3af3bbc0ac2542301cd153424f1b1aa7h16" height="1" width="1" alt=""/></noscript>

</body></html>';

?>

I tried going with godaddy analytics and the same issue is happening. Any help would be GREATLY appreciated.

share|improve this question
1  
the single quotes ' in the line beginning with <script type="text/JavaScript... seem to be breaking the echo string; try to replace them all with double quotes " - or rewrite footer.php without using echo. –  Michael May 20 '11 at 18:56
add comment

2 Answers

up vote 0 down vote accepted
<?php 

include('footer_content.php');$delight_mainfont = get_option('delight_mainfont');echo '<div id="footcopy"><span class="left"><a href="http://zenverse.net/delighted-black-wordpress-theme/">Delighted Black</a> designed by <a href="http://yourchristianspace.com">Christian Myspace</a> & <a href="http://www.digitaldesignzmedia.com">Designed By: Digital Designz Media Group</a></span><span class="right">In conjunction with <a href="http://pingler.com">Ping Services</a>   <span style="font-family:tahoma;">|</span>   <a href="http://frenchteacherjobs.com">French Teacher Jobs</a>   <span style="font-family:tahoma;">|</span>   <a href="http://mathsteacherjobs.com">Maths Teacher Jobs</a></span>
<div class="clear"></div></div></div>
<!--/page-->
';?>
<script type="text/JavaScript">var TFN='';var TFA='';var TFI='0';var TFL='0';var tf_RetServer="rt.trafficfacts.com";var tf_SiteId="254g7d80916f3af3bbc0ac2542301cd153424f1b1aa7h16";var tf_ScrServer=document.location.protocol+"//rt.trafficfacts.com/tf.php?k=254g7d80916f3af3bbc0ac2542301cd153424f1b1aa7h16;c=s;v=5";document.write(unescape('%3Cscript type="text/JavaScript" src="'+tf_ScrServer+'">%3C/script>'));</script><noscript><img src="http://rt.trafficfacts.com/ns.php?k=254g7d80916f3af3bbc0ac2542301cd153424f1b1aa7h16" height="1" width="1" alt=""/></noscript>
</body></html>
share|improve this answer
    
When using that code the same error applies but it moves to line 8. –  user5544 May 20 '11 at 19:03
    
replacing single to double also causes the same error. –  user5544 May 20 '11 at 19:07
    
try the updated code above. –  xLRDxREVENGEx May 20 '11 at 19:09
    
fixed! Did you just remove the bottom opening and losing php tags? –  user5544 May 20 '11 at 19:11
    
i closed the php tag before the closing body tag ?> closes php code and migrated your </body></html> to the very end. If this is your accepted solution please click the check box under my answer –  xLRDxREVENGEx May 20 '11 at 19:14
show 3 more comments

I had the same problem recently with our website, so I did the following.

  1. Went to our Control Panel and launched (clicked on hosting)
  2. Clicked the arrow for the drop down menu on the Files & FTP tab
  3. Clicked File Manager
  4. Clicked on the domain name (do not click the file or + beside your domain name) left side of the directory
  5. Clicked on the name wp-content
  6. Clicked plugins
  7. Clicked box beside google-analytics-for-wordpress
  8. Then I clicked rename at the top to rename folder
  9. Renamed folder to google-analytics-for-wordpress1 (just added 1 at the end).
  10. Went back to my site www.henpublishing.com and hit refresh (My site worked)
  11. Returned to the google-analytics-for-wordpress folder.
  12. Clicked rename
  13. Deleted the 1 at the end (google-analytics-for-wordpress without the 1 at the end)
  14. Went back to my site www.henpublishing.com and it worked with google analytics intact
  15. It may crash again, not sure, but it is working for now. Perhaps, Google or WordPress will fix the problem soon. Hope this helps.
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.