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 / sync-settings.php
really-simple-ssl / security Last commit date
includes 4 weeks ago server 4 weeks ago tests 4 weeks ago wordpress 4 weeks ago class-rsssl-htaccess-file-manager.php 4 weeks ago cron.php 4 weeks ago deactivate-integration.php 4 weeks ago firewall-manager.php 4 weeks ago functions.php 4 weeks ago index.php 4 weeks ago integrations.php 4 weeks ago notices.php 4 weeks ago security.php 4 weeks ago sync-settings.php 4 weeks ago tests.php 4 weeks ago
sync-settings.php
95 lines
1 <?php
2 defined('ABSPATH') or die();
3 /**
4 * Conditionally we can decide to disable fields, add comments, and manipulate the value here
5 * @param array $field
6 * @param string $field_id
7 *
8 * @return array
9 */
10
11 function rsssl_disable_fields( $field, $field_id ) {
12 /**
13 * If a feature is already enabled, but not by RSSSL, we can simply check for that feature, and if the option in RSSSL is active.
14 * We set is as true, but disabled. Because our React interface only updates changed option, and this option never changes, this won't get set to true in the database.
15 */
16 if ( $field_id === 'change_debug_log_location' ) {
17 if ( ! rsssl_debug_log_file_exists_in_default_location() ) {
18 if ( ! rsssl_is_debugging_enabled() ) {
19 if ( ! $field['value'] ) {
20 $field['value'] = true;
21 $field['disabled'] = true;
22 }
23 } else if ( ! rsssl_debug_log_value_is_default() ) {
24 if ( ! $field['value'] ) {
25 $field['value'] = true;
26 $field['disabled'] = true;
27 }
28 }
29 //if not the default location
30 $location = strstr( rsssl_get_debug_log_value(), 'wp-content' );
31 if ( ! empty( $location ) && rsssl_is_debugging_enabled() && ! rsssl_debug_log_value_is_default() ) {
32 $field['help'] = [
33 'label' => 'default',
34 'title' => __( "Debug.log", 'really-simple-ssl' ),
35 'text' => __( "Changed debug.log location to:", 'really-simple-ssl' ) . $location,
36 ];
37 }
38
39 }
40
41 }
42
43 if ( $field_id === 'disable_indexing' ) {
44 if ( ! rsssl_directory_indexing_allowed() && ! ( $field['value'] ?? false ) ) {
45 $field['value'] = true;
46 $field['disabled'] = true;
47 }
48 }
49
50 if ( $field_id === 'disable_anyone_can_register' ) {
51 if ( ! get_option( 'users_can_register' ) && ! ( $field['value'] ?? false ) ) {
52 $field['value'] = true;
53 $field['disabled'] = true;
54 }
55 }
56
57 if ( $field_id === 'disable_http_methods' ) {
58 if ( ! rsssl_http_methods_allowed() && ! ( $field['value'] ?? false ) ) {
59 $field['value'] = true;
60 $field['disabled'] = true;
61 }
62 }
63
64 if ( $field_id === 'disable_file_editing' ) {
65 if ( defined( 'DISALLOW_FILE_EDIT' ) && DISALLOW_FILE_EDIT && ! ( $field['value'] ?? false ) ) {
66 $field['value'] = true;
67 $field['disabled'] = true;
68 }
69 }
70
71 if ( $field_id === 'block_code_execution_uploads' ) {
72 if ( ! rsssl_code_execution_allowed() && ! ( $field['value'] ?? false ) ) {
73 $field['value'] = true;
74 $field['disabled'] = true;
75 }
76 }
77
78 if ( $field_id === 'disable_xmlrpc' ) {
79 if ( ! rsssl_xmlrpc_enabled() && ! ( $field['value'] ?? false ) ) {
80 $field['value'] = true;
81 $field['disabled'] = true;
82 }
83 }
84
85 if ( $field_id === 'rename_db_prefix' ) {
86 if ( ! rsssl_is_default_wp_prefix() && ! ( $field['value'] ?? false ) ) {
87 $field['value'] = true;
88 $field['disabled'] = true;
89 }
90 }
91
92 return $field;
93 }
94 add_filter('rsssl_field', 'rsssl_disable_fields', 10, 2);
95