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?
- Where to store PHP files created by plugin / themes
- How to use WordPress HTTP API to download file from remote location
- Copy and delete a directory with WordPress functions
- How to fix the error “file_get_contents was found in the file functions.php”?
- 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?
- Why do I get undefined function export_wp()?
- Merging PHP download script into `functions.php`
- Unable to access WP admin
- Use WP_Filesystem to list files in directory
- Standard permissions for wordpress; Plugin installation asks for FTP credentials
- When to use the Filesystem API? Should I use it at all?
- What to use , set_transient, set_option or file system? [closed]
- Why cant the WP Filesystem API read googlefonts.json?
- Convert PHP readfile to WP_Filesystem
- 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
- Register visits of my pages in wordpresss
- Why my wordpress blog files are getting changed?
- Adding Adobe files to a wordpress site [closed]
- What permissions should I give directories if I want to make WordPress more secure?
- How to include form for WP_Filesystem()?
- Using wp_handle_upload() to Direct Specific Path by Using $overrides
- “dashboard”-named PHP file doesn’t get included
- Why WordPress plugin url ajax doesn’t work?
- How to first edit in local WordPress editor on page and the add code?
- WordPress and plugins can’t update (“inconsistent file permissions” error)?
- How to know which ajax file or function is called for action
- Copy Folder to another Folder using WP Filesystem
- Alternative to file_get_contents() for theme operations
- why there is a large file named core in wpmu’s directory?
- Can WP plugins access files outside the installation folder?
- Does WordPress still ask for FTP credentials for each file operation?
- 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
- Error Copying Directory On Plugin Activation
- Using external file with WP_USE_THEMES set to false causing 404
- Enabling XSendFile causes 404 for images on WordPress Multisite / Network
- Displaying $_FILES data (simlar to $_POST)
- FTP file manager AS wordpress site
- File doesn’t exist! in wordpress function.php file while creating new post or page
- WordPress files owner changed silently
- How can I get blog content from SFTP?
- Do Not Back Up? Is there any accepted way to tell backup and clone plugins to skip a certain file? [closed]