[CodeFactor] Apply fixes

This commit is contained in:
codefactor-io 2020-03-26 17:03:00 +00:00
parent 055f7232cd
commit 44cdebaf44
28 changed files with 891 additions and 829 deletions

View file

@ -195,7 +195,7 @@ class MainWP_Child_Skeleton_Key {
public function save_settings() {
$settings = isset($_POST['settings']) ? $_POST['settings'] : array();
if (!is_array($settings) || empty($settings)) {
if ( ! is_array($settings) || empty($settings)) {
return array( 'error' => 'Invalid data. Please check and try again.' );
}
@ -203,11 +203,11 @@ class MainWP_Child_Skeleton_Key {
'general' => array( 'blogname', 'blogdescription', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'timezone_string', 'WPLANG' ),
);
if ( !is_multisite() ) {
if ( !defined( 'WP_SITEURL' ) ) {
if ( ! is_multisite() ) {
if ( ! defined( 'WP_SITEURL' ) ) {
$whitelist_options['general'][] = 'siteurl';
}
if ( !defined( 'WP_HOME' ) ) {
if ( ! defined( 'WP_HOME' ) ) {
$whitelist_options['general'][] = 'home';
}
@ -231,7 +231,7 @@ class MainWP_Child_Skeleton_Key {
}
$updated = false;
foreach($settings as $option => $value) {
foreach ($settings as $option => $value) {
if (in_array($option, $whitelist_general)) {
if ( ! is_array( $value ) ) {
$value = trim( $value );
@ -242,7 +242,7 @@ class MainWP_Child_Skeleton_Key {
}
}
if (!$updated) {
if ( ! $updated) {
return false;
}