plugin-update-checker icon indicating copy to clipboard operation
plugin-update-checker copied to clipboard

What file permissions are best practice?

Open JohnDeeBDD opened this issue 3 years ago • 1 comments

I'm deploying a plugin with zips created on a linux box [.zip in linux preserves permissions]. What are the best permission settings to set before I zip? I got "Update failed: The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions."

JohnDeeBDD avatar Mar 19 '22 04:03 JohnDeeBDD

I'm not very familiar with this aspect of the installation process, but I would guess that the permissions in the .zip file do not matter. Looking at the _unzip_file_ziparchive() and _unzip_file_pclzip() functions in WordPress core, it appears that they just set the permissions of all extracted files to the FS_CHMOD_FILE constant . The code doesn't look at the permissions stored in the .zip file.

In this case, it's more likely that the target site has a permissions issue. Maybe some wp-content subdirectories don't have the right permissions? Or maybe PHP is running under the wrong user account?

YahnisElsts avatar Mar 19 '22 11:03 YahnisElsts

In this case, it's more likely that the target site has a permissions issue. <-- Correct. Thanks Yahnis.

JohnDeeBDD avatar Sep 06 '23 19:09 JohnDeeBDD