Code Duplication    Length = 3-3 lines in 3 locations

includes/class-wc-ajax.php 3 locations

@@ 2411-2413 (lines=3) @@
2408
		check_ajax_referer( 'load-variations', 'security' );
2409
2410
		// Check permissions again and make sure we have what we need
2411
		if ( ! current_user_can( 'edit_products' ) || empty( $_POST['product_id'] ) || empty( $_POST['attributes'] ) ) {
2412
			die( -1 );
2413
		}
2414
2415
		global $post;
2416
@@ 2566-2568 (lines=3) @@
2563
		check_ajax_referer( 'save-variations', 'security' );
2564
2565
		// Check permissions again and make sure we have what we need
2566
		if ( ! current_user_can( 'edit_products' ) || empty( $_POST ) || empty( $_POST['product_id'] ) ) {
2567
			die( -1 );
2568
		}
2569
2570
		// Remove previous meta box errors
2571
		WC_Admin_Meta_Boxes::$meta_box_errors = array();
@@ 2939-2941 (lines=3) @@
2936
		check_ajax_referer( 'bulk-edit-variations', 'security' );
2937
2938
		// Check permissions again and make sure we have what we need
2939
		if ( ! current_user_can( 'edit_products' ) || empty( $_POST['product_id'] ) || empty( $_POST['bulk_action'] ) ) {
2940
			die( -1 );
2941
		}
2942
2943
		$product_id  = absint( $_POST['product_id'] );
2944
		$bulk_action = wc_clean( $_POST['bulk_action'] );