Code Duplication    Length = 14-16 lines in 2 locations

modules/widgets/eu-cookie-law.php 1 location

@@ 82-97 (lines=16) @@
79
		/**
80
		 * Constructor.
81
		 */
82
		function __construct() {
83
			parent::__construct(
84
				'eu_cookie_law_widget',
85
				/** This filter is documented in modules/widgets/facebook-likebox.php */
86
				apply_filters( 'jetpack_widget_name', esc_html__( 'EU Cookie Law Banner', 'jetpack' ) ),
87
				array(
88
					'description' => esc_html__( 'Display a banner for compliance with the EU Cookie Law.', 'jetpack' ),
89
					'customize_selective_refresh' => true,
90
				),
91
				array()
92
			);
93
94
			if ( is_active_widget( false, false, $this->id_base ) || is_customize_preview() ) {
95
				add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_frontend_scripts' ) );
96
			}
97
		}
98
99
		/**
100
		 * Enqueue scripts and styles.

modules/widgets/upcoming-events.php 1 location

@@ 4-17 (lines=14) @@
1
<?php
2
3
class Jetpack_Upcoming_Events_Widget extends WP_Widget {
4
	function __construct() {
5
		parent::__construct(
6
			'upcoming_events_widget',
7
			/** This filter is documented in modules/widgets/facebook-likebox.php */
8
			apply_filters( 'jetpack_widget_name', __( 'Upcoming Events', 'jetpack' ) ),
9
			array(
10
				'description' => __( 'Display upcoming events from an iCalendar feed.', 'jetpack' ),
11
				'customize_selective_refresh' => true,
12
			)
13
		);
14
		if ( is_active_widget( false, false, $this->id_base ) ) {
15
			add_action( 'wp_head', array( $this, 'css' ) );
16
		}
17
	}
18
19
	function css() {
20
?>