afragen/github-updater — pull request #11 by GaryJones (2013-09-07 20:05:20+00:00)
Title: Use $wp_filesystem to rename the plugin folder.

Instead using native file and folder manipulation functions, here, `rename()`, we should be using the WP_Filesystem. This has far better support across different systems and setups.

By the time we get to renaming the source folder, the global `$wp_filesystem` has already been setup, so we can simply re-use that to effectively rename the folder by moving it instead. Behind the scenes, WP_Filesystem will try to use `@rename()`, and if that doesn't work, it will copy the folder to a new location and then delete the original.

I've made the feedback a little more verbose - by default, this is hidden, so someone who clicks on the show details obviously wants a little more information anyway.

![github-updater-rename](https://f.cloud.github.com/assets/88371/1102037/63961e8e-17f8-11e3-8274-df8653b3880a.png)

I can't overemphasise how important this change is. My dev site is hosted on a semi-locked down environment (Suhosin, safe mode etc.), and the existing code (simple `rename()`) would not work - it needs the power of the WP_Filesystem to make that folder rename correctly. With that in place, the update proceeds correctly. Woohoo!