The Filesystem API abstracts out the functionality needed for reading and writing local files to the filesystem to be done securely, on a variety of host types.

learn more… | top users | synonyms

0
votes
2answers
578 views

How do you use unzip_file() successfully?

I have been trying to use the unzip_file() function. It says "undefined" so I looked into it, and the WP_Filesystem() must be called and set up. So easy, right? require_once(ABSPATH ...
1
vote
1answer
49 views

What's a simple but secure method to get file contents into WordPress?

The scenario I'm developing a plugin, and part of it requires lots of text content (help descriptions) that I would prefer to keep as separate text files (in a subdirectory within the plugin) for ...
0
votes
1answer
18 views

Error Copying Directory On Plugin Activation

I am trying to copy directory using WP_Filesystem API with the method copy_dir() on plugin activation, but it is give me the following error message: Plugin could not be activated because it ...
0
votes
1answer
166 views

Downloading File from Outside Web Root

I've set up some code to download zip files that exist in a folder above the web root. The download will be triggered from a user account page within WordPress. They don't need to be bank-level ...
0
votes
1answer
172 views

How to include form for WP_Filesystem()?

I've used a bit of code to try and write a dynamic.css file to a theme folder and it works fine. BUT, it doesn't work on certain shared hosting situations so the request_filesystem_credentials() ...
0
votes
0answers
37 views

WP_Filesystem error while checking with Theme Check plugin

I am having a problem solving an issue with WP_Filesystem. An error message occurs while checking with the Theme Check plugin: WARNING: file_get_contents was found in the file theme-options.php ...
0
votes
0answers
25 views

Delete directories on post

I'm trying to figure out some simple php code that would allow me to delete the contents of a directory when I create or update a post/page. Any tips on how to get the conditional aspect working?
0
votes
0answers
86 views

file_get_contents() alternate for inline js

I'm trying to get to 100% score for page speed, in efforts to reach that I'm trying to inline small js files. My js files are all process in and minified as part of a gulp workflow. Prior to looking ...
0
votes
0answers
53 views

version control for wordpress? (wordpress folder and database at same time)

I am familiar with version control to some extent. I have been using git and github for school purposes. Now when I use wordpress it makes sense that I can use git when developing on my local ...
0
votes
0answers
140 views

how to create or rewrite files in wordpress plugin folder

i'm developing my own plugin. in that i used a simple php file to generate contact vcards in the plugin folder. for this i used fopen & fwrite. but the file is not creating in the plugin folder. ...
0
votes
0answers
35 views

Page Not Found when file does exist

We are having an issue where although files are listed in File Manager they will not pull up when we link to them. We are on the current version of WordPress and all plug-ins. Here is a link to a ...
0
votes
0answers
106 views

How does WordPress access theme and plugin files through its editor?

I love that WordPress enables you to edit files in the WP back end, but I want to know how it works. How is WordPress able to access and allow you to edit files that are on a server like that? Please ...