No you don’t, and not even sure if you can use it for listing files in directories. The only limitation on reading files is that they will be readable to the web server, and obviously plugin directories has to be readable for the web server to be able to read the PHP files.
Now, if you are trying to read something outside of the wordpress file structure you might need to use the filesystem API.
Related Posts:
- temphangle variable missing when using wp_filesystem copy
- Creating directory in uploads – wp_mkdir_p() or WP_Filesystem?
- Convenient way to use wp_filesystem
- Converting fopen/fwrite operations to WP_filesystem
- What dependencies should I load and to use the WP_Filesystem?
- Right way to download file from source to destination
- 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
- How to append_contents using WP_Filesystem?
- 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
- 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
- Why is WordPress upgrade process not using WP_TEMP_DIR?
- What is the difference between the .po .mo and .pot localization files?
- Where to store PHP files created by plugin / themes
- Standard location for plugin to save/cache files?
- How to use WordPress HTTP API to download file from remote location
- Which filters or actions to use after a media upload and delete?
- Why doesn’t WP_Image_Editor save images using the Filesystem API?
- 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?
- How to give image source in wordpress page editor?
- Do I need to use WP_Filesystem when creating a downloadable file on the fly?
- add/apend templates ‘transparently’ via plugin to currently active theme or child theme?
- delete uploaded file
- Copy and delete a directory with WordPress functions
- Copy a file from a plugin into my theme directory
- How to configure WP filesystem access in Linux (Ubuntu Server)?
- How to fix the error “file_get_contents was found in the file functions.php”?
- Can’t access wp_filesystem in cron function
- What exactly does $wp_filesystem->abspath() return?
- How to set path with WP_Filesystem and ftp base / chroot
- How do you use unzip_file()?
- What is the correct way to check if WP_Filesystem can write to a directory without aking for username / password?
- Necessary user, group and permissions for core updates
- Allowing all/different file type uploads
- Why do I get undefined function export_wp()?
- Merging PHP download script into `functions.php`
- Uploading non-media files?
- Unable to access WP admin
- Use WP_Filesystem to list files in directory
- Which actions can update/change .php files?
- wp_temp_dir does not change the /tmp temporary default directory
- What’s a simple but secure method to get file contents into WordPress?
- wp-config.php file permissions
- Standard permissions for wordpress; Plugin installation asks for FTP credentials
- sanitize attachment filename
- When to use the Filesystem API? Should I use it at all?
- What to use , set_transient, set_option or file system? [closed]
- How to move WordPress theme files into a subfolder without breaking the theme?
- Why cant the WP Filesystem API read googlefonts.json?
- Convert PHP readfile to WP_Filesystem
- 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?
- Uploading Media gives error “Missing a temporary folder.”
- how to change max file upload size WordPress 4.9.8 [closed]
- Downloading File from Outside Web Root
- What are the hierarchy of filenames while initialising a WordPress plugin?
- Can’t write pdf file to upload directory using FPDF
- Creating directory and file using native wordpress file system
- Change default uploads file using wp Skeleton
- Securing a multi-user permission structure
- Installation failed: Could not create directory – CentOS 7
- Register visits of my pages in wordpresss
- Why my wordpress blog files are getting changed?
- Adding Adobe files to a wordpress site [closed]
- Placing assets for external use
- Files automatically added