Code Duplication    Length = 9-11 lines in 2 locations

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

@@ 176-184 (lines=9) @@
173
174
				// Check if keys are entered properly per live/test mode.
175
				if ( $testmode ) {
176
					if (
177
						! empty( $test_pub_key ) && ! preg_match( '/^pk_test_/', $test_pub_key )
178
						|| ( ! empty( $test_secret_key ) && ! preg_match( '/^sk_test_/', $test_secret_key )
179
						&& ! empty( $test_secret_key ) && ! preg_match( '/^rk_test_/', $test_secret_key ) ) ) {
180
						$setting_link = $this->get_setting_link();
181
						/* translators: 1) link */
182
						$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 );
183
					}
184
				} else {
185
					if (
186
						! empty( $live_pub_key ) && ! preg_match( '/^pk_live_/', $live_pub_key )
187
						|| ( ! empty( $live_secret_key ) && ! preg_match( '/^sk_live_/', $live_secret_key )
@@ 184-194 (lines=11) @@
181
						/* translators: 1) link */
182
						$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 );
183
					}
184
				} else {
185
					if (
186
						! empty( $live_pub_key ) && ! preg_match( '/^pk_live_/', $live_pub_key )
187
						|| ( ! empty( $live_secret_key ) && ! preg_match( '/^sk_live_/', $live_secret_key )
188
						&& ! empty( $live_secret_key ) && ! preg_match( '/^rk_live_/', $live_secret_key ) ) ) {
189
						$setting_link = $this->get_setting_link();
190
						/* translators: 1) link */
191
						$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 or rk_live. Please go to your settings and, <a href="%s">set your Stripe account keys</a>.', 'woocommerce-gateway-stripe' ), $setting_link ), true );
192
					}
193
				}
194
			}
195
196
			if ( empty( $show_ssl_notice ) ) {
197
				// Show message if enabled and FORCE SSL is disabled and WordpressHTTPS plugin is not detected.