PluginProbe ʕ •ᴥ•ʔ
Really Simple Security – Simple and Performant Security (formerly Really Simple SSL) / 9.5.11
Really Simple Security – Simple and Performant Security (formerly Really Simple SSL) v9.5.11
9.5.11 9.5.10.1 9.5.10 trunk 9.4.0 9.4.1 9.4.2 9.4.3 9.5.0 9.5.0.1 9.5.0.2 9.5.1 9.5.2 9.5.2.2 9.5.2.3 9.5.3 9.5.3.1 9.5.3.2 9.5.4 9.5.5 9.5.6 9.5.7 9.5.8 9.5.9
really-simple-ssl / security / wordpress / file-editing.php
really-simple-ssl / security / wordpress Last commit date
two-fa 4 weeks ago vulnerabilities 4 weeks ago block-code-execution-uploads.php 4 weeks ago disable-xmlrpc.php 4 weeks ago display-name-is-login-name.php 4 weeks ago file-editing.php 4 weeks ago hide-wp-version.php 4 weeks ago index.php 4 weeks ago prevent-login-info-leakage.php 4 weeks ago rename-admin-user.php 4 weeks ago rest-api.php 4 weeks ago user-enumeration.php 4 weeks ago user-registration.php 4 weeks ago
file-editing.php
45 lines
1 <?php
2 defined( 'ABSPATH' ) or die();
3
4 /**
5 * @return void
6 *
7 * Disable file editing
8 */
9 function rsssl_disable_file_editing() {
10 if ( ! defined('DISALLOW_FILE_EDIT' ) ) {
11 define('DISALLOW_FILE_EDIT', true );
12 }
13 }
14 add_action("init", "rsssl_disable_file_editing");
15
16
17 /**
18 * Username 'admin' changed notice
19 * @return array
20 */
21 function rsssl_disable_file_editing_notice( $notices ) {
22 $notices['disallow_file_edit_false'] = array(
23 'condition' => ['rsssl_file_editing_defined_but_disabled'],
24 'callback' => '_true_',
25 'score' => 5,
26 'output' => array(
27 'true' => array(
28 'msg' => __("The DISALLOW_FILE_EDIT constant is defined and set to false. You can remove it from your wp-config.php.", "really-simple-ssl"),
29 'icon' => 'open',
30 'dismissible' => true,
31 'url' => 'disallow_file_edit-defined-set-to-false'
32 ),
33 ),
34 );
35 return $notices;
36 }
37 add_filter('rsssl_notices', 'rsssl_disable_file_editing_notice');
38
39 /**
40 * Check if the constant is defined, AND set to false. In that case the plugin cannot override it anymore
41 * @return bool
42 */
43 function rsssl_file_editing_defined_but_disabled(){
44 return defined( 'DISALLOW_FILE_EDIT' ) && ! DISALLOW_FILE_EDIT;
45 }