WordPress.org

Support

Support » Plugins and Hacks » [Resolved] wp-content path incorrect for removal operation

[Resolved] wp-content path incorrect for removal operation

  • I can’t thank you enough for this plugin!

    My only (minor) complaint is that after I successfully migrate a site, Duplicator tells me to click a link to delete all of its files (installer.php, etc.). However, if I have modified my wp-content AND plugins folder paths, this doesn’t work.

    Clicking on the delete link takes me to a URL inside Duplicator’s folder. It automatically assumes that this file is inside mydomain.com/wp-content/plugins/duplicator/ which results in a 404 page; obviously because the actual path should be something like mydomain.com/custom-content-folder/custom-plugins-folder/duplicator/.

    I don’t know if this is “by design” or if the wp-content URL is just hardcoded in the code, but it would be good if it could be fixed.

    Of course, I can just delete these stuff through FTP, but still.

    http://wordpress.org/extend/plugins/duplicator/

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Cory Lamle

    @corylamleorg

    Hi Hassan,

    It currently is hard-coded I’ll see if I can get the plugins path parameter passed… Good find, thxs!

    Thanks.

    Hey, since we’re talking about custom content folder etc. there is another related thing. Of course, to change your default wp-content directory in the first place, you need to edit your wp-config.php with something like (assuming you’re using WAMP on a local machine):

    define( 'WP_CONTENT_DIR', 'C:\wamp\www\my-site/custom-content' );
    define( 'WP_CONTENT_URL', 'http://localhost/my-site/custom-content' );

    Same thing goes for the plugins and the uploads folders. These URLs do not get changed/updates after migration. However, Duplicator does give me a notice in the final step saying that I better check my wp-config.php because it found mentions of these code snippets. Without changing those, the site breaks of course.

    Wouldn’t it be better if Duplicator could update those paths to the new one automatically? It can write to wp-config.php, can’t it?

    Plugin Author Cory Lamle

    @corylamleorg

    Hi Hassan,

    That is on the todo list as well. The problem I found with those particular variables is that some theme/plugin authors would dynamically set the value to all kinds of combinations:

    define( 'WP_CONTENT_DIR', $_SERVER['REMOTE'] . 'value')
    define( 'WP_CONTENT_DIR', $_SERVER['REMOTE'] . "value$var")
    define( 'WP_CONTENT_DIR', 'foobar')
    etc... etc...

    Writing a regex to capture so many different types probably isn’t the way to go. What really need to happen is the creation of a state-machine that will cover all the scenarios. Once I get some time to really make that happen then I’ll integrate that in as well, until then it will have to be a report item… But it is on the todo list 🙂

    Sounds good all in all. Awaiting the fix and the new features 🙂

    Plugin Author Cory Lamle

    @corylamleorg

    It may be a few release out, as the todo list is currently pretty long, but it will eventually get addressed… Know of any good PHP developers who want to help for free 🙂

    Is this plugin on Github?

    Plugin Author Cory Lamle

    @corylamleorg

    Not yet, but I plan to getting a Github account for it….

    Hi,

    have you fixed the hardcoded URL thingy with the latest v0.4.5? I read the changelog before updating, but saw no mention of such thing.

    However, I just migrated a site that also has custom content folders and the delete link did work! It took me to a link inside my wp-admin folder and showed all kinds of success messages 😀

    Did you actually change this, or is it a “unintended success”?

    Plugin Author Cory Lamle

    @corylamleorg

    Hey Hassan,

    I did fix that issue I just forgot to add it to the changelog, sorry about that 🙂

    sorry about that?

    No man, THANK YOU for that; it was a pleasant surprise!

    Plugin Author Cory Lamle

    @corylamleorg

    LOL… Your welcome 🙂

    manuelkuhs

    @manuelkuhs

    lifeinthegrid,

    (thanks for such a fantastic plugin!)

    There is still an issue, at least when using Better WP Security to rename the wp-contents directory. Duplicator does NOT update the 2 lines that Better WP Security adds to the top of wp-config.php:

    define( 'WP_CONTENT_DIR', '/home/user/public_html/wp-content' );
    define( 'WP_CONTENT_URL', 'http://example.com/wp-content' );

    After manually updating these, it worked fine.

    Plugin Author Cory Lamle

    @corylamleorg

    Hey manuelkuhs,

    Thanks for the feedback! Right now the those are reported in Step 3 of the installer report as Warnings. I hope to get those into future updates.

    Cheers~

    Thanks lifeinthegrid – clearly I should have actually read the warnings!!

    Keep up the good stuff

    Plugin Author Cory Lamle

    @corylamleorg

    No Problem…

    I plan to make the report a bit more visible in the future…

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘[Resolved] wp-content path incorrect for removal operation’ is closed to new replies.