Change wp-content dir to other host #70

Open
Lofesa opened this Issue Oct 28, 2016 · 10 comments

Comments

2 participants
@Lofesa

Lofesa commented Oct 28, 2016

Hi
First of all, thx for your job.
Well, I tryed to change wp-content to other vhost.
I put
define('WP_CONTENT_DIR','new/path/wp-content');
define('WP_CONTENT_URL','https://vhost/wp-content'):
in wp-config.php, with and w/o set 'https://vhost' at cdn field in autoptimize config.
No file where created unless an empty /new/path/wp-content/cache/autoptimize/js/autoptimize_XXXX.js.
If these file is created, no file permision issue here. All css and js files from wp-include, theme and plugins are downloaded from https://vhost correctly. Seems the AO don´t cacht these files to do their work (unify and minify). No error in logs nor display.
Some clue to debug this?
Thx in advance

@Lofesa

This comment has been minimized.

Show comment
Hide comment
@Lofesa

Lofesa Oct 28, 2016

Hi again
After some digging, If the line 74 of the file autoptimizeBase.php is commented out, this work,but.... only with css and js files in /new/path/wp-content. Files in /old/path/wp-includes don´t

Lofesa commented Oct 28, 2016

Hi again
After some digging, If the line 74 of the file autoptimizeBase.php is commented out, this work,but.... only with css and js files in /new/path/wp-content. Files in /old/path/wp-includes don´t

@futtta

This comment has been minimized.

Show comment
Hide comment
@futtta

futtta Nov 1, 2016

Owner

not a simple issue Lofesa; AO uses the wp-content URL and DIR to "translate" each URL to a FS path. looks what like you did breaks that. I might look into this one day, but afraid I don't have time now (or in the next couple of weeks).

frank

Owner

futtta commented Nov 1, 2016

not a simple issue Lofesa; AO uses the wp-content URL and DIR to "translate" each URL to a FS path. looks what like you did breaks that. I might look into this one day, but afraid I don't have time now (or in the next couple of weeks).

frank

@Lofesa

This comment has been minimized.

Show comment
Hide comment
@Lofesa

Lofesa Nov 2, 2016

Hi @futtta
I tried to solve that.
Changes are in line 74 and between lines 82 -101 on the file I attach here.
Don´t know if this is the best approach but work.

autoptimizeBase.txt

Lofesa commented Nov 2, 2016

Hi @futtta
I tried to solve that.
Changes are in line 74 and between lines 82 -101 on the file I attach here.
Don´t know if this is the best approach but work.

autoptimizeBase.txt

@futtta

This comment has been minimized.

Show comment
Hide comment
@futtta

futtta Nov 11, 2016

Owner

Hi @Lofesa; could you upload the altered version of autoptimizeBase.php as a gist, or could you fork autoptimize and (if you're convinced this is the right solution) do a pull request?

Owner

futtta commented Nov 11, 2016

Hi @Lofesa; could you upload the altered version of autoptimizeBase.php as a gist, or could you fork autoptimize and (if you're convinced this is the right solution) do a pull request?

@Lofesa

This comment has been minimized.

Show comment
Hide comment
@Lofesa

Lofesa Nov 14, 2016

Hi @futtta
Sure. Here is the gist of the altered file

https://gist.github.com/Lofesa/29dca53264547f90b9f4457584172546

I don´t be convinced this is the rigth solution because I get focused to solve my own issue (change wp-content dir and wp-content url at same time). I don´t tried to change only wp-content dir (modifiying the vhost for that creating a location in nginx) or creating an vhost with rootdoc to wp-content and play with the cdn field of autoptimize. I don´t know if the modifications I make works in this cases.
But I´m glad if this help someone or help to make a better plugin

Lofesa commented Nov 14, 2016

Hi @futtta
Sure. Here is the gist of the altered file

https://gist.github.com/Lofesa/29dca53264547f90b9f4457584172546

I don´t be convinced this is the rigth solution because I get focused to solve my own issue (change wp-content dir and wp-content url at same time). I don´t tried to change only wp-content dir (modifiying the vhost for that creating a location in nginx) or creating an vhost with rootdoc to wp-content and play with the cdn field of autoptimize. I don´t know if the modifications I make works in this cases.
But I´m glad if this help someone or help to make a better plugin

@futtta

This comment has been minimized.

Show comment
Hide comment
@futtta

futtta Dec 18, 2016

Owner

OK, had a go at this, cfr. 1386e4f

Could you download the github zip-file and test (first on a non-productions site) if this works for you?

Owner

futtta commented Dec 18, 2016

OK, had a go at this, cfr. 1386e4f

Could you download the github zip-file and test (first on a non-productions site) if this works for you?

@Lofesa

This comment has been minimized.

Show comment
Hide comment
@Lofesa

Lofesa Dec 19, 2016

Sorry to be late.
I tried it but files are not created, In the html are referenced but get 404 error. I had no time now for digging in it, but as soon as possible I do.

Lofesa commented Dec 19, 2016

Sorry to be late.
I tried it but files are not created, In the html are referenced but get 404 error. I had no time now for digging in it, but as soon as possible I do.

@futtta

This comment has been minimized.

Show comment
Hide comment
@futtta

futtta Dec 19, 2016

Owner

OK, let me know, I'll be happy to fix once we know what is not working as expected!

Owner

futtta commented Dec 19, 2016

OK, let me know, I'll be happy to fix once we know what is not working as expected!

@futtta

This comment has been minimized.

Show comment
Hide comment
@futtta

futtta Jun 25, 2017

Owner

still interested in hunting this down, how does this look in AO 2.2.1 @Lofesa ?

Owner

futtta commented Jun 25, 2017

still interested in hunting this down, how does this look in AO 2.2.1 @Lofesa ?

@futtta

This comment has been minimized.

Show comment
Hide comment
@futtta

futtta Sep 27, 2017

Owner

@Lofesa any news about this?

Owner

futtta commented Sep 27, 2017

@Lofesa any news about this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment