Skip to content

Commit bb8dc1f

Browse files
Akshay UrankarAkshay Urankar
authored andcommitted
fixed phpcs
1 parent f8c7569 commit bb8dc1f

File tree

4 files changed

+225
-220
lines changed

4 files changed

+225
-220
lines changed

admin/bsf-analytics/class-bsf-analytics.php

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -480,33 +480,33 @@ public function maybe_track_analytics() {
480480
}
481481
}
482482

483-
/**
484-
* Save analytics option to network.
485-
*
486-
* @param string $option Name of option.
487-
* @param string $value Value of option.
488-
* @since 1.0.0
489-
*/
490-
public function add_option_to_network( $option, $value ) {
491-
492-
// Verify nonce to prevent CSRF attacks.
493-
if ( ! isset( $_POST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['_wpnonce'] ) ), 'general-options' ) ) {
494-
return; // Stop execution if nonce is invalid.
495-
}
496-
497-
// If action is coming from the general settings page.
498-
if ( isset( $_POST['option_page'] ) && 'general' === sanitize_text_field( wp_unslash( $_POST['option_page'] ) ) ) {
499-
500-
$option = sanitize_key( $option ); // Sanitize option name.
501-
$value = sanitize_text_field( $value ); // Sanitize option value (use a different function if storing more complex data).
502-
503-
if ( get_site_option( $option ) ) {
504-
update_site_option( $option, $value );
505-
} else {
506-
add_site_option( $option, $value );
507-
}
508-
}
509-
}
483+
/**
484+
* Save analytics option to network.
485+
*
486+
* @param string $option Name of option.
487+
* @param string $value Value of option.
488+
* @since 1.0.0
489+
*/
490+
public function add_option_to_network( $option, $value ) {
491+
492+
// Verify nonce to prevent CSRF attacks.
493+
if ( ! isset( $_POST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['_wpnonce'] ) ), 'general-options' ) ) {
494+
return; // Stop execution if nonce is invalid.
495+
}
496+
497+
// If action is coming from the general settings page.
498+
if ( isset( $_POST['option_page'] ) && 'general' === sanitize_text_field( wp_unslash( $_POST['option_page'] ) ) ) {
499+
500+
$option = sanitize_key( $option ); // Sanitize option name.
501+
$value = sanitize_text_field( $value ); // Sanitize option value (use a different function if storing more complex data).
502+
503+
if ( get_site_option( $option ) ) {
504+
update_site_option( $option, $value );
505+
} else {
506+
add_site_option( $option, $value );
507+
}
508+
}
509+
}
510510

511511
}
512512
}

admin/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ function rich_snippet_dashboard() {
871871
</table>
872872
</form>
873873
</div>
874-
</div>' . wp_kses_post(get_support())
874+
</div>' . wp_kses_post( get_support() )
875875
. '
876876
</div>';
877877
echo '

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
}
3737
},
3838
"require": {
39-
"php": "^8.3",
39+
"php": "^8.1",
4040
"composer/composer": "^2.7",
4141
"symfony/translation": "^6.4",
4242
"symfony/dependency-injection": "^6.4",

0 commit comments

Comments
 (0)