Force direct upgrading in WordPress

Many times it happens WordPress not to upgrade/update directly, but it requests FTP credentials.

This is because wp-content (for plugins) folder’s permissions have not been set correctly.

A temporary solution could be to chmod it recursively at 777

chmod 777 /path/to/wordpress/plugins/folder -R

This includes some security issues sometimes,if you dot know exactly what you’re doing,thus a better and even simpler solution to this problem is to add the following lines in WordPress wp-config.php file:

define( 'FS_METHOD', 'direct' );
define( 'FS_CHMOD_DIR', 0777 );
define( 'FS_CHMOD_FILE', 0777 );

And this is it.