Code Duplication    Length = 3-5 lines in 5 locations

includes/admin/tools/export/export-actions.php 1 location

@@ 25-29 (lines=5) @@
22
 */
23
function give_process_batch_export_form() {
24
25
	if ( ! wp_verify_nonce( $_REQUEST['nonce'], 'give-batch-export' ) ) {
26
		wp_die( esc_html__( 'We\'re unable to recognize your session. Please refresh the screen to try again; otherwise contact your website administrator for assistance.', 'give' ), esc_html__( 'Error', 'give' ), array(
27
			'response' => 403,
28
		) );
29
	}
30
31
	require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/class-batch-export.php';
32

includes/admin/tools/export/pdf-reports.php 1 location

@@ 34-36 (lines=3) @@
31
		wp_die( __( 'You do not have permission to generate PDF sales reports.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
32
	}
33
34
	if ( ! wp_verify_nonce( $_GET['_wpnonce'], 'give_generate_pdf' ) ) {
35
		wp_die( __( 'We\'re unable to recognize your session. Please refresh the screen to try again; otherwise contact your website administrator for assistance.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
36
	}
37
38
	if ( ! file_exists( GIVE_PLUGIN_DIR . '/includes/libraries/give-pdf.php' ) ) {
39
		wp_die( __( 'Dependency missing.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );

includes/gateways/manual.php 1 location

@@ 37-39 (lines=3) @@
34
 */
35
function give_manual_payment( $purchase_data ) {
36
37
	if ( ! wp_verify_nonce( $purchase_data['gateway_nonce'], 'give-gateway' ) ) {
38
		wp_die( esc_html__( 'We\'re unable to recognize your session. Please refresh the screen to try again; otherwise contact your website administrator for assistance.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) );
39
	}
40
41
	//Create payment_data array
42
	$payment_data = array(

includes/api/class-give-api.php 1 location

@@ 1867-1871 (lines=5) @@
1864
	 */
1865
	public function process_api_key( $args ) {
1866
1867
		if ( ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'give-api-nonce' ) ) {
1868
			wp_die( __( 'We\'re unable to recognize your session. Please refresh the screen to try again; otherwise contact your website administrator for assistance.', 'give' ), __( 'Error', 'give' ), array(
1869
				'response' => 403,
1870
			) );
1871
		}
1872
1873
		if ( empty( $args['user_id'] ) ) {
1874
			wp_die( __( 'User ID Required.', 'give' ), __( 'Error', 'give' ), array(

includes/admin/donors/donor-actions.php 1 location

@@ 51-55 (lines=5) @@
48
	);
49
50
	// Verify Nonce.
51
	if ( ! wp_verify_nonce( $args['_wpnonce'], 'edit-donor' ) ) {
52
		wp_die( esc_html__( 'Cheatin’ uh?', 'give' ), esc_html__( 'Error', 'give' ), array(
53
			'response' => 400,
54
		) );
55
	}
56
57
	$donor_info = $args['donor_info'];
58
	$donor_id   = intval( $donor_info['id'] );