Code Duplication    Length = 14-18 lines in 3 locations

modules/widgets/contact-info.php 1 location

@@ 22-39 (lines=18) @@
19
		/**
20
		 * Constructor
21
		 */
22
		function __construct() {
23
			$widget_ops = array(
24
				'classname' => 'widget_contact_info',
25
				'description' => __( 'Display your location, hours, and contact information.', 'jetpack' ),
26
				'customize_selective_refresh' => true,
27
			);
28
			parent::__construct(
29
				'widget_contact_info',
30
				/** This filter is documented in modules/widgets/facebook-likebox.php */
31
				apply_filters( 'jetpack_widget_name', __( 'Contact Info', 'jetpack' ) ),
32
				$widget_ops
33
			);
34
			$this->alt_option_name = 'widget_contact_info';
35
36
			if ( is_customize_preview() ) {
37
				add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
38
			}
39
		}
40
41
		/**
42
		 * Enqueue scripts and styles.

modules/widgets/google-translate.php 1 location

@@ 28-41 (lines=14) @@
25
	/**
26
	 * Register widget with WordPress.
27
	 */
28
	function __construct() {
29
		parent::__construct(
30
			'google_translate_widget',
31
			/** This filter is documented in modules/widgets/facebook-likebox.php */
32
			apply_filters( 'jetpack_widget_name', __( 'Google Translate', 'jetpack' ) ),
33
			array(
34
				'description' => __( 'Provide your readers with the option to translate your site into their preferred language.', 'jetpack' ),
35
				'customize_selective_refresh' => true
36
			)
37
		);
38
		add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
39
40
		$this->default_title = esc_html__( 'Translate', 'jetpack' );
41
	}
42
43
	/**
44
	 * Enqueue frontend JS scripts.

modules/widgets/wordpress-post-widget.php 1 location

@@ 140-155 (lines=16) @@
137
	public static $cron_name = 'jetpack_display_posts_widget_cron_update';
138
139
140
	public function __construct() {
141
		parent::__construct(
142
		// internal id
143
			'jetpack_display_posts_widget',
144
			/** This filter is documented in modules/widgets/facebook-likebox.php */
145
			apply_filters( 'jetpack_widget_name', __( 'Display WordPress Posts', 'jetpack' ) ),
146
			array(
147
				'description' => __( 'Displays a list of recent posts from another WordPress.com or Jetpack-enabled blog.', 'jetpack' ),
148
				'customize_selective_refresh' => true,
149
			)
150
		);
151
152
		if ( is_customize_preview() ) {
153
			add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
154
		}
155
	}
156
157
	/**
158
	 * Expiring transients have a name length maximum of 45 characters,