Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work if uploads aren't in wp-content/uploads #1

Closed
rosswintle opened this issue May 28, 2017 · 2 comments · Fixed by #2
Closed

Doesn't work if uploads aren't in wp-content/uploads #1

rosswintle opened this issue May 28, 2017 · 2 comments · Fixed by #2

Comments

@rosswintle
Copy link
Contributor

First of all, thanks for the awesome plugin. So helpful.

I've installed this on a new client's site where I'm taking over support of an existing site where the old developer has gone away.

The old developer has a bit of an odd wp-config.php and one of the things it does is:

define('WP_CONTENT_URL', "http://{$_SERVER['SERVER_NAME']}");

and his directory structure reflects this.

BE-Media-from-Production doesn't work in this setup.

At the very least, line 196 reads:

if( strpos( $url, 'wp-content/uploads' ) ) {

and should probably be changed so that it matches the WP_CONTENT_URL

if( false !== strpos( $url, WP_CONTENT_URL . '/uploads' ) ) {

(Note that we could now get a 0 from strpos and so we need the type-specific comparison)

You may also want to test for, and use if necessary, the UPLOADS constant (though, unlike WP_CONTENT_URL, this doesn't seem to be set by default, and will need to be tested for)

@billerickson
Copy link
Owner

That's a great point. Do you think you could put together a patch?

@rosswintle
Copy link
Contributor Author

Hi Bill, sorry for the delay, I've been on holiday this last week. I have a working patch that uses WP_CONTENT_URL but not UPLOADS. I'll have to set up a proper test for both. But yes, I'll attempt to make a pull request in the near future.

Thanks

billerickson added a commit that referenced this issue Nov 1, 2017
Two improvements - includes fix for issue #1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants