WordPress files should typically have permissions set to 644, which means the owner can read and write, and others can only read. This prevents unauthorized modifications while allowing the server to serve the files.
Directories require execute permission (x) to allow the server to access files inside. Setting directories to 644 removes execute permission, causing failures in uploading or installing plugins.
For Apache 2.4+, the correct way to deny access is using Require all denied inside a <FilesMatch> block. This prevents PHP execution in uploads, enhancing security.
Even with correct permissions, if the directory is owned by root and the web server runs as a different user, it cannot write to the directory. Changing ownership to the web server user fixes this.
WordPress only reads wp-config.php to get configuration. Setting it to 400 (read-only by owner) is secure and does not affect normal operation since no writing is needed.