Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have several local WordPress dev environments but, for the moment, a very very slow internet connection. The WordPress auto updater for core is very convenient, but would it possible for it to use update packages from localhost instead of downloading it for every site?

share|improve this question

2 Answers 2

A list of options, easier ones first.

  1. Run WordPress as a multisite network, you can find instructions here: http://codex.wordpress.org/Create_A_Network

  2. Manually apply changes via .zip file and overwriting.

    • Download latest zip from wordpress.org
    • Make a backup of your file base per install
    • Unpack the zip files then overwrite files in wp-admin and wp-includes.
    • Overwrite root files but make sure you do not change your wp-config.php settings. It's best to compare the new wp-config for any changes that might have been made so you can apply them.
    • Check wp-content for any new changes and apply them (do not overwrite your existing files)
  3. Using Symbolic Links, this isn't easy will probably break stuff.

share|improve this answer
    
Thanks for the alternatives write up. Was hoping for some "change this line in file.php", although I guess this comes through some wp org api. –  BoBoz Dec 16 '12 at 15:53

I was having the same problem, my Wordpress installation couldn't download the necessary update files fast enough. I could see that in wp-content/tmp the .tmp-files were created and growing, but they all stopped early and Wordpress tried downloading again and again. Of course, your Wordpress-installation might use a different tempdir. If you're unsure, just add the following line to your wp-config.php to make sure that the tempdir is exactly what you expect:

define('WP_TEMP_DIR', ABSPATH . 'wp-content/tmp');

I know that the question is rather old, but as I couldn't find any better solution in the web and I did resolve this issue, I thought the next one who has similar problems would be grateful to find the answer here.

Here's what you have to do:

  1. Download the update manually and upload it to the server into the directory wp-content/tmp.
  2. Modify the file wp-admin/includes/file.php by adding these five lines to the function download_url, right before the line with the call to wp_safe_remote_get().

    $parts = parse_url($url);
    if ( empty($dir) )
            $dir = get_temp_dir();
    if (file_exists($dir . $parts['path']))
            return $dir . $parts['path'];
    
  3. Run the "Automatic Update" from your dashboard.

Please keep these things in mind:

  • The file that you stored into the wp-content/tmp will be deleted after the upgrade.
  • The changes to file.php will disappear as the upgrade normally overwrites file.php

How does this work?

We extract the filename from the URL that Wordpress is trying to download ($parts['path'] is the filename). If the file resides in the tempdir, simply return with this filename rather than with a temporary filename.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.