Open chrisdfeld opened 6 years ago
Just to add to this: if you have SFTP access set up to your WP Engine hosting (and you're comfortable tweaking the PHP) within the /wp-content/mu-plugins/ folder you'll find the 'mu-plugin.php' file. Within this if you comment out the following (I'd recommend leaving a comment so any WPE techs know why and by whom this was done) then heartbeat will no longer be restricted:
if ( getenv( 'WPE_HEARTBEAT_AUTOSAVE_ONLY' ) == 'on' ) {
require_once __DIR__ . '/wpengine-common/class.heartbeatthrottle.php';
$heartbeat_throttle = new WPE_Heartbeat_Throttle();
$heartbeat_throttle->register();
}
Tailor relies on the WordPress Heartbeat API for edit locking, but WP Engine and possibly other web hosts disable Heartbeat except on certain whitelisted WordPress core pages out of performance concerns. Tailor doesn't handle that scenario well and throws a cryptic error. It would be better to detect when the Heartbeat API is blocked (or detect WP Engine specifically) and either provide guidance to the user or use a possible workaround.
Other plugins also warn users of this quirk in documentation, for example: https://eventespresso.com/wiki/setup-wpengine-hosting-event-espresso/
When run on WP Engine, Tailor 1.8.1 throws an
Uncaught ReferenceError: sidebarApp is not defined
JavaScript console error incanvas.js
when attempting to edit a page/post (http://example.com/sample-page/?tailor=1
). The errors were different under Tailor 1.7.9 and earlier:When these errors crop up, Tailor just shows an all-gray screen with a perpetually spinning circle instead of its editor.
Possible starting point for workaround implementation
Beyond warning the user, the plugin code below might offer a starting point for coding an automatic workaround for this issue. It provides an interface for whitelisting additional WP-Admin URLs that should be allowed to use the Heartbeat API:
https://github.com/PrysPlugins/WPE-Allow-Heartbeat
However, I haven't tested the plugin because WP Engine has already applied a blanket fix to my account.
Background on WP Engine's Heartbeat blocking
Here's what WP Engine's support told me:
Immediate fix for WP Engine users
Contact WP Engine's support (live chat is usually quick) and ask them to enable the Heartbeat API so you can use Tailor. They will have references to it in their internal support system.
Possible DIY fix for WP Engine users
It might also be possible to install the whitelist plugin above (https://github.com/PrysPlugins/WPE-Allow-Heartbeat) and add Tailor-specific admin URLs to the whitelist to get this working without the help of WP Engine support in a pinch.