Test Failed
Push — master ( 56b278...03d6f1 )
by Brandon
10:30 queued 07:01
created
re-pro.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -21,11 +21,11 @@  discard block
 block discarded – undo
21 21
 */
22 22
 
23 23
 /* Exit if accessed directly. */
24
-if ( ! defined( 'ABSPATH' ) ) { exit; }
24
+if ( ! defined('ABSPATH')) { exit; }
25 25
 
26 26
 /** Instantiate the plugin. */
27 27
 new RePro();
28
-require_once( 'settings.php');
28
+require_once('settings.php');
29 29
 
30 30
 
31 31
 /**
@@ -41,12 +41,12 @@  discard block
 block discarded – undo
41 41
 	 */
42 42
 	public function __construct() {
43 43
 		/* Define Constants */
44
-		define( 'REPRO_BASE_NAME', plugin_basename( __FILE__ ) );
45
-		define( 'REPRO_BASE_DIR', plugin_dir_path( __FILE__ ) );
46
-		define( 'REPRO_PLUGIN_FILE', REPRO_BASE_DIR . 're-pro.php' );
44
+		define('REPRO_BASE_NAME', plugin_basename(__FILE__));
45
+		define('REPRO_BASE_DIR', plugin_dir_path(__FILE__));
46
+		define('REPRO_PLUGIN_FILE', REPRO_BASE_DIR . 're-pro.php');
47 47
 
48 48
 		/* Include dependencies */
49
-		require_once( 'includes.php' );
49
+		require_once('includes.php');
50 50
 
51 51
 		$this->init();
52 52
 	}
@@ -62,45 +62,45 @@  discard block
 block discarded – undo
62 62
 		$this->general_settings = get_option('re_pro_settings');
63 63
 
64 64
 		/* Language Support. */
65
-		load_plugin_textdomain( 're-pro', false, dirname( REPRO_BASE_NAME ) . '/languages' );
65
+		load_plugin_textdomain('re-pro', false, dirname(REPRO_BASE_NAME) . '/languages');
66 66
 
67 67
 		/* Plugin Activation/De-Activation. */
68
-		register_activation_hook( REPRO_PLUGIN_FILE, array( $this, 'activate' ) );
69
-		register_deactivation_hook( REPRO_PLUGIN_FILE, array( $this, 'deactivate' ) );
68
+		register_activation_hook(REPRO_PLUGIN_FILE, array($this, 'activate'));
69
+		register_deactivation_hook(REPRO_PLUGIN_FILE, array($this, 'deactivate'));
70 70
 
71 71
 		/* Set menu page. */
72
-		add_action( 'admin_menu', array( $this, 'admin_menu' ) );
72
+		add_action('admin_menu', array($this, 'admin_menu'));
73 73
 
74 74
 		/** Enqueue css and js files. */
75
-		add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
76
-		add_action( 'wp_enqueue_scripts', 	 array( $this, 'widget_styles' ) );
75
+		add_action('admin_enqueue_scripts', array($this, 'admin_scripts'));
76
+		add_action('wp_enqueue_scripts', array($this, 'widget_styles'));
77 77
 
78 78
 		/* Add link to settings in plugins admin page. */
79
-		add_filter( 'plugin_action_links_' . REPRO_BASE_NAME , array( $this, 'plugin_links' ) );
79
+		add_filter('plugin_action_links_' . REPRO_BASE_NAME, array($this, 'plugin_links'));
80 80
 
81
-		add_filter( 'wpapi_google_map_data', array( $this, 'gmap_style' ), 1 );
81
+		add_filter('wpapi_google_map_data', array($this, 'gmap_style'), 1);
82 82
 
83 83
 		$this->init_modules();
84 84
 	}
85 85
 
86
-	private function init_modules(){
87
-		$gmaps_key = isset( $this->general_settings['gmaps_key'] ) ? $this->general_settings['gmaps_key'] : null;
86
+	private function init_modules() {
87
+		$gmaps_key = isset($this->general_settings['gmaps_key']) ? $this->general_settings['gmaps_key'] : null;
88 88
 
89
-		if ( isset( $this->general_settings['gmaps_active'] ) && isset( $gmaps_key ) ) {
90
-			new WPAPI_GOOGLE_MAPS( $gmaps_key );
89
+		if (isset($this->general_settings['gmaps_active']) && isset($gmaps_key)) {
90
+			new WPAPI_GOOGLE_MAPS($gmaps_key);
91 91
 		}
92 92
 	}
93 93
 
94
-	public function gmap_style( $map_data ){
94
+	public function gmap_style($map_data) {
95 95
 		// Grab style option.
96
-		$map_json = ( isset( $this->general_settings['gmaps_style'] ) ) ? $this->general_settings['gmaps_style'] : '[]';
96
+		$map_json = (isset($this->general_settings['gmaps_style'])) ? $this->general_settings['gmaps_style'] : '[]';
97 97
 
98 98
 		// Validate JSON.
99 99
 		json_decode($map_json);
100 100
 		$json_valid = json_last_error();
101 101
 
102 102
 		// Set style to map_data.
103
-		$map_data['style'] = ( $json_valid === JSON_ERROR_NONE ) ? $map_json : '[]';
103
+		$map_data['style'] = ($json_valid === JSON_ERROR_NONE) ? $map_json : '[]';
104 104
 
105 105
 		return $map_data;
106 106
 	}
@@ -116,8 +116,8 @@  discard block
 block discarded – undo
116 116
 	 * Enqueue CSS.
117 117
 	 */
118 118
 	public function admin_scripts() {
119
-		if ( ! is_admin() ) {
120
-			wp_register_style( 're-pro', plugins_url( 'assets/css/re-pro-min.css', REPRO_PLUGIN_FILE ) );
119
+		if ( ! is_admin()) {
120
+			wp_register_style('re-pro', plugins_url('assets/css/re-pro-min.css', REPRO_PLUGIN_FILE));
121 121
 			// wp_enqueue_style( 're-pro' );
122 122
 		}
123 123
 	}
@@ -126,8 +126,8 @@  discard block
 block discarded – undo
126 126
 	 * Register Widget CSS.
127 127
 	 */
128 128
 	public function widget_styles() {
129
-		wp_register_style( 're-pro-widgets', plugins_url( 'assets/css/re-pro-widgets.min.css', REPRO_PLUGIN_FILE ) );
130
-		wp_enqueue_style( 're-pro-widgets' );
129
+		wp_register_style('re-pro-widgets', plugins_url('assets/css/re-pro-widgets.min.css', REPRO_PLUGIN_FILE));
130
+		wp_enqueue_style('re-pro-widgets');
131 131
 	}
132 132
 
133 133
 	/**
@@ -150,9 +150,9 @@  discard block
 block discarded – undo
150 150
 	 * @param  [Array] $links : Array of links on plugin page.
151 151
 	 * @return [Array]        : Array of links on plugin page.
152 152
 	 */
153
-	public function plugin_links( $links ) {
153
+	public function plugin_links($links) {
154 154
 		$settings_link = '<a href="options-general.php?page=re-pro-settings">Settings</a>';
155
-		array_unshift( $links, $settings_link );
155
+		array_unshift($links, $settings_link);
156 156
 		return $links;
157 157
 	}
158 158
 }
Please login to merge, or discard this patch.
modules/equal-housing/widgets/class-equal-housing-widget.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
 
19 19
 		parent::__construct(
20 20
 			'equal_housing_logo',
21
-			__( 'Equal Housing Opportunity', 're-pro' ),
21
+			__('Equal Housing Opportunity', 're-pro'),
22 22
 			array(
23
-				'description' => __( 'Display the Equal Housing Opportunity Logo.', 're-pro' ),
23
+				'description' => __('Display the Equal Housing Opportunity Logo.', 're-pro'),
24 24
 				'classname'   => 're-pro re-pro-widget equal-housing',
25 25
 				'customize_selective_refresh' => true,
26 26
 			)
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
 	 * @param mixed $instance Instance.
37 37
 	 * @return void
38 38
 	 */
39
-	public function widget( $args, $instance ) {
39
+	public function widget($args, $instance) {
40 40
 
41
-		if ( ! empty( $instance['title'] ) ) {
41
+		if ( ! empty($instance['title'])) {
42 42
 			$title = $instance['title'];
43 43
 		} else {
44 44
 			$title = '';
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
 
48 48
 		echo $args['before_widget'];
49 49
 
50
-		echo $args['before_title'] . esc_attr( $title ) . $args['after_title'];
50
+		echo $args['before_title'] . esc_attr($title) . $args['after_title'];
51 51
 
52
-		echo '<img src="'. esc_url( plugins_url( '../../../assets/images/equalhousing/equal_housing.svg', __FILE__ ) ) .'" alt="'. __( 'Equal Housing Opportunity', 're-pro' ) .'" height="' . $logo_size . '" width="' . $logo_size . '" class="re-pro equal-housing-opportunity">';
52
+		echo '<img src="' . esc_url(plugins_url('../../../assets/images/equalhousing/equal_housing.svg', __FILE__)) . '" alt="' . __('Equal Housing Opportunity', 're-pro') . '" height="' . $logo_size . '" width="' . $logo_size . '" class="re-pro equal-housing-opportunity">';
53 53
 
54 54
 		echo $args['after_widget'];
55 55
 
@@ -62,38 +62,38 @@  discard block
 block discarded – undo
62 62
 	 * @param mixed $instance Instance.
63 63
 	 * @return void
64 64
 	 */
65
-	public function form( $instance ) {
65
+	public function form($instance) {
66 66
 
67 67
 		// Set default values
68
-		$instance = wp_parse_args( (array) $instance, array(
68
+		$instance = wp_parse_args((array) $instance, array(
69 69
 			'logo-size' => '32',
70 70
 			'title' => '',
71
-		) );
71
+		));
72 72
 
73 73
 		// Retrieve an existing value from the database
74
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
75
-		$logo_size = ! empty( $instance['logo_size'] ) ? $instance['logo_size'] : '';
74
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
75
+		$logo_size = ! empty($instance['logo_size']) ? $instance['logo_size'] : '';
76 76
 
77 77
 		// Form fields
78 78
 		echo '<p>';
79
-		echo '	<label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile', 're-pro' ) . '</label>';
80
-		echo '	<input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title  . '" class="widefat">';
79
+		echo '	<label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile', 're-pro') . '</label>';
80
+		echo '	<input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">';
81 81
 		echo '</p>';
82 82
 
83 83
 		echo '<p>';
84
-		echo '	<label for="' . $this->get_field_id( 'logo_size' ) . '" class="logo-size-label">' . __( 'Logo Size', 're-pro' ) . '</label>';
85
-		echo '	<select id="' . $this->get_field_id( 'logo_size' ) . '" name="' . $this->get_field_name( 'logo_size' ) . '" class="widefat">';
86
-		echo '		<option value="" ' . selected( $logo_size, '', false ) . '> ' . __( 'Choose', 're-pro' ) . '</option>';
87
-		echo '		<option value="512" ' . selected( $logo_size, '512', false ) . '> ' . __( '512px', 're-pro' ) . '</option>';
88
-		echo '		<option value="256" ' . selected( $logo_size, '256', false ) . '> ' . __( '256px', 're-pro' ) . '</option>';
89
-		echo '		<option value="128" ' . selected( $logo_size, '128', false ) . '> ' . __( '128px', 're-pro' ) . '</option>';
90
-		echo '		<option value="64" ' . selected( $logo_size, '64', false ) . '> ' . __( '64px', 're-pro' ) . '</option>';
91
-		echo '		<option value="32" ' . selected( $logo_size, '32', false ) . '> ' . __( '32px', 're-pro' ) . '</option>';
92
-		echo '		<option value="24" ' . selected( $logo_size, '24', false ) . '> ' . __( '24px', 're-pro' ) . '</option>';
93
-		echo '		<option value="16" ' . selected( $logo_size, '16', false ) . '> ' . __( '16px', 're-pro' ) . '</option>';
94
-		echo '		<option value="14" ' . selected( $logo_size, '14', false ) . '> ' . __( '14px', 're-pro' ) . '</option>';
84
+		echo '	<label for="' . $this->get_field_id('logo_size') . '" class="logo-size-label">' . __('Logo Size', 're-pro') . '</label>';
85
+		echo '	<select id="' . $this->get_field_id('logo_size') . '" name="' . $this->get_field_name('logo_size') . '" class="widefat">';
86
+		echo '		<option value="" ' . selected($logo_size, '', false) . '> ' . __('Choose', 're-pro') . '</option>';
87
+		echo '		<option value="512" ' . selected($logo_size, '512', false) . '> ' . __('512px', 're-pro') . '</option>';
88
+		echo '		<option value="256" ' . selected($logo_size, '256', false) . '> ' . __('256px', 're-pro') . '</option>';
89
+		echo '		<option value="128" ' . selected($logo_size, '128', false) . '> ' . __('128px', 're-pro') . '</option>';
90
+		echo '		<option value="64" ' . selected($logo_size, '64', false) . '> ' . __('64px', 're-pro') . '</option>';
91
+		echo '		<option value="32" ' . selected($logo_size, '32', false) . '> ' . __('32px', 're-pro') . '</option>';
92
+		echo '		<option value="24" ' . selected($logo_size, '24', false) . '> ' . __('24px', 're-pro') . '</option>';
93
+		echo '		<option value="16" ' . selected($logo_size, '16', false) . '> ' . __('16px', 're-pro') . '</option>';
94
+		echo '		<option value="14" ' . selected($logo_size, '14', false) . '> ' . __('14px', 're-pro') . '</option>';
95 95
 		echo '	</select>';
96
-		echo '	<span class="description">' . __( 'Choose the size of the logo you want to display.', 're-pro' ) . '</span>';
96
+		echo '	<span class="description">' . __('Choose the size of the logo you want to display.', 're-pro') . '</span>';
97 97
 		echo '</p>';
98 98
 
99 99
 	}
@@ -107,12 +107,12 @@  discard block
 block discarded – undo
107 107
 	 * @param mixed $old_instance Old Widget instance.
108 108
 	 * @return void
109 109
 	 */
110
-	public function update( $new_instance, $old_instance ) {
110
+	public function update($new_instance, $old_instance) {
111 111
 
112 112
 		$instance = $old_instance;
113 113
 
114
-		$instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : '';
115
-		$instance['logo_size'] = ! empty( $new_instance['logo_size'] ) ? strip_tags( $new_instance['logo_size'] ) : '';
114
+		$instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : '';
115
+		$instance['logo_size'] = ! empty($new_instance['logo_size']) ? strip_tags($new_instance['logo_size']) : '';
116 116
 
117 117
 		return $instance;
118 118
 
@@ -127,6 +127,6 @@  discard block
 block discarded – undo
127 127
  * @return void
128 128
  */
129 129
 function repro_register_widgets() {
130
-	register_widget( 'EqualHousingWidget' );
130
+	register_widget('EqualHousingWidget');
131 131
 }
132
-add_action( 'widgets_init', 'repro_register_widgets' );
132
+add_action('widgets_init', 'repro_register_widgets');
Please login to merge, or discard this patch.
modules/equal-housing/equal-housing.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Equal Housing Logo.
4
-include( 'widgets/class-equal-housing-widget.php' );
4
+include('widgets/class-equal-housing-widget.php');
Please login to merge, or discard this patch.
modules/homes-com/widgets/class-mortgage-calculator-widget.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  */
7 7
 
8 8
 	/* Exit if accessed directly. */
9
-if ( ! defined( 'ABSPATH' ) ) { exit; }
9
+if ( ! defined('ABSPATH')) { exit; }
10 10
 
11 11
 /**
12 12
  * HomesMortgageCalculatorWidget class.
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
 
26 26
 		parent::__construct(
27 27
 			'homes_mortgage_calc',
28
-			__( 'Homes Mortgage Calculator', 're-pro' ),
28
+			__('Homes Mortgage Calculator', 're-pro'),
29 29
 			array(
30
-				'description' => __( 'Display a mortgage calculator from Homes.com', 're-pro' ),
30
+				'description' => __('Display a mortgage calculator from Homes.com', 're-pro'),
31 31
 				'classname'   => 're-pro re-pro-widget homes-widget homes-mortgage-calc',
32 32
 				'customize_selective_refresh' => true,
33 33
 			)
@@ -41,19 +41,19 @@  discard block
 block discarded – undo
41 41
 	 * @param mixed $args Arguments.
42 42
 	 * @param mixed $instance Instance.
43 43
 	 */
44
-	public function widget( $args, $instance ) {
44
+	public function widget($args, $instance) {
45 45
 
46
-		$iframe_id = ! empty( $args['widget_id'] ) ? $args['widget_id'] : '';
47
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
48
-		$color = ! empty( $instance['color'] ) ? $instance['color'] : '';
46
+		$iframe_id = ! empty($args['widget_id']) ? $args['widget_id'] : '';
47
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
48
+		$color = ! empty($instance['color']) ? $instance['color'] : '';
49 49
 
50 50
 		echo $args['before_widget'];
51 51
 
52
-		echo $args['before_title'] . esc_attr( $title ) . $args['after_title'];
52
+		echo $args['before_title'] . esc_attr($title) . $args['after_title'];
53 53
 
54 54
 		$homes_widgets = new HomesWidgets();
55 55
 
56
-		$homes_widgets->get_mortgage_calc( $iframe_id, $color );
56
+		$homes_widgets->get_mortgage_calc($iframe_id, $color);
57 57
 
58 58
 		echo $args['after_widget'];
59 59
 	}
@@ -65,28 +65,28 @@  discard block
 block discarded – undo
65 65
 	 * @param mixed $instance Instance.
66 66
 	 * @return void
67 67
 	 */
68
-	public function form( $instance ) {
68
+	public function form($instance) {
69 69
 
70 70
 		// Set default values.
71
-		$instance = wp_parse_args( (array) $instance, array(
71
+		$instance = wp_parse_args((array) $instance, array(
72 72
 			'title' => '',
73 73
 			'color' => '0054a0',
74
-		) );
74
+		));
75 75
 
76 76
 		// Retrieve an existing value from the database.
77
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
78
-		$color = ! empty( $instance['color'] ) ? $instance['color'] : '';
77
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
78
+		$color = ! empty($instance['color']) ? $instance['color'] : '';
79 79
 
80 80
 		// Title.
81 81
 		echo '<p>';
82
-		echo '	<label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>';
83
-		echo '	<input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title  . '" class="widefat">';
82
+		echo '	<label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>';
83
+		echo '	<input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">';
84 84
 		echo '</p>';
85 85
 
86 86
 		// Color.
87 87
 		echo '<p>';
88
-		echo '	<label for="' . $this->get_field_id( 'color' ) . '" class="title-label">' . __( 'Color:', 're-pro' ) . '</label>';
89
-		echo '	<input id="' . $this->get_field_id( 'color' ) . '" name="' . $this->get_field_name( 'color' ) . '" value="' . $color  . '" class="widefat">';
88
+		echo '	<label for="' . $this->get_field_id('color') . '" class="title-label">' . __('Color:', 're-pro') . '</label>';
89
+		echo '	<input id="' . $this->get_field_id('color') . '" name="' . $this->get_field_name('color') . '" value="' . $color . '" class="widefat">';
90 90
 		echo '</p>';
91 91
 
92 92
 	}
@@ -99,12 +99,12 @@  discard block
 block discarded – undo
99 99
 	 * @param mixed $old_instance Old Instance.
100 100
 	 * @return $instance
101 101
 	 */
102
-	public function update( $new_instance, $old_instance ) {
102
+	public function update($new_instance, $old_instance) {
103 103
 
104 104
 		$instance = $old_instance;
105 105
 
106
-		$instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : '';
107
-		$instance['color'] = ! empty( $new_instance['color'] ) ? strip_tags( $new_instance['color'] ) : '';
106
+		$instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : '';
107
+		$instance['color'] = ! empty($new_instance['color']) ? strip_tags($new_instance['color']) : '';
108 108
 
109 109
 		return $instance;
110 110
 	}
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
  * @return void
118 118
  */
119 119
 function repro_homes_com_mortgage_calc() {
120
-	if ( ! is_ssl() ) {
121
-		register_widget( 'HomesMortgageCalculatorWidget' );
120
+	if ( ! is_ssl()) {
121
+		register_widget('HomesMortgageCalculatorWidget');
122 122
 	}
123 123
 }
124
-add_action( 'widgets_init', 'repro_homes_com_mortgage_calc' );
124
+add_action('widgets_init', 'repro_homes_com_mortgage_calc');
Please login to merge, or discard this patch.
modules/homes-com/widgets/class-home-values-widget.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  */
7 7
 
8 8
 	/* Exit if accessed directly. */
9
-if ( ! defined( 'ABSPATH' ) ) { exit; }
9
+if ( ! defined('ABSPATH')) { exit; }
10 10
 
11 11
 /**
12 12
  * HomesHomeValuesWidget class.
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
 
26 26
 		parent::__construct(
27 27
 			'homes_home_values',
28
-			__( 'Homes Home Values', 're-pro' ),
28
+			__('Homes Home Values', 're-pro'),
29 29
 			array(
30
-				'description' => __( 'Display the average home value in a neighborhood from Homes.com', 're-pro' ),
30
+				'description' => __('Display the average home value in a neighborhood from Homes.com', 're-pro'),
31 31
 				'classname'   => 're-pro re-pro-widget homes-widget homes-home-values',
32 32
 				'customize_selective_refresh' => true,
33 33
 			)
@@ -41,23 +41,23 @@  discard block
 block discarded – undo
41 41
 	 * @param mixed $args Arguments.
42 42
 	 * @param mixed $instance Instance.
43 43
 	 */
44
-	public function widget( $args, $instance ) {
44
+	public function widget($args, $instance) {
45 45
 
46
-		$iframe_id = ! empty( $args['widget_id'] ) ? $args['widget_id'] : '';
47
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
48
-		$location = ! empty( $instance['location'] ) ? $instance['location'] : '';
49
-		$firstColor = ! empty( $instance['firstColor'] ) ? $instance['firstColor'] : '';
50
-		$secondColor = ! empty( $instance['secondColor'] ) ? $instance['secondColor'] : '';
51
-		$average = ! empty( $instance['average'] ) ? $instance['average'] : '';
52
-		$median = ! empty( $instance['median'] ) ? $instance['median'] : '';
46
+		$iframe_id = ! empty($args['widget_id']) ? $args['widget_id'] : '';
47
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
48
+		$location = ! empty($instance['location']) ? $instance['location'] : '';
49
+		$firstColor = ! empty($instance['firstColor']) ? $instance['firstColor'] : '';
50
+		$secondColor = ! empty($instance['secondColor']) ? $instance['secondColor'] : '';
51
+		$average = ! empty($instance['average']) ? $instance['average'] : '';
52
+		$median = ! empty($instance['median']) ? $instance['median'] : '';
53 53
 
54 54
 		echo $args['before_widget'];
55 55
 
56
-		echo $args['before_title'] . esc_attr( $title ) . $args['after_title'];
56
+		echo $args['before_title'] . esc_attr($title) . $args['after_title'];
57 57
 
58 58
 		$homes_widgets = new HomesWidgets();
59 59
 
60
-		$homes_widgets->get_home_values( $iframe_id, $location, $firstColor, $secondColor, $average, $median );
60
+		$homes_widgets->get_home_values($iframe_id, $location, $firstColor, $secondColor, $average, $median);
61 61
 
62 62
 		echo $args['after_widget'];
63 63
 	}
@@ -69,64 +69,64 @@  discard block
 block discarded – undo
69 69
 	 * @param mixed $instance Instance.
70 70
 	 * @return void
71 71
 	 */
72
-	public function form( $instance ) {
72
+	public function form($instance) {
73 73
 
74 74
 		// Set default values.
75
-		$instance = wp_parse_args( (array) $instance, array(
75
+		$instance = wp_parse_args((array) $instance, array(
76 76
 			'title' => '',
77 77
 			'location' => '',
78 78
 			'firstColor' => '0054a0',
79 79
 			'secondColor' => 'f7841b',
80 80
 			'average' => 1,
81 81
 			'median' => 1,
82
-		) );
82
+		));
83 83
 
84 84
 		// Retrieve an existing value from the database.
85
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
86
-		$location = ! empty( $instance['location'] ) ? $instance['location'] : '';
87
-		$firstColor = ! empty( $instance['firstColor'] ) ? $instance['firstColor'] : '';
88
-		$secondColor = ! empty( $instance['secondColor'] ) ? $instance['secondColor'] : '';
89
-		$average = ! empty( $instance['average'] ) ? $instance['average'] : '';
90
-		$median = ! empty( $instance['median'] ) ? $instance['median'] : '';
91
-
92
-		if ( empty( $average ) && empty( $median ) ) {
85
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
86
+		$location = ! empty($instance['location']) ? $instance['location'] : '';
87
+		$firstColor = ! empty($instance['firstColor']) ? $instance['firstColor'] : '';
88
+		$secondColor = ! empty($instance['secondColor']) ? $instance['secondColor'] : '';
89
+		$average = ! empty($instance['average']) ? $instance['average'] : '';
90
+		$median = ! empty($instance['median']) ? $instance['median'] : '';
91
+
92
+		if (empty($average) && empty($median)) {
93 93
 			$average = 1;
94 94
 			$median = 1;
95 95
 		}
96 96
 
97 97
 		// Title.
98 98
 		echo '<p>';
99
-		echo '	<label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>';
100
-		echo '	<input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title  . '" class="widefat">';
99
+		echo '	<label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>';
100
+		echo '	<input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">';
101 101
 		echo '</p>';
102 102
 
103 103
 		// Location.
104 104
 		echo '<p>';
105
-		echo '	<label for="' . $this->get_field_id( 'location' ) . '" class="title-label">' . __( 'Location:', 're-pro' ) . '</label>';
106
-		echo '	<input id="' . $this->get_field_id( 'location' ) . '" name="' . $this->get_field_name( 'location' ) . '" value="' . $location . '" class="widefat">';
105
+		echo '	<label for="' . $this->get_field_id('location') . '" class="title-label">' . __('Location:', 're-pro') . '</label>';
106
+		echo '	<input id="' . $this->get_field_id('location') . '" name="' . $this->get_field_name('location') . '" value="' . $location . '" class="widefat">';
107 107
 		echo '</p>';
108 108
 
109 109
 		// Average Color.
110 110
 		echo '<p>';
111
-		echo '	<label for="' . $this->get_field_id( 'firstColor' ) . '" class="title-label">' . __( 'Color 1:', 're-pro' ) . '</label>';
112
-		echo '	<input id="' . $this->get_field_id( 'firstColor' ) . '" name="' . $this->get_field_name( 'firstColor' ) . '" value="' . $firstColor  . '" class="widefat">';
111
+		echo '	<label for="' . $this->get_field_id('firstColor') . '" class="title-label">' . __('Color 1:', 're-pro') . '</label>';
112
+		echo '	<input id="' . $this->get_field_id('firstColor') . '" name="' . $this->get_field_name('firstColor') . '" value="' . $firstColor . '" class="widefat">';
113 113
 		echo '</p>';
114 114
 
115 115
 		// Median Color.
116 116
 		echo '<p>';
117
-		echo '	<label for="' . $this->get_field_id( 'secondColor' ) . '" class="title-label">' . __( 'Color 2:', 're-pro' ) . '</label>';
118
-		echo '	<input id="' . $this->get_field_id( 'secondColor' ) . '" name="' . $this->get_field_name( 'secondColor' ) . '" value="' . $secondColor  . '" class="widefat">';
117
+		echo '	<label for="' . $this->get_field_id('secondColor') . '" class="title-label">' . __('Color 2:', 're-pro') . '</label>';
118
+		echo '	<input id="' . $this->get_field_id('secondColor') . '" name="' . $this->get_field_name('secondColor') . '" value="' . $secondColor . '" class="widefat">';
119 119
 		echo '</p>';
120 120
 
121 121
 		// Home Value Types.
122 122
 		echo '<p>';
123
-		echo '<label for="home-values-type" class="homes_value_type_label">' . __( 'Home Value Types:', 're-pro' ) . '</label>';
123
+		echo '<label for="home-values-type" class="homes_value_type_label">' . __('Home Value Types:', 're-pro') . '</label>';
124 124
 		echo '<br />';
125
-		echo '<input value="1" type="checkbox"' . checked( $average, 1, false ) . 'id="' . $this->get_field_id( 'average' ) . '" name="' . $this->get_field_name( 'average' )  . '" />';
126
-		echo '<label for="' . $this->get_field_id( 'average' ) . '">Average Home Value</label>';
125
+		echo '<input value="1" type="checkbox"' . checked($average, 1, false) . 'id="' . $this->get_field_id('average') . '" name="' . $this->get_field_name('average') . '" />';
126
+		echo '<label for="' . $this->get_field_id('average') . '">Average Home Value</label>';
127 127
 		echo '<br />';
128
-		echo '<input value="1" type="checkbox"' . checked( $median, 1, false ) . 'id="' . $this->get_field_id( 'median' ) . '" name="' . $this->get_field_name( 'median' ) . '" />';
129
-		echo '<label for="' . $this->get_field_id( 'median' ) . '">Median Home Value</label>';
128
+		echo '<input value="1" type="checkbox"' . checked($median, 1, false) . 'id="' . $this->get_field_id('median') . '" name="' . $this->get_field_name('median') . '" />';
129
+		echo '<label for="' . $this->get_field_id('median') . '">Median Home Value</label>';
130 130
 		echo '</p>';
131 131
 	}
132 132
 
@@ -138,16 +138,16 @@  discard block
 block discarded – undo
138 138
 	 * @param mixed $old_instance Old Instance.
139 139
 	 * @return $instance
140 140
 	 */
141
-	public function update( $new_instance, $old_instance ) {
141
+	public function update($new_instance, $old_instance) {
142 142
 
143 143
 		$instance = $old_instance;
144 144
 
145
-		$instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : '';
146
-		$instance['location'] = ! empty( $new_instance['location'] ) ? strip_tags( $new_instance['location'] ) : '';
147
-		$instance['firstColor'] = ! empty( $new_instance['firstColor'] ) ? strip_tags( $new_instance['firstColor'] ) : '';
148
-		$instance['secondColor'] = ! empty( $new_instance['secondColor'] ) ? strip_tags( $new_instance['secondColor'] ) : '';
149
-		$instance['average'] = ! empty( $new_instance['average'] ) ? strip_tags( $new_instance['average'] ) : '';
150
-		$instance['median'] = ! empty( $new_instance['median'] ) ? strip_tags( $new_instance['median'] ) : '';
145
+		$instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : '';
146
+		$instance['location'] = ! empty($new_instance['location']) ? strip_tags($new_instance['location']) : '';
147
+		$instance['firstColor'] = ! empty($new_instance['firstColor']) ? strip_tags($new_instance['firstColor']) : '';
148
+		$instance['secondColor'] = ! empty($new_instance['secondColor']) ? strip_tags($new_instance['secondColor']) : '';
149
+		$instance['average'] = ! empty($new_instance['average']) ? strip_tags($new_instance['average']) : '';
150
+		$instance['median'] = ! empty($new_instance['median']) ? strip_tags($new_instance['median']) : '';
151 151
 
152 152
 		return $instance;
153 153
 	}
@@ -160,8 +160,8 @@  discard block
 block discarded – undo
160 160
  * @return void
161 161
  */
162 162
 function repro_homes_com_home_values() {
163
-	if ( ! is_ssl() ) {
164
-		register_widget( 'HomesHomeValuesWidget' );
163
+	if ( ! is_ssl()) {
164
+		register_widget('HomesHomeValuesWidget');
165 165
 	}
166 166
 }
167
-add_action( 'widgets_init', 'repro_homes_com_home_values' );
167
+add_action('widgets_init', 'repro_homes_com_home_values');
Please login to merge, or discard this patch.
modules/homes-com/widgets/class-commute-time-widget.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  */
7 7
 
8 8
 	/* Exit if accessed directly. */
9
-if ( ! defined( 'ABSPATH' ) ) { exit; }
9
+if ( ! defined('ABSPATH')) { exit; }
10 10
 
11 11
 /**
12 12
  * HomesCommuteTimeWidget class.
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
 
26 26
 		parent::__construct(
27 27
 			'homes_commute_time',
28
-			__( 'Homes Commute Time', 're-pro' ),
28
+			__('Homes Commute Time', 're-pro'),
29 29
 			array(
30
-				'description' => __( 'Display a form that checks the commute time from Homes.com', 're-pro' ),
30
+				'description' => __('Display a form that checks the commute time from Homes.com', 're-pro'),
31 31
 				'classname'   => 're-pro re-pro-widget homes-widget homes-commute-time',
32 32
 				'customize_selective_refresh' => true,
33 33
 			)
@@ -41,20 +41,20 @@  discard block
 block discarded – undo
41 41
 	 * @param mixed $args Arguments.
42 42
 	 * @param mixed $instance Instance.
43 43
 	 */
44
-	public function widget( $args, $instance ) {
44
+	public function widget($args, $instance) {
45 45
 
46
-		$iframe_id = ! empty( $args['widget_id'] ) ? $args['widget_id'] : '';
47
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
48
-		$addr = ! empty( $instance['addr'] ) ? $instance['addr'] : '';
49
-		$color = ! empty( $instance['color'] ) ? $instance['color'] : '';
46
+		$iframe_id = ! empty($args['widget_id']) ? $args['widget_id'] : '';
47
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
48
+		$addr = ! empty($instance['addr']) ? $instance['addr'] : '';
49
+		$color = ! empty($instance['color']) ? $instance['color'] : '';
50 50
 
51 51
 		echo $args['before_widget'];
52 52
 
53
-		echo $args['before_title'] . esc_attr( $title ) . $args['after_title'];
53
+		echo $args['before_title'] . esc_attr($title) . $args['after_title'];
54 54
 
55 55
 		$homes_widgets = new HomesWidgets();
56 56
 
57
-		$homes_widgets->get_commute_time_widget( $iframe_id, $addr, $color );
57
+		$homes_widgets->get_commute_time_widget($iframe_id, $addr, $color);
58 58
 
59 59
 		echo $args['after_widget'];
60 60
 	}
@@ -66,36 +66,36 @@  discard block
 block discarded – undo
66 66
 	 * @param mixed $instance Instance.
67 67
 	 * @return void
68 68
 	 */
69
-	public function form( $instance ) {
69
+	public function form($instance) {
70 70
 
71 71
 		// Set default values.
72
-		$instance = wp_parse_args( (array) $instance, array(
72
+		$instance = wp_parse_args((array) $instance, array(
73 73
 			'title' => '',
74 74
 			'addr' => '',
75 75
 			'color' => '0054a0',
76
-		) );
76
+		));
77 77
 
78 78
 		// Retrieve an existing value from the database.
79
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
80
-		$addr = ! empty( $instance['addr'] ) ? $instance['addr'] : '';
81
-		$color = ! empty( $instance['color'] ) ? $instance['color'] : '';
79
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
80
+		$addr = ! empty($instance['addr']) ? $instance['addr'] : '';
81
+		$color = ! empty($instance['color']) ? $instance['color'] : '';
82 82
 
83 83
 		// Title.
84 84
 		echo '<p>';
85
-		echo '	<label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>';
86
-		echo '	<input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title  . '" class="widefat">';
85
+		echo '	<label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>';
86
+		echo '	<input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">';
87 87
 		echo '</p>';
88 88
 
89 89
 		// Street Address.
90 90
 		echo '<p>';
91
-		echo '	<label for="' . $this->get_field_id( 'addr' ) . '" class="title-label">' . __( 'Default Start Address:', 're-pro' ) . '</label>';
92
-		echo '	<input id="' . $this->get_field_id( 'addr' ) . '" name="' . $this->get_field_name( 'addr' ) . '" value="' . $addr  . '" class="widefat">';
91
+		echo '	<label for="' . $this->get_field_id('addr') . '" class="title-label">' . __('Default Start Address:', 're-pro') . '</label>';
92
+		echo '	<input id="' . $this->get_field_id('addr') . '" name="' . $this->get_field_name('addr') . '" value="' . $addr . '" class="widefat">';
93 93
 		echo '</p>';
94 94
 
95 95
 		// Button Color
96 96
 		echo '<p>';
97
-		echo '	<label for="' . $this->get_field_id( 'color' ) . '" class="title-label">' . __( 'Button Color:', 're-pro' ) . '</label>';
98
-		echo '	<input id="' . $this->get_field_id( 'color' ) . '" name="' . $this->get_field_name( 'color' ) . '" value="' . $color  . '" class="widefat">';
97
+		echo '	<label for="' . $this->get_field_id('color') . '" class="title-label">' . __('Button Color:', 're-pro') . '</label>';
98
+		echo '	<input id="' . $this->get_field_id('color') . '" name="' . $this->get_field_name('color') . '" value="' . $color . '" class="widefat">';
99 99
 		echo '</p>';
100 100
 
101 101
 	}
@@ -108,13 +108,13 @@  discard block
 block discarded – undo
108 108
 	 * @param mixed $old_instance Old Instance.
109 109
 	 * @return $instance
110 110
 	 */
111
-	public function update( $new_instance, $old_instance ) {
111
+	public function update($new_instance, $old_instance) {
112 112
 
113 113
 		$instance = $old_instance;
114 114
 
115
-		$instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : '';
116
-		$instance['addr'] = ! empty( $new_instance['addr'] ) ? strip_tags( $new_instance['addr'] ) : '';
117
-		$instance['color'] = ! empty( $new_instance['color'] ) ? strip_tags( $new_instance['color'] ) : '';
115
+		$instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : '';
116
+		$instance['addr'] = ! empty($new_instance['addr']) ? strip_tags($new_instance['addr']) : '';
117
+		$instance['color'] = ! empty($new_instance['color']) ? strip_tags($new_instance['color']) : '';
118 118
 
119 119
 		return $instance;
120 120
 	}
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
  * @return void
128 128
  */
129 129
 function repro_homes_com_commute_widget() {
130
-	if ( ! is_ssl() ) {
131
-		register_widget( 'HomesCommuteTimeWidget' );
130
+	if ( ! is_ssl()) {
131
+		register_widget('HomesCommuteTimeWidget');
132 132
 	}
133 133
 }
134
-add_action( 'widgets_init', 'repro_homes_com_commute_widget' );
134
+add_action('widgets_init', 'repro_homes_com_commute_widget');
Please login to merge, or discard this patch.
modules/homes-com/widgets/class-search-widget.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  */
7 7
 
8 8
 	/* Exit if accessed directly. */
9
-if ( ! defined( 'ABSPATH' ) ) { exit; }
9
+if ( ! defined('ABSPATH')) { exit; }
10 10
 
11 11
 /**
12 12
  * HomesSearchWidget class.
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
 
26 26
 		parent::__construct(
27 27
 			'homes_search',
28
-			__( 'Homes Search', 're-pro' ),
28
+			__('Homes Search', 're-pro'),
29 29
 			array(
30
-				'description' => __( 'Display a search box from Homes.com', 're-pro' ),
30
+				'description' => __('Display a search box from Homes.com', 're-pro'),
31 31
 				'classname'   => 're-pro re-pro-widget homes-widget homes-search',
32 32
 				'customize_selective_refresh' => true,
33 33
 			)
@@ -41,22 +41,22 @@  discard block
 block discarded – undo
41 41
 	 * @param mixed $args Arguments.
42 42
 	 * @param mixed $instance Instance.
43 43
 	 */
44
-	public function widget( $args, $instance ) {
44
+	public function widget($args, $instance) {
45 45
 
46
-		$iframe_id = ! empty( $args['widget_id'] ) ? $args['widget_id'] : '';
47
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
48
-		$location = ! empty( $instance['location'] ) ? $instance['location'] : '';
49
-		$color = ! empty( $instance['color'] ) ? $instance['color'] : '';
50
-		$sale = ! empty( $instance['sale'] ) ? $instance['sale'] : '';
51
-		$rent = ! empty( $instance['rent'] ) ? $instance['rent'] : '';
46
+		$iframe_id = ! empty($args['widget_id']) ? $args['widget_id'] : '';
47
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
48
+		$location = ! empty($instance['location']) ? $instance['location'] : '';
49
+		$color = ! empty($instance['color']) ? $instance['color'] : '';
50
+		$sale = ! empty($instance['sale']) ? $instance['sale'] : '';
51
+		$rent = ! empty($instance['rent']) ? $instance['rent'] : '';
52 52
 
53 53
 		echo $args['before_widget'];
54 54
 
55
-		echo $args['before_title'] . esc_attr( $title ) . $args['after_title'];
55
+		echo $args['before_title'] . esc_attr($title) . $args['after_title'];
56 56
 
57 57
 		$homes_widgets = new HomesWidgets();
58 58
 
59
-		$homes_widgets->get_search( $iframe_id, $location, $color, $sale, $rent );
59
+		$homes_widgets->get_search($iframe_id, $location, $color, $sale, $rent);
60 60
 
61 61
 		echo $args['after_widget'];
62 62
 	}
@@ -68,51 +68,51 @@  discard block
 block discarded – undo
68 68
 	 * @param mixed $instance Instance.
69 69
 	 * @return void
70 70
 	 */
71
-	public function form( $instance ) {
71
+	public function form($instance) {
72 72
 
73 73
 		// Set default values.
74
-		$instance = wp_parse_args( (array) $instance, array(
74
+		$instance = wp_parse_args((array) $instance, array(
75 75
 			'title' => '',
76 76
 			'location' => '',
77 77
 			'color' => '0054a0',
78 78
 			'sale' => 1,
79 79
 			'rent' => 1,
80
-		) );
80
+		));
81 81
 
82 82
 		// Retrieve an existing value from the database.
83
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
84
-		$location = ! empty( $instance['location'] ) ? $instance['location'] : '';
85
-		$color = ! empty( $instance['color'] ) ? $instance['color'] : '';
86
-		$sale = ! empty( $instance['sale'] ) ? $instance['sale'] : '';
87
-		$rent = ! empty( $instance['rent'] ) ? $instance['rent'] : '';
83
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
84
+		$location = ! empty($instance['location']) ? $instance['location'] : '';
85
+		$color = ! empty($instance['color']) ? $instance['color'] : '';
86
+		$sale = ! empty($instance['sale']) ? $instance['sale'] : '';
87
+		$rent = ! empty($instance['rent']) ? $instance['rent'] : '';
88 88
 
89 89
 		// Title.
90 90
 		echo '<p>';
91
-		echo '	<label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>';
92
-		echo '	<input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title  . '" class="widefat">';
91
+		echo '	<label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>';
92
+		echo '	<input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">';
93 93
 		echo '</p>';
94 94
 
95 95
 		// Location.
96 96
 		echo '<p>';
97
-		echo '	<label for="' . $this->get_field_id( 'location' ) . '" class="title-label">' . __( 'Location:', 're-pro' ) . '</label>';
98
-		echo '	<input id="' . $this->get_field_id( 'location' ) . '" name="' . $this->get_field_name( 'location' ) . '" value="' . $location . '" class="widefat">';
97
+		echo '	<label for="' . $this->get_field_id('location') . '" class="title-label">' . __('Location:', 're-pro') . '</label>';
98
+		echo '	<input id="' . $this->get_field_id('location') . '" name="' . $this->get_field_name('location') . '" value="' . $location . '" class="widefat">';
99 99
 		echo '</p>';
100 100
 
101 101
 		// Color.
102 102
 		echo '<p>';
103
-		echo '	<label for="' . $this->get_field_id( 'color' ) . '" class="title-label">' . __( 'Color:', 're-pro' ) . '</label>';
104
-		echo '	<input id="' . $this->get_field_id( 'color' ) . '" name="' . $this->get_field_name( 'color' ) . '" value="' . $color  . '" class="widefat">';
103
+		echo '	<label for="' . $this->get_field_id('color') . '" class="title-label">' . __('Color:', 're-pro') . '</label>';
104
+		echo '	<input id="' . $this->get_field_id('color') . '" name="' . $this->get_field_name('color') . '" value="' . $color . '" class="widefat">';
105 105
 		echo '</p>';
106 106
 
107 107
 		// Search Types.
108 108
 		echo '<p>';
109
-		echo '<label for="search-type" class="search_type_label">' . __( 'Search Types:', 're-pro' ) . '</label>';
109
+		echo '<label for="search-type" class="search_type_label">' . __('Search Types:', 're-pro') . '</label>';
110 110
 		echo '<br />';
111
-		echo '<input value="1" type="checkbox"' . checked( $sale, 1, false ) . 'id="' . $this->get_field_id( 'sale' ) . '" name="' . $this->get_field_name( 'sale' )  . '" />';
112
-		echo '<label for="' . $this->get_field_id( 'sale' ) . '">For Sale</label>';
111
+		echo '<input value="1" type="checkbox"' . checked($sale, 1, false) . 'id="' . $this->get_field_id('sale') . '" name="' . $this->get_field_name('sale') . '" />';
112
+		echo '<label for="' . $this->get_field_id('sale') . '">For Sale</label>';
113 113
 		echo '<br />';
114
-		echo '<input value="1" type="checkbox"' . checked( $rent, 1, false ) . 'id="' . $this->get_field_id( 'rent' ) . '" name="' . $this->get_field_name( 'rent' ) . '" />';
115
-		echo '<label for="' . $this->get_field_id( 'rent' ) . '">For Rent</label>';
114
+		echo '<input value="1" type="checkbox"' . checked($rent, 1, false) . 'id="' . $this->get_field_id('rent') . '" name="' . $this->get_field_name('rent') . '" />';
115
+		echo '<label for="' . $this->get_field_id('rent') . '">For Rent</label>';
116 116
 		echo '</p>';
117 117
 	}
118 118
 
@@ -124,15 +124,15 @@  discard block
 block discarded – undo
124 124
 	 * @param mixed $old_instance Old Instance.
125 125
 	 * @return $instance
126 126
 	 */
127
-	public function update( $new_instance, $old_instance ) {
127
+	public function update($new_instance, $old_instance) {
128 128
 
129 129
 		$instance = $old_instance;
130 130
 
131
-		$instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : '';
132
-		$instance['location'] = ! empty( $new_instance['location'] ) ? strip_tags( $new_instance['location'] ) : '';
133
-		$instance['color'] = ! empty( $new_instance['color'] ) ? strip_tags( $new_instance['color'] ) : '';
134
-		$instance['sale'] = ! empty( $new_instance['sale'] ) ? strip_tags( $new_instance['sale'] ) : '';
135
-		$instance['rent'] = ! empty( $new_instance['rent'] ) ? strip_tags( $new_instance['rent'] ) : '';
131
+		$instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : '';
132
+		$instance['location'] = ! empty($new_instance['location']) ? strip_tags($new_instance['location']) : '';
133
+		$instance['color'] = ! empty($new_instance['color']) ? strip_tags($new_instance['color']) : '';
134
+		$instance['sale'] = ! empty($new_instance['sale']) ? strip_tags($new_instance['sale']) : '';
135
+		$instance['rent'] = ! empty($new_instance['rent']) ? strip_tags($new_instance['rent']) : '';
136 136
 
137 137
 		return $instance;
138 138
 	}
@@ -145,8 +145,8 @@  discard block
 block discarded – undo
145 145
  * @return void
146 146
  */
147 147
 function repro_homes_com_search() {
148
-	if ( ! is_ssl() ) {
149
-		register_widget( 'HomesSearchWidget' );
148
+	if ( ! is_ssl()) {
149
+		register_widget('HomesSearchWidget');
150 150
 	}
151 151
 }
152
-add_action( 'widgets_init', 'repro_homes_com_search' );
152
+add_action('widgets_init', 'repro_homes_com_search');
Please login to merge, or discard this patch.
modules/homes-com/widgets/class-simple-search-widget.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  */
7 7
 
8 8
 	/* Exit if accessed directly. */
9
-if ( ! defined( 'ABSPATH' ) ) { exit; }
9
+if ( ! defined('ABSPATH')) { exit; }
10 10
 
11 11
 /**
12 12
  * HomesSimpleSearchWidget class.
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
 
26 26
 		parent::__construct(
27 27
 			'homes_simple_search',
28
-			__( 'Homes Real Estate Search', 're-pro' ),
28
+			__('Homes Real Estate Search', 're-pro'),
29 29
 			array(
30
-				'description' => __( 'Display a simple search box from Homes.com', 're-pro' ),
30
+				'description' => __('Display a simple search box from Homes.com', 're-pro'),
31 31
 				'classname'   => 're-pro re-pro-widget homes-widget homes-simple-search',
32 32
 				'customize_selective_refresh' => true,
33 33
 			)
@@ -41,22 +41,22 @@  discard block
 block discarded – undo
41 41
 	 * @param mixed $args Arguments.
42 42
 	 * @param mixed $instance Instance.
43 43
 	 */
44
-	public function widget( $args, $instance ) {
44
+	public function widget($args, $instance) {
45 45
 
46
-		$iframe_id = ! empty( $args['widget_id'] ) ? $args['widget_id'] : '';
47
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
48
-		$location = ! empty( $instance['location'] ) ? $instance['location'] : '';
49
-		$color = ! empty( $instance['color'] ) ? $instance['color'] : '';
50
-		$sale = ! empty( $instance['sale'] ) ? $instance['sale'] : '';
51
-		$rent = ! empty( $instance['rent'] ) ? $instance['rent'] : '';
46
+		$iframe_id = ! empty($args['widget_id']) ? $args['widget_id'] : '';
47
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
48
+		$location = ! empty($instance['location']) ? $instance['location'] : '';
49
+		$color = ! empty($instance['color']) ? $instance['color'] : '';
50
+		$sale = ! empty($instance['sale']) ? $instance['sale'] : '';
51
+		$rent = ! empty($instance['rent']) ? $instance['rent'] : '';
52 52
 
53 53
 		echo $args['before_widget'];
54 54
 
55
-		echo $args['before_title'] . esc_attr( $title ) . $args['after_title'];
55
+		echo $args['before_title'] . esc_attr($title) . $args['after_title'];
56 56
 
57 57
 		$homes_widgets = new HomesWidgets();
58 58
 
59
-		$homes_widgets->get_simple_search( $iframe_id, $location, $color, $sale, $rent );
59
+		$homes_widgets->get_simple_search($iframe_id, $location, $color, $sale, $rent);
60 60
 
61 61
 		echo $args['after_widget'];
62 62
 	}
@@ -68,51 +68,51 @@  discard block
 block discarded – undo
68 68
 	 * @param mixed $instance Instance.
69 69
 	 * @return void
70 70
 	 */
71
-	public function form( $instance ) {
71
+	public function form($instance) {
72 72
 
73 73
 		// Set default values.
74
-		$instance = wp_parse_args( (array) $instance, array(
74
+		$instance = wp_parse_args((array) $instance, array(
75 75
 			'title' => '',
76 76
 			'location' => '',
77 77
 			'color' => '0054a0',
78 78
 			'sale' => 1,
79 79
 			'rent' => 1,
80
-		) );
80
+		));
81 81
 
82 82
 		// Retrieve an existing value from the database.
83
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
84
-		$location = ! empty( $instance['location'] ) ? $instance['location'] : '';
85
-		$color = ! empty( $instance['color'] ) ? $instance['color'] : '';
86
-		$sale = ! empty( $instance['sale'] ) ? $instance['sale'] : '';
87
-		$rent = ! empty( $instance['rent'] ) ? $instance['rent'] : '';
83
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
84
+		$location = ! empty($instance['location']) ? $instance['location'] : '';
85
+		$color = ! empty($instance['color']) ? $instance['color'] : '';
86
+		$sale = ! empty($instance['sale']) ? $instance['sale'] : '';
87
+		$rent = ! empty($instance['rent']) ? $instance['rent'] : '';
88 88
 
89 89
 		// Title.
90 90
 		echo '<p>';
91
-		echo '	<label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>';
92
-		echo '	<input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title  . '" class="widefat">';
91
+		echo '	<label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>';
92
+		echo '	<input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">';
93 93
 		echo '</p>';
94 94
 
95 95
 		// Location.
96 96
 		echo '<p>';
97
-		echo '	<label for="' . $this->get_field_id( 'location' ) . '" class="title-label">' . __( 'Location:', 're-pro' ) . '</label>';
98
-		echo '	<input id="' . $this->get_field_id( 'location' ) . '" name="' . $this->get_field_name( 'location' ) . '" value="' . $location . '" class="widefat">';
97
+		echo '	<label for="' . $this->get_field_id('location') . '" class="title-label">' . __('Location:', 're-pro') . '</label>';
98
+		echo '	<input id="' . $this->get_field_id('location') . '" name="' . $this->get_field_name('location') . '" value="' . $location . '" class="widefat">';
99 99
 		echo '</p>';
100 100
 
101 101
 		// Color.
102 102
 		echo '<p>';
103
-		echo '	<label for="' . $this->get_field_id( 'color' ) . '" class="title-label">' . __( 'Color:', 're-pro' ) . '</label>';
104
-		echo '	<input id="' . $this->get_field_id( 'color' ) . '" name="' . $this->get_field_name( 'color' ) . '" value="' . $color  . '" class="widefat">';
103
+		echo '	<label for="' . $this->get_field_id('color') . '" class="title-label">' . __('Color:', 're-pro') . '</label>';
104
+		echo '	<input id="' . $this->get_field_id('color') . '" name="' . $this->get_field_name('color') . '" value="' . $color . '" class="widefat">';
105 105
 		echo '</p>';
106 106
 
107 107
 		// Search Types.
108 108
 		echo '<p>';
109
-		echo '<label for="search-type" class="search_type_label">' . __( 'Search Types:', 're-pro' ) . '</label>';
109
+		echo '<label for="search-type" class="search_type_label">' . __('Search Types:', 're-pro') . '</label>';
110 110
 		echo '<br />';
111
-		echo '<input value="1" type="checkbox"' . checked( $sale, 1, false ) . 'id="' . $this->get_field_id( 'sale' ) . '" name="' . $this->get_field_name( 'sale' )  . '" />';
112
-		echo '<label for="' . $this->get_field_id( 'sale' ) . '">For Sale</label>';
111
+		echo '<input value="1" type="checkbox"' . checked($sale, 1, false) . 'id="' . $this->get_field_id('sale') . '" name="' . $this->get_field_name('sale') . '" />';
112
+		echo '<label for="' . $this->get_field_id('sale') . '">For Sale</label>';
113 113
 		echo '<br />';
114
-		echo '<input value="1" type="checkbox"' . checked( $rent, 1, false ) . 'id="' . $this->get_field_id( 'rent' ) . '" name="' . $this->get_field_name( 'rent' ) . '" />';
115
-		echo '<label for="' . $this->get_field_id( 'rent' ) . '">For Rent</label>';
114
+		echo '<input value="1" type="checkbox"' . checked($rent, 1, false) . 'id="' . $this->get_field_id('rent') . '" name="' . $this->get_field_name('rent') . '" />';
115
+		echo '<label for="' . $this->get_field_id('rent') . '">For Rent</label>';
116 116
 		echo '</p>';
117 117
 	}
118 118
 
@@ -124,15 +124,15 @@  discard block
 block discarded – undo
124 124
 	 * @param mixed $old_instance Old Instance.
125 125
 	 * @return $instance
126 126
 	 */
127
-	public function update( $new_instance, $old_instance ) {
127
+	public function update($new_instance, $old_instance) {
128 128
 
129 129
 		$instance = $old_instance;
130 130
 
131
-		$instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : '';
132
-		$instance['location'] = ! empty( $new_instance['location'] ) ? strip_tags( $new_instance['location'] ) : '';
133
-		$instance['color'] = ! empty( $new_instance['color'] ) ? strip_tags( $new_instance['color'] ) : '';
134
-		$instance['sale'] = ! empty( $new_instance['sale'] ) ? strip_tags( $new_instance['sale'] ) : '';
135
-		$instance['rent'] = ! empty( $new_instance['rent'] ) ? strip_tags( $new_instance['rent'] ) : '';
131
+		$instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : '';
132
+		$instance['location'] = ! empty($new_instance['location']) ? strip_tags($new_instance['location']) : '';
133
+		$instance['color'] = ! empty($new_instance['color']) ? strip_tags($new_instance['color']) : '';
134
+		$instance['sale'] = ! empty($new_instance['sale']) ? strip_tags($new_instance['sale']) : '';
135
+		$instance['rent'] = ! empty($new_instance['rent']) ? strip_tags($new_instance['rent']) : '';
136 136
 
137 137
 		return $instance;
138 138
 	}
@@ -145,8 +145,8 @@  discard block
 block discarded – undo
145 145
  * @return void
146 146
  */
147 147
 function repro_homes_com_simple_search() {
148
-	if ( ! is_ssl() ) {
149
-		register_widget( 'HomesSimpleSearchWidget' );
148
+	if ( ! is_ssl()) {
149
+		register_widget('HomesSimpleSearchWidget');
150 150
 	}
151 151
 }
152
-add_action( 'widgets_init', 'repro_homes_com_simple_search' );
152
+add_action('widgets_init', 'repro_homes_com_simple_search');
Please login to merge, or discard this patch.
modules/homes-com/widgets/class-featured-listings-widget.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  */
7 7
 
8 8
 	/* Exit if accessed directly. */
9
-if ( ! defined( 'ABSPATH' ) ) { exit; }
9
+if ( ! defined('ABSPATH')) { exit; }
10 10
 
11 11
 /**
12 12
  * HomesFeaturedListingsWidget class.
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
 
26 26
 		parent::__construct(
27 27
 			'homes_featured_listings',
28
-			__( 'Homes Featured Listings', 're-pro' ),
28
+			__('Homes Featured Listings', 're-pro'),
29 29
 			array(
30
-				'description' => __( 'Display featured listings from Homes.com', 're-pro' ),
30
+				'description' => __('Display featured listings from Homes.com', 're-pro'),
31 31
 				'classname'   => 're-pro re-pro-widget homes-widget homes-featured-listings',
32 32
 				'customize_selective_refresh' => true,
33 33
 			)
@@ -41,21 +41,21 @@  discard block
 block discarded – undo
41 41
 	 * @param mixed $args Arguments.
42 42
 	 * @param mixed $instance Instance.
43 43
 	 */
44
-	public function widget( $args, $instance ) {
44
+	public function widget($args, $instance) {
45 45
 
46
-		$iframe_id = ! empty( $args['widget_id'] ) ? $args['widget_id'] : '';
47
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
48
-		$location = ! empty( $instance['location'] ) ? $instance['location'] : '';
49
-		$color = ! empty( $instance['color'] ) ? $instance['color'] : '';
50
-		$status = ! empty( $instance['status'] ) ? $instance['status'] : '';
46
+		$iframe_id = ! empty($args['widget_id']) ? $args['widget_id'] : '';
47
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
48
+		$location = ! empty($instance['location']) ? $instance['location'] : '';
49
+		$color = ! empty($instance['color']) ? $instance['color'] : '';
50
+		$status = ! empty($instance['status']) ? $instance['status'] : '';
51 51
 
52 52
 		echo $args['before_widget'];
53 53
 
54
-		echo $args['before_title'] . esc_attr( $title ) . $args['after_title'];
54
+		echo $args['before_title'] . esc_attr($title) . $args['after_title'];
55 55
 
56 56
 		$homes_widgets = new HomesWidgets();
57 57
 
58
-		$homes_widgets->get_featured_listings( $iframe_id, $location, $color, $status );
58
+		$homes_widgets->get_featured_listings($iframe_id, $location, $color, $status);
59 59
 
60 60
 		echo $args['after_widget'];
61 61
 	}
@@ -67,46 +67,46 @@  discard block
 block discarded – undo
67 67
 	 * @param mixed $instance Instance.
68 68
 	 * @return void
69 69
 	 */
70
-	public function form( $instance ) {
70
+	public function form($instance) {
71 71
 
72 72
 		// Set default values.
73
-		$instance = wp_parse_args( (array) $instance, array(
73
+		$instance = wp_parse_args((array) $instance, array(
74 74
 			'title' => '',
75 75
 			'location' => '',
76 76
 			'color' => '0054a0',
77 77
 			'status' => 'SALE',
78
-		) );
78
+		));
79 79
 
80 80
 		// Retrieve an existing value from the database.
81
-		$title = ! empty( $instance['title'] ) ? $instance['title'] : '';
82
-		$location = ! empty( $instance['location'] ) ? $instance['location'] : '';
83
-		$color = ! empty( $instance['color'] ) ? $instance['color'] : '';
84
-		$status = ! empty( $instance['status'] ) ? $instance['status'] : '';
81
+		$title = ! empty($instance['title']) ? $instance['title'] : '';
82
+		$location = ! empty($instance['location']) ? $instance['location'] : '';
83
+		$color = ! empty($instance['color']) ? $instance['color'] : '';
84
+		$status = ! empty($instance['status']) ? $instance['status'] : '';
85 85
 
86 86
 		// Title.
87 87
 		echo '<p>';
88
-		echo '	<label for="' . $this->get_field_id( 'title' ) . '" class="title-label">' . __( 'Tile:', 're-pro' ) . '</label>';
89
-		echo '	<input id="' . $this->get_field_id( 'title' ) . '" name="' . $this->get_field_name( 'title' ) . '" value="' . $title  . '" class="widefat">';
88
+		echo '	<label for="' . $this->get_field_id('title') . '" class="title-label">' . __('Tile:', 're-pro') . '</label>';
89
+		echo '	<input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . $title . '" class="widefat">';
90 90
 		echo '</p>';
91 91
 
92 92
 		// Location.
93 93
 		echo '<p>';
94
-		echo '	<label for="' . $this->get_field_id( 'location' ) . '" class="title-label">' . __( 'Location:', 're-pro' ) . '</label>';
95
-		echo '	<input id="' . $this->get_field_id( 'location' ) . '" name="' . $this->get_field_name( 'location' ) . '" value="' . $location . '" class="widefat">';
94
+		echo '	<label for="' . $this->get_field_id('location') . '" class="title-label">' . __('Location:', 're-pro') . '</label>';
95
+		echo '	<input id="' . $this->get_field_id('location') . '" name="' . $this->get_field_name('location') . '" value="' . $location . '" class="widefat">';
96 96
 		echo '</p>';
97 97
 
98 98
 		// Text Color
99 99
 		echo '<p>';
100
-		echo '	<label for="' . $this->get_field_id( 'color' ) . '" class="title-label">' . __( 'Button Color:', 're-pro' ) . '</label>';
101
-		echo '	<input id="' . $this->get_field_id( 'color' ) . '" name="' . $this->get_field_name( 'color' ) . '" value="' . $color  . '" class="widefat">';
100
+		echo '	<label for="' . $this->get_field_id('color') . '" class="title-label">' . __('Button Color:', 're-pro') . '</label>';
101
+		echo '	<input id="' . $this->get_field_id('color') . '" name="' . $this->get_field_name('color') . '" value="' . $color . '" class="widefat">';
102 102
 		echo '</p>';
103 103
 
104 104
 		// Listing Status
105 105
 		echo '<p>';
106
-		echo '	<label for="' . $this->get_field_id( 'status' ) . '" class="title-label">' . __( 'Listing Status:', 're-pro' ) . '</label>';
106
+		echo '	<label for="' . $this->get_field_id('status') . '" class="title-label">' . __('Listing Status:', 're-pro') . '</label>';
107 107
 		echo '	<br />';
108
-		echo '	<input id="' . $this->get_field_id( 'status' ) . '" type="radio" name="' . $this->get_field_name( 'status' ) . '" value="SALE"' . checked( $status, 'SALE', false ) . '>For Sale<br />' . "\n";
109
-		echo '	<input id="' . $this->get_field_id( 'status' ) . '" type="radio" name="' . $this->get_field_name( 'status' ) . '" value="RENT"' . checked( $status, 'RENT', false ) . '>For Rent<br />' . "\n";
108
+		echo '	<input id="' . $this->get_field_id('status') . '" type="radio" name="' . $this->get_field_name('status') . '" value="SALE"' . checked($status, 'SALE', false) . '>For Sale<br />' . "\n";
109
+		echo '	<input id="' . $this->get_field_id('status') . '" type="radio" name="' . $this->get_field_name('status') . '" value="RENT"' . checked($status, 'RENT', false) . '>For Rent<br />' . "\n";
110 110
 		echo '</p>';
111 111
 
112 112
 	}
@@ -119,14 +119,14 @@  discard block
 block discarded – undo
119 119
 	 * @param mixed $old_instance Old Instance.
120 120
 	 * @return $instance
121 121
 	 */
122
-	public function update( $new_instance, $old_instance ) {
122
+	public function update($new_instance, $old_instance) {
123 123
 
124 124
 		$instance = $old_instance;
125 125
 
126
-		$instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : '';
127
-		$instance['location'] = ! empty( $new_instance['location'] ) ? strip_tags( $new_instance['location'] ) : '';
128
-		$instance['color'] = ! empty( $new_instance['color'] ) ? strip_tags( $new_instance['color'] ) : '';
129
-		$instance['status'] = ! empty( $new_instance['status'] ) ? strip_tags( $new_instance['status'] ) : '';
126
+		$instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : '';
127
+		$instance['location'] = ! empty($new_instance['location']) ? strip_tags($new_instance['location']) : '';
128
+		$instance['color'] = ! empty($new_instance['color']) ? strip_tags($new_instance['color']) : '';
129
+		$instance['status'] = ! empty($new_instance['status']) ? strip_tags($new_instance['status']) : '';
130 130
 
131 131
 		return $instance;
132 132
 	}
@@ -139,8 +139,8 @@  discard block
 block discarded – undo
139 139
  * @return void
140 140
  */
141 141
 function repro_homes_com_featured_listings() {
142
-	if ( ! is_ssl() ) {
143
-		register_widget( 'HomesFeaturedListingsWidget' );
142
+	if ( ! is_ssl()) {
143
+		register_widget('HomesFeaturedListingsWidget');
144 144
 	}
145 145
 }
146
-add_action( 'widgets_init', 'repro_homes_com_featured_listings' );
146
+add_action('widgets_init', 'repro_homes_com_featured_listings');
Please login to merge, or discard this patch.