To be clear, the reason I use ```substr()``` instead of ```*_replace``` is because it's easier (i.e., fewer lines of code), not because it's faster. It just happens to be faster as well.

But anyway, how about ```pathinfo()``` instead of ```substr()``` to create ```$tempdir``` value? (L82) That would be both readable and easy to implement.

For ```$tempOffset```, I can use ```strlen($tempdir . '/wordpress')``` and that would increase readability and give us the same value, so we could still use it as the offset in L86-87. Or we can implement a ```*_replace()``` approach. I just have an aversion to using string replacement when the portion to be replaced is in the exact same part of each value. This is precisely what ```substr()``` was created to address.

But it's your call. Let me know which approach you want to take, and I'll add another commit sometime over the weekend.