WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#10349 closed defect (bug) (fixed)

No plugin update messages displayed in trunk

Reported by: pavelevap Owned by: dd32
Milestone: 2.9 Priority: normal
Severity: normal Version: 2.9
Component: Upgrade/Install Keywords: has-patch needs-testing
Focuses: Cc:

Description

I am using 2.9-rare version and there is no message about new plugin yet even if I know that many plugins were updated. It would be fine to allow updating for trunk version to test plugins with this version and use automatical upgrade...

Attachments (1)

10439.diff (1.8 KB) - added by dd32 5 years ago.

Download all attachments as: .zip

Change History (22)

comment:1 pavelevap5 years ago

  • Cc pavelevap@… added
  • Component changed from General to Plugins

comment:2 pavelevap5 years ago

  • Summary changed from Plugin update does not work to Plugin update does not work in trunk

comment:3 dd325 years ago

  • Component changed from Plugins to Upgrade/Install
  • Owner set to dd32
  • Summary changed from Plugin update does not work in trunk to No plugin update messages displayed in trunk

Example of a plugin thats not working?

Does the Plugin Browser work? (Or throw an error)

Did it work in a previous version? (If so, Which)

comment:4 pavelevap5 years ago

I use many plugins for testing purposes and no one displays update message (for example Changelogger, I have 1.0.0.1 version, and there were two upgrades 1.0.0.5 and 1.1.0). On all my installations of version 2.8 were these notices displayed, but on my localhost no and there is still oldest version without message. Automatical upgrade of plugin stopped about two weeks ago and no plugin can be automatically upgraded. And the same was with old version Wordpress (there was official 2.7 and I used 2.8-trunk and until 2.8-RC was released, no update message appears).

Plugin Browser and Installation of new plugins works without problem. Only plugin can not be automatically updated because of no message when using trunk from SVN.

comment:5 dd325 years ago

I have a feeling this is due to the timeouts on the API requests.

pavelevap: Are you on a slow(er) connection?

All the update API requests time out after 3 seconds.. So that could be it, open wp-includes/update.php and search for 'timeout' => 3, try changing that to 30, if that works its just due to your slow connection.

I'd suggest increasing that timeout to at least 5-8seconds.. its usually run via a cron, so the timeout isnt a huge problem.. Could be increased to a higher value if its a ajax request, and a lower timeout if its being run as a realtime process maybe?

comment:6 pavelevap5 years ago

Great, thank you! Increasing timeout helped me very much. I use slower connection based on mobile CDMA technology, which is a little slower...

comment:7 dd325 years ago

  • Status changed from new to assigned

I might knock up a patch which uses a increased timeout on cron-based requests... and that upon a timeout, it doesnt wipe out the update details....

dd325 years ago

comment:8 dd325 years ago

  • Keywords has-patch added

attachment 10439.diff added

  • Typo in patch filename, But its for this ticket.

comment:9 dd325 years ago

  • Keywords needs-testing added

comment:10 azaozz5 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [11826]) Increase timeout on cron-based requests when checking for upgrades, props dd32, fixes #10349

comment:11 pavelevap5 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Does not work for me. Only sometimes... When I come after some days, there is 6 plugins notified with update messagge. As soon as I update one of them, all others messagges disappear. When I activate any new plugin, messagges appear again, but after update of next plugin, all others disappear once again...

comment:12 dd325 years ago

As soon as I update one of them, all others messagges disappear.

Yes, That would be expected, As after you upgrade a plugin, WordPress requires a new API request to be made.. If that times out, Then you will have no update messages visible until the next cron-made request IF the inline cron times out.

When I activate any new plugin, messagges appear again, but after update of next plugin, all others disappear once again...

Because, by that time, The Cron request has completed (Remember, Its probably taking about 10 seconds), in the time between, those on slow connections will have no feedback.

It'd be possible to simply remove the plugin from the update-list, but that'll require some new API on the transients (Specifically, Finding out the age of a transient, so that upgrading a plugin doesnt end up with a forever-extending cache timeout)

comment:13 pavelevap5 years ago

Thank you very much for clarification. It would be very helpfull to make this work...

comment:14 dd325 years ago

You could add this to a plugin or your themes functions.php file in the meantime: (I'd nearly suggest Plugin material)

add_filer('http_request_timeout', '_30sec_http_timeout');
function _30sec_http_timeout($timeout) {
  return ($timeout > 30) ? $timeout : 30; //Return 30 or greater
}

comment:15 pavelevap5 years ago

I tried to add this to functions.php and also to Hello Dolly plugin, but does not work for me (now does not work also after activating new plugin)...

comment:16 dd325 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

Sorry a typo:

add_filter('http_request_timeout', '_30sec_http_timeout');
function _30sec_http_timeout($timeout) {
  return ($timeout > 30) ? $timeout : 30; //Return 30 or greater
}

('add_filter' not 'add_filer')

(now does not work also after activating new plugin).

Like i said, Thats just you're slow connection, And due to the availability of the above function, I'm going to reclose this as fixed, Not many installs are hosted on outdated slow links anymore, and the increased timeout for non-realtime requests is all i think you can hope for at the present time.

comment:17 pavelevap5 years ago

Yes, I noticed typo before, this function does not work for me also with corrected typo... Without this fuction I could see messagges for a while after activating new plugin, but with this function I can not see plugin updates in no case...

comment:18 dd325 years ago

this function does not work for me also with corrected typo

Oh 'Duh! I was looking at the defaults.. God i hate the filters in that file, none of them make sense... (ok, some do)

this should:

add_filter('http_request_args', '_30sec_http_timeout');
function _30sec_http_timeout($r) {
  if ( $r['timeout'] < 30 )
    $r['timeout'] = 30;
  return $r;
}

comment:19 pavelevap5 years ago

Great, it works now, thank you very much. It is great solution which can be used as small standalone plugin for people with slow internet connection.

comment:20 hakre4 years ago

Cross-Referenced: #11505

comment:21 miqrogroove4 years ago

*cough* *sneeze* set_time_limit()

*hides*

Note: See TracTickets for help on using tickets.