Skip to content
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

Updates do not always show #23

Open
stephenh1988 opened this issue Oct 17, 2012 · 0 comments
Open

Updates do not always show #23

stephenh1988 opened this issue Oct 17, 2012 · 0 comments

Comments

@stephenh1988
Copy link

I noticed this bug when adapting this for a non-GitHub context, so potentially it is something that I've done. But hopefully I can explain this bug and how it effects the updater.

Inside the callback on the pre_set_site_transient_update_plugins hook we have:

// Check if the transient contains the 'checked' information
// If not, just return its value without hacking it
if ( empty( $transient->checked ) )
    return $transient;

This is presumably because wp_update_plugin() saves the transient twice - and we only want to run our check the second time. (Or is there another reason?).

However, $transient->checked is only ever non-empty when $time_not_changed is 'true' ( see source: https://github.com/WordPress/WordPress/blob/3.4.1/wp-includes/update.php#L155 ). This is only true when within the 'timeout' of the plug-in checker (minute on update-core.php, hour on the plug-ins page).

So, if you go to the plug-ins page and more than an hour has passed since the last plug-in check - the updater doesn't do anything. Refreshing the page, and the plug-ins have been checked under an hour ago (obviously), so this time the updater does run (and the update is viewable in the admin bar).

In real terms this shows itself as updates appearing for other plug-ins (because a cron job has been triggered), but not ones using this updater.

Hopefully that makes sense...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant