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
- What is the difference between the .po .mo and .pot localization files?
- How to use WordPress HTTP API to download file from remote location
- Copy a file from a plugin into my theme directory
- What exactly does $wp_filesystem->abspath() return?
- How to set path with WP_Filesystem and ftp base / chroot
- What is the correct way to check if WP_Filesystem can write to a directory without aking for username / password?
- Why do I get undefined function export_wp()?
- Use WP_Filesystem to list files in directory
- Why cant the WP Filesystem API read googlefonts.json?
- Uploading Media gives error “Missing a temporary folder.”
- Downloading File from Outside Web Root
- What are the hierarchy of filenames while initialising a WordPress plugin?
- Creating directory and file using native wordpress file system
- Why my wordpress blog files are getting changed?
- Placing assets for external use
- Files automatically added
- What permissions should I give directories if I want to make WordPress more secure?
- Where do I save widget code for wordpress?
- Finding the path of a specific WordPress install
- How to include form for WP_Filesystem()?
- “dashboard”-named PHP file doesn’t get included
- Why WordPress plugin url ajax doesn’t work?
- WordPress and plugins can’t update (“inconsistent file permissions” error)?
- wp_filesystem put_contents issue with owner/group
- Copy Folder to another Folder using WP Filesystem
- Alternative to file_get_contents() for theme operations
- How does WordPress access theme and plugin files through its editor?
- How to edit php code in WordPress Post file?
- Why does WP load so many files in the head of source code? How do I optimize it?
- Adding regular php file to site
- What functions of WP_Filesystem allow me to create a file with code-generated contents in a directory?
- Is there a name for trivial WP PHP files like functions.php, archive php entry.php, page.php and so forth?
- Removing the references to the wp-content folder
- Why WordPress not using WP_Filesystem
- Cleaning a filename after image sideloading a url that contains `%20`
- Generating and downloading files with WP API
- Page to show a link to every file in an directory
- unzip_file not working with the remote file
- How can I create a WordPress dynamic download counter
- Admin Custom Plugin List Files in admin Table
- How can I add a method to create files when in theme-editor.php
- how to get json file in wordpress template
- Add `manifest.json` file to a Custom WordPress Theme
- Unzip_file causing Media file upload error
- Creating an .ics calendar subscription service with wordpress
- How to include all files within a folder & its sub folders to functions.php?
- How to Call Function From Separate WordPress Install on Same Server?
- WP_Filesystem usage within a block of code
- how to create or rewrite files in wordpress plugin folder
- How to display dialog box to save file from wp_filesystem->put_contents function?
- Get original path of user’s filesystem of an uploaded media
- Making a custom upload form and page in the admin section
- wp_redirect to file:// location results in blank page/cannot be displayed page
- Plugin installation works only with FTP – how to debug?
- 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