Code Duplication    Length = 7-8 lines in 2 locations

modules/simple-payments/simple-payments.php 2 locations

@@ 154-161 (lines=8) @@
151
152
		$data['id'] = $attrs['id'];
153
154
		if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
155
			require_once WP_CONTENT_DIR . '/lib/display-context.php';
156
			$context = \A8C\Display_Context\get_current_context();
157
			if ( \A8C\Display_Context\EMAIL === $context ) {
158
				// Avoid enqueueing unsupported files by emails.
159
				return $this->output_shortcode( $data );
160
			}
161
		}
162
163
		if( ! wp_style_is( 'jetpack-simple-payments', 'enqueued' ) ) {
164
			wp_enqueue_style( 'jetpack-simple-payments' );
@@ 205-211 (lines=7) @@
202
		$css_prefix = self::$css_classname_prefix;
203
204
		$is_paypal_button_visible = true;
205
		if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
206
			require_once WP_CONTENT_DIR . '/lib/display-context.php';
207
			$context = \A8C\Display_Context\get_current_context();
208
			if ( \A8C\Display_Context\EMAIL === $context ) {
209
				$is_paypal_button_visible = false;
210
			}
211
		}
212
213
		if ( $data['multiple'] ) {
214
			$items = sprintf( '