[Solved] wp_temp_dir does not change the /tmp temporary default directory

sys_get_temp_dir is not a WordPress function, it’s a core PHP function. It cannot be modified or changed using WordPress constants. To modify this would require changes to the servers operating system by the root user. Instead, WP_TEMP_DIR can be used to influence the value of get_temp_dir which is a WordPress function. In the event that … Read more

[Solved] How to Protect Uploads, if User is not Logged In?

Only checking if the cookie exists, is not much of a strict protection. To get a stronger protection, you can pass or “proxy” all requests to the uploaded folder (exemplary uploads in the following example) through a php script: RewriteCond %{REQUEST_FILENAME} -s RewriteRule ^wp-content/uploads/(.*)$ dl-file.php?file=$1 [QSA,L] All requests to uploaded files (which includes images in … Read more