Completed
Push — develop ( 578953...555ad7 )
by Zack
26:20 queued 13:08
created
includes/widgets/search-widget/templates/search-field-search_all.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,15 +7,15 @@
 block discarded – undo
7 7
 
8 8
 $gravityview_view = GravityView_View::getInstance();
9 9
 $view_id = $gravityview_view->getViewId();
10
-$value = $gravityview_view->search_field['value'];
11
-$label = $gravityview_view->search_field['label'];
10
+$value = $gravityview_view->search_field[ 'value' ];
11
+$label = $gravityview_view->search_field[ 'label' ];
12 12
 
13 13
 $html_input_type = RGFormsModel::is_html5_enabled() ? 'search' : 'text';
14 14
 ?>
15 15
 
16 16
 <div class="gv-search-box gv-search-field-text gv-search-field-search_all">
17 17
 	<div class="gv-search">
18
-	<?php if( ! gv_empty( $label, false, false ) ) { ?>
18
+	<?php if ( ! gv_empty( $label, false, false ) ) { ?>
19 19
 		<label for="gv_search_<?php echo $view_id; ?>"><?php echo esc_html( $label ); ?></label>
20 20
 	<?php } ?>
21 21
 		<p><input type="<?php echo $html_input_type; ?>" name="gv_search" id="gv_search_<?php echo $view_id; ?>" value="<?php echo esc_attr( $value ); ?>" /></p>
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-entry_id.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@
 block discarded – undo
7 7
 
8 8
 $gravityview_view = GravityView_View::getInstance();
9 9
 $view_id = $gravityview_view->getViewId();
10
-$value = $gravityview_view->search_field['value'];
11
-$label = $gravityview_view->search_field['label'];
10
+$value = $gravityview_view->search_field[ 'value' ];
11
+$label = $gravityview_view->search_field[ 'label' ];
12 12
 ?>
13 13
 
14 14
 <div class="gv-search-box gv-search-field-entry_id">
15 15
 	<div class="gv-search">
16
-		<?php if( ! gv_empty( $label, false, false ) ) { ?>
16
+		<?php if ( ! gv_empty( $label, false, false ) ) { ?>
17 17
 		<label for="gv_entry_id_<?php echo $view_id; ?>"><?php echo esc_html( $label ); ?></label>
18 18
 		<?php } ?>
19 19
 		<p><input type="text" name="gv_id" id="gv_entry_id_<?php echo $view_id; ?>" value="<?php echo esc_attr( $value ); ?>" /></p>
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-entry_date.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@
 block discarded – undo
7 7
 
8 8
 $gravityview_view = GravityView_View::getInstance();
9 9
 $view_id = $gravityview_view->getViewId();
10
-$value = $gravityview_view->search_field['value'];
11
-$label = $gravityview_view->search_field['label'];
10
+$value = $gravityview_view->search_field[ 'value' ];
11
+$label = $gravityview_view->search_field[ 'label' ];
12 12
 
13 13
 ?>
14 14
 
15 15
 <div class="gv-search-box gv-search-date gv-search-date-range gv-search-field-entry_date">
16
-	<?php if( ! gv_empty( $label, false, false ) ) { ?>
16
+	<?php if ( ! gv_empty( $label, false, false ) ) { ?>
17 17
 	<label for="gv_start_date_<?php echo $view_id; ?>"><?php echo esc_html( $label ); ?></label>
18 18
 	<?php } ?>
19 19
 	<p>
20
-		<input name="gv_start" id="gv_start_date_<?php echo $view_id; ?>" type="text" class="<?php echo esc_attr( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e('Start date', 'gravityview' ); ?>" value="<?php echo $value['start']; ?>">
21
-		<input name="gv_end" id="gv_end_date_<?php echo $view_id; ?>" type="text" class="<?php echo esc_attr( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e('End date', 'gravityview' ); ?>" value="<?php echo $value['end']; ?>">
20
+		<input name="gv_start" id="gv_start_date_<?php echo $view_id; ?>" type="text" class="<?php echo esc_attr( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e( 'Start date', 'gravityview' ); ?>" value="<?php echo $value[ 'start' ]; ?>">
21
+		<input name="gv_end" id="gv_end_date_<?php echo $view_id; ?>" type="text" class="<?php echo esc_attr( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e( 'End date', 'gravityview' ); ?>" value="<?php echo $value[ 'end' ]; ?>">
22 22
 	</p>
23 23
 </div>
24 24
\ No newline at end of file
Please login to merge, or discard this patch.
includes/widgets/search-widget/templates/search-field-date_range.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@
 block discarded – undo
7 7
 
8 8
 $gravityview_view = GravityView_View::getInstance();
9 9
 $view_id = $gravityview_view->getViewId();
10
-$value = $gravityview_view->search_field['value'];
11
-$label = $gravityview_view->search_field['label'];
12
-$name = $gravityview_view->search_field['name'];
10
+$value = $gravityview_view->search_field[ 'value' ];
11
+$label = $gravityview_view->search_field[ 'label' ];
12
+$name = $gravityview_view->search_field[ 'name' ];
13 13
 ?>
14 14
 
15 15
 <div class="gv-search-box gv-search-date gv-search-date-range">
16
-	<?php if( ! gv_empty( $label, false, false ) ) { ?>
17
-	<label for="search-box-<?php echo esc_attr( $name ).'-start'; ?>"><?php echo esc_html( $label ); ?></label>
16
+	<?php if ( ! gv_empty( $label, false, false ) ) { ?>
17
+	<label for="search-box-<?php echo esc_attr( $name ) . '-start'; ?>"><?php echo esc_html( $label ); ?></label>
18 18
 	<?php } ?>
19 19
 	<p>
20
-		<input name="<?php echo esc_attr( $name ).'[start]'; ?>" id="search-box-<?php echo esc_attr( $name ).'-start'; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e('Start date', 'gravityview' ); ?>" value="<?php echo esc_attr( $value['start'] ); ?>">
21
-		<input name="<?php echo esc_attr( $name ).'[end]'; ?>" id="search-box-<?php echo esc_attr( $name ).'-end'; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e('End date', 'gravityview' ); ?>" value="<?php echo esc_attr( $value['end'] ); ?>">
20
+		<input name="<?php echo esc_attr( $name ) . '[start]'; ?>" id="search-box-<?php echo esc_attr( $name ) . '-start'; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e( 'Start date', 'gravityview' ); ?>" value="<?php echo esc_attr( $value[ 'start' ] ); ?>">
21
+		<input name="<?php echo esc_attr( $name ) . '[end]'; ?>" id="search-box-<?php echo esc_attr( $name ) . '-end'; ?>" type="text" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" placeholder="<?php esc_attr_e( 'End date', 'gravityview' ); ?>" value="<?php echo esc_attr( $value[ 'end' ] ); ?>">
22 22
 	</p>
23 23
 </div>
24 24
\ No newline at end of file
Please login to merge, or discard this patch.
future/includes/class-gv-entry.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
 		$args = array();
115 115
 
116
-		$view_id = is_null ( $view ) ? null : $view->ID;
116
+		$view_id = is_null( $view ) ? null : $view->ID;
117 117
 
118 118
 		$permalink = null;
119 119
 
@@ -126,8 +126,8 @@  discard block
 block discarded – undo
126 126
 
127 127
 				$view_collection = View_Collection::from_post( $post );
128 128
 
129
-				if( 1 < $view_collection->count() ) {
130
-					$args['gvid'] = $view_id;
129
+				if ( 1 < $view_collection->count() ) {
130
+					$args[ 'gvid' ] = $view_id;
131 131
 				}
132 132
 			}
133 133
 		}
@@ -156,21 +156,21 @@  discard block
 block discarded – undo
156 156
 			 */
157 157
 			$link_parts = explode( '?', $permalink );
158 158
 
159
-			$query = ! empty( $link_parts[1] ) ? '?' . $link_parts[1] : '';
159
+			$query = ! empty( $link_parts[ 1 ] ) ? '?' . $link_parts[ 1 ] : '';
160 160
 
161
-			$permalink = trailingslashit( $link_parts[0] ) . $entry_endpoint_name . '/'. $entry_slug .'/' . $query;
161
+			$permalink = trailingslashit( $link_parts[ 0 ] ) . $entry_endpoint_name . '/' . $entry_slug . '/' . $query;
162 162
 		} else {
163 163
 			$args[ $entry_endpoint_name ] = $entry_slug;
164 164
 		}
165 165
 
166 166
 		if ( $track_directory ) {
167
-			if ( ! empty( $_GET['pagenum'] ) ) {
168
-				$args['pagenum'] = intval( $_GET['pagenum'] );
167
+			if ( ! empty( $_GET[ 'pagenum' ] ) ) {
168
+				$args[ 'pagenum' ] = intval( $_GET[ 'pagenum' ] );
169 169
 			}
170 170
 
171 171
 			if ( $sort = Utils::_GET( 'sort' ) ) {
172
-				$args['sort'] = $sort;
173
-				$args['dir'] = Utils::_GET( 'dir' );
172
+				$args[ 'sort' ] = $sort;
173
+				$args[ 'dir' ] = Utils::_GET( 'dir' );
174 174
 			}
175 175
 		}
176 176
 
Please login to merge, or discard this patch.
includes/class-gravityview-entry-link-shortcode.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 
76 76
 		$atts = shortcode_atts( self::$defaults, $atts );
77 77
 
78
-		$atts['action'] = 'edit';
78
+		$atts[ 'action' ] = 'edit';
79 79
 
80 80
 		return $this->shortcode( $atts, $content, $context );
81 81
 	}
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
 		$atts = shortcode_atts( self::$defaults, $atts );
93 93
 
94
-		$atts['action'] = 'delete';
94
+		$atts[ 'action' ] = 'delete';
95 95
 
96 96
 		return $this->shortcode( $atts, $content, $context );
97 97
 	}
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 
132 132
 		$this->settings = shortcode_atts( self::$defaults, $atts, $context );
133 133
 
134
-		$this->view_id = empty( $this->settings['view_id'] ) ? GravityView_View::getInstance()->getViewId() : absint( $this->settings['view_id'] );
134
+		$this->view_id = empty( $this->settings[ 'view_id' ] ) ? GravityView_View::getInstance()->getViewId() : absint( $this->settings[ 'view_id' ] );
135 135
 
136 136
 		if ( empty( $this->view_id ) ) {
137 137
 			gravityview()->log->error( 'A View ID was not defined and we are not inside a View' );
@@ -139,10 +139,10 @@  discard block
 block discarded – undo
139 139
 			return null;
140 140
 		}
141 141
 
142
-		$this->entry = $this->get_entry( $this->settings['entry_id'] );
142
+		$this->entry = $this->get_entry( $this->settings[ 'entry_id' ] );
143 143
 
144 144
 		if ( empty( $this->entry ) ) {
145
-			gravityview()->log->error( 'An Entry ID was not defined or found. Entry ID: {entry_id}', array( 'entry_id' => $this->settings['entry_id'] ) );
145
+			gravityview()->log->error( 'An Entry ID was not defined or found. Entry ID: {entry_id}', array( 'entry_id' => $this->settings[ 'entry_id' ] ) );
146 146
 
147 147
 			return null;
148 148
 		}
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 		gravityview()->log->debug( '{context} atts:', array( 'context' => $context, 'data' => $atts ) );
151 151
 
152 152
 		if ( ! $this->has_cap() ) {
153
-			gravityview()->log->error( 'User does not have the capability to {action} this entry: {entry_id}', array( 'action' => esc_attr( $this->settings['action'] ), 'entry_id' => $this->entry['id'] ) );
153
+			gravityview()->log->error( 'User does not have the capability to {action} this entry: {entry_id}', array( 'action' => esc_attr( $this->settings[ 'action' ] ), 'entry_id' => $this->entry[ 'id' ] ) );
154 154
 
155 155
 			return null;
156 156
 		}
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 		}
165 165
 
166 166
 		// Get just the URL, not the tag
167
-		if ( 'url' === $this->settings['return'] ) {
167
+		if ( 'url' === $this->settings[ 'return' ] ) {
168 168
 			return $url;
169 169
 		}
170 170
 
@@ -185,13 +185,13 @@  discard block
 block discarded – undo
185 185
 	 */
186 186
 	private function get_link_atts() {
187 187
 
188
-		wp_parse_str( $this->settings['link_atts'], $link_atts );
188
+		wp_parse_str( $this->settings[ 'link_atts' ], $link_atts );
189 189
 
190
-		if ( 'delete' === $this->settings['action'] ) {
191
-			$link_atts['onclick'] = isset( $link_atts['onclick'] ) ? $link_atts['onclick'] : GravityView_Delete_Entry::get_confirm_dialog();
190
+		if ( 'delete' === $this->settings[ 'action' ] ) {
191
+			$link_atts[ 'onclick' ] = isset( $link_atts[ 'onclick' ] ) ? $link_atts[ 'onclick' ] : GravityView_Delete_Entry::get_confirm_dialog();
192 192
 		}
193 193
 
194
-		return (array) $link_atts;
194
+		return (array)$link_atts;
195 195
 	}
196 196
 
197 197
 	/**
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 			return do_shortcode( $content );
212 212
 		}
213 213
 
214
-		switch ( $this->settings['action'] ) {
214
+		switch ( $this->settings[ 'action' ] ) {
215 215
 			case 'edit':
216 216
 				$anchor_text = __( 'Edit Entry', 'gravityview' );
217 217
 				break;
@@ -239,9 +239,9 @@  discard block
 block discarded – undo
239 239
 	private function get_url() {
240 240
 
241 241
 		// if post_id is not defined, default to view_id
242
-		$post_id = empty( $this->settings['post_id'] ) ? $this->view_id : $this->settings['post_id'];
242
+		$post_id = empty( $this->settings[ 'post_id' ] ) ? $this->view_id : $this->settings[ 'post_id' ];
243 243
 
244
-		switch ( $this->settings['action'] ) {
244
+		switch ( $this->settings[ 'action' ] ) {
245 245
 			case 'edit':
246 246
 				$url = GravityView_Edit_Entry::get_edit_link( $this->entry, $this->view_id, $post_id );
247 247
 				break;
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 	 */
267 267
 	private function has_cap() {
268 268
 
269
-		switch ( $this->settings['action'] ) {
269
+		switch ( $this->settings[ 'action' ] ) {
270 270
 			case 'edit':
271 271
 				$has_cap = GravityView_Edit_Entry::check_user_cap_edit_entry( $this->entry, $this->view_id );
272 272
 				break;
@@ -331,9 +331,9 @@  discard block
 block discarded – undo
331 331
 	 */
332 332
 	private function maybe_add_field_values_query_args( $url ) {
333 333
 
334
-		if ( $url && ! empty( $this->settings['field_values'] ) ) {
334
+		if ( $url && ! empty( $this->settings[ 'field_values' ] ) ) {
335 335
 
336
-			wp_parse_str( $this->settings['field_values'], $field_values );
336
+			wp_parse_str( $this->settings[ 'field_values' ], $field_values );
337 337
 
338 338
 			$url = add_query_arg( $field_values, $url );
339 339
 		}
Please login to merge, or discard this patch.
future/includes/class-gv-license-handler.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		);
101 101
 
102 102
 		if ( ! empty( $action ) ) {
103
-			$settings['edd_action'] = esc_attr( $action );
103
+			$settings[ 'edd_action' ] = esc_attr( $action );
104 104
 		}
105 105
 
106 106
 		return array_map( 'urlencode', $settings );
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 			'format' => 'json',
157 157
 		) );
158 158
 
159
-		if ( $is_ajax && empty( $data['license'] ) ) {
159
+		if ( $is_ajax && empty( $data[ 'license' ] ) ) {
160 160
 			die( -1 );
161 161
 		}
162 162
 
@@ -184,12 +184,12 @@  discard block
 block discarded – undo
184 184
 
185 185
 			$json = json_encode( $license_data );
186 186
 
187
-			$update_license = Utils::get( $data, 'update' ) || 'gravityview_license' === Utils::_POST('action');
187
+			$update_license = Utils::get( $data, 'update' ) || 'gravityview_license' === Utils::_POST( 'action' );
188 188
 
189 189
 			$is_check_action_button = ( 'check_license' === Utils::get( $data, 'edd_action' ) && defined( 'DOING_AJAX' ) && DOING_AJAX );
190 190
 
191 191
 			if ( 'deactivate_license' === Utils::get( $data, 'edd_action' ) ) {
192
-				do_action('gravityview/admin_installer/delete_downloads_data', true );
192
+				do_action( 'gravityview/admin_installer/delete_downloads_data', true );
193 193
 			}
194 194
 
195 195
 			if ( $is_check_action_button ) {
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 			// most likely a mistake.
202 202
 			} else if ( $license_data->license !== 'failed' && $update_license ) {
203 203
 
204
-				if ( ! empty( $data['field_id'] ) ) {
204
+				if ( ! empty( $data[ 'field_id' ] ) ) {
205 205
 					set_transient( self::status_transient_key, $license_data, DAY_IN_SECONDS );
206 206
 				}
207 207
 
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 		if ( empty( $license_data ) ) {
229 229
 			$message = '';
230 230
 		} else {
231
-			if( ! empty( $license_data->error ) ) {
231
+			if ( ! empty( $license_data->error ) ) {
232 232
 				$class = 'error';
233 233
 				$string_key = $license_data->error;
234 234
 			} else { $class = $license_data->license;
@@ -254,17 +254,17 @@  discard block
 block discarded – undo
254 254
 	 */
255 255
 	public function license_details( $response = array() ) {
256 256
 
257
-		$response = (array) $response;
257
+		$response = (array)$response;
258 258
 
259 259
 		$return = '';
260 260
 		$wrapper = '<span class="gv-license-details" aria-live="polite" aria-busy="false">%s</span>';
261 261
 
262
-		if ( ! empty( $response['license_key'] ) ) {
262
+		if ( ! empty( $response[ 'license_key' ] ) ) {
263 263
 			$return .= '<h3>' . esc_html__( 'License Details:', 'gravityview' ) . '</h3>';
264 264
 
265 265
 			if ( in_array( Utils::get( $response, 'license' ), array( 'invalid', 'deactivated' ) ) ) {
266
-				$return .= $this->strings( $response['license'], $response );
267
-			} elseif ( ! empty( $response['license_name'] ) ) {
266
+				$return .= $this->strings( $response[ 'license' ], $response );
267
+			} elseif ( ! empty( $response[ 'license_name' ] ) ) {
268 268
 				$response_keys = array(
269 269
 					'license_name'   => '',
270 270
 					'license_limit'  => '',
@@ -278,19 +278,19 @@  discard block
 block discarded – undo
278 278
 				// Make sure all the keys are set
279 279
 				$response = wp_parse_args( $response, $response_keys );
280 280
 
281
-				$login_link = sprintf( '<a href="%s" class="howto" rel="external">%s</a>', esc_url( sprintf( 'https://gravityview.co/wp-login.php?username=%s', $response['customer_email'] ) ), esc_html__( 'Access your GravityView account', 'gravityview' ) );
282
-				$local_text = ( ! empty( $response['is_local'] ) ? '<span class="howto">' . __( 'This development site does not count toward license activation limits', 'gravityview' ) . '</span>' : '' );
281
+				$login_link = sprintf( '<a href="%s" class="howto" rel="external">%s</a>', esc_url( sprintf( 'https://gravityview.co/wp-login.php?username=%s', $response[ 'customer_email' ] ) ), esc_html__( 'Access your GravityView account', 'gravityview' ) );
282
+				$local_text = ( ! empty( $response[ 'is_local' ] ) ? '<span class="howto">' . __( 'This development site does not count toward license activation limits', 'gravityview' ) . '</span>' : '' );
283 283
 				$details    = array(
284
-					'license'     => sprintf( esc_html__( 'License level: %s', 'gravityview' ), esc_html( $response['license_name'] ), esc_html( $response['license_limit'] ) ),
285
-					'licensed_to' => sprintf( esc_html_x( 'Licensed to: %1$s (%2$s)', '1: Customer name; 2: Customer email', 'gravityview' ), esc_html__( $response['customer_name'], 'gravityview' ), esc_html__( $response['customer_email'], 'gravityview' ) ) . $login_link,
286
-					'activations' => sprintf( esc_html__( 'Activations: %d of %s sites', 'gravityview' ), intval( $response['site_count'] ), esc_html( $response['license_limit'] ) ) . $local_text,
287
-					'expires'     => 'lifetime' === $response['expires'] ? '' : sprintf( esc_html__( 'Renew on: %s', 'gravityview' ), date_i18n( get_option( 'date_format' ), strtotime( $response['expires'] ) - DAY_IN_SECONDS ) ),
288
-					'upgrade'     => $this->get_upgrade_html( $response['upgrades'] ),
284
+					'license'     => sprintf( esc_html__( 'License level: %s', 'gravityview' ), esc_html( $response[ 'license_name' ] ), esc_html( $response[ 'license_limit' ] ) ),
285
+					'licensed_to' => sprintf( esc_html_x( 'Licensed to: %1$s (%2$s)', '1: Customer name; 2: Customer email', 'gravityview' ), esc_html__( $response[ 'customer_name' ], 'gravityview' ), esc_html__( $response[ 'customer_email' ], 'gravityview' ) ) . $login_link,
286
+					'activations' => sprintf( esc_html__( 'Activations: %d of %s sites', 'gravityview' ), intval( $response[ 'site_count' ] ), esc_html( $response[ 'license_limit' ] ) ) . $local_text,
287
+					'expires'     => 'lifetime' === $response[ 'expires' ] ? '' : sprintf( esc_html__( 'Renew on: %s', 'gravityview' ), date_i18n( get_option( 'date_format' ), strtotime( $response[ 'expires' ] ) - DAY_IN_SECONDS ) ),
288
+					'upgrade'     => $this->get_upgrade_html( $response[ 'upgrades' ] ),
289 289
 				);
290 290
 
291
-				if ( ! empty( $response['error'] ) && 'expired' === $response['error'] ) {
292
-					unset( $details['upgrade'] );
293
-					$details['expires'] = '<div class="error inline"><p>' . $this->strings( 'expired', $response ) . '</p></div>';
291
+				if ( ! empty( $response[ 'error' ] ) && 'expired' === $response[ 'error' ] ) {
292
+					unset( $details[ 'upgrade' ] );
293
+					$details[ 'expires' ] = '<div class="error inline"><p>' . $this->strings( 'expired', $response ) . '</p></div>';
294 294
 				}
295 295
 
296 296
 				$return .= '<ul><li>' . implode( '</li><li>', array_filter( $details ) ) . '</li></ul>';
@@ -316,20 +316,20 @@  discard block
 block discarded – undo
316 316
 		if ( ! empty( $upgrades ) ) {
317 317
 
318 318
 			$locale_parts = explode( '_', get_locale() );
319
-			$is_english = ( 'en' === $locale_parts[0] );
319
+			$is_english = ( 'en' === $locale_parts[ 0 ] );
320 320
 
321 321
 			$output .= '<h4>' . esc_html__( 'Upgrades available:', 'gravityview' ) . '</h4>';
322 322
 			$output .= '<ul class="ul-disc">';
323 323
 
324 324
 			foreach ( $upgrades as $upgrade_id => $upgrade ) {
325
-				$upgrade = (object) $upgrade;
325
+				$upgrade = (object)$upgrade;
326 326
 
327 327
 				$anchor_text = sprintf( esc_html_x( 'Upgrade to %1$s for %2$s', '1: GravityView upgrade name, 2: Cost of upgrade', 'gravityview' ), esc_attr( $upgrade->name ), esc_attr( $upgrade->price ) );
328 328
 
329 329
 				if ( $is_english && isset( $upgrade->description ) ) {
330 330
 					$message = esc_html( $upgrade->description );
331 331
 				} else {
332
-					switch( $upgrade->price_id ) {
332
+					switch ( $upgrade->price_id ) {
333 333
 						// Interstellar
334 334
 						case 1:
335 335
 						default:
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 			'invalid' => esc_html__( 'The license key entered is invalid.', 'gravityview' ),
389 389
 			'missing' => esc_html__( 'Invalid license key.', 'gravityview' ),
390 390
 			'revoked' => esc_html__( 'This license key has been revoked.', 'gravityview' ),
391
-			'expired' => sprintf( esc_html__( 'This license key has expired. %sRenew your license on the GravityView website%s to receive updates and support.', 'gravityview' ), '<a href="'. esc_url( $this->get_license_renewal_url( $license_data ) ) .'">', '</a>' ),
391
+			'expired' => sprintf( esc_html__( 'This license key has expired. %sRenew your license on the GravityView website%s to receive updates and support.', 'gravityview' ), '<a href="' . esc_url( $this->get_license_renewal_url( $license_data ) ) . '">', '</a>' ),
392 392
 			'capability' => esc_html__( 'You don\'t have the ability to edit plugin settings.', 'gravityview' ),
393 393
 
394 394
 			'verifying_license' => esc_html__( 'Verifying license&hellip;', 'gravityview' ),
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
 
418 418
 		if ( ! empty( $license_data->renewal_url ) ) {
419 419
 			$renew_license_url = $license_data->renewal_url;
420
-		} elseif( ! empty( $license_data->license_key ) ) {
420
+		} elseif ( ! empty( $license_data->license_key ) ) {
421 421
 			$renew_license_url = sprintf( 'https://gravityview.co/checkout/?download_id=17&edd_license_key=%s', $license_data->license_key );
422 422
 		} else {
423 423
 			$renew_license_url = 'https://gravityview.co/account/';
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
 	 * @return array|\WP_Error
435 435
 	 */
436 436
 	private function _license_get_remote_response( $data, $license = '' ) {
437
-		$api_params = $this->_get_edd_settings( $data['edd_action'], $license );
437
+		$api_params = $this->_get_edd_settings( $data[ 'edd_action' ], $license );
438 438
 
439 439
 		$url = add_query_arg( $api_params, self::url );
440 440
 
@@ -474,9 +474,9 @@  discard block
 block discarded – undo
474 474
 	private function license_call_update_settings( $license_data, $data ) {
475 475
 		$settings = array();
476 476
 
477
-        $settings['license_key'] = $license_data->license_key = trim( $data['license'] );
478
-		$settings['license_key_status'] = $license_data->license;
479
-		$settings['license_key_response'] = (array)$license_data;
477
+        $settings[ 'license_key' ] = $license_data->license_key = trim( $data[ 'license' ] );
478
+		$settings[ 'license_key_status' ] = $license_data->license;
479
+		$settings[ 'license_key_response' ] = (array)$license_data;
480 480
 
481 481
 		$this->settings->set( $settings );
482 482
 	}
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
 
492 492
 		if ( ! empty( $key ) ) {
493 493
 			$response = $this->settings->get( 'license_key_response' );
494
-			$response = is_array( $response ) ? (object) $response : json_decode( $response );
494
+			$response = is_array( $response ) ? (object)$response : json_decode( $response );
495 495
 		} else {
496 496
 			$response = array();
497 497
 		}
@@ -533,11 +533,11 @@  discard block
 block discarded – undo
533 533
 
534 534
 		$submit = '<div class="gv-edd-button-wrapper">';
535 535
 		foreach ( $fields as $field ) {
536
-			$field['type'] = 'button';
537
-			$field['class'] = isset( $field['class'] ) ? $field['class'] . ' '. $class : $class;
538
-			$field['style'] = 'margin-left: 10px;';
539
-			if( $disabled_attribute ) {
540
-				$field['disabled'] = $disabled_attribute;
536
+			$field[ 'type' ] = 'button';
537
+			$field[ 'class' ] = isset( $field[ 'class' ] ) ? $field[ 'class' ] . ' ' . $class : $class;
538
+			$field[ 'style' ] = 'margin-left: 10px;';
539
+			if ( $disabled_attribute ) {
540
+				$field[ 'disabled' ] = $disabled_attribute;
541 541
 			}
542 542
 			$submit .= $this->settings->as_html( $field, $echo );
543 543
 		}
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
 				    'url'        => home_url(),
617 617
 				    'site_data'  => $this->get_site_data(),
618 618
 			    ),
619
-			));
619
+			) );
620 620
 
621 621
 			// make sure the response came back okay
622 622
 			if ( is_wp_error( $response ) ) {
@@ -647,45 +647,45 @@  discard block
 block discarded – undo
647 647
 		$theme_data = wp_get_theme();
648 648
 		$theme      = $theme_data->Name . ' ' . $theme_data->Version;
649 649
 
650
-		$data['gv_version']  = Plugin::$version;
651
-		$data['php_version']  = phpversion();
652
-		$data['wp_version']   = get_bloginfo( 'version' );
653
-		$data['gf_version']  = \GFForms::$version;
654
-		$data['server']       = Utils::get( $_SERVER, 'SERVER_SOFTWARE' );
655
-		$data['multisite']    = is_multisite();
656
-		$data['theme']        = $theme;
657
-		$data['url']          = home_url();
658
-		$data['license_key']  = $this->settings->get( 'license_key' );
659
-		$data['beta']         = $this->settings->get( 'beta' );
650
+		$data[ 'gv_version' ]  = Plugin::$version;
651
+		$data[ 'php_version' ]  = phpversion();
652
+		$data[ 'wp_version' ]   = get_bloginfo( 'version' );
653
+		$data[ 'gf_version' ]  = \GFForms::$version;
654
+		$data[ 'server' ]       = Utils::get( $_SERVER, 'SERVER_SOFTWARE' );
655
+		$data[ 'multisite' ]    = is_multisite();
656
+		$data[ 'theme' ]        = $theme;
657
+		$data[ 'url' ]          = home_url();
658
+		$data[ 'license_key' ]  = $this->settings->get( 'license_key' );
659
+		$data[ 'beta' ]         = $this->settings->get( 'beta' );
660 660
 
661 661
 		// View Data
662 662
 		$gravityview_posts = wp_count_posts( 'gravityview', 'readable' );
663 663
 
664
-		$data['view_count'] = null;
665
-		$data['view_first'] = null;
666
-		$data['view_latest'] = null;
664
+		$data[ 'view_count' ] = null;
665
+		$data[ 'view_first' ] = null;
666
+		$data[ 'view_latest' ] = null;
667 667
 
668 668
 		if ( $gravityview_posts->publish ) {
669
-			$data['view_count'] = $gravityview_posts->publish;
669
+			$data[ 'view_count' ] = $gravityview_posts->publish;
670 670
 
671 671
 			$first = get_posts( 'numberposts=1&post_type=gravityview&post_status=publish&order=ASC' );
672 672
 			$latest = get_posts( 'numberposts=1&post_type=gravityview&post_status=publish&order=DESC' );
673 673
 
674 674
 			if ( $first = array_shift( $first ) ) {
675
-				$data['view_first'] = $first->post_date;
675
+				$data[ 'view_first' ] = $first->post_date;
676 676
 			}
677 677
 			if ( $latest = array_pop( $latest ) ) {
678
-				$data['view_latest'] = $latest->post_date;
678
+				$data[ 'view_latest' ] = $latest->post_date;
679 679
 			}
680 680
 		}
681 681
 
682 682
 		// Form counts
683 683
 		if ( class_exists( 'GFFormsModel' ) ) {
684 684
 			$form_data = \GFFormsModel::get_form_count();
685
-			$data['forms_total'] = Utils::get( $form_data, 'total', 0 );
686
-			$data['forms_active'] = Utils::get( $form_data, 'active', 0 );
687
-			$data['forms_inactive'] = Utils::get( $form_data, 'inactive', 0 );
688
-			$data['forms_trash'] = Utils::get( $form_data, 'inactive', 0 );
685
+			$data[ 'forms_total' ] = Utils::get( $form_data, 'total', 0 );
686
+			$data[ 'forms_active' ] = Utils::get( $form_data, 'active', 0 );
687
+			$data[ 'forms_inactive' ] = Utils::get( $form_data, 'inactive', 0 );
688
+			$data[ 'forms_trash' ] = Utils::get( $form_data, 'inactive', 0 );
689 689
 		}
690 690
 
691 691
 		// Retrieve current plugin information
@@ -693,13 +693,13 @@  discard block
 block discarded – undo
693 693
 			include ABSPATH . '/wp-admin/includes/plugin.php';
694 694
 		}
695 695
 
696
-		$data['integrations']     = self::get_related_plugins_and_extensions();
697
-		$data['active_plugins']   = get_option( 'active_plugins', array() );
698
-		$data['inactive_plugins'] = array();
699
-		$data['locale']           = get_locale();
696
+		$data[ 'integrations' ]     = self::get_related_plugins_and_extensions();
697
+		$data[ 'active_plugins' ]   = get_option( 'active_plugins', array() );
698
+		$data[ 'inactive_plugins' ] = array();
699
+		$data[ 'locale' ]           = get_locale();
700 700
 
701 701
 		// Validate request on the GV server
702
-		$data['hash']             = 'gv_version.url.locale:' . sha1( $data['gv_version'] . $data['url'] . $data['locale'] );
702
+		$data[ 'hash' ]             = 'gv_version.url.locale:' . sha1( $data[ 'gv_version' ] . $data[ 'url' ] . $data[ 'locale' ] );
703 703
 
704 704
 		return $data;
705 705
 	}
@@ -729,7 +729,7 @@  discard block
 block discarded – undo
729 729
 
730 730
 				$plugin_data = get_plugin_data( $active_plugin );
731 731
 
732
-				$extensions[] = sprintf( '%s %s', $plugin_data['Name'], $plugin_data['Version'] );
732
+				$extensions[ ] = sprintf( '%s %s', $plugin_data[ 'Name' ], $plugin_data[ 'Version' ] );
733 733
 			}
734 734
 
735 735
 			if ( ! empty( $extensions ) ) {
Please login to merge, or discard this patch.
future/includes/rest/class-gv-rest-route.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 
133 133
 		$format = '(?:\.(?P<format>html|json))?';
134 134
 
135
-		register_rest_route( $namespace, sprintf( '/%s/(?P<id>[\d]+)/%s/(?P<s_id>[\w-]+)%s', $base, $sub_type, $format ) , array(
135
+		register_rest_route( $namespace, sprintf( '/%s/(?P<id>[\d]+)/%s/(?P<s_id>[\w-]+)%s', $base, $sub_type, $format ), array(
136 136
 			array(
137 137
 				'methods'         => \WP_REST_Server::READABLE,
138 138
 				'callback'        => array( $this, 'get_sub_item' ),
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 	 * @return \WP_REST_Response
384 384
 	 */
385 385
 	protected function not_implemented(  ) {
386
-		$error = new \WP_Error( 'not-implemented-yet', __( 'Endpoint Not Yet Implemented.', 'gravityview' )  );
386
+		$error = new \WP_Error( 'not-implemented-yet', __( 'Endpoint Not Yet Implemented.', 'gravityview' ) );
387 387
 		return new \WP_REST_Response( $error, 501 );
388 388
 	}
389 389
 
Please login to merge, or discard this patch.
includes/class-gravityview-shortcode.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
 		gravityview()->log->debug( '$passed_atts: ', array( 'data' => $passed_atts ) );
49 49
 
50 50
 		// Get details about the current View
51
-		if( !empty( $passed_atts['detail'] ) ) {
52
-			return $this->get_view_detail( $passed_atts['detail'] );
51
+		if ( ! empty( $passed_atts[ 'detail' ] ) ) {
52
+			return $this->get_view_detail( $passed_atts[ 'detail' ] );
53 53
 		}
54 54
 
55 55
 		$atts = $this->parse_and_sanitize_atts( $passed_atts );
@@ -85,16 +85,16 @@  discard block
 block discarded – undo
85 85
 		$filtered_atts = shortcode_atts( $supported_atts, $passed_atts, 'gravityview' );
86 86
 
87 87
 		// Only keep the passed attributes after making sure that they're valid pairs
88
-		$filtered_atts = array_intersect_key( (array) $passed_atts, $filtered_atts );
88
+		$filtered_atts = array_intersect_key( (array)$passed_atts, $filtered_atts );
89 89
 
90 90
 		$atts = array();
91 91
 
92
-		foreach( $filtered_atts as $key => $passed_value ) {
92
+		foreach ( $filtered_atts as $key => $passed_value ) {
93 93
 
94 94
 			// Allow using GravityView merge tags in shortcode attributes, like {get} and {created_by}
95 95
 			$passed_value = GravityView_Merge_Tags::replace_variables( $passed_value );
96 96
 
97
-			switch( $defaults[ $key ]['type'] ) {
97
+			switch ( $defaults[ $key ][ 'type' ] ) {
98 98
 
99 99
 				/**
100 100
 				 * Make sure number fields are numeric.
@@ -102,14 +102,14 @@  discard block
 block discarded – undo
102 102
 				 * @see http://php.net/manual/en/function.is-numeric.php#107326
103 103
 				 */
104 104
 				case 'number':
105
-					if( is_numeric( $passed_value ) ) {
105
+					if ( is_numeric( $passed_value ) ) {
106 106
 						$atts[ $key ] = ( $passed_value + 0 );
107 107
 					}
108 108
 					break;
109 109
 
110 110
 				/** @since 2.1 */
111 111
 				case 'operator':
112
-					if( GFFormsModel::is_valid_operator( $passed_value ) ) {
112
+					if ( GFFormsModel::is_valid_operator( $passed_value ) ) {
113 113
 						$atts[ $key ] = $passed_value;
114 114
 					}
115 115
 					break;
@@ -124,8 +124,8 @@  discard block
 block discarded – undo
124 124
 				 */
125 125
 				case 'select':
126 126
 				case 'radio':
127
-					$options = isset( $defaults[ $key ]['choices'] ) ? $defaults[ $key ]['choices'] : $defaults[ $key ]['options'];
128
-					if( in_array( $passed_value, array_keys( $options ) ) ) {
127
+					$options = isset( $defaults[ $key ][ 'choices' ] ) ? $defaults[ $key ][ 'choices' ] : $defaults[ $key ][ 'options' ];
128
+					if ( in_array( $passed_value, array_keys( $options ) ) ) {
129 129
 						$atts[ $key ] = $passed_value;
130 130
 					}
131 131
 					break;
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 		$gravityview_view = GravityView_View::getInstance();
155 155
 		$return = '';
156 156
 
157
-		switch( $detail ) {
157
+		switch ( $detail ) {
158 158
 			case 'total_entries':
159 159
 				$return = number_format_i18n( $gravityview_view->getTotalEntries() );
160 160
 				break;
Please login to merge, or discard this patch.