Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. WordPress (Managed)
  3. Some plugins will make WP theme editor unresponsive

Some plugins will make WP theme editor unresponsive

Scheduled Pinned Locked Moved WordPress (Managed)
1 Posts 1 Posters 206 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • girishG Offline
      girishG Offline
      girish
      Staff
      wrote on last edited by
      #1

      When saving a theme file (say header.php) in unmanaged or managed WP app, you might see the theme editor or some other functions like file upload go completely unresponsive (like the screenshot below) or show an error Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP..

      8ffb8498-4b98-475d-8e4a-7d53ca15846e-image.png

      tl;dr - The issue is with some of the WP plugin(s) you have installed which are still using legacy PHP sessions. Try disabling some plugins and editing the file again.

      Long version

      PHP sessions are created using session_start. This method creates files on the filesystem and also gets a lock! When using sessions, all other PHP scripts will block until the current script has completed (yes, really). WP itself does not use PHP sessions but many plugins do. In WP 4.9, they added a fix to the theme editor to check if the code is valid. They do this saving the file and doing a loopback request to see if the file is OK. If the loopback call fails, they revert the editor changes. It's sensible except that when if you have plugin which is using PHP sessions, this loopback request will fail because only one PHP script can run at a time!

      It looks me a while to figure the about out but this comment by a WP dev and this bug report helped me connect various bits of info together.

      Identifying the plugins

      Open a Web terminal and go to the plugins directory of wordpress and do a grep -ir session_start. That will give you the plugins which will cause this problem.

      Note that as mentioned earlier, not only do those plugins cause the theme editor to fail but they will also severely affect the parallelism of your site because of the session lock!

      Fix

      The fix is to just not use those plugins + inform the developer about it.

      Some references:

      • https://wordpress.org/support/topic/cant-edit-main-theme-php-files-after-upgrading-to-4-9/page/5/#post-9703465
      • https://wordpress.org/support/topic/the-loopback-request-to-your-site-failed-4/page/2/#post-10662220 (fix for plugin authors)

      Writing this post was cathartic, since I was going crazy trying to figure why session_start was hanging 🙂

      1 Reply Last reply
      3
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Bookmarks
        • Search