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.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.