Skip to content

Commit 6201b27

Browse files
authored
Merge pull request #18 from MEOM/feature/security-settings-on
Set Seravo security settings on by default
2 parents e32ca19 + d70a259 commit 6201b27

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

inc/security.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
/**
3+
* Filters the default value for security options.
4+
*
5+
* @param mixed $default_value The default value to return if the option does not exist
6+
* in the database.
7+
* @param string $option Option name.
8+
* @param bool $passed_default Was `get_option()` passed a default value?
9+
*/
10+
function security_checks_on( $default_value, $option, $passed_default ) {
11+
$default_value = 'on';
12+
return $default_value;
13+
}
14+
add_filter( 'default_option_seravo-disable-xml-rpc-all-methods', __NAMESPACE__ . '\security_checks_on', 100, 3 );
15+
add_filter( 'default_option_seravo-disable-json-user-enumeration', __NAMESPACE__ . '\security_checks_on', 100, 3 );
16+
add_filter( 'default_option_seravo-disable-get-author-enumeration', __NAMESPACE__ . '\security_checks_on', 100, 3 );

meom-dodo.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ function meom_dodo_i18n() {
2121
}
2222
add_action( 'plugins_loaded', 'meom_dodo_i18n', 2 );
2323

24-
require_once dirname( __FILE__ ) . '/inc/contact-dashboard-widget.php';
25-
require_once dirname( __FILE__ ) . '/inc/enqueue-assets.php';
26-
require_once dirname( __FILE__ ) . '/inc/remove-admin-menu-items.php';
27-
require_once dirname( __FILE__ ) . '/inc/remove-editor-settings.php';
28-
require_once dirname( __FILE__ ) . '/inc/remove-svg-filters.php';
29-
require_once dirname( __FILE__ ) . '/inc/user-meta.php';
24+
require_once __DIR__ . '/inc/contact-dashboard-widget.php';
25+
require_once __DIR__ . '/inc/enqueue-assets.php';
26+
require_once __DIR__ . '/inc/remove-admin-menu-items.php';
27+
require_once __DIR__ . '/inc/remove-editor-settings.php';
28+
require_once __DIR__ . '/inc/remove-svg-filters.php';
29+
require_once __DIR__ . '/inc/security.php';
30+
require_once __DIR__ . '/inc/user-meta.php';

0 commit comments

Comments
 (0)