I had asked a related question on Super User:

A use case of a system “receiving” files over FTP would be, for example, the way WordPress plugins are installed via 1-click where WordPress initiates a file transfer to the local Linux box from the remote WordPress plugin repository using ftp(s)

More specifically this screen:

WP asking for ftp info during plugin install

My initial understanding that WordPress would transfer the files from the WordPress plugin repository, like how a FTP client would do. But further discussions on chat have left me confused as to why would WordPress require the FTP details of the web server?

What am I missing here?

3 s
3

When you do something that requires WordPress write to the filesystem, it does a check to see if it has permissions to do so by writing a temp file. If this check fails it will ask for FTP details in order to write the files to your server.

EDIT

look in wp-admin/includes/file.php, line 843, for the get_filesystem_method function that does this check.

Leave a Reply

Your email address will not be published. Required fields are marked *