Code Duplication    Length = 8-8 lines in 24 locations

includes/admin/admin-actions.php 24 locations

@@ 211-218 (lines=8) @@
208
			// Donation reports errors.
209
			if ( current_user_can( 'view_give_reports' ) ) {
210
				switch ( $message_notice ) {
211
					case 'donation-deleted' :
212
						Give()->notices->register_notice( array(
213
							'id'          => 'give-donation-deleted',
214
							'type'        => 'updated',
215
							'description' => __( 'The donation has been deleted.', 'give' ),
216
							'show'        => true,
217
						) );
218
						break;
219
					case 'email-sent' :
220
						Give()->notices->register_notice( array(
221
							'id'          => 'give-email-sent',
@@ 219-226 (lines=8) @@
216
							'show'        => true,
217
						) );
218
						break;
219
					case 'email-sent' :
220
						Give()->notices->register_notice( array(
221
							'id'          => 'give-email-sent',
222
							'type'        => 'updated',
223
							'description' => __( 'The donation receipt has been resent.', 'give' ),
224
							'show'        => true,
225
						) );
226
						break;
227
					case 'refreshed-reports' :
228
						Give()->notices->register_notice( array(
229
							'id'          => 'give-refreshed-reports',
@@ 227-234 (lines=8) @@
224
							'show'        => true,
225
						) );
226
						break;
227
					case 'refreshed-reports' :
228
						Give()->notices->register_notice( array(
229
							'id'          => 'give-refreshed-reports',
230
							'type'        => 'updated',
231
							'description' => __( 'The reports cache has been cleared.', 'give' ),
232
							'show'        => true,
233
						) );
234
						break;
235
					case 'donation-note-deleted' :
236
						Give()->notices->register_notice( array(
237
							'id'          => 'give-donation-note-deleted',
@@ 235-242 (lines=8) @@
232
							'show'        => true,
233
						) );
234
						break;
235
					case 'donation-note-deleted' :
236
						Give()->notices->register_notice( array(
237
							'id'          => 'give-donation-note-deleted',
238
							'type'        => 'updated',
239
							'description' => __( 'The donation note has been deleted.', 'give' ),
240
							'show'        => true,
241
						) );
242
						break;
243
				}// End switch().
244
			}// End if().
245
@@ 249-256 (lines=8) @@
246
			// Give settings notices and errors.
247
			if ( current_user_can( 'manage_give_settings' ) ) {
248
				switch ( $message_notice ) {
249
					case 'settings-imported' :
250
						Give()->notices->register_notice( array(
251
							'id'          => 'give-settings-imported',
252
							'type'        => 'updated',
253
							'description' => __( 'The settings have been imported.', 'give' ),
254
							'show'        => true,
255
						) );
256
						break;
257
					case 'api-key-generated' :
258
						Give()->notices->register_notice( array(
259
							'id'          => 'give-api-key-generated',
@@ 257-264 (lines=8) @@
254
							'show'        => true,
255
						) );
256
						break;
257
					case 'api-key-generated' :
258
						Give()->notices->register_notice( array(
259
							'id'          => 'give-api-key-generated',
260
							'type'        => 'updated',
261
							'description' => __( 'API keys have been generated.', 'give' ),
262
							'show'        => true,
263
						) );
264
						break;
265
					case 'api-key-exists' :
266
						Give()->notices->register_notice( array(
267
							'id'          => 'give-api-key-exists',
@@ 265-272 (lines=8) @@
262
							'show'        => true,
263
						) );
264
						break;
265
					case 'api-key-exists' :
266
						Give()->notices->register_notice( array(
267
							'id'          => 'give-api-key-exists',
268
							'type'        => 'updated',
269
							'description' => __( 'The specified user already has API keys.', 'give' ),
270
							'show'        => true,
271
						) );
272
						break;
273
					case 'api-key-regenerated' :
274
						Give()->notices->register_notice( array(
275
							'id'          => 'give-api-key-regenerated',
@@ 273-280 (lines=8) @@
270
							'show'        => true,
271
						) );
272
						break;
273
					case 'api-key-regenerated' :
274
						Give()->notices->register_notice( array(
275
							'id'          => 'give-api-key-regenerated',
276
							'type'        => 'updated',
277
							'description' => __( 'API keys have been regenerated.', 'give' ),
278
							'show'        => true,
279
						) );
280
						break;
281
					case 'api-key-revoked' :
282
						Give()->notices->register_notice( array(
283
							'id'          => 'give-api-key-revoked',
@@ 281-288 (lines=8) @@
278
							'show'        => true,
279
						) );
280
						break;
281
					case 'api-key-revoked' :
282
						Give()->notices->register_notice( array(
283
							'id'          => 'give-api-key-revoked',
284
							'type'        => 'updated',
285
							'description' => __( 'API keys have been revoked.', 'give' ),
286
							'show'        => true,
287
						) );
288
						break;
289
					case 'sent-test-email' :
290
						Give()->notices->register_notice( array(
291
							'id'          => 'give-sent-test-email',
@@ 289-296 (lines=8) @@
286
							'show'        => true,
287
						) );
288
						break;
289
					case 'sent-test-email' :
290
						Give()->notices->register_notice( array(
291
							'id'          => 'give-sent-test-email',
292
							'type'        => 'updated',
293
							'description' => __( 'The test email has been sent.', 'give' ),
294
							'show'        => true,
295
						) );
296
						break;
297
					case 'matched-success-failure-page':
298
						Give()->notices->register_notice( array(
299
							'id'          => 'give-matched-success-failure-page',
@@ 297-304 (lines=8) @@
294
							'show'        => true,
295
						) );
296
						break;
297
					case 'matched-success-failure-page':
298
						Give()->notices->register_notice( array(
299
							'id'          => 'give-matched-success-failure-page',
300
							'type'        => 'updated',
301
							'description' => __( 'You cannot set the success and failed pages to the same page', 'give' ),
302
							'show'        => true,
303
						) );
304
						break;
305
				}// End switch().
306
			}// End if().
307
@@ 311-318 (lines=8) @@
308
			// Payments errors.
309
			if ( current_user_can( 'edit_give_payments' ) ) {
310
				switch ( $message_notice ) {
311
					case 'note-added' :
312
						Give()->notices->register_notice( array(
313
							'id'          => 'give-note-added',
314
							'type'        => 'updated',
315
							'description' => __( 'The donation note has been added.', 'give' ),
316
							'show'        => true,
317
						) );
318
						break;
319
					case 'payment-updated' :
320
						Give()->notices->register_notice( array(
321
							'id'          => 'give-payment-updated',
@@ 319-326 (lines=8) @@
316
							'show'        => true,
317
						) );
318
						break;
319
					case 'payment-updated' :
320
						Give()->notices->register_notice( array(
321
							'id'          => 'give-payment-updated',
322
							'type'        => 'updated',
323
							'description' => __( 'The donation has been updated.', 'give' ),
324
							'show'        => true,
325
						) );
326
						break;
327
				}// End switch().
328
			}// End if().
329
@@ 333-340 (lines=8) @@
330
			// Donor Notices.
331
			if ( current_user_can( 'edit_give_payments' ) ) {
332
				switch ( $message_notice ) {
333
					case 'donor-deleted' :
334
						Give()->notices->register_notice( array(
335
							'id'          => 'give-donor-deleted',
336
							'type'        => 'updated',
337
							'description' => __( 'The selected donor(s) has been deleted.', 'give' ),
338
							'show'        => true,
339
						) );
340
						break;
341
342
					case 'donor-donations-deleted' :
343
						Give()->notices->register_notice( array(
@@ 342-349 (lines=8) @@
339
						) );
340
						break;
341
342
					case 'donor-donations-deleted' :
343
						Give()->notices->register_notice( array(
344
							'id'          => 'give-donor-donations-deleted',
345
							'type'        => 'updated',
346
							'description' => __( 'The selected donor(s) and the associated donation(s) has been deleted.', 'give' ),
347
							'show'        => true,
348
						) );
349
						break;
350
351
					case 'confirm-delete-donor' :
352
						Give()->notices->register_notice( array(
@@ 351-358 (lines=8) @@
348
						) );
349
						break;
350
351
					case 'confirm-delete-donor' :
352
						Give()->notices->register_notice( array(
353
							'id'          => 'give-confirm-delete-donor',
354
							'type'        => 'updated',
355
							'description' => __( 'You must confirm to delete the selected donor(s).', 'give' ),
356
							'show'        => true,
357
						) );
358
						break;
359
360
					case 'invalid-donor-id' :
361
						Give()->notices->register_notice( array(
@@ 360-367 (lines=8) @@
357
						) );
358
						break;
359
360
					case 'invalid-donor-id' :
361
						Give()->notices->register_notice( array(
362
							'id'          => 'give-invalid-donor-id',
363
							'type'        => 'updated',
364
							'description' => __( 'Invalid Donor ID.', 'give' ),
365
							'show'        => true,
366
						) );
367
						break;
368
369
					case 'donor-delete-failed' :
370
						Give()->notices->register_notice( array(
@@ 378-385 (lines=8) @@
375
						) );
376
						break;
377
378
					case 'email-added' :
379
						Give()->notices->register_notice( array(
380
							'id'          => 'give-email-added',
381
							'type'        => 'updated',
382
							'description' => __( 'Donor email added.', 'give' ),
383
							'show'        => true,
384
						) );
385
						break;
386
387
					case 'email-removed' :
388
						Give()->notices->register_notice( array(
@@ 387-394 (lines=8) @@
384
						) );
385
						break;
386
387
					case 'email-removed' :
388
						Give()->notices->register_notice( array(
389
							'id'          => 'give-email-removed',
390
							'type'        => 'updated',
391
							'description' => __( 'Donor email removed.', 'give' ),
392
							'show'        => true,
393
						) );
394
						break;
395
396
					case 'email-remove-failed' :
397
						Give()->notices->register_notice( array(
@@ 396-403 (lines=8) @@
393
						) );
394
						break;
395
396
					case 'email-remove-failed' :
397
						Give()->notices->register_notice( array(
398
							'id'          => 'give-email-remove-failed',
399
							'type'        => 'updated',
400
							'description' => __( 'Failed to remove donor email.', 'give' ),
401
							'show'        => true,
402
						) );
403
						break;
404
405
					case 'primary-email-updated' :
406
						Give()->notices->register_notice( array(
@@ 405-412 (lines=8) @@
402
						) );
403
						break;
404
405
					case 'primary-email-updated' :
406
						Give()->notices->register_notice( array(
407
							'id'          => 'give-primary-email-updated',
408
							'type'        => 'updated',
409
							'description' => __( 'Primary email updated for donor.', 'give' ),
410
							'show'        => true,
411
						) );
412
						break;
413
414
					case 'primary-email-failed' :
415
						Give()->notices->register_notice( array(
@@ 414-421 (lines=8) @@
411
						) );
412
						break;
413
414
					case 'primary-email-failed' :
415
						Give()->notices->register_notice( array(
416
							'id'          => 'give-primary-email-failed',
417
							'type'        => 'updated',
418
							'description' => __( 'Failed to set primary email.', 'give' ),
419
							'show'        => true,
420
						) );
421
						break;
422
423
					case 'reconnect-user' :
424
						Give()->notices->register_notice( array(
@@ 423-430 (lines=8) @@
420
						) );
421
						break;
422
423
					case 'reconnect-user' :
424
						Give()->notices->register_notice( array(
425
							'id'          => 'give-reconnect-user',
426
							'type'        => 'updated',
427
							'description' => __( 'User has been successfully connected with Donor.', 'give' ),
428
							'show'        => true,
429
						) );
430
						break;
431
432
					case 'profile-updated' :
433
						Give()->notices->register_notice( array(
@@ 432-439 (lines=8) @@
429
						) );
430
						break;
431
432
					case 'profile-updated' :
433
						Give()->notices->register_notice( array(
434
							'id'          => 'give-profile-updated',
435
							'type'        => 'updated',
436
							'description' => __( 'Donor information updated successfully.', 'give' ),
437
							'show'        => true,
438
						) );
439
						break;
440
				}// End switch().
441
			}// End if().
442
		}