Security check failed
-
Hello,
When adding a new product (
/wp-admin/post-new.php?post_type=product), the plugin immediately shows “Security check failed”. This happens because the nonce validation runs even when no nonce is present.Suggested fix: only run the check if the nonce exists, e.g.:
/ni-woocommerce-cost-of-goods/include/class-ni-woocommerce-cost-of-goods-quick-edit.php:106if ( isset( $_REQUEST['ni_cog_from_nonce'] ) ) {
if ( ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST['ni_cog_from_nonce'] ) ), 'ni_cog_from_action' ) ) {
wp_die( 'Security check failed' );
}
}Ideally, the validation should run on
save_postinstead of admin page load. Could you please patch this in the next update?Thanks!
The topic ‘Security check failed’ is closed to new replies.