Code Duplication    Length = 7-9 lines in 2 locations

includes/admin/class-wc-stripe-admin-notices.php 2 locations

@@ 175-181 (lines=7) @@
172
173
				// Check if keys are entered properly per live/test mode.
174
				if ( $testmode ) {
175
					if (
176
						! empty( $test_pub_key ) && ! preg_match( '/^pk_test_/', $test_pub_key )
177
						|| ! empty( $test_secret_key ) && ! preg_match( '/^[rs]k_test_/', $test_secret_key ) ) {
178
						$setting_link = $this->get_setting_link();
179
						/* translators: 1) link */
180
						$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 or rk_test. Please go to your settings and, <a href="%s">set your Stripe account keys</a>.', 'woocommerce-gateway-stripe' ), $setting_link ), true );
181
					}
182
				} else {
183
					if (
184
						! empty( $live_pub_key ) && ! preg_match( '/^pk_live_/', $live_pub_key )
@@ 182-190 (lines=9) @@
179
						/* translators: 1) link */
180
						$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 or rk_test. Please go to your settings and, <a href="%s">set your Stripe account keys</a>.', 'woocommerce-gateway-stripe' ), $setting_link ), true );
181
					}
182
				} else {
183
					if (
184
						! empty( $live_pub_key ) && ! preg_match( '/^pk_live_/', $live_pub_key )
185
						|| ! empty( $live_secret_key ) && ! preg_match( '/^[rs]k_live_/', $live_secret_key ) ) {
186
						$setting_link = $this->get_setting_link();
187
						/* translators: 1) link */
188
						$this->add_admin_notice( 'keys', 'notice notice-error', sprintf( __( 'Stripe is in live mode however your live keys may not be valid. Live keys start with pk_live and sk_live or rk_live. Please go to your settings and, <a href="%s">set your Stripe account keys</a>.', 'woocommerce-gateway-stripe' ), $setting_link ), true );
189
					}
190
				}
191
			}
192
193
			if ( empty( $show_ssl_notice ) ) {