| @@ -190,8 +190,9 @@ | ||
| 190 | 190 | if ( count( $data ) > 0 ) { |
| 191 | 191 | foreach ( $data as $key => $val ) { |
| 192 | 192 | ultimate_post()->set_setting( $key, $val ); |
| 193 | 193 | } |
| 194 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Public hook; renaming breaks existing callbacks. | |
| 194 | 195 | do_action( 'ultimate_post_after_setting_save' ); |
| 195 | 196 | } |
| 196 | 197 | return rest_ensure_response( |
| 197 | 198 | array( |
| @@ -395,13 +396,13 @@ | ||
| 395 | 396 | * @since v.3.0.0 |
| 396 | 397 | * @return OBJECT. REST response object. |
| 397 | 398 | */ |
| 398 | 399 | public static function wizard_site_status_callback() { |
| 399 | - if ( ! ( isset( $_POST['wpnonce'] ) && wp_verify_nonce( sanitize_key( wp_unslash( $_POST['wpnonce'] ) ), 'ultp-nonce' ) ) ) { | |
| 400 | + if ( ! ( isset( $_POST['wpnonce'] ) && wp_verify_nonce( sanitize_key( wp_unslash( $_POST['wpnonce'] ) ), 'ultp-admin-nonce' ) ) ) { | |
| 400 | 401 | die(); |
| 401 | 402 | } |
| 402 | 403 | if ( isset( $_POST['siteType'] ) ) { |
| 403 | - $site_type = ultimate_post()->ultp_rest_sanitize_params( $_POST['siteType'] ); | |
| 404 | + $site_type = ultimate_post()->ultp_rest_sanitize_params( wp_unslash( $_POST['siteType'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized by ultp_rest_sanitize_params(). | |
| 404 | 405 | update_option( '__ultp_site_type', $site_type ); |
| 405 | 406 | } |
| 406 | 407 | DurbinClient::send( DurbinClient::WIZARD_ACTION ); |
| 407 | 408 | |
| @@ -415,9 +416,9 @@ | ||
| 415 | 416 | * @param OBJECT $server The REST server request object. |
| 416 | 417 | */ |
| 417 | 418 | public function send_initial_plugin_data_callback( $server ) { |
| 418 | 419 | $post = $server->get_params(); |
| 419 | - if ( ! ( isset( $post['wpnonce'] ) && wp_verify_nonce( sanitize_key( wp_unslash( $post['wpnonce'] ) ), 'ultp-nonce' ) ) ) { | |
| 420 | + if ( ! ( isset( $post['wpnonce'] ) && wp_verify_nonce( sanitize_key( wp_unslash( $post['wpnonce'] ) ), 'ultp-admin-nonce' ) ) ) { | |
| 420 | 421 | die(); |
| 421 | 422 | } |
| 422 | 423 | |
| 423 | 424 | $site = isset( $post['site'] ) ? ultimate_post()->ultp_rest_sanitize_params( $post['site'] ) : ''; |
| @@ -433,9 +434,9 @@ | ||
| 433 | 434 | * @return OBJECT REST response object. |
| 434 | 435 | */ |
| 435 | 436 | public static function initial_setup_complete_callback( $server ) { |
| 436 | 437 | $post = $server->get_params(); |
| 437 | - if ( ! ( isset( $post['wpnonce'] ) && wp_verify_nonce( sanitize_key( wp_unslash( $post['wpnonce'] ) ), 'ultp-nonce' ) ) ) { | |
| 438 | + if ( ! ( isset( $post['wpnonce'] ) && wp_verify_nonce( sanitize_key( wp_unslash( $post['wpnonce'] ) ), 'ultp-admin-nonce' ) ) ) { | |
| 438 | 439 | die(); |
| 439 | 440 | } |
| 440 | 441 | ultimate_post()->set_setting( 'init_setup', 'yes' ); |
| 441 | 442 | return rest_ensure_response( |