humanmade/BackUpWordPress — pull request #132 by mattheu (2012-05-24 14:48:14+00:00)
Title: Shouldn't use ABSPATH here

# My Situation

I have WordPress in a subdirectory, not in root. http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

I have also defined WP_CONTENT_DIR and WP_CONTENT_URL to be outside of this wordpress directory.

# The Problem

When generating the url to the download, ABSPATH and site_url are used. These specifically point to the WordPress install directory, which is usually fine, but breaks if ABSPATH is not the site root, and site_url() is not the main home url.

# The Solution

* Use home_url() instead of site_url() - usually these are the same of course... but not always.
* Find the site root, instead of using ABSPATH. Not 100% of the best way to do this so take a look at my solution.