Code Duplication    Length = 16-24 lines in 4 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.

modules/widgets/my-community.php 1 location

@@ 33-49 (lines=17) @@
30
	/**
31
	 * Registers the widget with WordPress.
32
	 */
33
	function __construct() {
34
		parent::__construct(
35
			'jetpack_my_community', // Base ID
36
			/** This filter is documented in modules/widgets/facebook-likebox.php */
37
			apply_filters( 'jetpack_widget_name', esc_html__( 'My Community', 'jetpack' ) ),
38
			array(
39
				'description' => esc_html__( "Display members of your site's community.", 'jetpack' ),
40
				'customize_selective_refresh' => true,
41
			)
42
		);
43
44
		if ( is_active_widget( false, false, $this->id_base ) || is_active_widget( false, false, 'monster' ) || is_customize_preview() ) {
45
			add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_style' ) );
46
		}
47
48
		$this->default_title = esc_html__( 'Community', 'jetpack' );
49
	}
50
51
	/**
52
	 * Enqueue stylesheet for grid layout.

modules/subscriptions.php 1 location

@@ 742-759 (lines=18) @@
739
 */
740
741
class Jetpack_Subscriptions_Widget extends WP_Widget {
742
	function __construct() {
743
		$widget_ops  = array(
744
			'classname' => 'jetpack_subscription_widget',
745
			'description' => esc_html__( 'Add an email signup form to allow people to subscribe to your blog.', 'jetpack' ),
746
			'customize_selective_refresh' => true,
747
		);
748
749
		parent::__construct(
750
			'blog_subscription',
751
			/** This filter is documented in modules/widgets/facebook-likebox.php */
752
			apply_filters( 'jetpack_widget_name', __( 'Blog Subscriptions', 'jetpack' ) ),
753
			$widget_ops
754
		);
755
756
		if ( is_active_widget( false, false, $this->id_base ) || is_active_widget( false, false, 'monster' ) || is_customize_preview() ) {
757
			add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_style' ) );
758
		}
759
	}
760
761
	/**
762
	 * Enqueue the form's CSS.