Closed afragen closed 5 years ago
I’m using get_transient()
and set_transient()
but not sure if we should be using get_site_transient()
and set_site_transient()
@afragen Thanks! You are doing it correctly. The get_site_transient()
and set_site_transient()
functions are multisite specific.
@afragen Looking closer, I question whether these changes are even necessary.
1) WordPress only makes plugin update requests every 12 hours.
2) The update()
method in this file is never called, which makes me think this is dead code that can be removed. I highly doubt anything externally calls this method.
@MikeHansenMe Any reason we should keep the update()
method?
@wpscholar as someone who has views plugins.php a lot, I can tell you the call goes out more than every 12 hours and sometimes more than one per page load. Specifically I think it also happens if another plugin might call those functions or interact with the update transient in some manner or using the pre_set_site_transient_update_plugins
filter.
All requested changes have been made.
@afragen Just out of curiosity, do you know what is actually triggering the call to the update()
method? I can't see anything that calls it.
I believe it’s any other plugin that is also calling add_filter( 'pre_set_site_tramsient_update_plugins', … );
or possibly anything that does set_site_transient('update_plugins');
My current version of GitHub Updater does that.
Set a transient to cache the update wp_remote_get request as these take time.