Error: Notification Requires “PHP OP Cache to be disabled”
-
Has anyone ever encountered this error? I can’t pinpoint the exact moment I started seeing this error on my WP Backend but it might have been after I regenerated CSS using WP Rocket.
-
Hey, yes, it’s definitely connected to caching and the plugin cannot work with such caching enabled. But this is rather low-level server caching than WP plugin.
I think in some particular version OPCaching has a bug which prevents Notification from working. It might be a good idea to update server packages.
I checked in with our hosting provider (WP Engine) and they said it’s impossible for them to disable OP Caching across our entire site. We’re on the latest version of PHP so we cannot upgrade any further.
That’s bad news. Have you migrated lately to WP Engine?
I thought WP Engine is a managed host where they do stuff for you 😉 Well, disabling/updating OP Cache isn’t the easiest thing but it’s doable.
Unfortunately this prevents the Notification from working because it’s stripping all the PHP comments. Notification needs them to register own action and filter handlers. It’s not even possible to boot up the plugin when the OP Cache strips comments.
I can’t do anything on my end, sorry 🙁
The weird thing is that I’ve been on WP Engine from day one (9 months) and I haven’t added a single plugin in the last few months. This issue only presented itself after I used a little button within WP Rocket to clear cache/rebuild CSS.
Maybe that was the day when they updated the server packages
Ok, I’ve been testing and on the phone with WP Engine. Looks like the culprit is when we upgraded from PHP 7.2 to PHP 7.3. Your plugin is not compatible with 7.3, at least with their settings. And because my installation works with around 40 plugins, with Notification as the only one that doesn’t work with 7.3, they said they cannot fix this issue.
Specifically, “OP cache is enabled on the server and unfortunately we can’t turn it off.”
Is there any way you would consider making your plugin compatible with WP Engine? They’re definitely one of the biggest hosting providers for WordPress installs so would be a shame for us to have to migrate off. Selfishly, we have integrated pretty heavily with Notifications as well so would be tough to break our current pipeline.
Oh, that’s not ideal at all.
This must be a config as the plugin has been tested multiple times on PHP 7.3 and it was fine. I can even see about 13% of plugin users are on PHP 7.3
But I think I found a solution. You just need to put a
opcache.save_comments=1into php.ini and it should work!Please let me know
WP Engine advised that even if I uploaded php.ini with that line (I’m assuming that’s what you’re suggesting), it would not be able to change any of the server behavior. Sadly, looks like it’s just not compatible with WP Engine.
Hmm, why? OP Cache is configurable and I’m sure they can update the config for you.
Got my ticket escalated through 5 levels at WP Engine and this is their official response,
“Our platform team has reviewed the issue, and save_comments were disabled in PHP 7.3 for performance improvements. Due to this, any plugins that would require this being enabled, the developers would need to update the coding of their plugins to work around this change going forward with PHP 7.3 or higher on our platform.”
Looks like this is a permanent change on their platform. Any hope you’ll rewrite this part of your plugin or is it integral into everything you’ve built on top? I did find another unproven plugin that will do webhooks so not the worst thing in the world to migrate if I have to but I’d rather stick with your solution because I believe in the vision of where you’re headed.
Oh wow! Looks like we have no choice…
The bad news is that this is a very, very low-level feature of the plugin and we built all the classes upon that. I think I have an idea how to make it work, though. We’ll be trying to create an integration file when building the release version. It should use this file instead o the feature reliable on OP Cache.
Please, keep your fingers crossed. I’ll keep you updated on the progress.
Hey @amateurhr! I think we got it!
Can you please install the development version in staging/dev environment to test if it helps?
Basically, we are dumping all the hooks the OP Cache clears out, and we load them from the compatibility file.
Seems to work for us!
Perfect!
The topic ‘Error: Notification Requires “PHP OP Cache to be disabled”’ is closed to new replies.