Code Duplication    Length = 8-10 lines in 2 locations

woocommerce-gateway-stripe.php 2 locations

@@ 292-299 (lines=8) @@
289
290
				// Check if keys are entered properly per live/test mode.
291
				if ( $testmode ) {
292
					if (
293
						! empty( $test_pub_key ) && ! preg_match( '/^pk_test_/', $test_pub_key )
294
						|| ! empty( $test_secret_key ) && ! preg_match( '/^sk_test_/', $test_secret_key ) )
295
					{
296
						$setting_link = $this->get_setting_link();
297
						/* translators: 1) link */
298
						$this->add_admin_notice( 'keys', 'notice notice-error', sprintf( __( 'Stripe is in test mode however your test keys may not be valid. Test keys start with pk_test and sk_test. Please go to your settings and, <a href="%s">set your Stripe account keys</a>.', 'woocommerce-gateway-stripe' ), $setting_link ), true );
299
					}
300
				} else {
301
					if (
302
						! empty( $live_pub_key ) && ! preg_match( '/^pk_live_/', $live_pub_key )
@@ 300-309 (lines=10) @@
297
						/* translators: 1) link */
298
						$this->add_admin_notice( 'keys', 'notice notice-error', sprintf( __( 'Stripe is in test mode however your test keys may not be valid. Test keys start with pk_test and sk_test. Please go to your settings and, <a href="%s">set your Stripe account keys</a>.', 'woocommerce-gateway-stripe' ), $setting_link ), true );
299
					}
300
				} else {
301
					if (
302
						! empty( $live_pub_key ) && ! preg_match( '/^pk_live_/', $live_pub_key )
303
						|| ! empty( $live_secret_key ) && ! preg_match( '/^sk_live_/', $live_secret_key ) )
304
					{
305
						$setting_link = $this->get_setting_link();
306
						/* translators: 1) link */
307
						$this->add_admin_notice( 'keys', 'notice notice-error', sprintf( __( 'Stripe is in live mode however your test keys may not be valid. Live keys start with pk_live and sk_live. Please go to your settings and, <a href="%s">set your Stripe account keys</a>.', 'woocommerce-gateway-stripe' ), $setting_link ), true );
308
					}
309
				}
310
			}
311
312
			if ( empty( $show_ssl_notice ) && isset( $options['enabled'] ) && 'yes' === $options['enabled'] ) {