Code Duplication    Length = 10-10 lines in 25 locations

includes/admin/admin-actions.php 25 locations

@@ 218-227 (lines=10) @@
215
			// Donation reports errors.
216
			if ( current_user_can( 'view_give_reports' ) ) {
217
				switch ( $message_notice ) {
218
					case 'donation-deleted':
219
						Give()->notices->register_notice(
220
							array(
221
								'id'          => 'give-donation-deleted',
222
								'type'        => 'updated',
223
								'description' => __( 'The donation has been deleted.', 'give' ),
224
								'show'        => true,
225
							)
226
						);
227
						break;
228
					case 'email-sent':
229
						Give()->notices->register_notice(
230
							array(
@@ 228-237 (lines=10) @@
225
							)
226
						);
227
						break;
228
					case 'email-sent':
229
						Give()->notices->register_notice(
230
							array(
231
								'id'          => 'give-email-sent',
232
								'type'        => 'updated',
233
								'description' => __( 'The donation receipt has been resent.', 'give' ),
234
								'show'        => true,
235
							)
236
						);
237
						break;
238
					case 'refreshed-reports':
239
						Give()->notices->register_notice(
240
							array(
@@ 238-247 (lines=10) @@
235
							)
236
						);
237
						break;
238
					case 'refreshed-reports':
239
						Give()->notices->register_notice(
240
							array(
241
								'id'          => 'give-refreshed-reports',
242
								'type'        => 'updated',
243
								'description' => __( 'The reports cache has been cleared.', 'give' ),
244
								'show'        => true,
245
							)
246
						);
247
						break;
248
					case 'donation-note-deleted':
249
						Give()->notices->register_notice(
250
							array(
@@ 248-257 (lines=10) @@
245
							)
246
						);
247
						break;
248
					case 'donation-note-deleted':
249
						Give()->notices->register_notice(
250
							array(
251
								'id'          => 'give-donation-note-deleted',
252
								'type'        => 'updated',
253
								'description' => __( 'The donation note has been deleted.', 'give' ),
254
								'show'        => true,
255
							)
256
						);
257
						break;
258
				}// End switch().
259
			}// End if().
260
@@ 264-273 (lines=10) @@
261
			// Give settings notices and errors.
262
			if ( current_user_can( 'manage_give_settings' ) ) {
263
				switch ( $message_notice ) {
264
					case 'settings-imported':
265
						Give()->notices->register_notice(
266
							array(
267
								'id'          => 'give-settings-imported',
268
								'type'        => 'updated',
269
								'description' => __( 'The settings have been imported.', 'give' ),
270
								'show'        => true,
271
							)
272
						);
273
						break;
274
					case 'api-key-generated':
275
						Give()->notices->register_notice(
276
							array(
@@ 274-283 (lines=10) @@
271
							)
272
						);
273
						break;
274
					case 'api-key-generated':
275
						Give()->notices->register_notice(
276
							array(
277
								'id'          => 'give-api-key-generated',
278
								'type'        => 'updated',
279
								'description' => __( 'API keys have been generated.', 'give' ),
280
								'show'        => true,
281
							)
282
						);
283
						break;
284
					case 'api-key-exists':
285
						Give()->notices->register_notice(
286
							array(
@@ 284-293 (lines=10) @@
281
							)
282
						);
283
						break;
284
					case 'api-key-exists':
285
						Give()->notices->register_notice(
286
							array(
287
								'id'          => 'give-api-key-exists',
288
								'type'        => 'updated',
289
								'description' => __( 'The specified user already has API keys.', 'give' ),
290
								'show'        => true,
291
							)
292
						);
293
						break;
294
					case 'api-key-regenerated':
295
						Give()->notices->register_notice(
296
							array(
@@ 294-303 (lines=10) @@
291
							)
292
						);
293
						break;
294
					case 'api-key-regenerated':
295
						Give()->notices->register_notice(
296
							array(
297
								'id'          => 'give-api-key-regenerated',
298
								'type'        => 'updated',
299
								'description' => __( 'API keys have been regenerated.', 'give' ),
300
								'show'        => true,
301
							)
302
						);
303
						break;
304
					case 'api-key-revoked':
305
						Give()->notices->register_notice(
306
							array(
@@ 304-313 (lines=10) @@
301
							)
302
						);
303
						break;
304
					case 'api-key-revoked':
305
						Give()->notices->register_notice(
306
							array(
307
								'id'          => 'give-api-key-revoked',
308
								'type'        => 'updated',
309
								'description' => __( 'API keys have been revoked.', 'give' ),
310
								'show'        => true,
311
							)
312
						);
313
						break;
314
					case 'sent-test-email':
315
						Give()->notices->register_notice(
316
							array(
@@ 314-323 (lines=10) @@
311
							)
312
						);
313
						break;
314
					case 'sent-test-email':
315
						Give()->notices->register_notice(
316
							array(
317
								'id'          => 'give-sent-test-email',
318
								'type'        => 'updated',
319
								'description' => __( 'The test email has been sent.', 'give' ),
320
								'show'        => true,
321
							)
322
						);
323
						break;
324
					case 'matched-success-failure-page':
325
						Give()->notices->register_notice(
326
							array(
@@ 324-333 (lines=10) @@
321
							)
322
						);
323
						break;
324
					case 'matched-success-failure-page':
325
						Give()->notices->register_notice(
326
							array(
327
								'id'          => 'give-matched-success-failure-page',
328
								'type'        => 'updated',
329
								'description' => __( 'You cannot set the success and failed pages to the same page', 'give' ),
330
								'show'        => true,
331
							)
332
						);
333
						break;
334
				}// End switch().
335
			}// End if().
336
@@ 340-349 (lines=10) @@
337
			// Payments errors.
338
			if ( current_user_can( 'edit_give_payments' ) ) {
339
				switch ( $message_notice ) {
340
					case 'note-added':
341
						Give()->notices->register_notice(
342
							array(
343
								'id'          => 'give-note-added',
344
								'type'        => 'updated',
345
								'description' => __( 'The donation note has been added.', 'give' ),
346
								'show'        => true,
347
							)
348
						);
349
						break;
350
					case 'payment-updated':
351
						Give()->notices->register_notice(
352
							array(
@@ 350-359 (lines=10) @@
347
							)
348
						);
349
						break;
350
					case 'payment-updated':
351
						Give()->notices->register_notice(
352
							array(
353
								'id'          => 'give-payment-updated',
354
								'type'        => 'updated',
355
								'description' => __( 'The donation has been updated.', 'give' ),
356
								'show'        => true,
357
							)
358
						);
359
						break;
360
				}// End switch().
361
			}// End if().
362
@@ 366-375 (lines=10) @@
363
			// Donor Notices.
364
			if ( current_user_can( 'edit_give_payments' ) ) {
365
				switch ( $message_notice ) {
366
					case 'donor-deleted':
367
						Give()->notices->register_notice(
368
							array(
369
								'id'          => 'give-donor-deleted',
370
								'type'        => 'updated',
371
								'description' => __( 'The selected donor(s) has been deleted.', 'give' ),
372
								'show'        => true,
373
							)
374
						);
375
						break;
376
377
					case 'donor-donations-deleted':
378
						Give()->notices->register_notice(
@@ 377-386 (lines=10) @@
374
						);
375
						break;
376
377
					case 'donor-donations-deleted':
378
						Give()->notices->register_notice(
379
							array(
380
								'id'          => 'give-donor-donations-deleted',
381
								'type'        => 'updated',
382
								'description' => __( 'The selected donor(s) and the associated donation(s) has been deleted.', 'give' ),
383
								'show'        => true,
384
							)
385
						);
386
						break;
387
388
					case 'confirm-delete-donor':
389
						Give()->notices->register_notice(
@@ 388-397 (lines=10) @@
385
						);
386
						break;
387
388
					case 'confirm-delete-donor':
389
						Give()->notices->register_notice(
390
							array(
391
								'id'          => 'give-confirm-delete-donor',
392
								'type'        => 'updated',
393
								'description' => __( 'You must confirm to delete the selected donor(s).', 'give' ),
394
								'show'        => true,
395
							)
396
						);
397
						break;
398
399
					case 'invalid-donor-id':
400
						Give()->notices->register_notice(
@@ 399-408 (lines=10) @@
396
						);
397
						break;
398
399
					case 'invalid-donor-id':
400
						Give()->notices->register_notice(
401
							array(
402
								'id'          => 'give-invalid-donor-id',
403
								'type'        => 'updated',
404
								'description' => __( 'Invalid Donor ID.', 'give' ),
405
								'show'        => true,
406
							)
407
						);
408
						break;
409
410
					case 'donor-delete-failed':
411
						Give()->notices->register_notice(
@@ 421-430 (lines=10) @@
418
						);
419
						break;
420
421
					case 'email-added':
422
						Give()->notices->register_notice(
423
							array(
424
								'id'          => 'give-email-added',
425
								'type'        => 'updated',
426
								'description' => __( 'Donor email added.', 'give' ),
427
								'show'        => true,
428
							)
429
						);
430
						break;
431
432
					case 'email-removed':
433
						Give()->notices->register_notice(
@@ 432-441 (lines=10) @@
429
						);
430
						break;
431
432
					case 'email-removed':
433
						Give()->notices->register_notice(
434
							array(
435
								'id'          => 'give-email-removed',
436
								'type'        => 'updated',
437
								'description' => __( 'Donor email removed.', 'give' ),
438
								'show'        => true,
439
							)
440
						);
441
						break;
442
443
					case 'email-remove-failed':
444
						Give()->notices->register_notice(
@@ 443-452 (lines=10) @@
440
						);
441
						break;
442
443
					case 'email-remove-failed':
444
						Give()->notices->register_notice(
445
							array(
446
								'id'          => 'give-email-remove-failed',
447
								'type'        => 'updated',
448
								'description' => __( 'Failed to remove donor email.', 'give' ),
449
								'show'        => true,
450
							)
451
						);
452
						break;
453
454
					case 'primary-email-updated':
455
						Give()->notices->register_notice(
@@ 454-463 (lines=10) @@
451
						);
452
						break;
453
454
					case 'primary-email-updated':
455
						Give()->notices->register_notice(
456
							array(
457
								'id'          => 'give-primary-email-updated',
458
								'type'        => 'updated',
459
								'description' => __( 'Primary email updated for donor.', 'give' ),
460
								'show'        => true,
461
							)
462
						);
463
						break;
464
465
					case 'primary-email-failed':
466
						Give()->notices->register_notice(
@@ 465-474 (lines=10) @@
462
						);
463
						break;
464
465
					case 'primary-email-failed':
466
						Give()->notices->register_notice(
467
							array(
468
								'id'          => 'give-primary-email-failed',
469
								'type'        => 'updated',
470
								'description' => __( 'Failed to set primary email.', 'give' ),
471
								'show'        => true,
472
							)
473
						);
474
						break;
475
476
					case 'reconnect-user':
477
						Give()->notices->register_notice(
@@ 476-485 (lines=10) @@
473
						);
474
						break;
475
476
					case 'reconnect-user':
477
						Give()->notices->register_notice(
478
							array(
479
								'id'          => 'give-reconnect-user',
480
								'type'        => 'updated',
481
								'description' => __( 'User has been successfully connected with Donor.', 'give' ),
482
								'show'        => true,
483
							)
484
						);
485
						break;
486
487
					case 'disconnect-user':
488
						Give()->notices->register_notice(
@@ 487-496 (lines=10) @@
484
						);
485
						break;
486
487
					case 'disconnect-user':
488
						Give()->notices->register_notice(
489
							array(
490
								'id'          => 'give-disconnect-user',
491
								'type'        => 'updated',
492
								'description' => __( 'User has been successfully disconnected from donor.', 'give' ),
493
								'show'        => true,
494
							)
495
						);
496
						break;
497
498
					case 'profile-updated':
499
						Give()->notices->register_notice(
@@ 498-507 (lines=10) @@
495
						);
496
						break;
497
498
					case 'profile-updated':
499
						Give()->notices->register_notice(
500
							array(
501
								'id'          => 'give-profile-updated',
502
								'type'        => 'updated',
503
								'description' => __( 'Donor information updated successfully.', 'give' ),
504
								'show'        => true,
505
							)
506
						);
507
						break;
508
				}// End switch().
509
			}// End if().
510
		}