wp-cli / ideas

💡 Ideas and feature requests are collected here
40 stars 1 forks source link

Add File/Directory Permissions Fixing #190

Open lucanos opened 5 months ago

lucanos commented 5 months ago

Feature Request

Describe your use case and the problem you are facing

One of the most common problems encountered with WordPress installations is where the file or directory permissions are incorrectly set. This can cause issues when maintaining a website (updating plugins/themes/core), and fixing it either relies on the user knowing what permissions the various files/directories should be set to, or finding a shell script on GitHub to then try and run it (often without being able to verify that the script is safe, or inline with best practices).

Describe the solution you'd like

I would like to see WP-CLI include a function to fix the permissions of the targetted WP instance. There is a guide on the WordPress Developer Website at https://developer.wordpress.org/advanced-administration/security/hardening/#File_permissions, which along with some of the better public shell scripts might form the basis of this function.

In essence, it would be great if a WP-CLI user could just run something like wp core permissions fix and have it all automated for them.