diff --git a/README.md b/README.md index 9c6f423..9b3cd37 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,47 @@ -# disallow-file-edit-wordpress +# Disallow File Edit - WordPress Plugin -## In wp-config.php -``` -define('DISALLOW_FILE_EDIT', true); +A simple WordPress plugin that enhances security by disabling the file editor and file modifications in the WordPress admin area. + +## Features + +- Disables the plugin and theme file editor in WordPress admin +- Prevents file modifications including plugin/theme installation and updates +- Lightweight and easy to use +- No configuration needed - works immediately upon activation + +## Installation + +1. Download the plugin files +2. Upload the `disallow-file-edit.php` file to the `/wp-content/plugins/disallow-file-edit/` directory, or install the plugin through the WordPress plugins screen directly +3. Activate the plugin through the 'Plugins' screen in WordPress + +## What This Plugin Does + +This plugin defines two WordPress security constants: + +- `DISALLOW_FILE_EDIT` - Disables the plugin and theme file editor in the WordPress admin +- `DISALLOW_FILE_MODS` - Disables all file modifications including plugin/theme installation and updates +## Alternative Configuration Methods + +If you prefer not to use a plugin, you can achieve the same result by adding the following code: + +### In wp-config.php +```php +define('DISALLOW_FILE_EDIT', true); define('DISALLOW_FILE_MODS', true); ``` -# OR -## In Functions.php +### In Functions.php -``` +```php function disable_mytheme_action() { - define('DISALLOW_FILE_EDIT', true); - define('DISALLOW_FILE_MODS', true); - } add_action('init','disable_mytheme_action'); ``` + +## License + +This plugin is licensed under GPL v2 or later. diff --git a/disallow-file-edit.php b/disallow-file-edit.php new file mode 100644 index 0000000..c12346b --- /dev/null +++ b/disallow-file-edit.php @@ -0,0 +1,37 @@ +