Support » Plugin: Media Vault » Plugin not working anymore

Viewing 2 replies - 1 through 2 (of 2 total)
  • Ok, I got one step forward with the error analysis. As you can read within the plugin author’s reply here https://wordpress.org/support/topic/how-the-unprotected-files-are-handeled?replies=3 protected files are automatically moved to the “_mediavault” sub-directory.

    I found out that this still works for protected files. However, what’s not working is that the new path is correctly set for protected files. So when you click on the file link, you get an error message. When you manually add “/mediavault” after “uploads” within the file link, the file can be accessed for users that meet the requirements set within the file protection settings.

    So, @max GJ Panas, I hope that helps for resolving the issue. Do you have any clue why this is happening?

    Thanks!
    joschi81

    Here’s a dirty JS workaround that should work for all who don’t mix protected and unprotected files on one page.

    1. Install a custom JS plugin (e.g. TC Custom JavaScript)
    2. Make sure to place a div or span with the class “protected-files” somewhere on the respective page (easiest way: go to text/html view of your page and type <div class="screen-reader-text protected-files"></div>).
    3. Add the following JS code by using the plugin mentioned above:

    var $ = jQuery;
    
    $(document).ready(function(){
      if($('.protected-files').length) {
        $('.entry-content a').each(function(){
          var link = $(this).attr('href');
          if(link.replace('uploads','')!=link) {
            $(this).attr('href',link.replace('uploads','uploads/_mediavault'));
          }
        });
      }
    });

    I hope this helps until a new version of the plugin that works with the current WP version is available.

    Iportant: This solution only works when you unselect the option that puts media files into year/month subfolders whithin the media settings page before uploading the files used within the page.

    Best regards
    joschi81

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Plugin not working anymore’ is closed to new replies.