• I am working at moving a site I built using Download Manager to become part of a multi-site installation. In doing so, I found out that part of the code was not written to work on multisite installations. Please make the following updates to download-manager.php to work on multisite installations. These changes will also work in single site setups.

    define('UPLOAD_DIR', wp_upload_dir()['basedir'].'/download-manager-files/');
    
    define('WPDM_CACHE_DIR',dirname(__FILE__).'/cache/');
    
    define('_DEL_DIR',wp_upload_dir()['basedir'].'/download-manager-files');
    
    define('UPLOAD_BASE',wp_upload_dir()['basedir']);

    Basically, use the wp_upload_dir function instead of trying to create these paths from the Content directory. This is needed since each sub-site in a multisite installation gets assigned its own upload directory.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor W3 Eden, Inc.

    (@w3eden)

    Noted ??

    Thread Starter Yannick Lefebvre

    (@jackdewey)

    Are we going to see the changes I mentioned above in a new release soon? I currently need to re-apply these changes with every update. As I mentioned, making these changes will not break the plugin for single site installations. It will only add that it will now work on multi-site installations. Thanks in advance.

    Plugin Contributor W3 Eden, Inc.

    (@w3eden)

    Yes, from next update.

    Thread Starter Yannick Lefebvre

    (@jackdewey)

    I checked the latest versions and the code you changed still does not work in multisite installations. I had to modify as follows to have it work on a multisite installation.

    Just using WP_CONTENT_DIR is not valid, since each site has its own subfolder under wp-content/uploads/sites/xxx in a multi-site installation.

    if(!defined('UPLOAD_DIR'))
    define('UPLOAD_DIR',wp_upload_dir()['basedir'].'/download-manager-files/');
    
    if(!defined('WPDM_CACHE_DIR'))
    define('WPDM_CACHE_DIR',dirname(__FILE__).'/cache/');
    
    if(!defined('_DEL_DIR'))
    define('_DEL_DIR',wp_upload_dir()['basedir'].'/download-manager-files');
    
    if(!defined('UPLOAD_BASE'))
    define('UPLOAD_BASE',wp_upload_dir()['basedir']);
    Thread Starter Yannick Lefebvre

    (@jackdewey)

    Still waiting for the inclusion of this fix in new updates. I keep having to manually re-apply these changes with each version.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Changes to work in multisite installation’ is closed to new replies.