I’m sorry, but it seems you don’t understand the difference between javascript, css and php code.
The uploads directory is not any less safe than any other directory… most of the time, the sites are infected by malware by vulnerabilities in the theme directory or some old plugin.
Furthermore, as I explained earlier, many commercial themes cache css and js files on the uploads directory. The same is true for many paid and free plugins.
There is zero chance of your site being hacked if people upload js or css files, unless you execute those with php (and then, something is very wrong).
What you must do to protect your uploads directory, is not to remove permissions but rather, to disable php execution.
https://www.wpbeginner.com/wp-tutorials/how-to-disable-php-execution-in-certain-wordpress-directories/
If you use apache, you add this to the .htaccess inside the uploads directory (replace php version accordingly):
# no php execution here
<Files *.php>
deny from all
</Files>
# disable php engine
<IfModule mod_php5.c>
php_flag engine off
</IfModule>
This would prevent execution of any php code, even if someone uploads php code to it… although, if they are able to upload, you must have some other vulnerabilities somewhere.
The answer to secure wordpress is not to remove permissions to js and css files.
Those files are never executed on the server (same as images), so it really is irrelevant to do so. It would be the exact same thing as blocking images, videos or whatever.
That being said, it’s your choice to block them of course.
Unfortunately, that makes your server incompatible with our plugin as well as with a lot of other themes and plugins.
Sorry for not being able to solve the issue with the file paths.
Currently there’s no hook to change the file path, but I’ll consider adding it for the future.