You tried to Delete a Plugin or theme or you tried to update or install a new plugin or theme but WordPress took you to a new Page, where WordPress asked you to enter the FTP details like your Host Details,FTP Username and FTP Password.
1.Try to add the below code in wp-config.php file(The file is located in the WordPress directory).
2.Save it and try to update or whatever you were doing.
Problem Solved? No? Move on.
2.I was trying to delete a Plugin on newly Installed WordPress Installation,After adding the above code,WordPress didn’t ask me for FTP details any more but it started showing me a new error which meant that WordPress can’t delete the Plugin files.
Plugin could not be deleted due to an error: Could not fully remove the plugin(s) pluginname/pluginfile.php.
If you are on Shared Hosting or on a Managed Hosting ask the Hosting Provider about the solution as the error is not from your end, it can be only solved by the person who manages the hosting.
The problem was with File Permission,Changing the Permissions for directories didn’t worked for me,Run the Below command via your Terminal,Problem Solved!
sudo chown -R www-data:www-data DirectoryADDRESS
Change the “DirectoryADDRESS” in the above command with the directory where your WordPress is installed.