Code Duplication    Length = 8-8 lines in 20 locations

includes/admin/admin-actions.php 20 locations

@@ 182-189 (lines=8) @@
179
		// Donation reports errors.
180
		if ( current_user_can( 'view_give_reports' ) ) {
181
			switch ( $_GET['give-message'] ) {
182
				case 'donation_deleted' :
183
					Give()->notices->register_notice( array(
184
						'id'          => 'give-donation-deleted',
185
						'type'        => 'updated',
186
						'description' => __( 'The donation has been deleted.', 'give' ),
187
						'show'        => true,
188
					) );
189
					break;
190
				case 'email_sent' :
191
					Give()->notices->register_notice( array(
192
						'id'          => 'give-payment-sent',
@@ 190-197 (lines=8) @@
187
						'show'        => true,
188
					) );
189
					break;
190
				case 'email_sent' :
191
					Give()->notices->register_notice( array(
192
						'id'          => 'give-payment-sent',
193
						'type'        => 'updated',
194
						'description' => __( 'The donation receipt has been resent.', 'give' ),
195
						'show'        => true,
196
					) );
197
					break;
198
				case 'refreshed-reports' :
199
					Give()->notices->register_notice( array(
200
						'id'          => 'give-refreshed-reports',
@@ 198-205 (lines=8) @@
195
						'show'        => true,
196
					) );
197
					break;
198
				case 'refreshed-reports' :
199
					Give()->notices->register_notice( array(
200
						'id'          => 'give-refreshed-reports',
201
						'type'        => 'updated',
202
						'description' => __( 'The reports cache has been cleared.', 'give' ),
203
						'show'        => true,
204
					) );
205
					break;
206
				case 'donation-note-deleted' :
207
					Give()->notices->register_notice( array(
208
						'id'          => 'give-donation-note-deleted',
@@ 206-213 (lines=8) @@
203
						'show'        => true,
204
					) );
205
					break;
206
				case 'donation-note-deleted' :
207
					Give()->notices->register_notice( array(
208
						'id'          => 'give-donation-note-deleted',
209
						'type'        => 'updated',
210
						'description' => __( 'The donation note has been deleted.', 'give' ),
211
						'show'        => true,
212
					) );
213
					break;
214
			}
215
		}
216
@@ 220-227 (lines=8) @@
217
		// Give settings notices and errors.
218
		if ( current_user_can( 'manage_give_settings' ) ) {
219
			switch ( $_GET['give-message'] ) {
220
				case 'settings-imported' :
221
					Give()->notices->register_notice( array(
222
						'id'          => 'give-settings-imported',
223
						'type'        => 'updated',
224
						'description' => __( 'The settings have been imported.', 'give' ),
225
						'show'        => true,
226
					) );
227
					break;
228
				case 'api-key-generated' :
229
					Give()->notices->register_notice( array(
230
						'id'          => 'give-api-key-generated',
@@ 228-235 (lines=8) @@
225
						'show'        => true,
226
					) );
227
					break;
228
				case 'api-key-generated' :
229
					Give()->notices->register_notice( array(
230
						'id'          => 'give-api-key-generated',
231
						'type'        => 'updated',
232
						'description' => __( 'API keys have been generated.', 'give' ),
233
						'show'        => true,
234
					) );
235
					break;
236
				case 'api-key-exists' :
237
					Give()->notices->register_notice( array(
238
						'id'          => 'give-api-key-exists',
@@ 236-243 (lines=8) @@
233
						'show'        => true,
234
					) );
235
					break;
236
				case 'api-key-exists' :
237
					Give()->notices->register_notice( array(
238
						'id'          => 'give-api-key-exists',
239
						'type'        => 'updated',
240
						'description' => __( 'The specified user already has API keys.', 'give' ),
241
						'show'        => true,
242
					) );
243
					break;
244
				case 'api-key-regenerated' :
245
					Give()->notices->register_notice( array(
246
						'id'          => 'give-api-key-regenerated',
@@ 244-251 (lines=8) @@
241
						'show'        => true,
242
					) );
243
					break;
244
				case 'api-key-regenerated' :
245
					Give()->notices->register_notice( array(
246
						'id'          => 'give-api-key-regenerated',
247
						'type'        => 'updated',
248
						'description' => __( 'API keys have been regenerated.', 'give' ),
249
						'show'        => true,
250
					) );
251
					break;
252
				case 'api-key-revoked' :
253
					Give()->notices->register_notice( array(
254
						'id'          => 'give-api-key-revoked',
@@ 252-259 (lines=8) @@
249
						'show'        => true,
250
					) );
251
					break;
252
				case 'api-key-revoked' :
253
					Give()->notices->register_notice( array(
254
						'id'          => 'give-api-key-revoked',
255
						'type'        => 'updated',
256
						'description' => __( 'API keys have been revoked.', 'give' ),
257
						'show'        => true,
258
					) );
259
					break;
260
				case 'sent-test-email' :
261
					Give()->notices->register_notice( array(
262
						'id'          => 'give-sent-test-email',
@@ 260-267 (lines=8) @@
257
						'show'        => true,
258
					) );
259
					break;
260
				case 'sent-test-email' :
261
					Give()->notices->register_notice( array(
262
						'id'          => 'give-sent-test-email',
263
						'type'        => 'updated',
264
						'description' => __( 'The test email has been sent.', 'give' ),
265
						'show'        => true,
266
					) );
267
					break;
268
				case 'matched-success-failure-page':
269
					Give()->notices->register_notice( array(
270
						'id'          => 'give-matched-success-failure-page',
@@ 268-275 (lines=8) @@
265
						'show'        => true,
266
					) );
267
					break;
268
				case 'matched-success-failure-page':
269
					Give()->notices->register_notice( array(
270
						'id'          => 'give-matched-success-failure-page',
271
						'type'        => 'updated',
272
						'description' => __( 'You cannot set the success and failed pages to the same page', 'give' ),
273
						'show'        => true,
274
					) );
275
					break;
276
			}
277
		}
278
		// Payments errors.
@@ 281-288 (lines=8) @@
278
		// Payments errors.
279
		if ( current_user_can( 'edit_give_payments' ) ) {
280
			switch ( $_GET['give-message'] ) {
281
				case 'note-added' :
282
					Give()->notices->register_notice( array(
283
						'id'          => 'give-note-added',
284
						'type'        => 'updated',
285
						'description' => __( 'The donation note has been added.', 'give' ),
286
						'show'        => true,
287
					) );
288
					break;
289
				case 'payment-updated' :
290
					Give()->notices->register_notice( array(
291
						'id'          => 'give-payment-updated',
@@ 289-296 (lines=8) @@
286
						'show'        => true,
287
					) );
288
					break;
289
				case 'payment-updated' :
290
					Give()->notices->register_notice( array(
291
						'id'          => 'give-payment-updated',
292
						'type'        => 'updated',
293
						'description' => __( 'The donation has been updated.', 'give' ),
294
						'show'        => true,
295
					) );
296
					break;
297
			}
298
		}
299
@@ 303-310 (lines=8) @@
300
		// Donor Notices.
301
		if ( current_user_can( 'edit_give_payments' ) ) {
302
			switch ( $_GET['give-message'] ) {
303
				case 'donor-deleted' :
304
					Give()->notices->register_notice( array(
305
						'id'          => 'give-donor-deleted',
306
						'type'        => 'updated',
307
						'description' => __( 'The donor has been deleted.', 'give' ),
308
						'show'        => true,
309
					) );
310
					break;
311
312
				case 'email-added' :
313
					Give()->notices->register_notice( array(
@@ 312-319 (lines=8) @@
309
					) );
310
					break;
311
312
				case 'email-added' :
313
					Give()->notices->register_notice( array(
314
						'id'          => 'give-donor-email-added',
315
						'type'        => 'updated',
316
						'description' => __( 'Donor email added.', 'give' ),
317
						'show'        => true,
318
					) );
319
					break;
320
321
				case 'email-removed' :
322
					Give()->notices->register_notice( array(
@@ 321-328 (lines=8) @@
318
					) );
319
					break;
320
321
				case 'email-removed' :
322
					Give()->notices->register_notice( array(
323
						'id'          => 'give-donor-email-removed',
324
						'type'        => 'updated',
325
						'description' => __( 'Donor email removed.', 'give' ),
326
						'show'        => true,
327
					) );
328
					break;
329
330
				case 'email-remove-failed' :
331
					Give()->notices->register_notice( array(
@@ 330-337 (lines=8) @@
327
					) );
328
					break;
329
330
				case 'email-remove-failed' :
331
					Give()->notices->register_notice( array(
332
						'id'          => 'give-donor-email-remove-failed',
333
						'type'        => 'updated',
334
						'description' => __( 'Failed to remove donor email.', 'give' ),
335
						'show'        => true,
336
					) );
337
					break;
338
339
				case 'primary-email-updated' :
340
					Give()->notices->register_notice( array(
@@ 339-346 (lines=8) @@
336
					) );
337
					break;
338
339
				case 'primary-email-updated' :
340
					Give()->notices->register_notice( array(
341
						'id'          => 'give-donor-primary-email-updated',
342
						'type'        => 'updated',
343
						'description' => __( 'Primary email updated for donor.', 'give' ),
344
						'show'        => true,
345
					) );
346
					break;
347
348
				case 'primary-email-failed' :
349
					Give()->notices->register_notice( array(
@@ 348-355 (lines=8) @@
345
					) );
346
					break;
347
348
				case 'primary-email-failed' :
349
					Give()->notices->register_notice( array(
350
						'id'          => 'give-donor-primary-email-failed',
351
						'type'        => 'updated',
352
						'description' => __( 'Failed to set primary email.', 'give' ),
353
						'show'        => true,
354
					) );
355
					break;
356
357
				case 'reconnect-user' :
358
					Give()->notices->register_notice( array(
@@ 357-364 (lines=8) @@
354
					) );
355
					break;
356
357
				case 'reconnect-user' :
358
					Give()->notices->register_notice( array(
359
						'id'          => 'give-donor-reconnect-user',
360
						'type'        => 'updated',
361
						'description' => __( 'User has been successfully connected with Donor.', 'give' ),
362
						'show'        => true,
363
					) );
364
					break;
365
			}
366
		}
367
	}