Completed
Pull Request — master (#1356)
by Stephanie
59s
created
classes/views/frm-fields/front-end/checkbox-field.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,6 +83,6 @@
 block discarded – undo
83 83
 
84 84
 		?></div>
85 85
 <?php
86
-		++$option_index;
86
+		++ $option_index;
87 87
 	}
88 88
 }
Please login to merge, or discard this patch.
classes/helpers/FrmCurrencyHelper.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,10 +16,10 @@
 block discarded – undo
16 16
 	public static function get_currency( $currency ) {
17 17
 		$currency   = strtoupper( $currency );
18 18
 		$currencies = self::get_currencies();
19
-		if ( isset( $currencies[ $currency ] ) ) {
20
-			$currency = $currencies[ $currency ];
21
-		} elseif ( isset( $currencies[ strtolower( $currency ) ] ) ) {
22
-			$currency = $currencies[ strtolower( $currency ) ];
19
+		if ( isset( $currencies[$currency] ) ) {
20
+			$currency = $currencies[$currency];
21
+		} elseif ( isset( $currencies[strtolower( $currency )] ) ) {
22
+			$currency = $currencies[strtolower( $currency )];
23 23
 		} else {
24 24
 			$currency = $currencies['USD'];
25 25
 		}
Please login to merge, or discard this patch.
classes/models/FrmInbox.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 			return;
106 106
 		}
107 107
 
108
-		if ( isset( self::$messages[ $message['key'] ] ) && ! isset( $message['force'] ) ) {
108
+		if ( isset( self::$messages[$message['key']] ) && ! isset( $message['force'] ) ) {
109 109
 			// Don't replace messages unless required.
110 110
 			return;
111 111
 		}
@@ -114,13 +114,13 @@  discard block
 block discarded – undo
114 114
 			return;
115 115
 		}
116 116
 
117
-		if ( isset( self::$messages[ $message['key'] ] ) ) {
117
+		if ( isset( self::$messages[$message['key']] ) ) {
118 118
 			// Move up and mark as new.
119
-			unset( self::$messages[ $message['key'] ] );
119
+			unset( self::$messages[$message['key']] );
120 120
 		}
121 121
 
122 122
 		$this->fill_message( $message );
123
-		self::$messages[ $message['key'] ] = $message;
123
+		self::$messages[$message['key']] = $message;
124 124
 
125 125
 		$this->update_list();
126 126
 
@@ -156,11 +156,11 @@  discard block
 block discarded – undo
156 156
 	private function clean_messages() {
157 157
 		$removed = false;
158 158
 		foreach ( self::$messages as $t => $message ) {
159
-			$read      = isset( $message['read'] ) && ! empty( $message['read'] ) && isset( $message['read'][ get_current_user_id() ] ) && $message['read'][ get_current_user_id() ] < strtotime( '-1 month' );
160
-			$dismissed = isset( $message['dismissed'] ) && ! empty( $message['dismissed'] ) && isset( $message['dismissed'][ get_current_user_id() ] ) && $message['dismissed'][ get_current_user_id() ] < strtotime( '-1 week' );
159
+			$read      = isset( $message['read'] ) && ! empty( $message['read'] ) && isset( $message['read'][get_current_user_id()] ) && $message['read'][get_current_user_id()] < strtotime( '-1 month' );
160
+			$dismissed = isset( $message['dismissed'] ) && ! empty( $message['dismissed'] ) && isset( $message['dismissed'][get_current_user_id()] ) && $message['dismissed'][get_current_user_id()] < strtotime( '-1 week' );
161 161
 			$expired   = $this->is_expired( $message );
162 162
 			if ( $read || $expired || $dismissed ) {
163
-				unset( self::$messages[ $t ] );
163
+				unset( self::$messages[$t] );
164 164
 				$removed = true;
165 165
 			}
166 166
 		}
@@ -176,11 +176,11 @@  discard block
 block discarded – undo
176 176
 	public function filter_messages( &$messages, $type = 'unread' ) {
177 177
 		$user_id = get_current_user_id();
178 178
 		foreach ( $messages as $k => $message ) {
179
-			$dismissed = isset( $message['dismissed'] ) && isset( $message['dismissed'][ $user_id ] );
179
+			$dismissed = isset( $message['dismissed'] ) && isset( $message['dismissed'][$user_id] );
180 180
 			if ( empty( $k ) || $this->is_expired( $message ) || ( $dismissed && 'dismissed' !== $type ) || ( 'dismissed' === $type && ! $dismissed ) ) {
181
-				unset( $messages[ $k ] );
181
+				unset( $messages[$k] );
182 182
 			} elseif ( ! $this->is_for_user( $message ) ) {
183
-				unset( $messages[ $k ] );
183
+				unset( $messages[$k] );
184 184
 			}
185 185
 		}
186 186
 		$messages = apply_filters( 'frm_filter_inbox', $messages );
@@ -226,14 +226,14 @@  discard block
 block discarded – undo
226 226
 	 * @return void
227 227
 	 */
228 228
 	public function mark_read( $key ) {
229
-		if ( ! $key || ! isset( self::$messages[ $key ] ) ) {
229
+		if ( ! $key || ! isset( self::$messages[$key] ) ) {
230 230
 			return;
231 231
 		}
232 232
 
233
-		if ( ! isset( self::$messages[ $key ]['read'] ) ) {
234
-			self::$messages[ $key ]['read'] = array();
233
+		if ( ! isset( self::$messages[$key]['read'] ) ) {
234
+			self::$messages[$key]['read'] = array();
235 235
 		}
236
-		self::$messages[ $key ]['read'][ get_current_user_id() ] = time();
236
+		self::$messages[$key]['read'][get_current_user_id()] = time();
237 237
 
238 238
 		$this->update_list();
239 239
 	}
@@ -246,9 +246,9 @@  discard block
 block discarded – undo
246 246
 	 * @return void
247 247
 	 */
248 248
 	public function mark_unread( $key ) {
249
-		$is_read = isset( self::$messages[ $key ] ) && isset( self::$messages[ $key ]['read'] ) && isset( self::$messages[ $key ]['read'][ get_current_user_id() ] );
249
+		$is_read = isset( self::$messages[$key] ) && isset( self::$messages[$key]['read'] ) && isset( self::$messages[$key]['read'][get_current_user_id()] );
250 250
 		if ( $is_read ) {
251
-			unset( self::$messages[ $key ]['read'][ get_current_user_id() ] );
251
+			unset( self::$messages[$key]['read'][get_current_user_id()] );
252 252
 			$this->update_list();
253 253
 		}
254 254
 	}
@@ -264,14 +264,14 @@  discard block
 block discarded – undo
264 264
 			return;
265 265
 		}
266 266
 
267
-		if ( ! isset( self::$messages[ $key ] ) ) {
267
+		if ( ! isset( self::$messages[$key] ) ) {
268 268
 			return;
269 269
 		}
270 270
 
271
-		if ( ! isset( self::$messages[ $key ]['dismissed'] ) ) {
272
-			self::$messages[ $key ]['dismissed'] = array();
271
+		if ( ! isset( self::$messages[$key]['dismissed'] ) ) {
272
+			self::$messages[$key]['dismissed'] = array();
273 273
 		}
274
-		self::$messages[ $key ]['dismissed'][ get_current_user_id() ] = time();
274
+		self::$messages[$key]['dismissed'][get_current_user_id()] = time();
275 275
 
276 276
 		$this->update_list();
277 277
 	}
@@ -285,11 +285,11 @@  discard block
 block discarded – undo
285 285
 		$user_id = get_current_user_id();
286 286
 		foreach ( self::$messages as $key => $message ) {
287 287
 			if ( ! isset( $message['dismissed'] ) ) {
288
-				self::$messages[ $key ]['dismissed'] = array();
288
+				self::$messages[$key]['dismissed'] = array();
289 289
 			}
290 290
 
291
-			if ( ! isset( $message['dismissed'][ $user_id ] ) ) {
292
-				self::$messages[ $key ]['dismissed'][ $user_id ] = time();
291
+			if ( ! isset( $message['dismissed'][$user_id] ) ) {
292
+				self::$messages[$key]['dismissed'][$user_id] = time();
293 293
 			}
294 294
 		}
295 295
 		$this->update_list();
@@ -299,8 +299,8 @@  discard block
 block discarded – undo
299 299
 		$messages = $this->get_messages( 'filter' );
300 300
 		$user_id  = get_current_user_id();
301 301
 		foreach ( $messages as $t => $message ) {
302
-			if ( isset( $message['read'] ) && isset( $message['read'][ $user_id ] ) ) {
303
-				unset( $messages[ $t ] );
302
+			if ( isset( $message['read'] ) && isset( $message['read'][$user_id] ) ) {
303
+				unset( $messages[$t] );
304 304
 			}
305 305
 		}
306 306
 		return $messages;
@@ -328,8 +328,8 @@  discard block
 block discarded – undo
328 328
 	 * @return void
329 329
 	 */
330 330
 	public function remove( $key ) {
331
-		if ( isset( self::$messages[ $key ] ) ) {
332
-			unset( self::$messages[ $key ] );
331
+		if ( isset( self::$messages[$key] ) ) {
332
+			unset( self::$messages[$key] );
333 333
 			$this->update_list();
334 334
 		}
335 335
 	}
Please login to merge, or discard this patch.
classes/controllers/FrmAddonsController.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		} else {
102 102
 			foreach ( $addons as $k => $addon ) {
103 103
 				if ( empty( $addon['excerpt'] ) && $k !== 'error' ) {
104
-					unset( $addons[ $k ] );
104
+					unset( $addons[$k] );
105 105
 				}
106 106
 			}
107 107
 		}
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 
203 203
 		foreach ( $list as $k => $info ) {
204 204
 			$info['slug'] = $k;
205
-			$list[ $k ]   = array_merge( $defaults, $info );
205
+			$list[$k]   = array_merge( $defaults, $info );
206 206
 		}
207 207
 		return $list;
208 208
 	}
@@ -352,17 +352,17 @@  discard block
 block discarded – undo
352 352
 				continue;
353 353
 			}
354 354
 
355
-			$wp_plugin    = isset( $wp_plugins[ $folder ] ) ? $wp_plugins[ $folder ] : array();
355
+			$wp_plugin    = isset( $wp_plugins[$folder] ) ? $wp_plugins[$folder] : array();
356 356
 			$wp_version   = isset( $wp_plugin['Version'] ) ? $wp_plugin['Version'] : '1.0';
357 357
 			$plugin->slug = explode( '/', $folder )[0];
358 358
 
359 359
 			if ( version_compare( $wp_version, $plugin->new_version, '<' ) ) {
360
-				$transient->response[ $folder ] = $plugin;
360
+				$transient->response[$folder] = $plugin;
361 361
 			} else {
362
-				$transient->no_update[ $folder ] = $plugin;
362
+				$transient->no_update[$folder] = $plugin;
363 363
 			}
364 364
 
365
-			$transient->checked[ $folder ] = $wp_version;
365
+			$transient->checked[$folder] = $wp_version;
366 366
 
367 367
 		}
368 368
 
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 	 */
396 396
 	protected static function is_installed( $plugin ) {
397 397
 		$all_plugins = self::get_plugins();
398
-		return isset( $all_plugins[ $plugin ] );
398
+		return isset( $all_plugins[$plugin] );
399 399
 	}
400 400
 
401 401
 	/**
@@ -434,13 +434,13 @@  discard block
 block discarded – undo
434 434
 			}
435 435
 
436 436
 			$download_id = isset( $plugin['id'] ) ? $plugin['id'] : 0;
437
-			if ( ! empty( $download_id ) && ! isset( $version_info[ $download_id ]['package'] ) ) {
437
+			if ( ! empty( $download_id ) && ! isset( $version_info[$download_id]['package'] ) ) {
438 438
 				// if this addon is using its own license, get the update url
439 439
 				$addon_info = $api->get_api_info();
440 440
 
441
-				$version_info[ $download_id ] = $addon_info[ $download_id ];
441
+				$version_info[$download_id] = $addon_info[$download_id];
442 442
 				if ( isset( $addon_info['error'] ) ) {
443
-					$version_info[ $download_id ]['error'] = array(
443
+					$version_info[$download_id]['error'] = array(
444 444
 						'message' => $addon_info['error']['message'],
445 445
 						'code'    => $addon_info['error']['code'],
446 446
 					);
@@ -539,8 +539,8 @@  discard block
 block discarded – undo
539 539
 					return $addon;
540 540
 				}
541 541
 			}
542
-		} elseif ( isset( $addons[ $download_id ] ) ) {
543
-			$plugin = $addons[ $download_id ];
542
+		} elseif ( isset( $addons[$download_id] ) ) {
543
+			$plugin = $addons[$download_id];
544 544
 		}
545 545
 
546 546
 		return $plugin;
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
 			self::prepare_addon_link( $addon['link'] );
605 605
 
606 606
 			self::set_addon_status( $addon );
607
-			$addons[ $id ] = $addon;
607
+			$addons[$id] = $addon;
608 608
 		}
609 609
 	}
610 610
 
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
 			'utm_medium'   => 'addons',
646 646
 			'utm_campaign' => 'liteplugin',
647 647
 		);
648
-		$link       = add_query_arg( $query_args, $link );
648
+		$link = add_query_arg( $query_args, $link );
649 649
 	}
650 650
 
651 651
 	/**
@@ -1373,7 +1373,7 @@  discard block
 block discarded – undo
1373 1373
 		$addons = $api->get_api_info();
1374 1374
 
1375 1375
 		if ( is_array( $addons ) && array_key_exists( $addon_id, $addons ) ) {
1376
-			$dates    = $addons[ $addon_id ];
1376
+			$dates    = $addons[$addon_id];
1377 1377
 			$requires = FrmFormsHelper::get_plan_required( $dates );
1378 1378
 		}
1379 1379
 
Please login to merge, or discard this patch.
classes/helpers/FrmTipsHelper.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 			'page'  => '',
46 46
 			'class' => 'frm-mt-0',
47 47
 		);
48
-		$tip      = array_merge( $defaults, $tip );
48
+		$tip = array_merge( $defaults, $tip );
49 49
 
50 50
 		if ( isset( $tip['link'] ) && ! isset( $tip['link']['medium'] ) ) {
51 51
 			$tip['link']['medium'] = 'tip';
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 	 * @return array
373 373
 	 */
374 374
 	public static function get_banner_tip() {
375
-		$tips       = array(
375
+		$tips = array(
376 376
 			array(
377 377
 				'link' => array(
378 378
 					'medium'  => 'banner',
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 			),
400 400
 		);
401 401
 		$random     = rand( 0, count( $tips ) - 1 );
402
-		$tip        = $tips[ $random ];
402
+		$tip        = $tips[$random];
403 403
 		$tip['num'] = $random;
404 404
 
405 405
 		return $tip;
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
 	public static function get_random_tip( $tips ) {
409 409
 		$random = rand( 0, count( $tips ) - 1 );
410 410
 
411
-		return $tips[ $random ];
411
+		return $tips[$random];
412 412
 	}
413 413
 
414 414
 	/**
Please login to merge, or discard this patch.
classes/models/FrmEmailStats.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 	 * @param array $stats Statistics section data.
123 123
 	 */
124 124
 	protected function add_payments_data( &$stats ) {
125
-		$payment_data  = FrmEmailSummaryHelper::get_payments_data( $this->from_date, $this->to_date );
125
+		$payment_data = FrmEmailSummaryHelper::get_payments_data( $this->from_date, $this->to_date );
126 126
 		$stats['payments_count'] = array(
127 127
 			'label'   => __( 'Payments collected', 'formidable' ),
128 128
 			'count'   => $payment_data['count'],
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 
132 132
 		// Build total for each currency.
133 133
 		foreach ( $payment_data['total'] as $currency => $amount ) {
134
-			$stats[ 'payments_total_' . $currency ] = array(
134
+			$stats['payments_total_' . $currency] = array(
135 135
 				// translators: currency name.
136 136
 				'label'   => sprintf( __( 'Total %s', 'formidable' ), strtoupper( $currency ) ),
137 137
 				'count'   => $amount,
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 		}
142 142
 
143 143
 		if ( $this->has_comparison ) {
144
-			$prev_payment_data  = FrmEmailSummaryHelper::get_payments_data( $this->prev_from_date, $this->prev_to_date );
144
+			$prev_payment_data = FrmEmailSummaryHelper::get_payments_data( $this->prev_from_date, $this->prev_to_date );
145 145
 
146 146
 			if ( ! $payment_data['count'] && ! $prev_payment_data['count'] ) {
147 147
 				// Maybe this site doesn't collect payment, hide these sections.
@@ -153,23 +153,23 @@  discard block
 block discarded – undo
153 153
 
154 154
 			// Compare total for each currency.
155 155
 			foreach ( $payment_data['total'] as $currency => $amount ) {
156
-				if ( ! isset( $prev_payment_data['total'][ $currency ] ) ) {
157
-					$stats[ 'payments_total_' . $currency ]['compare'] = 1;
156
+				if ( ! isset( $prev_payment_data['total'][$currency] ) ) {
157
+					$stats['payments_total_' . $currency]['compare'] = 1;
158 158
 					continue;
159 159
 				}
160 160
 
161
-				$stats[ 'payments_total_' . $currency ]['compare'] = $this->get_compare_diff( $amount, $prev_payment_data['total'][ $currency ] );
162
-				unset( $prev_payment_data['total'][ $currency ] );
161
+				$stats['payments_total_' . $currency]['compare'] = $this->get_compare_diff( $amount, $prev_payment_data['total'][$currency] );
162
+				unset( $prev_payment_data['total'][$currency] );
163 163
 			}
164 164
 
165 165
 			// If prev month has more currencies.
166 166
 			foreach ( $prev_payment_data['total'] as $currency => $amount ) {
167
-				$stats[ 'payments_total_' . $currency ] = array(
167
+				$stats['payments_total_' . $currency] = array(
168 168
 					// translators: currency name.
169 169
 					'label'   => sprintf( __( 'Total %s', 'formidable' ), strtoupper( $currency ) ),
170 170
 					'count'   => 0,
171 171
 					'display' => $this->get_formatted_price( 0, $currency ),
172
-					'compare' => -1,
172
+					'compare' => - 1,
173 173
 				);
174 174
 			}
175 175
 		}
Please login to merge, or discard this patch.
classes/models/FrmForm.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 			}
210 210
 
211 211
 			if ( $new_val !== $value ) {
212
-				$new_values[ $key ] = $new_val;
212
+				$new_values[$key] = $new_val;
213 213
 			}
214 214
 		}
215 215
 
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 
241 241
 		foreach ( $values as $value_key => $value ) {
242 242
 			if ( $value_key && in_array( $value_key, $form_fields ) ) {
243
-				$new_values[ $value_key ] = $value;
243
+				$new_values[$value_key] = $value;
244 244
 			}
245 245
 		}
246 246
 
@@ -323,15 +323,15 @@  discard block
 block discarded – undo
323 323
 		$existing_keys = array_keys( $values['item_meta'] );
324 324
 		foreach ( $all_fields as $fid ) {
325 325
 			if ( ! in_array( $fid->id, $existing_keys ) && ( isset( $values['frm_fields_submitted'] ) && in_array( $fid->id, $values['frm_fields_submitted'] ) ) || isset( $values['options'] ) ) {
326
-				$values['item_meta'][ $fid->id ] = '';
326
+				$values['item_meta'][$fid->id] = '';
327 327
 			}
328
-			$field_array[ $fid->id ] = $fid;
328
+			$field_array[$fid->id] = $fid;
329 329
 		}
330 330
 		unset( $all_fields );
331 331
 
332 332
 		foreach ( $values['item_meta'] as $field_id => $default_value ) {
333
-			if ( isset( $field_array[ $field_id ] ) ) {
334
-				$field = $field_array[ $field_id ];
333
+			if ( isset( $field_array[$field_id] ) ) {
334
+				$field = $field_array[$field_id];
335 335
 			} else {
336 336
 				$field = FrmField::getOne( $field_id );
337 337
 			}
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 				continue;
341 341
 			}
342 342
 
343
-			$is_settings_page = ( isset( $values['options'] ) || isset( $values['field_options'][ 'custom_html_' . $field_id ] ) );
343
+			$is_settings_page = ( isset( $values['options'] ) || isset( $values['field_options']['custom_html_' . $field_id] ) );
344 344
 			if ( $is_settings_page ) {
345 345
 				self::get_settings_page_html( $values, $field );
346 346
 
@@ -355,22 +355,22 @@  discard block
 block discarded – undo
355 355
 			$update_options = apply_filters( 'frm_field_options_to_update', $update_options );
356 356
 
357 357
 			foreach ( $update_options as $opt => $default ) {
358
-				$field->field_options[ $opt ] = isset( $values['field_options'][ $opt . '_' . $field_id ] ) ? $values['field_options'][ $opt . '_' . $field_id ] : $default;
359
-				self::sanitize_field_opt( $opt, $field->field_options[ $opt ] );
358
+				$field->field_options[$opt] = isset( $values['field_options'][$opt . '_' . $field_id] ) ? $values['field_options'][$opt . '_' . $field_id] : $default;
359
+				self::sanitize_field_opt( $opt, $field->field_options[$opt] );
360 360
 			}
361 361
 
362 362
 			$field->field_options = apply_filters( 'frm_update_field_options', $field->field_options, $field, $values );
363 363
 
364 364
 			$new_field = array(
365 365
 				'field_options' => $field->field_options,
366
-				'default_value' => isset( $values[ 'default_value_' . $field_id ] ) ? FrmAppHelper::maybe_json_encode( $values[ 'default_value_' . $field_id ] ) : '',
366
+				'default_value' => isset( $values['default_value_' . $field_id] ) ? FrmAppHelper::maybe_json_encode( $values['default_value_' . $field_id] ) : '',
367 367
 			);
368 368
 
369
-			if ( ! FrmAppHelper::allow_unfiltered_html() && isset( $values['field_options'][ 'options_' . $field_id ] ) && is_array( $values['field_options'][ 'options_' . $field_id ] ) ) {
370
-				foreach ( $values['field_options'][ 'options_' . $field_id ] as $option_key => $option ) {
369
+			if ( ! FrmAppHelper::allow_unfiltered_html() && isset( $values['field_options']['options_' . $field_id] ) && is_array( $values['field_options']['options_' . $field_id] ) ) {
370
+				foreach ( $values['field_options']['options_' . $field_id] as $option_key => $option ) {
371 371
 					if ( is_array( $option ) ) {
372 372
 						foreach ( $option as $key => $item ) {
373
-							$values['field_options'][ 'options_' . $field_id ][ $option_key ][ $key ] = FrmAppHelper::kses( $item, 'all' );
373
+							$values['field_options']['options_' . $field_id][$option_key][$key] = FrmAppHelper::kses( $item, 'all' );
374 374
 						}
375 375
 					}
376 376
 				}
@@ -400,8 +400,8 @@  discard block
 block discarded – undo
400 400
 	 */
401 401
 	private static function maybe_update_max_option( $field, $values, &$new_field ) {
402 402
 		if ( $field->type === 'textarea' &&
403
-			! empty( $values['field_options'][ 'type_' . $field->id ] ) &&
404
-			in_array( $values['field_options'][ 'type_' . $field->id ], array( 'text', 'email', 'url', 'password', 'phone' ), true ) ) {
403
+			! empty( $values['field_options']['type_' . $field->id] ) &&
404
+			in_array( $values['field_options']['type_' . $field->id], array( 'text', 'email', 'url', 'password', 'phone' ), true ) ) {
405 405
 
406 406
 			$new_field['field_options']['max'] = '';
407 407
 
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
 			 * Update posted field setting so that new 'max' option is displayed after form is saved and page reloads.
410 410
 			 * FrmFieldsHelper::fill_default_field_opts populates field options by calling self::get_posted_field_setting.
411 411
 			 */
412
-			$_POST['field_options'][ 'max_' . $field->id ] = '';
412
+			$_POST['field_options']['max_' . $field->id] = '';
413 413
 		}
414 414
 	}
415 415
 
@@ -484,11 +484,11 @@  discard block
 block discarded – undo
484 484
 	 * Updating the settings page
485 485
 	 */
486 486
 	private static function get_settings_page_html( $values, &$field ) {
487
-		if ( isset( $values['field_options'][ 'custom_html_' . $field->id ] ) ) {
487
+		if ( isset( $values['field_options']['custom_html_' . $field->id] ) ) {
488 488
 			$prev_opts     = array();
489 489
 			$fallback_html = isset( $field->field_options['custom_html'] ) ? $field->field_options['custom_html'] : FrmFieldsHelper::get_default_html( $field->type );
490 490
 
491
-			$field->field_options['custom_html'] = isset( $values['field_options'][ 'custom_html_' . $field->id ] ) ? $values['field_options'][ 'custom_html_' . $field->id ] : $fallback_html;
491
+			$field->field_options['custom_html'] = isset( $values['field_options']['custom_html_' . $field->id] ) ? $values['field_options']['custom_html_' . $field->id] : $fallback_html;
492 492
 		} elseif ( $field->type == 'hidden' || $field->type == 'user_id' ) {
493 493
 			$prev_opts = $field->field_options;
494 494
 		}
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
 		foreach ( $field_cols as $col => $default ) {
515 515
 			$default = ( $default === '' ) ? $field->{$col} : $default;
516 516
 
517
-			$new_field[ $col ] = isset( $values['field_options'][ $col . '_' . $field->id ] ) ? $values['field_options'][ $col . '_' . $field->id ] : $default;
517
+			$new_field[$col] = isset( $values['field_options'][$col . '_' . $field->id] ) ? $values['field_options'][$col . '_' . $field->id] : $default;
518 518
 		}
519 519
 
520 520
 		// Don't save the template option.
@@ -938,8 +938,8 @@  discard block
 block discarded – undo
938 938
 			self::maybe_get_form( $form );
939 939
 		}
940 940
 
941
-		if ( isset( $frm_vars['form_params'] ) && is_array( $frm_vars['form_params'] ) && isset( $frm_vars['form_params'][ $form->id ] ) ) {
942
-			return $frm_vars['form_params'][ $form->id ];
941
+		if ( isset( $frm_vars['form_params'] ) && is_array( $frm_vars['form_params'] ) && isset( $frm_vars['form_params'][$form->id] ) ) {
942
+			return $frm_vars['form_params'][$form->id];
943 943
 		}
944 944
 
945 945
 		$action_var = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action'; // phpcs:ignore WordPress.Security.NonceVerification.Missing
@@ -968,15 +968,15 @@  discard block
 block discarded – undo
968 968
 			//if there are two forms on the same page, make sure not to submit both
969 969
 			foreach ( $default_values as $var => $default ) {
970 970
 				if ( $var == 'action' ) {
971
-					$values[ $var ] = FrmAppHelper::get_param( $action_var, $default, 'get', 'sanitize_title' );
971
+					$values[$var] = FrmAppHelper::get_param( $action_var, $default, 'get', 'sanitize_title' );
972 972
 				} else {
973
-					$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
973
+					$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
974 974
 				}
975 975
 				unset( $var, $default );
976 976
 			}
977 977
 		} else {
978 978
 			foreach ( $default_values as $var => $default ) {
979
-				$values[ $var ] = $default;
979
+				$values[$var] = $default;
980 980
 				unset( $var, $default );
981 981
 			}
982 982
 		}
@@ -1002,7 +1002,7 @@  discard block
 block discarded – undo
1002 1002
 			'sdir'     => '',
1003 1003
 		);
1004 1004
 		foreach ( $defaults as $var => $default ) {
1005
-			$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
1005
+			$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
1006 1006
 		}
1007 1007
 
1008 1008
 		return $values;
@@ -1030,7 +1030,7 @@  discard block
 block discarded – undo
1030 1030
 			'keep_post' => '',
1031 1031
 		);
1032 1032
 		foreach ( $defaults as $var => $default ) {
1033
-			$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
1033
+			$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
1034 1034
 		}
1035 1035
 
1036 1036
 		return $values;
@@ -1133,7 +1133,7 @@  discard block
 block discarded – undo
1133 1133
 		$form = $atts['form'];
1134 1134
 		$default = isset( $atts['default'] ) ? $atts['default'] : '';
1135 1135
 
1136
-		return isset( $form->options[ $atts['option'] ] ) ? $form->options[ $atts['option'] ] : $default;
1136
+		return isset( $form->options[$atts['option']] ) ? $form->options[$atts['option']] : $default;
1137 1137
 	}
1138 1138
 
1139 1139
 	/**
Please login to merge, or discard this patch.
classes/views/dashboard/templates/counters.php 1 patch
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,20 +15,26 @@
 block discarded – undo
15 15
 				<h4><?php echo esc_html( $counter['heading'] ); ?></h4>
16 16
 				<?php if ( isset( $counter['cta'] ) && isset( $counter['cta']['display'] ) && true === $counter['cta']['display'] ) : ?>
17 17
 					<a href="<?php echo esc_url( $counter['cta']['link'] ); ?>"><?php echo esc_attr( $counter['cta']['title'] ); ?></a>
18
-				<?php else : ?>
18
+				<?php else {
19
+	: ?>
19 20
 					<?php if ( 'currency' === $counter['type'] ) : ?>
20 21
 						<div class="frm-flex-box frm-gap-md">
21 22
 							<?php foreach ( $counter['items'] as $item ) : ?>
22 23
 								<b>
23
-									<?php echo esc_attr( $item['counter_label']['symbol_left'] ); ?>
24
+									<?php echo esc_attr( $item['counter_label']['symbol_left'] );
25
+}
26
+?>
24 27
 									<span class="frm-counter" data-type="<?php echo esc_attr( $counter['type'] ); ?>" data-locale="<?php echo esc_attr( get_locale() ); ?>" data-counter="<?php echo (int) $item['counter']; ?>"><?php echo (int) $item['counter']; ?></span>
25 28
 									<?php echo esc_attr( $item['counter_label']['symbol_right'] ); ?>
26 29
 								</b>
27 30
 							<?php endforeach; ?>
28 31
 						</div>
29
-					<?php else : ?>
32
+					<?php else {
33
+	: ?>
30 34
 						<b>
31
-							<span class="frm-counter" data-type="<?php echo esc_attr( $counter['type'] ); ?>" data-locale="<?php echo esc_attr( get_locale() ); ?>" data-counter="<?php echo (int) $counter['counter']; ?>"><?php echo (int) $counter['counter']; ?></span>
35
+							<span class="frm-counter" data-type="<?php echo esc_attr( $counter['type'] );
36
+}
37
+?>" data-locale="<?php echo esc_attr( get_locale() ); ?>" data-counter="<?php echo (int) $counter['counter']; ?>"><?php echo (int) $counter['counter']; ?></span>
32 38
 						</b>
33 39
 					<?php endif; ?>
34 40
 				<?php endif; ?>
Please login to merge, or discard this patch.
classes/helpers/FrmFormsHelper.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 			'class'        => '',
29 29
 			'inc_children' => 'exclude',
30 30
 		);
31
-		$args     = wp_parse_args( $args, $defaults );
31
+		$args = wp_parse_args( $args, $defaults );
32 32
 
33 33
 		if ( ! $args['field_id'] ) {
34 34
 			$args['field_id'] = $field_name;
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	 */
71 71
 	public static function add_html_attr( $class, $param, &$add_html ) {
72 72
 		if ( ! empty( $class ) ) {
73
-			$add_html[ $param ] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"';
73
+			$add_html[$param] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"';
74 74
 		}
75 75
 	}
76 76
 
@@ -293,8 +293,8 @@  discard block
 block discarded – undo
293 293
 			'description' => '',
294 294
 		);
295 295
 		foreach ( $defaults as $var => $default ) {
296
-			if ( ! isset( $values[ $var ] ) ) {
297
-				$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
296
+			if ( ! isset( $values[$var] ) ) {
297
+				$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
298 298
 			}
299 299
 		}
300 300
 
@@ -309,8 +309,8 @@  discard block
 block discarded – undo
309 309
 			'parent_form_id' => 0,
310 310
 		);
311 311
 		foreach ( $defaults as $var => $default ) {
312
-			if ( ! isset( $values[ $var ] ) ) {
313
-				$values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
312
+			if ( ! isset( $values[$var] ) ) {
313
+				$values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' );
314 314
 			}
315 315
 		}
316 316
 		unset( $defaults );
@@ -347,16 +347,16 @@  discard block
 block discarded – undo
347 347
 		$defaults = self::get_default_opts();
348 348
 		foreach ( $defaults as $var => $default ) {
349 349
 			if ( is_array( $default ) ) {
350
-				if ( ! isset( $values[ $var ] ) ) {
351
-					$values[ $var ] = ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : array();
350
+				if ( ! isset( $values[$var] ) ) {
351
+					$values[$var] = ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : array();
352 352
 				}
353 353
 
354 354
 				foreach ( $default as $k => $v ) {
355
-					$values[ $var ][ $k ] = ( $post_values && isset( $post_values[ $var ][ $k ] ) ) ? $post_values[ $var ][ $k ] : ( ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) ) ? $record->options[ $var ][ $k ] : $v );
355
+					$values[$var][$k] = ( $post_values && isset( $post_values[$var][$k] ) ) ? $post_values[$var][$k] : ( ( $record && isset( $record->options[$var] ) && isset( $record->options[$var][$k] ) ) ? $record->options[$var][$k] : $v );
356 356
 
357 357
 					if ( is_array( $v ) ) {
358 358
 						foreach ( $v as $k1 => $v1 ) {
359
-							$values[ $var ][ $k ][ $k1 ] = ( $post_values && isset( $post_values[ $var ][ $k ][ $k1 ] ) ) ? $post_values[ $var ][ $k ][ $k1 ] : ( ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) && isset( $record->options[ $var ][ $k ][ $k1 ] ) ) ? $record->options[ $var ][ $k ][ $k1 ] : $v1 );
359
+							$values[$var][$k][$k1] = ( $post_values && isset( $post_values[$var][$k][$k1] ) ) ? $post_values[$var][$k][$k1] : ( ( $record && isset( $record->options[$var] ) && isset( $record->options[$var][$k] ) && isset( $record->options[$var][$k][$k1] ) ) ? $record->options[$var][$k][$k1] : $v1 );
360 360
 							unset( $k1, $v1 );
361 361
 						}
362 362
 					}
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 					unset( $k, $v );
365 365
 				}
366 366
 			} else {
367
-				$values[ $var ] = ( $post_values && isset( $post_values['options'][ $var ] ) ) ? $post_values['options'][ $var ] : ( ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : $default );
367
+				$values[$var] = ( $post_values && isset( $post_values['options'][$var] ) ) ? $post_values['options'][$var] : ( ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : $default );
368 368
 			}
369 369
 
370 370
 			unset( $var, $default );
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 	public static function fill_form_options( &$options, $values ) {
411 411
 		$defaults = self::get_default_opts();
412 412
 		foreach ( $defaults as $var => $default ) {
413
-			$options[ $var ] = isset( $values['options'][ $var ] ) ? $values['options'][ $var ] : $default;
413
+			$options[$var] = isset( $values['options'][$var] ) ? $values['options'][$var] : $default;
414 414
 			unset( $var, $default );
415 415
 		}
416 416
 	}
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
 	public static function insert_opt_html( $args ) {
586 586
 		$class  = isset( $args['class'] ) ? $args['class'] : '';
587 587
 		$fields = FrmField::all_field_selection();
588
-		$field  = isset( $fields[ $args['type'] ] ) ? $fields[ $args['type'] ] : array();
588
+		$field  = isset( $fields[$args['type']] ) ? $fields[$args['type']] : array();
589 589
 
590 590
 		self::prepare_field_type( $field );
591 591
 
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
 			FrmField::update( $field->id, array( 'field_order' => $field->field_order + 2 ) );
742 742
 		}
743 743
 
744
-		$add_order    += 2;
744
+		$add_order += 2;
745 745
 		$open         = false;
746 746
 		$reset_fields = true;
747 747
 	}
@@ -1148,10 +1148,10 @@  discard block
 block discarded – undo
1148 1148
 				$link .= ' onclick="return confirm(\'' . esc_attr( $link_details['confirm'] ) . '\')"';
1149 1149
 			}
1150 1150
 
1151
-			$label = ( isset( $link_details[ $length ] ) ? $link_details[ $length ] : $link_details['label'] );
1152
-			if ( $length == 'icon' && isset( $link_details[ $length ] ) ) {
1151
+			$label = ( isset( $link_details[$length] ) ? $link_details[$length] : $link_details['label'] );
1152
+			if ( $length == 'icon' && isset( $link_details[$length] ) ) {
1153 1153
 				$label = '<span class="' . $label . '" title="' . esc_attr( $link_details['label'] ) . '" aria-hidden="true"></span>';
1154
-				$link  .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"';
1154
+				$link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"';
1155 1155
 			}
1156 1156
 
1157 1157
 			$link .= '>' . $label . '</a>';
@@ -1296,7 +1296,7 @@  discard block
 block discarded – undo
1296 1296
 			$status = 'publish';
1297 1297
 		}
1298 1298
 
1299
-		$name = $nice_names[ $status ];
1299
+		$name = $nice_names[$status];
1300 1300
 
1301 1301
 		return $name;
1302 1302
 	}
@@ -1360,7 +1360,7 @@  discard block
 block discarded – undo
1360 1360
 		$icon = $icons[''];
1361 1361
 		if ( count( $categories ) === 1 ) {
1362 1362
 			$category = reset( $categories );
1363
-			$icon     = isset( $icons[ $category ] ) ? $icons[ $category ] : $icon;
1363
+			$icon     = isset( $icons[$category] ) ? $icons[$category] : $icon;
1364 1364
 		} elseif ( ! empty( $categories ) ) {
1365 1365
 			$icons = array_intersect_key( $icons, array_flip( $categories ) );
1366 1366
 			$icon = reset( $icons );
@@ -1498,7 +1498,7 @@  discard block
 block discarded – undo
1498 1498
 
1499 1499
 		foreach ( $item['categories'] as $k => $category ) {
1500 1500
 			if ( in_array( $category, $plans, true ) ) {
1501
-				unset( $item['categories'][ $k ] );
1501
+				unset( $item['categories'][$k] );
1502 1502
 
1503 1503
 				if ( in_array( $category, array( 'Creator', 'Personal' ), true ) ) {
1504 1504
 					// Show the current package name.
@@ -1700,9 +1700,9 @@  discard block
 block discarded – undo
1700 1700
 		}
1701 1701
 
1702 1702
 		foreach ( $shortcodes[0] as $key => $shortcode ) {
1703
-			$options = trim( $shortcodes[3][ $key ] );
1703
+			$options = trim( $shortcodes[3][$key] );
1704 1704
 
1705
-			if ( in_array( $shortcodes[1][ $key ], array( 'if ' ), true ) ) {
1705
+			if ( in_array( $shortcodes[1][$key], array( 'if ' ), true ) ) {
1706 1706
 				// Skip if shortcodes.
1707 1707
 				continue;
1708 1708
 			}
@@ -1712,7 +1712,7 @@  discard block
 block discarded – undo
1712 1712
 				continue;
1713 1713
 			}
1714 1714
 
1715
-			$new_shortcode = '[' . $shortcodes[2][ $key ];
1715
+			$new_shortcode = '[' . $shortcodes[2][$key];
1716 1716
 			if ( $options ) {
1717 1717
 				$new_shortcode .= ' ' . $options;
1718 1718
 			}
Please login to merge, or discard this patch.