=== Disable File Editor ===
Contributors: snehalpancholi
Tags: security, file editor, hardening, DISALLOW_FILE_EDIT, lockdown
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.1
Stable tag: 1.0.0
License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Disable the WordPress theme and plugin file editors via a settings toggle. Uses an mu-plugin for early-load protection plus capability filtering as a fallback.

== Description ==

Disable File Editor is a hardening plugin that removes the built-in code editors from your WordPress admin. It writes an mu-plugin that defines `DISALLOW_FILE_EDIT` before any regular plugin or theme loads — the earliest possible point. It also filters capabilities and removes the menu items as belt-and-suspenders protection.

**Features**

* Disables Appearance → Theme File Editor
* Disables Plugins → Plugin File Editor
* Optionally defines DISALLOW_FILE_MODS to block all file writes (updates, installs)
* Optionally blocks plugin installation
* Optionally blocks theme installation
* Status panel shows live DISALLOW_FILE_EDIT / DISALLOW_FILE_MODS state
* MU-plugin auto-deleted on uninstall

== Installation ==

1. Upload `disable-file-editor` to `/wp-content/plugins/`.
2. Activate in **Plugins → Installed Plugins**.
3. Navigate to **Settings → File Editor**.
4. Toggle the desired options and click **Save Settings**.

== Frequently Asked Questions ==

= What is the mu-plugin for? =
`DISALLOW_FILE_EDIT` must be defined very early — before WordPress loads the editor pages. An mu-plugin achieves this, unlike a regular plugin option that's read after WordPress bootstraps.

= Can I manually remove the mu-plugin? =
Yes. Delete `/wp-content/mu-plugins/addlc-dfe-constants.php` via FTP and the constants will no longer be defined. Alternatively, turn off all toggles in Settings → File Editor and save.

= Does uninstalling the plugin re-enable the editor? =
Yes. Uninstalling the plugin deletes the mu-plugin, which removes the DISALLOW_FILE_EDIT definition.

== Changelog ==

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
