Disable external access to REST API Endpoint

I would suggest to not use WP REST API for this purpose, since it’s being used on homepage and not any remote app/service. The REST API is supposed to grant access to any already publicly available data to a remote developer. Since you’re not providing any public data but registering users from homepage, Ajax might … Read more

How to protect uploads in multisite if user is not logged in?

Nice Question! Poking around it a little bit, this seems to be working (further tests and a more qualified look are much welcome:). Tested only in a localhost development install with subdomains. No domain mapping. Change the following .htaccess rewrite rule: # uploaded files # RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L] RewriteRule ^files/(.+) dl-files.php?file=$1 [L] Make a … Read more

Password protect some uploaded files, so only logged-in users can view them

See my question and answer again, you linked it already in your question: simple solution for restricting access to (some) uploads/downloads The solution isn’t that hairy the only necessity – besides configuring the plugin correct – is to create a .htaccess, which you could do programmatically. For that you have to automate the creation of … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)