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/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/widgets/image-widget.php 1 location

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

modules/subscriptions.php 1 location

@@ 777-794 (lines=18) @@
774
 */
775
776
class Jetpack_Subscriptions_Widget extends WP_Widget {
777
	function __construct() {
778
		$widget_ops  = array(
779
			'classname' => 'jetpack_subscription_widget',
780
			'description' => esc_html__( 'Add an email signup form to allow people to subscribe to your blog.', 'jetpack' ),
781
			'customize_selective_refresh' => true,
782
		);
783
784
		parent::__construct(
785
			'blog_subscription',
786
			/** This filter is documented in modules/widgets/facebook-likebox.php */
787
			apply_filters( 'jetpack_widget_name', __( 'Blog Subscriptions', 'jetpack' ) ),
788
			$widget_ops
789
		);
790
791
		if ( is_active_widget( false, false, $this->id_base ) || is_active_widget( false, false, 'monster' ) || is_customize_preview() ) {
792
			add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_style' ) );
793
		}
794
	}
795
796
	/**
797
	 * Enqueue the form's CSS.