YahnisElsts / plugin-update-checker

A custom update checker for WordPress plugins. Useful if you don't want to host your project in the official WP repository, but would still like it to support automatic updates. Despite the name, it also works with themes.
MIT License
2.26k stars 410 forks source link

Plugin update checker runs in the frontend v2 #400

Open dimitarconev opened 4 years ago

dimitarconev commented 4 years ago

So, Im using a self-hosted gitlab server. If I register the checker, everything works. But if for some reason the gitlab is down, all Ajax calls is slow and took more than 10-20 seconds until it refuse to load. How I can prevent that, Im using the latest version of the update checker.

YahnisElsts commented 4 years ago

You could try reducing the HTTP request timeout so that the update checker doesn't wait as long when the server isn't working. You can use the puc_request_info_options-$slug filter to change the options passed to wp_remote_get(). Example:

add_filter('puc_request_info_options-myplugin', function($options) {
    $options['timeout'] = 2; //seconds
    return $options;
});