Automattic\WooCommerce\Internal\ProductAttributesLookup

DataRegenerator::verify_tool_execution_nonce()privateWC 1.0

Verify the validity of the nonce received when executing a tool from the Status - Tools page.

Method of the class: DataRegenerator{}

No Hooks.

Return

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->verify_tool_execution_nonce();

DataRegenerator::verify_tool_execution_nonce() code WC 8.7.0

private function verify_tool_execution_nonce() {
	// phpcs:ignore WordPress.Security.ValidatedSanitizedInput
	if ( ! isset( $_REQUEST['_wpnonce'] ) || wp_verify_nonce( $_REQUEST['_wpnonce'], 'debug_action' ) === false ) {
		throw new \Exception( 'Invalid nonce' );
	}
}