Support » Requests and Feedback » Symlink to separate content from wordpress?

  • Hi,
    It’s understandable not to want to support remotely creating symlinks (through php code) for security reasons. However for multiple blogs we may wish to put our content files (themes, plugins, uploads, etc.) into a shared directory, and then link over to that.

    Personally, i am new to WordPress and i also would appreciate the safety of working on my files in a separate folder. Especially using an ftp client it’s easy to damage/mame some of the WordPress’ installation files by accident when they are all together with your own content.

    So i have created a sister folder next to my WordPress folder and symlinked the wordpress/wp-content to that outside one. I feel it is safe because nobody can see outside of either the wordpress directory, or the sister directory.

    Themes appear to be largely unaffected. But when linking this breaks probably 30% of all plugins. Can WordPress update the plugindir() method? This method is completely broken for symlinks.

    Many plugins do this;

    $path = dirname(plugindir(__FILE__));

    However the path becomes mangled when the symlink’s name is substituted for its full path by apache server/php distribution. (Something like /user/id/public_html/wordpress/wp-content//user/id/public_html/_wp-config)

    As A TEMPORARY WORKAROUND can do the following replacement;

    $path = basename(dirname(__FILE__));

    which works but needs to be applied to all these broken plugin individually. Hence my comment – that the symlink support is poor in WordPress because it could be very easily fixed (but it is not fixed). However isnt this a worthwhile avenue to pursue?

  • The topic ‘Symlink to separate content from wordpress?’ is closed to new replies.