radishconcepts / WordPress-GitHub-Plugin-Updater

This class is meant to be used with your Github hosted WordPress plugins. The purpose of the class is to allow your WordPress plugin to be updated whenever you push out a new version of your plugin; similarly to the experience users know and love with the WordPress.org plugin repository.
https://github.com/jkudish/WordPress-GitHub-Plugin-Updater
822 stars 195 forks source link

Slowing down admin area a fair bit #54

Closed Jeradin closed 9 years ago

Jeradin commented 11 years ago

Hello there,

I added this excellent feature to one of my plugins and I actually didn't notice it, but a user did. https://github.com/Jeradin/acf-website-field/issues/14

After reading this issue I did the same, commented out the updater code and instantly my admin speed improved, I hadn't even noticed it was an issue!

Any thoughts on this? Here is my includes text:

include_once('updater.php');

if (is_admin()) { // note the use of is_admin() to double check that this is happening in the admin
    $config = array(
        'slug' => plugin_basename(__FILE__), // this is the slug of your plugin
        'proper_folder_name' => 'acf-website-field', // this is the name of the folder your plugin lives in
        'api_url' => 'https://github.com/Jeradin/acf-website-field', // the github API url of your github repo
        'raw_url' => 'https://raw.github.com/Jeradin/acf-website-field/master', // the github raw url of your github repo
        'github_url' => 'https://github.com/Jeradin/acf-website-field', // the github url of your github repo
        'zip_url' => 'https://github.com/Jeradin/acf-website-field/zipball/master', // the zip url of the github repo
        'sslverify' => true, // wether WP should check the validity of the SSL cert when getting an update, see https://github.com/jkudish/WordPress-GitHub-Plugin-Updater/issues/2 and https://github.com/jkudish/WordPress-GitHub-Plugin-Updater/issues/4 for details
        'requires' => '3.0', // which version of WordPress does your plugin require?
        'tested' => '3.3', // which version of WordPress is your plugin tested up to?
        'readme' => 'README.md', // which file to use as the readme for the version number
        'access_token' => '', // Access private repositories by authorizing under Appearance > Github Updates when this example plugin is installed
    );
    new WP_GitHub_Updater($config);
}
benjaminpick commented 10 years ago

My Zend Server says 'Function curl_exec() took 3948ms', which is probably the lag you are talking about.

The cause here is updater.php#L158 which fetches the github data on every single request.

coenjacobs commented 9 years ago

This has been fixed in #21 which still hasn't released. Now that we're speeding things up again, let's try and get that out the door as soon as we can.