First of all, thx for your job.
Well, I tryed to change wp-content to other vhost.
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
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
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).
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.
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?
Sure. Here is the gist of the altered file
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
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?
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.
OK, let me know, I'll be happy to fix once we know what is not working as expected!