How Prevent Direct Access Gold Protect Your WordPress Files?

Performance has always been a major concern for every website owner because it affects not only the website SEO ranking but also their user experience. Both contribute to the success of their website in general and their online business in particular. That’s why Prevent Direct Access performance is indeed our top priority when developing our Gold version as well.

Prevent Direct Access Performance

There are a lot of questions asked on how our Gold version handles protected files as well as serves non-protected files. You might have only a few protected among a lot of non-protected files on your WordPress website. So if these unprotected files are also served through our plugin’s scripts, it will probably slow down your website.

Well, we totally understand your concern. That’s why we’re going to explain briefly on the technical side: how Prevent Direct Access Gold actually works.

How Prevent Direct Access Gold handles and protects your files?

First and foremost, Prevent Direct Access Gold only redirects and handles requests for protected files whose locations are under _pda directory. That means requests for your “normal” unprotected files are not handled and served by our plugin’s scripts. As a result, the load speed of your website in general and unprotected files, in particular, are not affected by our Gold version.

When you protect your private files under Media Library, Prevent Direct Access Gold automatically moves these files (preserving your WordPress folder structure) from WordPress uploads folder (where they are originally stored) into our own protected folder (/_pda/), which is a sub-directory within uploads folder. Most importantly, our Gold version updates the file’s relevant fields (including its File URL) in the database to reflect the move.

This move and update are crucial as our plugin is now able to know which files are protected and which are not. If they are, these file requests will be redirected and handled by Prevent Direct Access Gold file handler scripts. Otherwise, we don’t interfere and redirect any other file requests from your WordPress uploads folder.

When you unprotect a file, the reverse applies. Prevent Direct Access Gold moves the file back to its original folder under WordPress uploads as well as updates its File URL in the Database.

Compared to other plugins…

In contrast, many membership and download manager plugins are using similar redirect rules as follows:

RewriteBase /
RewriteRule ^wp-content/uploads/(.*\.pdf)$ /wp-content/plugins/memberships-pro/handle-file.php [L]

These redirect rules handle both your protected and unprotected files, which could slow down your website performance adversely.

“So, does Prevent Direct Access Gold slow down my WordPress website?”

The answer is no, none whatsoever. As explained above, our plugin doesn’t interfere with or affect how your website serves your normal (unprotected) files and assets. So Prevent Direct Access Gold hardly slows down your website at all.

Please note that our Free version 2.4 and below is still using an outdated file protection handling, which interferes with all file upload requests. So the free version is not meant for production use as it would slow down your website, sometimes significantly.

Protected Image Gallery

Technically, PDA Gold will check the file access permission first before returning the images to the end-users. So it’s absolutely normal if you experience a slight delay in loading speed of these protected images compared to unprotected images.

In case you’re protecting the entire image gallery, it takes some time to completely load the gallery, as a whole.

We’re working on a solution that caches protected files on the front-end so that our plugin doesn’t have to constantly make requests to the database for each image.

Alternatively, lazy-loading your images would provide better user experience by avoiding abrupt loading.

Lasted updated on May 5, 2020