WordPress 4.9 Tipton introduced error checking upon save of PHP files to help users avoid fatal errors. While this is an excellent feature intended to protect users, the loopback check which identifies fatal errors has experienced conflicts with some plugins. If this is the case, you will experience the following error when saving changes to PHP files in your WordPress Admin Dashboard editor:
“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.”
There are a variety of plugins reported to cause this issue, including:
- ShortPixel Optimizer (fixed with v4.8.4)
- WP Server Stats (fixed with v1.5.7)
- Custom Sidebars (working on an update)
- Magic Fields
- WP Spamshield
- Social Login WordPress Plugin – AccessPress Social Login Lite
- Ninja Popups for WordPress
- Custom firewalls or security rules
- Some custom themes
In most cases, the issue lies with an open “session_start()” function being called unconditionally, meaning that the plugin or theme is trying to initiate PHP Sessions everywhere on the site, instead of strictly where it is needed. WordPress does not use PHP Sessions, and as such sessions should not be initiated on the editor pages.
How to resolve the error message
For urgent changes, please follow the directions in the error message to deploy your changes over SFTP or git. To find out where the problem lies within the WordPress Admin Dashboard Editor, we suggest following these steps:
- Download the free Health Check plugin
- Make a backup of your website in User Portal
- Run a Health Check using the Health Check plugin. Look for any fields with a red “x.” You may see a message which reads: “Unable to perform a loopback request to your site, this may prevent WP_Cron from working, along with theme and plugin editors.”
- Copy your site to staging.
- Download the Twenty Seventeen theme and activate it. Run the Health Check again.
- Do you see a loopback or any other failed response? If so, disable all plugins (except Health Check) and run the Health Check again.
- You may see “The loopback request to your site completed successfully.” This indicates one of your plugins is the problem. Re-activate them one by one, running Health Check each time to isolate the problem. If you have a lot of plugins you can re-activate them in small groups instead.
- If you still see the loopback request error in Health Check, check with any external firewall settings or security settings in your .htaccess file.