Theme options reseting after inserting the Google Analytics Code

Hello,

I am having following issue: 
when I paste my Google Analytics Code in the Options - SEO - Google | Analytics field and press "save options" following happens:
1. the browser downloads options.php
2. most of the theme options are reseting (e.g. Fonts, colors ...)
3. after refreshing the page the code also disappears

The same happens when I insert something in Copyright field in footer.
The latest version of the theme and WP is installed. 


The code I am using:
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', '.........hidden........', 'auto');
  ga('send', 'pageview');

</script>

Help!!

Comments

  • Hi,

    there is few possible reasons why Muffin Options might be empty on load (blank) or does not save settings properly:

    - PHP version - Wordpress, since version 4.5, requires minimum PHP 5.6. So if your version is older than 5.6, you need to contact with your admin/hosting provider because it need to be updated.
    - Memory Limit - the more plugins you have enabled, the more resources your WordPress instance will consume. So if this is happening, you need to contact with your admin/hosting provider to increase this limit.
    - Suhosin extension - if it’s installed on your server, it could bring the issues as well because the limits for Suhosin are usually different from the general one.

    Thanks!
  • So, 

    1. I switched to PHP 5.6.
    2. I turned off all extensions (I have 128 Mb memory limit)
    3. I do not have suhosin extension

    now I have this problem with ALL theme options (before I managed to save most of them). 

    Most important! This site worked perfectly under same conditions on the subdomain. I just moved it to the main domain on the same hosting.
     
  • edited November 2016
    UPDATE:

    I tried to type some text instead of code and it functioning. The text appears on the top of the page.
    However when I paste the <script>... the problem appears!
  • That's very weird then because we did never met with anything like that. Please go to theme folder, create php file with phpinfo() function inside and send us link to that file so we can have a look on your server settings because we really don't know what else might be the reason.
  • edited December 2016

  • Ok, thanks. As we can see, you use Zend OPcache which might be the reason of this strange behave. So please contact with your admin and ask him to remove it and check because except that we do not see anything else that might be the culprit.
  • JFYI:

    Looks like turning off the PHP Boost (Zend OPcache) helped this time. 

  • Ok, thanks for the info. We are glad to know that disabling Zend OPcache helped.
Sign In or Register to comment.