New answers tagged wp-filesystem
No, there is not a more convenient way. The thing is, your first example is insecure on the most common hosting systems because the directory will be "owned" by whatever user the webserver itself is running as. Thus, anybody else able to execute code on that same webserver will be able to access it, write to it, changes files in it, and so on. Credentials ...
Top 50 recent answers are included