Code Duplication    Length = 16-24 lines in 2 locations

modules/widgets/facebook-likebox.php 1 location

@@ 26-49 (lines=24) @@
23
	private $max_height           = 9999;
24
	private $min_height           = 130;
25
26
	function __construct() {
27
		parent::__construct(
28
			'facebook-likebox',
29
			/**
30
			 * Filter the name of a widget included in the Extra Sidebar Widgets module.
31
			 *
32
			 * @module widgets
33
			 *
34
			 * @since 2.1.2
35
			 *
36
			 * @param string $widget_name Widget title.
37
			 */
38
			apply_filters( 'jetpack_widget_name', __( 'Facebook Page Plugin', 'jetpack' ) ),
39
			array(
40
				'classname' => 'widget_facebook_likebox',
41
				'description' => __( 'Use the Facebook Page Plugin to connect visitors to your Facebook Page', 'jetpack' ),
42
				'customize_selective_refresh' => true,
43
			)
44
		);
45
46
		if ( is_active_widget( false, false, $this->id_base ) || is_active_widget( false, false, 'monster' ) || is_customize_preview() ) {
47
			add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
48
		}
49
	}
50
51
	/**
52
	 * Enqueue scripts.

modules/widgets/image-widget.php 1 location

@@ 21-36 (lines=16) @@
18
	/**
19
	* Register widget with WordPress.
20
	*/
21
	public function __construct() {
22
		parent::__construct(
23
			'image',
24
			/** This filter is documented in modules/widgets/facebook-likebox.php */
25
			apply_filters( 'jetpack_widget_name', esc_html__( 'Image', 'jetpack' ) ),
26
			array(
27
				'classname' => 'widget_image',
28
				'description' => __( 'Display an image in your sidebar', 'jetpack' ),
29
				'customize_selective_refresh' => true,
30
			)
31
		);
32
33
		if ( is_active_widget( false, false, $this->id_base ) || is_active_widget( false, false, 'monster' ) || is_customize_preview() ) {
34
			add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_style' ) );
35
		}
36
	}
37
38
	/**
39
	* Loads file for front-end widget style.