WP Updates for own plugin: site_transient_plugin in a long loop
-
After checking this guide by @pbiron
I’ve noticed he uses `pre_set_site_transient_update_plugins
` which works fine for meBut in the past I was using
site_transient_update_plugins
and I noticed mywp-admin/plugins.php
andwp-admin/update-core.php
admin pages where ultra-slow.After installing Debug plugin, I noticed that there were like 40+ calls from the remote host where my plugin was trying to be updated (I have 31 plugins, 24 inactive, but I would say at least 1 call per plugin installed).
With
pre_set_site_transient_update_plugins
this doesn’t happen.Purely out of curiosity, I was reading down in the bottom the comments and @afragen, author of the awesome plugin Git Updater (who must be a mega expert on WP Updating topics) commented literally this:
As I’ve shared with you, my preference is to use the site_transient_{$transient} filter hooks. The reason is that, as an updater developer, I prefer not to add extra code around the database that is more easily injected when it’s needed instead of having it saved in the transient. Simply my preference.
That blew my mind. So now I’m wondering whats going on with my code and with all this site_transient thing.
Why my code checks like 45 times for updates with
site_transient_update_plugins
and only twice withpre_set_site_transient_update_plugins
Proof server log with
site_transient_update_plugins
:
- The topic ‘WP Updates for own plugin: site_transient_plugin in a long loop’ is closed to new replies.