Code Duplication    Length = 3-6 lines in 5 locations

includes/admin/donors/donor-actions.php 3 locations

@@ 179-183 (lines=5) @@
176
177
	$donor_view_role = apply_filters( 'give_view_donors_role', 'view_give_reports' );
178
179
	if ( ! is_admin() || ! current_user_can( $donor_view_role ) ) {
180
		wp_die( __( 'You do not have permission to edit this donor.', 'give' ), __( 'Error', 'give' ), array(
181
			'response' => 403,
182
		) );
183
	}
184
185
	if ( empty( $args ) ) {
186
		return false;
@@ 262-266 (lines=5) @@
259
260
	$donor_edit_role = apply_filters( 'give_edit_donors_role', 'edit_give_payments' );
261
262
	if ( ! is_admin() || ! current_user_can( $donor_edit_role ) ) {
263
		wp_die( __( 'You do not have permission to edit this donor.', 'give' ), __( 'Error', 'give' ), array(
264
			'response' => 403,
265
		) );
266
	}
267
268
	if ( empty( $args ) ) {
269
		return false;
@@ 355-359 (lines=5) @@
352
	$donor_id = '';
353
	$donor_edit_role = apply_filters( 'give_edit_donors_role', 'edit_give_payments' );
354
355
	if ( ! is_admin() || ! current_user_can( $donor_edit_role ) ) {
356
		wp_die( __( 'You do not have permission to edit this donor.', 'give' ), __( 'Error', 'give' ), array(
357
			'response' => 403,
358
		) );
359
	}
360
361
	$output = array();
362
	if ( empty( $args ) || empty( $args['email'] ) || empty( $args['customer_id'] ) ) {

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

@@ 38-40 (lines=3) @@
35
		wp_die( __( 'Nonce verification failed.', '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 ) );
40
	}
41
42
	require_once GIVE_PLUGIN_DIR . '/includes/libraries/give-pdf.php';
43

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

@@ 1880-1885 (lines=6) @@
1877
				__( 'You do not have permission to %s API keys for this user.', 'give' ), $process ), __( 'Error', 'give' ), array(
1878
				'response' => 403,
1879
			) );
1880
		} elseif ( ! current_user_can( 'manage_give_settings' ) ) {
1881
			wp_die( sprintf( /* translators: %s: process */
1882
				__( 'You do not have permission to %s API keys for this user.', 'give' ), $process ), __( 'Error', 'give' ), array(
1883
				'response' => 403,
1884
			) );
1885
		}
1886
1887
		switch ( $process ) {
1888
			case 'generate':