igorhrcek / wp-cli-secure-command

Secure package for WP CLI, built to provide an easier way of securing your WordPress installation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement a command that will allow us to set custom file and directory permissions

igorhrcek opened this issue · comments

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
There is an official recommendation about permission masks for files and folders in WP, so we should implement a command to do all that for us

Describe alternatives you've considered
No

Additional context
WP recommends 666 for files, 755 for folders and I think that this should be a default:
https://wordpress.org/support/article/changing-file-permissions/

Now, someone might want a more permissive system for folders, like 775 instead of 755, so I think there should be an option to pass an additional arguments for files and folders separately, like:

wp secure fixpermissions
wp secure fixpermissions --files=644 --folders=775

We should also forbid setting 777 for either files and folders.