Completed
Pull Request — master (#1304)
by Stephanie
46s
created
classes/models/FrmEntryShortcodeFormatter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -285,7 +285,7 @@
 block discarded – undo
285 285
 			'type'  => $field->type,
286 286
 		);
287 287
 
288
-		$this->array_content[ $field->id ] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $array, $field );
288
+		$this->array_content[$field->id] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $array, $field );
289 289
 	}
290 290
 
291 291
 	/**
Please login to merge, or discard this patch.
classes/models/FrmInstallerSkin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 	 */
22 22
 	public function set_upgrader( &$upgrader ) {
23 23
 		if ( is_object( $upgrader ) ) {
24
-			$this->upgrader =& $upgrader;
24
+			$this->upgrader = & $upgrader;
25 25
 		}
26 26
 	}
27 27
 
Please login to merge, or discard this patch.
classes/models/fields/FrmFieldEmail.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 	public function validate( $args ) {
37 37
 		$errors = array();
38 38
 		if ( $args['value'] != '' && ! is_email( $args['value'] ) ) {
39
-			$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' );
39
+			$errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' );
40 40
 		}
41 41
 
42 42
 		return $errors;
Please login to merge, or discard this patch.
classes/models/fields/FrmFieldUrl.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 			'sep'  => ', ',
40 40
 			'html' => false,
41 41
 		);
42
-		$atts     = wp_parse_args( $atts, $defaults );
42
+		$atts = wp_parse_args( $atts, $defaults );
43 43
 
44 44
 		if ( $atts['html'] ) {
45 45
 			$atts['sep'] = ' ';
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
 
62 62
 		// validate the url format
63 63
 		if ( ! empty( $value ) && ! preg_match( '/^http(s)?:\/\/(?:localhost|(?:[\da-z\.-]+\.[\da-z\.-]+))/i', $value ) ) {
64
-			$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' );
64
+			$errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' );
65 65
 		} elseif ( $this->field->required == '1' && empty( $value ) ) {
66
-			$errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'blank' );
66
+			$errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'blank' );
67 67
 		}
68 68
 
69 69
 		return $errors;
Please login to merge, or discard this patch.
classes/models/FrmAddon.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	}
42 42
 
43 43
 	public function insert_installed_addon( $plugins ) {
44
-		$plugins[ $this->plugin_slug ] = $this;
44
+		$plugins[$this->plugin_slug] = $this;
45 45
 
46 46
 		return $plugins;
47 47
 	}
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 	public static function get_addon( $plugin_slug ) {
50 50
 		$plugins = apply_filters( 'frm_installed_addons', array() );
51 51
 		$plugin  = false;
52
-		if ( isset( $plugins[ $plugin_slug ] ) ) {
53
-			$plugin = $plugins[ $plugin_slug ];
52
+		if ( isset( $plugins[$plugin_slug] ) ) {
53
+			$plugin = $plugins[$plugin_slug];
54 54
 		}
55 55
 
56 56
 		return $plugin;
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 		} else {
110 110
 			$api     = new FrmFormApi( $this->license );
111 111
 			$plugins = $api->get_api_info();
112
-			$_data   = $plugins[ $item_id ];
112
+			$_data   = $plugins[$item_id];
113 113
 		}
114 114
 
115 115
 		$_data['sections'] = array(
@@ -301,19 +301,19 @@  discard block
 block discarded – undo
301 301
 
302 302
 		if ( $this->is_current_version( $transient ) ) {
303 303
 			//make sure it doesn't show there is an update if plugin is up-to-date
304
-			if ( isset( $transient->response[ $this->plugin_folder ] ) ) {
305
-				unset( $transient->response[ $this->plugin_folder ] );
304
+			if ( isset( $transient->response[$this->plugin_folder] ) ) {
305
+				unset( $transient->response[$this->plugin_folder] );
306 306
 			}
307
-		} elseif ( isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) ) {
308
-			$this->prepare_update_details( $transient->response[ $this->plugin_folder ] );
307
+		} elseif ( isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) ) {
308
+			$this->prepare_update_details( $transient->response[$this->plugin_folder] );
309 309
 
310 310
 			// if the transient has expired, clear the update and trigger it again
311
-			if ( $transient->response[ $this->plugin_folder ] === false ) {
311
+			if ( $transient->response[$this->plugin_folder] === false ) {
312 312
 				if ( ! $this->has_been_cleared() ) {
313 313
 					$this->cleared_plugins();
314 314
 					$this->manually_queue_update();
315 315
 				}
316
-				unset( $transient->response[ $this->plugin_folder ] );
316
+				unset( $transient->response[$this->plugin_folder] );
317 317
 			}
318 318
 		}
319 319
 
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 	}
402 402
 
403 403
 	private function is_current_version( $transient ) {
404
-		if ( empty( $transient->checked ) || ! isset( $transient->checked[ $this->plugin_folder ] ) ) {
404
+		if ( empty( $transient->checked ) || ! isset( $transient->checked[$this->plugin_folder] ) ) {
405 405
 			return false;
406 406
 		}
407 407
 
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 			return true;
411 411
 		}
412 412
 
413
-		return isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) && $transient->checked[ $this->plugin_folder ] === $transient->response[ $this->plugin_folder ]->new_version;
413
+		return isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) && $transient->checked[$this->plugin_folder] === $transient->response[$this->plugin_folder]->new_version;
414 414
 	}
415 415
 
416 416
 	private function has_been_cleared() {
@@ -491,8 +491,8 @@  discard block
 block discarded – undo
491 491
 			$response['message'] = $response['status'];
492 492
 		} else {
493 493
 			$messages = $this->get_messages();
494
-			if ( is_string( $response['status'] ) && isset( $messages[ $response['status'] ] ) ) {
495
-				$response['message'] = $messages[ $response['status'] ];
494
+			if ( is_string( $response['status'] ) && isset( $messages[$response['status']] ) ) {
495
+				$response['message'] = $messages[$response['status']];
496 496
 			} else {
497 497
 				$response['message'] = FrmAppHelper::kses( $response['status'], array( 'a' ) );
498 498
 			}
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -367,7 +367,8 @@  discard block
 block discarded – undo
367 367
 
368 368
 		if ( isset( $version_info->new_version ) && ! empty( $version_info->new_version ) ) {
369 369
 			$this->clear_old_plugin_version( $version_info );
370
-			if ( $version_info === false ) { // was cleared with timeout
370
+			if ( $version_info === false ) {
371
+// was cleared with timeout
371 372
 				$transient = false;
372 373
 			} else {
373 374
 				$this->maybe_use_beta_url( $version_info );
@@ -455,7 +456,8 @@  discard block
 block discarded – undo
455 456
 	}
456 457
 
457 458
 	private function is_license_revoked() {
458
-		if ( empty( $this->license ) || empty( $this->plugin_slug ) || isset( $_POST['license'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
459
+		if ( empty( $this->license ) || empty( $this->plugin_slug ) || isset( $_POST['license'] ) ) {
460
+// phpcs:ignore WordPress.Security.NonceVerification.Missing
459 461
 			return;
460 462
 		}
461 463
 
Please login to merge, or discard this patch.
classes/models/FrmSettings.php 2 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,7 +56,8 @@  discard block
 block discarded – undo
56 56
 	}
57 57
 
58 58
 	private function translate_settings( $settings ) {
59
-		if ( $settings ) { //workaround for W3 total cache conflict
59
+		if ( $settings ) {
60
+//workaround for W3 total cache conflict
60 61
 			return unserialize( serialize( $settings ) );
61 62
 		}
62 63
 
@@ -68,7 +69,8 @@  discard block
 block discarded – undo
68 69
 		}
69 70
 
70 71
 		// If unserializing didn't work
71
-		if ( $settings ) { //workaround for W3 total cache conflict
72
+		if ( $settings ) {
73
+//workaround for W3 total cache conflict
72 74
 			$settings = unserialize( serialize( $settings ) );
73 75
 		} else {
74 76
 			$settings = $this;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
 		}
188 188
 
189 189
 		foreach ( $settings as $setting => $default ) {
190
-			if ( isset( $params[ 'frm_' . $setting ] ) ) {
191
-				$this->{$setting} = $params[ 'frm_' . $setting ];
190
+			if ( isset( $params['frm_' . $setting] ) ) {
191
+				$this->{$setting} = $params['frm_' . $setting];
192 192
 			} elseif ( ! isset( $this->{$setting} ) ) {
193 193
 				$this->{$setting} = $default;
194 194
 			}
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 
357 357
 		$checkboxes = array( 'mu_menu', 're_multi', 'use_html', 'jquery_css', 'accordion_js', 'fade_form', 'no_ips', 'custom_header_ip', 'tracking', 'admin_bar', 'summary_emails' );
358 358
 		foreach ( $checkboxes as $set ) {
359
-			$this->$set = isset( $params[ 'frm_' . $set ] ) ? absint( $params[ 'frm_' . $set ] ) : 0;
359
+			$this->$set = isset( $params['frm_' . $set] ) ? absint( $params['frm_' . $set] ) : 0;
360 360
 		}
361 361
 	}
362 362
 
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 		$frm_roles = FrmAppHelper::frm_capabilities();
370 370
 		$roles     = get_editable_roles();
371 371
 		foreach ( $frm_roles as $frm_role => $frm_role_description ) {
372
-			$this->$frm_role = (array) ( isset( $params[ $frm_role ] ) ? $params[ $frm_role ] : 'administrator' );
372
+			$this->$frm_role = (array) ( isset( $params[$frm_role] ) ? $params[$frm_role] : 'administrator' );
373 373
 
374 374
 			// Make sure administrators always have permissions
375 375
 			if ( ! in_array( 'administrator', $this->$frm_role ) ) {
Please login to merge, or discard this patch.
classes/models/FrmCreateFile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@
 block discarded – undo
146 146
 
147 147
 		$next_dir = '';
148 148
 		foreach ( $dir_names as $dir ) {
149
-			$next_dir      .= '/' . $dir;
149
+			$next_dir .= '/' . $dir;
150 150
 			$needed_dirs[] = $this->uploads['basedir'] . $next_dir;
151 151
 		}
152 152
 
Please login to merge, or discard this patch.
classes/models/FrmFieldValue.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,8 +59,8 @@
 block discarded – undo
59 59
 	protected function init_saved_value( $entry ) {
60 60
 		if ( $this->field->type === 'html' ) {
61 61
 			$this->saved_value = $this->field->description;
62
-		} elseif ( isset( $entry->metas[ $this->field->id ] ) ) {
63
-			$this->saved_value = $entry->metas[ $this->field->id ];
62
+		} elseif ( isset( $entry->metas[$this->field->id] ) ) {
63
+			$this->saved_value = $entry->metas[$this->field->id];
64 64
 		} else {
65 65
 			$this->saved_value = '';
66 66
 		}
Please login to merge, or discard this patch.
classes/views/frm-form-actions/_action_inside.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 	$event_labels = FrmFormAction::trigger_labels();
37 37
 	foreach ( $action_control->action_options['event'] as $event ) {
38 38
 		?>
39
-		<option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( isset( $event_labels[ $event ] ) ? $event_labels[ $event ] : $event ); ?></option>
39
+		<option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( isset( $event_labels[$event] ) ? $event_labels[$event] : $event ); ?></option>
40 40
 <?php } ?>
41 41
 		</select>
42 42
 	</p>
Please login to merge, or discard this patch.