Enabling Media Protection in Membership 2 hides all media

Enabling Media Protection in Membership 2 hides all media (even the logo) even when I'm logged in as admin and no media is still protected. I've tried a plugin/theme conflict test which didn't reveal anything, neither did the debug logs

    • Paul Kevin

      Hello Bernadette ,

      Hope you are well and thank you. I have checked and seen that your web server is returning a 404 on all media library items that are media protected. I have seen that you are using nginx and there should be a configuration that can be added by your webhost to allow the yoursite/downloads/filename.jpg . Kindly check your nginx configuration or ask your webhost to check if there are special rules not allowing other custom request rewrites.

      Warm Regards
      Paul Kevin

  • Bernadette

    Hi Paul,

    I have talked to the people at WP Engine and this their reply.

    "We are not blocking it, the 404(not found) error is only happening because there is no such file or folder that matches the first request. If we were in fact "returning a 404 on all media library items" then the 2nd url http://encstsaging2.…/2017/09/ENCS-logo-dark-01.svg would also be showing you a 404. Additionally, when something is blocked, it would trigger a 403 (forbidden) error, rather than a 404(not found) error. I would also let them know that both apache and nginx are used, nginx serves cached content, apache serves uncached requests. I can confirm however that we are not blocking custom rewrites."

    Please let me know how I can further solve this problem. It is very important that we get this fixed. Is there another add on that we can use that does the same thing except to specific files only?

    Thank you!

  • Bernadette

    Hi Paul

    This is the latest response from WP Engine:

    "Hi Yasmine,
    I adjusted the proxy passvof the downloadable virtual folder to our Apache Read port and now the only console errors I'm seeing are 404's for some jpeg images like this:
    http://encstsaging2.wpengine.com/downloadable/1710-NBNL-sign-uai-
    1024x768.jpg
    It seems that the plugin may not be properly pulling the files from your wp-content/uploads/*
    folder for these files.
    As for the images being blurred, I see that they are of lower quality, however when I'm
    logged in as an Administrator user on the front page I don't get any images rendered, nor
    do I see any kind of console errors.

    Could you provide us a bit more detail on how this plugin is suppose to function and what
    it's doing so that we can make further adjustments on our end if necessary. I'm not seeing
    any 403 errors either as well anymore. Would you be able to get back with the WPMU Dev
    developers and see if they have any more insight into how we can help better assist."

    Could you provide the information they are requesting here please?

    Thanks a lot

    • Paul Kevin

      Hey there Bernadette ,

      Hope you are well today. Media protection add-on creates a virtual page with a rewrite rule based on what path you specify in the add-on settings. Sometimes the rewrite rules do not update in WordPress so you need to just save the permalinks again.
      The add-on first checks if the media item is protected in the posts or in the attachment url. It should only affect direct access to files for now on apache if "Advanced Media Protection" is enabled. All media items are masked in the url eg "https://siteurl/downloadable/?ms-fileid" depending on the protection rule. The code then checks if the file is protected, if it is it checks for the permissions of the user.
      If the file is not protected or the user has permission, it will get the full path of the file from the WordPress upload directory and buffer the file to the response. If not it will show a no-access image. If the file is not found in the current WordPress installation, it will throw a 404 error.

      Warm Regards
      Paul Kevin

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.