wp-content/uploads/ should be writable for the server (otherwise it would be impossible to upload a file, no?). If you are going to create something under this directory, it is safe to use wp_mkdir_p().
I would only use WP_Filesystem if there is a chance the server does not have permissions to write to the location, like in wp-content/plugins/, which does not have to be writable for the server (at least I think it doesn’t have to be?).
Sidenote: The File Permissions page of the Codex also talks about a wp-content/cache/ directory. Would this be a “more standard” location for cache files?
Related Posts:
- Convenient way to use wp_filesystem
- Converting fopen/fwrite operations to WP_filesystem
- What dependencies should I load and to use the WP_Filesystem?
- temphangle variable missing when using wp_filesystem copy
- Should I use Filesystem API for reading files or listing directories?
- Does unzip_file() over-write by default?
- Is there a WP Way of getting a filehandle?
- Moving wp-content outside of web root?
- $wp_filesystem returns NULL. What are the dependencies?
- How do I edit the php/html for a particular post?
- Setting wp_temp_dir and permissions not working for “Missing A Temporary Folder” error
- What is the best way to move a plugin´s subdirectory+files to wp-content/uploads-directory?
- Relative file paths in CSS when linking directly (not enqueuing)
- Is fopen() forbidden in WP?
- How to check if txt file exists inside template folder?
- Can I delete `wp-config-sample.php` after installing and configuring WordPress?
- Is it bad to store many files in a single folder?
- External pages redirecting back to wordpress
- WordPress Login doesnt respond after using Filezilla to upload my files on the server
- List of files/folders writable by the web server?
- Save PDF File From Plugin to Filesystem /wp_upload
- accessing files in custom folder in wordpress
- How to replace file_get_contents() with a WordPress Filesystem call
- What files are safe to delete after a security breach in WP content folder?
- Running rmdir function on post save
- WordPress Creates Unused (Unregistered) Image Sizes
- Failed opening required
- Right way to download file from source to destination
- Correct file permissions for in-browser updates using WP-CLI
- WordPress installation on digitalocean eating the server storage
- How to prevent users to view server files using WP File Manager plugin?
- Serve contents from Nextcloud / WebDAV
- File ownership for file tree php user ID – Folder permission 775
- How to write to a text file and save it in a folder for later download?
- 403 Error on “/”
- Get names and paths from unzip_file()
- Downloadable content file structure
- saving file to external server vip
- Time limited file download upon form submit
- How do I upload my WordPress code files from previous website onto local host WordPress website?
- WordPress – tracking options
- Standard location for plugin to save/cache files?
- Which filters or actions to use after a media upload and delete?
- How to convert the file path to a URL of the same file?
- Call to a member function put_contents() on a non-object
- Do WordPress Core Filenames Work as Hooks?
- add/apend templates ‘transparently’ via plugin to currently active theme or child theme?
- delete uploaded file
- Copy a file from a plugin into my theme directory
- Can’t access wp_filesystem in cron function
- Necessary user, group and permissions for core updates
- Allowing all/different file type uploads
- Which actions can update/change .php files?
- What’s a simple but secure method to get file contents into WordPress?
- sanitize attachment filename
- How to move WordPress theme files into a subfolder without breaking the theme?
- Using wp_filesystem in Plugins to store customizer settings
- Where is Featured Image code stored in WP?
- How do I maintain static directories on multisite subdomains?
- how to change max file upload size WordPress 4.9.8 [closed]
- Securing a multi-user permission structure
- Installation failed: Could not create directory – CentOS 7
- Files automatically added
- WordPress HTTP Error on File upload
- Plugin writing: access file that was just uploaded
- How to implement filesystem cache in WordPress
- Interface for logged-in users to upload/download files
- Image URLs stopped working due to Permalinks?
- Unable to check if image uploaded by wp_image_editor exists using file_exists function
- Is file_get_contents() the only way for plugins reading local files OR does WP_Filesystem_Direct::get_contents() even work?
- Where to write custom logs in WordPress
- How to block access to files without modifying .htaccess or ngnix config? [closed]
- wp_filesystem put_contents issue with owner/group
- Why is server preventing admin styles? (Was: Where are WordPress sessions saved?)
- why there is a large file named core in wpmu’s directory?
- Can WP plugins access files outside the installation folder?
- Should I store critical css in the database or in my theme’s filesystem?
- Is there a way to use WP filesystem without credentials when FS_METHOD is NOT set to direct?
- WP_Filesystem in custom customize control
- Upload PDF and other files from the Front-End
- Submitting form from input[type=file] dialog box
- How do you find a file in the media library using the file URL?
- How to Copy Upload Image using WP_Filesystem_Direct
- WordPress Filesystem create CSS-File – get Shortcode ID for Name
- Where to store sensitive uploaded file?
- How to upload .tex files in wordpress?
- Need folder for CPT templates for eg: single-{post_type}.php
- How to handle a lot of media files in the uploads folder? (+10.000)
- Media Upload to custom database and Custom Directory
- Why does unzip_file always return true but nothing happens?
- Error Copying Directory On Plugin Activation
- Private file system for attachments
- Folder Permissions + Security Concerns
- Enabling XSendFile causes 404 for images on WordPress Multisite / Network
- FTP file manager AS wordpress site
- Download a zip folder of selected files
- Hook on opening a media/document
- Media Library Issues
- how to get json file in wordpress template in wordpress
- Search with indexing and linking to PDF content