-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/killswitch #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Where are they cached exactly? Do you mean the nginx cache for However, I think we should also include a transient cache after retrieving the setting. Even if just a 5 minute one ... to prevent a high-traffic site potentially bringing down OpsOasis if something goes wrong with the caching ... |
|
The setting name is extremely verbose 😅 I don't think we need the |
The problem isn't on the opsoasis side of things; the wp-json endpoint is updating correctly and quickly each time. The lag is happening on the site where the Plugin Autoupdate Filter code is running. I think what is happening is that when an instance of |
Updates
|
Hmmm ... unfortunately, it does not make sense 😢 Unless cached in the object cache, PHP objects don't persist past their current request unlike objects running on a Java Tomcat or ASP.NET server. I also checked the code of I haven't tested this to confirm but if you think the plugin is somehow using "old" settings even though OpsOasis has updated, then we need to investigate exactly why 😢 I still think some batcache feature would be the culprit... I still think we should incorporate a ~5 minute transient ourselves for the settings so we only get a maximum of ~1000 requests every 5 minutes to OpsOasis (roughly the number of sites we run the plugin on) instead of any number of requests proportional to the number of visitors that our managed sites get, but that's a separate conversation 😄 |
The latest version of the settings plugin is on opsoasis and this branch of Plugin Autoupdate Filter can be loaded on any site to test. |
That makes a lot of sense! Especially since my
I'm still not a fan of the fact that error handling happens in two places (lines 85 and 26 when just 26 would be enough) nor of the fact that Big fan of the renaming of the class methods though! |
|
@ahegyes Thank you for your persistence, sorry to make you look through this so many times. I'm definitely slowly understanding your suggestions fully, without just copy/pasting them. I've updated the code, and I'm hoping you'll have time to look at it again. No hurry, BTW :) The only odd thing that I wasn't able to understand fully was how, when the JSON is empty, line 88 would not return an object, so starting on line 91, I had to set it as an object so that the function would return an object. Maybe that's not a big deal; it certainly works as-is. |
|
@NickGreen Very big fan of the current iteration! 😄 I left a few comments but 👍 from me. |
|
OK, I've tested this locally to ensure that autoupdates still do work as intended. I've also loaded version 1.5.0 (the version with the killswitch functionality) on a single production site before we roll it out to all of them: https://americanperimetertrail.org/wp-admin/plugins.php I'll check back in this week to ensure that it's not causing any problems, then will probably merge this to trunk, which will cause all of the existing copies of this plugin to autpopdate themselves. This also means that we can no longer mess with the opsoasis killswitch without it affecting prod sites. |
The worst that can happen is that auto-updates will stop, right? 😅 Because the plugin won't be able to pull in the settings and will default to ... pausing, no? |
|
Ha, that's true. I'll roll this out today 👍 |

Synopsis
Simplified version of the centralized settings here: #24
The point of this is to get an MVP up and running, with the most important feature, and then we can discuss and add the "Swiss Army Knife" features later.
To Test
When that toggle switch is toggled on, then all autoupdates should stop happening, and a notice should appear on the top of the plugins page.
Details
Any other feedback is helpful, with the goal of getting out a minimum viable product that includes the killswitch, and we can add more features later :)