Troubleshooting Customizer Errors & Performance

FAQ  Troubleshooting  Last Updated: Layers ver. 1.5 Time to Read: 7 minutes

Problem Description:

Errors may appear when you enter the WordPress Customizer and will continue down the page. Example:

Warning: Creating default object from empty value in customize.php…

or you may just get a blank preview pane with a never-ending load spinner

or you may see a permission error or the dubious “Cheatin eh?”messge

or you may just have a really slow customizer.

Answer:

This is usually caused by a plugin conflict or the customizer having issues loading all the data on the page.

  1. Ensure you are on Layers 1.2.0 or later. Learn How to Update.
  2. Go to Appearance → Widgets and check the Inactive Sidebar at bottom-left. If you have a lot of widgets there, go to PluginsAdd New and search for “Remove Inactive Widgets” then install and activate that plugin. This will add a button to the Inactive Sidebar that lets you clear all of those widgets. Inactive widgets are still read and loaded in the customizer, so when this sidebar gets loaded, it can slow down your customizer performance.
  3. Remove 3rd party widgets from any sidebar panel loading in the customizer that connect to a third party or use an API key. This includes widgets such as Facebook feeds, Instagram, Twitter, WP Subscribe, etc. If this resolves the issue, you can use a plugin like Widget Logic, Dynamic Widgets or Jetpack’s Widget Visibility to keep the widget from being loaded when you are logged in, or you will need to remember to deactivate it prior to entering the customizer.
  4. If you are attempting to enter the customizer on a Layers page with a high number of widgets, or widgets that load a significant amount of content (such as a posts widget with 30 video posts all trying to connect to YouTube), expect performance to be slow. Try reducing the number of widgets per page, and optimize the content for fastest load. See How to Speed Up Your Website for more tips.

If your customizer is working but is just really slow, go through the above 4 steps first. When these don’t help, you’re likely experiencing a slow customizer. Well, duh, right? The fact is, slow customizers in WordPress is a very complex issue, and one that is not entirely up to Layers to solve or improve. Please check out our Development Blog post on this subject to see why this happens and what we have already done about it.

Slow performance manifests itself as drop-downs that don’t open right away, lag in the editor, and so on until you save and reload the customizer.

The most common cause of this is:

  1. You have a plugin conflict
  2. One of your widgets is trying to communicate with a 3rd party and timing out
  3. Too many widgets in the page
  4. Too many columns or slides in a single widget
  5. Huge images that are slow to preload.

In short, the more stuff going on, the larger the load will be on the customizer, as ALL your widget data is loaded into the Customizer the way it used to be loaded into the Appearance > Widget screen (this is why getting rid of Inactive Widgets is your first line of fire).  Additionally, the longer you are working in the customizer, the more scripting is piling up and having to run.

Plugins

This is also covered below, but essentially check for plugins that have not been updated in the last couple months, especially Layers Extensions or plugins that add widgets. Update them if possible – if no recent updates are found, deactivate the plugin temporarily and see if your issues clear up.

Widgets

Widgets that need you to enter an API key or perform some other function that connects to another site like Google, Facebook or Twitter can experience delays that also slow your customizer. Configure these settings via Appearance > Widgets if possible.

Images

If you are loading backgrounds or featured images that are HD or have large file sizes, they are reloading on your customizer refreshes and can really slow things down! Use an image ratio in the widgets to scale your images down, or optimize them prior to uploading.

Overloading the Customizer

  • Try to keep the number of Layers pages low. The more widgets you have in pages and the more pages you have, the more the customizer needs to scan and load everytime. In other words, do not use Layers pages as a replacement for posts on your blog! We recommend some of the great Layers Extensions out there for post cusotmization, or a free plugin like SiteOrigins Page Builder or Shortcodes Ultimate to get some added flair in your posts.
  • Save your changes in the customizer often and reload the page/customizer.
  • Ensure your server is up to the task. WordPress 4.4 and higher needs PHP 5.6 to run efficiently, as well as adequate database and PHP memory. Settings such as memory and var limits in the PHP config are managed by your host in most cases, so it is important to contact them to see what improvements can be made. If you are on shared hosting, moving to a WordPress host may help. See How to Speed Up Your Website for more details on server-side optimizations. In the meantime, keep the number of columns in a single Content Widget to a minimum – use multiple content widgets to create large grids when possible to avoid exceeding low thresholds set on your server.

See Customizer: Can’t Save Changes or Refresh is not Triggered

ALERT – configured POST variable limit exceeded or similar

This is only visible with PHP debugging enabled and will occur in pages with too many widgets, widgets that are injecting scripts or information into the preview pane incorrectly, or widgets with too much data for your server setup (such as a Content Widget with 40 columns).

See Customizer: Can’t Save Changes or Refresh is not Triggered

Warning: Creating default object from empty value in customize.php…

This is usually a debug message caused by PHP 5.4 on your server and does not indicate a functionality problem with the customizer or the theme in most cases. By default, PHP has this set to 0 for production servers on most hosts  (your host should have PHP debugging turned OFF)

Unfortunately, shared hosts always have display_errors on. To turn this off yourself, you can attempt to modify your WordPress config.

  1. Connect to your server via FTP
  2. Download a copy of the  wp-config.php and open it in a text or HTML editor
  3. Find the following section and ensure WP_DEBUG is false:

4. Paste the following line right below the WP_DEBUG line:

5. Save and re-upload the file to your root directory or wherever WordPress is installed.

If this does not work, you will need to contact your host about disabling PHP debugging/error display for your site.

Internal Server Error…

See Internal Server Error HTTP 500 in WordPress Customizer

404 Errors

See Layers Pages: No Posts Found or 404 Error in Customizer

This is due to an incorrect site address.

  1. Go to Settings → General
  2. Ensure the Site URL and WordPress URL are correct, In most cases they should match.

The most important thing to look for here is an url that is missing the www. ie if your url is http://mysite.com, try http://www.mysite.com. You will need to check with your host for how to ensure both urls( www and no www ) resolve properly. If your site is behind SSL, both urls need an https:// prefix.

Be sure to enter the customizer from an “approved” link, which include Appearance > Customize or Layers > Customize, Edit Layout on the Layers pages, or Edit Layout in the Admin bar when viewing the front-end. Cheatin eh? May appear if your admin login cookie has expired or you are trying to enter from a cached URL or bookmark.

1. Ensure you are logged in as an administrator. See this article for help with Editors and Author access to the Customizer.

2. If you have a child theme active, try temporarily activating the main Layers theme, or switch to a different theme and see if the customizer access changes.

3. See our troubleshooting tips for general WordPress troubleshooting, including how to determine if you have a plugin conflict.