{"id":18990178,"date":"2026-08-11T07:41:34","date_gmt":"2026-08-11T07:41:34","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/bug-report-overwrites-disallow_file_edit-in-wp-config-php-issue\/"},"modified":"2026-08-11T07:43:53","modified_gmt":"2026-08-11T07:43:53","slug":"bug-report-overwrites-disallow_file_edit-in-wp-config-php-issue","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/bug-report-overwrites-disallow_file_edit-in-wp-config-php-issue\/","title":{"rendered":"[Bug Report] overwrites DISALLOW_FILE_EDIT in wp-config.php issue"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hi WPASE Team,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;d like to report a bug in Admin and Site Enhancements Pro regarding the &#8220;Disable Plugin and Theme Editor feature.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Summary<\/strong><br \/>When the &#8220;Disable Plugin and Theme Editor setting is OFF (file editing allowed), the plugin still forcibly overwrites the DISALLOW_FILE_EDIT constant in wp-config.php to false on every admin page load \u2014 silently undoing a user&#8217;s manual security hardening.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Steps to reproduce<\/strong><\/p>\n\n\n\n<ol>\n<li>Install ASE Pro v8.9.2, keep &#8220;Disable Plugin and Theme Editor OFF.<\/li>\n\n\n\n<li>Manually add define(&#8216;DISALLOW_FILE_EDIT&#8217;, true); to wp-config.php.<\/li>\n\n\n\n<li>Log in as an administrator and visit any wp-admin page (dashboard, settings, etc.).<\/li>\n\n\n\n<li>wp-config.php is silently modified: DISALLOW_FILE_EDIT is changed back to false (within seconds).<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Root cause (from code inspection)<\/strong><br \/>In classes\/class-disable-smaller-components.php, the enable_plugin_theme_editor() method runs on every admin request (skipped only for ajax\/cron). When the option disable_plugin_theme_editor is false (feature OFF), ASE still calls enable_plugin_theme_editor(), which uses WP_Config_Transformer to force DISALLOW_FILE_EDIT to &#8216;false&#8217;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Expected behavior<\/strong><br \/>When the feature is disabled (setting = false), ASE should NOT touch the DISALLOW_FILE_EDIT constant at all. Users who manually set DISALLOW_FILE_EDIT=true for security hardening should have their setting respected.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Impact<\/strong><\/p>\n\n\n\n<ul>\n<li>Security hardening (DISALLOW_FILE_EDIT=true) is silently reverted, re-enabling the plugin\/theme file editor.<\/li>\n\n\n\n<li>Affects multiple sites using the plugin (we confirmed it on 3 sites).<\/li>\n\n\n\n<li>Hard to detect because there is no log or notice about the modification.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Suggested fix<\/strong><br \/>Only run enable\/disable_plugin_theme_editor() logic when the user explicitly enables the corresponding feature. When the setting is OFF, leave wp-config.php untouched. Alternatively, add an opt-out option for ASE not to manage DISALLOW_FILE_EDIT.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Environment<\/strong><\/p>\n\n\n\n<ul>\n<li>WordPress 7.0.3<\/li>\n\n\n\n<li>PHP 8.3.32<\/li>\n\n\n\n<li>Memcached object cache<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you for maintaining a great plugin \u2014 I&#8217;m happy to provide more details if needed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Best regards,<\/p>\n","protected":false},"template":"","class_list":["post-18990178","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18990178","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":2,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18990178\/revisions"}],"predecessor-version":[{"id":18990183,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18990178\/revisions\/18990183"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=18990178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}