I am writing a plugin, I want, in some cases, to tell WordPress to update that plugin, and that plugin only, immediately.

I know that there is a transient called update_plugins that contains the latest time the plugin was updated. and from that value, WordPress checks if 12 hours have passed.

I have tried to manually change that value in order to fool WordPress into thinking the last update happened more than 12 hours ago and therefore trriger a new update check But that didn't work, The value in the transient is changed but the update is not triggered.

This is the code I used:

$update_plugins = get_site_transient( 'update_plugins' );
$update_plugins->last_checked = $update_plugins->last_checked - 86400;
set_site_transient( 'update_plugins', $value );

What can I do to change the WordPress auto-update rate? Is there a hook I can use?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.