@@ -114,13 +114,16 @@ discard block |
||
114 | 114 | */ |
115 | 115 | public static function value_is_posted( $field, $args ) { |
116 | 116 | $value_is_posted = false; |
117 | - if ( $_POST ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
117 | + if ( $_POST ) { |
|
118 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
118 | 119 | $repeating = isset( $args['repeating'] ) && $args['repeating']; |
119 | 120 | if ( $repeating ) { |
120 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
121 | + if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { |
|
122 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
121 | 123 | $value_is_posted = true; |
122 | 124 | } |
123 | - } elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
125 | + } elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { |
|
126 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
124 | 127 | $value_is_posted = true; |
125 | 128 | } |
126 | 129 | } |
@@ -322,8 +325,10 @@ discard block |
||
322 | 325 | * @since 4.01 |
323 | 326 | */ |
324 | 327 | private static function set_parent_field_posted_value( $field, $value, $args ) { |
325 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
326 | - if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
328 | + if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { |
|
329 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
330 | + if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) { |
|
331 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
327 | 332 | $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
328 | 333 | } |
329 | 334 | } else { |
@@ -395,7 +400,8 @@ discard block |
||
395 | 400 | self::set_other_repeating_vals( $field, $value, $args ); |
396 | 401 | |
397 | 402 | // Check if there are any posted "Other" values. |
398 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
403 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { |
|
404 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
399 | 405 | |
400 | 406 | // Save original value. |
401 | 407 | $args['temp_value'] = $value; |
@@ -425,7 +431,8 @@ discard block |
||
425 | 431 | } |
426 | 432 | |
427 | 433 | // Check if there are any other posted "other" values for this field. |
428 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
434 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { |
|
435 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
429 | 436 | // Save original value |
430 | 437 | $args['temp_value'] = $value; |
431 | 438 | $args['other'] = true; |
@@ -117,10 +117,10 @@ discard block |
||
117 | 117 | if ( $_POST ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
118 | 118 | $repeating = isset( $args['repeating'] ) && $args['repeating']; |
119 | 119 | if ( $repeating ) { |
120 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
120 | + if ( isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
121 | 121 | $value_is_posted = true; |
122 | 122 | } |
123 | - } elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
123 | + } elseif ( isset( $_POST['item_meta'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
124 | 124 | $value_is_posted = true; |
125 | 125 | } |
126 | 126 | } |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | preg_match_all( "/\[(default-message|default_message)\b(.*?)(?:(\/))?\]/s", $message, $shortcodes, PREG_PATTERN_ORDER ); |
153 | 153 | |
154 | 154 | foreach ( $shortcodes[0] as $short_key => $tag ) { |
155 | - $add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] ); |
|
155 | + $add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] ); |
|
156 | 156 | if ( ! empty( $add_atts ) ) { |
157 | 157 | $this_atts = array_merge( $atts, $add_atts ); |
158 | 158 | } else { |
@@ -162,14 +162,14 @@ discard block |
||
162 | 162 | $default = FrmEntriesController::show_entry_shortcode( $this_atts ); |
163 | 163 | |
164 | 164 | // Add the default message. |
165 | - $message = str_replace( $shortcodes[0][ $short_key ], $default, $message ); |
|
165 | + $message = str_replace( $shortcodes[0][$short_key], $default, $message ); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | return $message; |
169 | 169 | } |
170 | 170 | |
171 | 171 | public static function prepare_display_value( $entry, $field, $atts ) { |
172 | - $field_value = isset( $entry->metas[ $field->id ] ) ? $entry->metas[ $field->id ] : false; |
|
172 | + $field_value = isset( $entry->metas[$field->id] ) ? $entry->metas[$field->id] : false; |
|
173 | 173 | |
174 | 174 | if ( FrmAppHelper::pro_is_installed() ) { |
175 | 175 | $empty = empty( $field_value ); |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | $child_entries = FrmEntry::getAll( array( 'it.parent_item_id' => $entry->id ) ); |
193 | 193 | } else { |
194 | 194 | // Get all values for this field. |
195 | - $child_values = isset( $entry->metas[ $atts['embedded_field_id'] ] ) ? $entry->metas[ $atts['embedded_field_id'] ] : false; |
|
195 | + $child_values = isset( $entry->metas[$atts['embedded_field_id']] ) ? $entry->metas[$atts['embedded_field_id']] : false; |
|
196 | 196 | |
197 | 197 | if ( $child_values ) { |
198 | 198 | $child_entries = FrmEntry::getAll( array( 'it.id' => (array) $child_values ) ); |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | $value = $args['temp_value']; |
311 | 311 | } |
312 | 312 | if ( empty( $args['parent_field_id'] ) ) { |
313 | - $_POST['item_meta'][ $field->id ] = $value; |
|
313 | + $_POST['item_meta'][$field->id] = $value; |
|
314 | 314 | } else { |
315 | 315 | self::set_parent_field_posted_value( $field, $value, $args ); |
316 | 316 | } |
@@ -322,17 +322,17 @@ discard block |
||
322 | 322 | * @since 4.01 |
323 | 323 | */ |
324 | 324 | private static function set_parent_field_posted_value( $field, $value, $args ) { |
325 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
326 | - if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
327 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
325 | + if ( isset( $_POST['item_meta'][$args['parent_field_id']] ) && is_array( $_POST['item_meta'][$args['parent_field_id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
326 | + if ( ! isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) || ! is_array( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
327 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
328 | 328 | } |
329 | 329 | } else { |
330 | 330 | // All of the section was probably removed. |
331 | - $_POST['item_meta'][ $args['parent_field_id'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
332 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
331 | + $_POST['item_meta'][$args['parent_field_id']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
332 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
333 | 333 | } |
334 | 334 | |
335 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
335 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
336 | 336 | } |
337 | 337 | |
338 | 338 | public static function get_posted_value( $field, &$value, $args ) { |
@@ -362,9 +362,9 @@ discard block |
||
362 | 362 | private static function get_posted_meta( $field_id, $args ) { |
363 | 363 | if ( empty( $args['parent_field_id'] ) ) { |
364 | 364 | // Sanitizing is done next. |
365 | - $value = isset( $_POST['item_meta'][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
365 | + $value = isset( $_POST['item_meta'][$field_id] ) ? wp_unslash( $_POST['item_meta'][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
366 | 366 | } else { |
367 | - $value = isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
367 | + $value = isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) ? wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
368 | 368 | } |
369 | 369 | return $value; |
370 | 370 | } |
@@ -395,14 +395,14 @@ discard block |
||
395 | 395 | self::set_other_repeating_vals( $field, $value, $args ); |
396 | 396 | |
397 | 397 | // Check if there are any posted "Other" values. |
398 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
398 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
399 | 399 | |
400 | 400 | // Save original value. |
401 | 401 | $args['temp_value'] = $value; |
402 | 402 | $args['other'] = true; |
403 | 403 | |
404 | 404 | // Sanitizing is done next. |
405 | - $other_vals = wp_unslash( $_POST['item_meta']['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
405 | + $other_vals = wp_unslash( $_POST['item_meta']['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
406 | 406 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals ); |
407 | 407 | |
408 | 408 | // Set the validation value now |
@@ -425,12 +425,12 @@ discard block |
||
425 | 425 | } |
426 | 426 | |
427 | 427 | // Check if there are any other posted "other" values for this field. |
428 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
428 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
429 | 429 | // Save original value |
430 | 430 | $args['temp_value'] = $value; |
431 | 431 | $args['other'] = true; |
432 | 432 | |
433 | - $other_vals = wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
433 | + $other_vals = wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
434 | 434 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals ); |
435 | 435 | |
436 | 436 | // Set the validation value now. |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | if ( is_array( $value ) && $field->type === 'checkbox' ) { |
458 | 458 | // Combine "Other" values with checked values. "Other" values will override checked box values. |
459 | 459 | foreach ( $other_vals as $k => $v ) { |
460 | - if ( isset( $value[ $k ] ) && trim( $v ) === '' ) { |
|
460 | + if ( isset( $value[$k] ) && trim( $v ) === '' ) { |
|
461 | 461 | // If the other box is checked, but doesn't have a value. |
462 | 462 | $value = ''; |
463 | 463 | break; |
@@ -474,25 +474,25 @@ discard block |
||
474 | 474 | |
475 | 475 | // Multi-select dropdown. |
476 | 476 | if ( is_array( $value ) ) { |
477 | - $o_key = array_search( $field->options[ $other_key ], $value ); |
|
477 | + $o_key = array_search( $field->options[$other_key], $value ); |
|
478 | 478 | |
479 | 479 | if ( $o_key !== false ) { |
480 | 480 | // Modify the original value so other key will be preserved. |
481 | - $value[ $other_key ] = $value[ $o_key ]; |
|
481 | + $value[$other_key] = $value[$o_key]; |
|
482 | 482 | |
483 | 483 | // By default, the array keys will be numeric for multi-select dropdowns. |
484 | 484 | // If going backwards and forwards between pages, the array key will match the other key. |
485 | 485 | if ( $o_key !== $other_key ) { |
486 | - unset( $value[ $o_key ] ); |
|
486 | + unset( $value[$o_key] ); |
|
487 | 487 | } |
488 | 488 | |
489 | 489 | $args['temp_value'] = $value; |
490 | - $value[ $other_key ] = reset( $other_vals ); |
|
491 | - if ( FrmAppHelper::is_empty_value( $value[ $other_key ] ) ) { |
|
492 | - unset( $value[ $other_key ] ); |
|
490 | + $value[$other_key] = reset( $other_vals ); |
|
491 | + if ( FrmAppHelper::is_empty_value( $value[$other_key] ) ) { |
|
492 | + unset( $value[$other_key] ); |
|
493 | 493 | } |
494 | 494 | } |
495 | - } elseif ( $field->options[ $other_key ] == $value ) { |
|
495 | + } elseif ( $field->options[$other_key] == $value ) { |
|
496 | 496 | $value = $other_vals; |
497 | 497 | } |
498 | 498 | } |
@@ -702,7 +702,7 @@ discard block |
||
702 | 702 | * @return void |
703 | 703 | */ |
704 | 704 | public static function maybe_render_captcha_score( $entry_id ) { |
705 | - $query = array( |
|
705 | + $query = array( |
|
706 | 706 | 'item_id' => (int) $entry_id, |
707 | 707 | 'field_id' => 0, |
708 | 708 | ); |
@@ -412,7 +412,8 @@ discard block |
||
412 | 412 | |
413 | 413 | if ( $src === 'get' ) { |
414 | 414 | $value = isset( $_POST[ $param ] ) ? wp_unslash( $_POST[ $param ] ) : ( isset( $_GET[ $param ] ) ? wp_unslash( $_GET[ $param ] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
415 | - if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
415 | + if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { |
|
416 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
416 | 417 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
417 | 418 | $value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) ); |
418 | 419 | } |
@@ -500,7 +501,8 @@ discard block |
||
500 | 501 | $value = wp_unslash( $_GET[ $args['param'] ] ); |
501 | 502 | } |
502 | 503 | } elseif ( $args['type'] == 'post' ) { |
503 | - if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
504 | + if ( isset( $_POST[ $args['param'] ] ) ) { |
|
505 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
504 | 506 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
505 | 507 | $value = wp_unslash( $_POST[ $args['param'] ] ); |
506 | 508 | if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) { |
@@ -508,7 +510,8 @@ discard block |
||
508 | 510 | } |
509 | 511 | } |
510 | 512 | } else { |
511 | - if ( isset( $_REQUEST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
513 | + if ( isset( $_REQUEST[ $args['param'] ] ) ) { |
|
514 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
512 | 515 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
513 | 516 | $value = wp_unslash( $_REQUEST[ $args['param'] ] ); |
514 | 517 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | 'fill' => '#4d4d4d', |
163 | 163 | 'orange' => '#f05a24', |
164 | 164 | ); |
165 | - $atts = array_merge( $defaults, $atts ); |
|
165 | + $atts = array_merge( $defaults, $atts ); |
|
166 | 166 | |
167 | 167 | return '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 599.68 601.37" width="' . esc_attr( $atts['width'] ) . '" height="' . esc_attr( $atts['height'] ) . '"> |
168 | 168 | <path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/> |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | * @return string |
374 | 374 | */ |
375 | 375 | public static function get_server_value( $value ) { |
376 | - return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : ''; |
|
376 | + return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : ''; |
|
377 | 377 | } |
378 | 378 | |
379 | 379 | /** |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | $ip = ''; |
388 | 388 | |
389 | 389 | foreach ( $ip_options as $key ) { |
390 | - if ( ! isset( $_SERVER[ $key ] ) ) { |
|
390 | + if ( ! isset( $_SERVER[$key] ) ) { |
|
391 | 391 | continue; |
392 | 392 | } |
393 | 393 | |
@@ -455,10 +455,10 @@ discard block |
||
455 | 455 | } |
456 | 456 | |
457 | 457 | if ( $src === 'get' ) { |
458 | - $value = isset( $_POST[ $param ] ) ? wp_unslash( $_POST[ $param ] ) : ( isset( $_GET[ $param ] ) ? wp_unslash( $_GET[ $param ] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
|
459 | - if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
458 | + $value = isset( $_POST[$param] ) ? wp_unslash( $_POST[$param] ) : ( isset( $_GET[$param] ) ? wp_unslash( $_GET[$param] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
|
459 | + if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
460 | 460 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
461 | - $value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) ); |
|
461 | + $value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) ); |
|
462 | 462 | } |
463 | 463 | self::sanitize_value( $sanitize, $value ); |
464 | 464 | } else { |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | } |
480 | 480 | |
481 | 481 | $p = trim( $p, ']' ); |
482 | - $value = isset( $value[ $p ] ) ? $value[ $p ] : $default; |
|
482 | + $value = isset( $value[$p] ) ? $value[$p] : $default; |
|
483 | 483 | } |
484 | 484 | } |
485 | 485 | |
@@ -535,26 +535,26 @@ discard block |
||
535 | 535 | 'sanitize' => 'sanitize_text_field', |
536 | 536 | 'serialized' => false, |
537 | 537 | ); |
538 | - $args = wp_parse_args( $args, $defaults ); |
|
538 | + $args = wp_parse_args( $args, $defaults ); |
|
539 | 539 | |
540 | 540 | $value = $args['default']; |
541 | 541 | if ( $args['type'] == 'get' ) { |
542 | - if ( $_GET && isset( $_GET[ $args['param'] ] ) ) { |
|
542 | + if ( $_GET && isset( $_GET[$args['param']] ) ) { |
|
543 | 543 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
544 | - $value = wp_unslash( $_GET[ $args['param'] ] ); |
|
544 | + $value = wp_unslash( $_GET[$args['param']] ); |
|
545 | 545 | } |
546 | 546 | } elseif ( $args['type'] == 'post' ) { |
547 | - if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
547 | + if ( isset( $_POST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
548 | 548 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
549 | - $value = wp_unslash( $_POST[ $args['param'] ] ); |
|
549 | + $value = wp_unslash( $_POST[$args['param']] ); |
|
550 | 550 | if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) { |
551 | 551 | self::unserialize_or_decode( $value ); |
552 | 552 | } |
553 | 553 | } |
554 | 554 | } else { |
555 | - if ( isset( $_REQUEST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
555 | + if ( isset( $_REQUEST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
556 | 556 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
557 | - $value = wp_unslash( $_REQUEST[ $args['param'] ] ); |
|
557 | + $value = wp_unslash( $_REQUEST[$args['param']] ); |
|
558 | 558 | } |
559 | 559 | } |
560 | 560 | |
@@ -586,7 +586,7 @@ discard block |
||
586 | 586 | if ( is_array( $value ) ) { |
587 | 587 | $temp_values = $value; |
588 | 588 | foreach ( $temp_values as $k => $v ) { |
589 | - self::sanitize_value( $sanitize, $value[ $k ] ); |
|
589 | + self::sanitize_value( $sanitize, $value[$k] ); |
|
590 | 590 | } |
591 | 591 | } else { |
592 | 592 | $value = call_user_func( $sanitize, $value ); |
@@ -597,8 +597,8 @@ discard block |
||
597 | 597 | public static function sanitize_request( $sanitize_method, &$values ) { |
598 | 598 | $temp_values = $values; |
599 | 599 | foreach ( $temp_values as $k => $val ) { |
600 | - if ( isset( $sanitize_method[ $k ] ) ) { |
|
601 | - $values[ $k ] = call_user_func( $sanitize_method[ $k ], $val ); |
|
600 | + if ( isset( $sanitize_method[$k] ) ) { |
|
601 | + $values[$k] = call_user_func( $sanitize_method[$k], $val ); |
|
602 | 602 | } |
603 | 603 | } |
604 | 604 | } |
@@ -621,7 +621,7 @@ discard block |
||
621 | 621 | if ( is_array( $value ) ) { |
622 | 622 | $temp_values = $value; |
623 | 623 | foreach ( $temp_values as $k => $v ) { |
624 | - self::decode_specialchars( $value[ $k ] ); |
|
624 | + self::decode_specialchars( $value[$k] ); |
|
625 | 625 | } |
626 | 626 | } else { |
627 | 627 | self::decode_amp( $value ); |
@@ -741,7 +741,7 @@ discard block |
||
741 | 741 | * @return array |
742 | 742 | */ |
743 | 743 | public static function add_allowed_submit_button_tags( $allowed_html ) { |
744 | - $allowed_html['input'] = array( |
|
744 | + $allowed_html['input'] = array( |
|
745 | 745 | 'type' => true, |
746 | 746 | 'value' => true, |
747 | 747 | 'formnovalidate' => true, |
@@ -764,7 +764,7 @@ discard block |
||
764 | 764 | $allowed_html = $html; |
765 | 765 | } elseif ( ! empty( $allowed ) ) { |
766 | 766 | foreach ( (array) $allowed as $a ) { |
767 | - $allowed_html[ $a ] = isset( $html[ $a ] ) ? $html[ $a ] : array(); |
|
767 | + $allowed_html[$a] = isset( $html[$a] ) ? $html[$a] : array(); |
|
768 | 768 | } |
769 | 769 | } |
770 | 770 | |
@@ -943,8 +943,8 @@ discard block |
||
943 | 943 | } |
944 | 944 | |
945 | 945 | global $wp_query; |
946 | - if ( isset( $wp_query->query_vars[ $param ] ) ) { |
|
947 | - $value = $wp_query->query_vars[ $param ]; |
|
946 | + if ( isset( $wp_query->query_vars[$param] ) ) { |
|
947 | + $value = $wp_query->query_vars[$param]; |
|
948 | 948 | } |
949 | 949 | |
950 | 950 | return $value; |
@@ -971,9 +971,9 @@ discard block |
||
971 | 971 | $deprecated = array( |
972 | 972 | 'frm_clone_solid_icon' => 'frm_clone_icon', |
973 | 973 | ); |
974 | - if ( isset( $deprecated[ $icon ] ) ) { |
|
975 | - $icon = $deprecated[ $icon ]; |
|
976 | - $class = str_replace( $icon, $deprecated[ $icon ], $class ); |
|
974 | + if ( isset( $deprecated[$icon] ) ) { |
|
975 | + $icon = $deprecated[$icon]; |
|
976 | + $class = str_replace( $icon, $deprecated[$icon], $class ); |
|
977 | 977 | } |
978 | 978 | |
979 | 979 | if ( $icon === $class ) { |
@@ -1296,7 +1296,7 @@ discard block |
||
1296 | 1296 | 'new_file_path' => self::plugin_path() . '/js', |
1297 | 1297 | ) |
1298 | 1298 | ); |
1299 | - $new_file = new FrmCreateFile( $file_atts ); |
|
1299 | + $new_file = new FrmCreateFile( $file_atts ); |
|
1300 | 1300 | |
1301 | 1301 | $files = array( |
1302 | 1302 | self::plugin_path() . '/js/formidable.min.js', |
@@ -1777,8 +1777,8 @@ discard block |
||
1777 | 1777 | return $error; |
1778 | 1778 | } |
1779 | 1779 | |
1780 | - $nonce_value = ( $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : ''; |
|
1781 | - if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
1780 | + $nonce_value = ( $_REQUEST && isset( $_REQUEST[$nonce_name] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : ''; |
|
1781 | + if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
1782 | 1782 | $frm_settings = self::get_settings(); |
1783 | 1783 | $error = $frm_settings->admin_permission; |
1784 | 1784 | } |
@@ -1813,7 +1813,7 @@ discard block |
||
1813 | 1813 | } else { |
1814 | 1814 | foreach ( $value as $k => $v ) { |
1815 | 1815 | if ( ! is_array( $v ) ) { |
1816 | - $value[ $k ] = call_user_func( $original_function, $v ); |
|
1816 | + $value[$k] = call_user_func( $original_function, $v ); |
|
1817 | 1817 | } |
1818 | 1818 | } |
1819 | 1819 | } |
@@ -1838,7 +1838,7 @@ discard block |
||
1838 | 1838 | $return = array_merge( $return, self::array_flatten( $value, $keys ) ); |
1839 | 1839 | } else { |
1840 | 1840 | if ( $keys == 'keep' ) { |
1841 | - $return[ $key ] = $value; |
|
1841 | + $return[$key] = $value; |
|
1842 | 1842 | } else { |
1843 | 1843 | $return[] = $value; |
1844 | 1844 | } |
@@ -1891,11 +1891,11 @@ discard block |
||
1891 | 1891 | } |
1892 | 1892 | |
1893 | 1893 | $ver = $default; |
1894 | - if ( ! isset( $wp_scripts->registered[ $handle ] ) ) { |
|
1894 | + if ( ! isset( $wp_scripts->registered[$handle] ) ) { |
|
1895 | 1895 | return $ver; |
1896 | 1896 | } |
1897 | 1897 | |
1898 | - $query = $wp_scripts->registered[ $handle ]; |
|
1898 | + $query = $wp_scripts->registered[$handle]; |
|
1899 | 1899 | if ( is_object( $query ) && ! empty( $query->ver ) ) { |
1900 | 1900 | $ver = $query->ver; |
1901 | 1901 | } |
@@ -2001,7 +2001,7 @@ discard block |
||
2001 | 2001 | $suffix = 2; |
2002 | 2002 | do { |
2003 | 2003 | $key_check = $key . $separator . $suffix; |
2004 | - ++$suffix; |
|
2004 | + ++ $suffix; |
|
2005 | 2005 | } while ( in_array( $key_check, $similar_keys, true ) ); |
2006 | 2006 | |
2007 | 2007 | $key = $key_check; |
@@ -2102,7 +2102,7 @@ discard block |
||
2102 | 2102 | |
2103 | 2103 | foreach ( array( 'name', 'description' ) as $var ) { |
2104 | 2104 | $default_val = isset( $record->{$var} ) ? $record->{$var} : ''; |
2105 | - $values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
2105 | + $values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
2106 | 2106 | unset( $var, $default_val ); |
2107 | 2107 | } |
2108 | 2108 | |
@@ -2160,9 +2160,9 @@ discard block |
||
2160 | 2160 | } |
2161 | 2161 | } |
2162 | 2162 | |
2163 | - $field_type = isset( $post_values['field_options'][ 'type_' . $field->id ] ) ? $post_values['field_options'][ 'type_' . $field->id ] : $field->type; |
|
2164 | - if ( isset( $post_values['item_meta'][ $field->id ] ) ) { |
|
2165 | - $new_value = $post_values['item_meta'][ $field->id ]; |
|
2163 | + $field_type = isset( $post_values['field_options']['type_' . $field->id] ) ? $post_values['field_options']['type_' . $field->id] : $field->type; |
|
2164 | + if ( isset( $post_values['item_meta'][$field->id] ) ) { |
|
2165 | + $new_value = $post_values['item_meta'][$field->id]; |
|
2166 | 2166 | self::unserialize_or_decode( $new_value ); |
2167 | 2167 | } else { |
2168 | 2168 | $new_value = $meta_value; |
@@ -2183,7 +2183,7 @@ discard block |
||
2183 | 2183 | |
2184 | 2184 | $field_array = array_merge( (array) $field->field_options, $field_array ); |
2185 | 2185 | |
2186 | - $values['fields'][ $field->id ] = $field_array; |
|
2186 | + $values['fields'][$field->id] = $field_array; |
|
2187 | 2187 | } |
2188 | 2188 | |
2189 | 2189 | /** |
@@ -2230,11 +2230,11 @@ discard block |
||
2230 | 2230 | } |
2231 | 2231 | |
2232 | 2232 | foreach ( $form->options as $opt => $value ) { |
2233 | - if ( isset( $post_values[ $opt ] ) ) { |
|
2234 | - $values[ $opt ] = $post_values[ $opt ]; |
|
2235 | - self::unserialize_or_decode( $values[ $opt ] ); |
|
2233 | + if ( isset( $post_values[$opt] ) ) { |
|
2234 | + $values[$opt] = $post_values[$opt]; |
|
2235 | + self::unserialize_or_decode( $values[$opt] ); |
|
2236 | 2236 | } else { |
2237 | - $values[ $opt ] = $value; |
|
2237 | + $values[$opt] = $value; |
|
2238 | 2238 | } |
2239 | 2239 | } |
2240 | 2240 | |
@@ -2248,8 +2248,8 @@ discard block |
||
2248 | 2248 | $form_defaults = FrmFormsHelper::get_default_opts(); |
2249 | 2249 | |
2250 | 2250 | foreach ( $form_defaults as $opt => $default ) { |
2251 | - if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) { |
|
2252 | - $values[ $opt ] = ( $post_values && isset( $post_values['options'][ $opt ] ) ) ? $post_values['options'][ $opt ] : $default; |
|
2251 | + if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) { |
|
2252 | + $values[$opt] = ( $post_values && isset( $post_values['options'][$opt] ) ) ? $post_values['options'][$opt] : $default; |
|
2253 | 2253 | } |
2254 | 2254 | |
2255 | 2255 | unset( $opt, $default ); |
@@ -2260,8 +2260,8 @@ discard block |
||
2260 | 2260 | } |
2261 | 2261 | |
2262 | 2262 | foreach ( array( 'before', 'after', 'submit' ) as $h ) { |
2263 | - if ( ! isset( $values[ $h . '_html' ] ) ) { |
|
2264 | - $values[ $h . '_html' ] = ( isset( $post_values['options'][ $h . '_html' ] ) ? $post_values['options'][ $h . '_html' ] : FrmFormsHelper::get_default_html( $h ) ); |
|
2263 | + if ( ! isset( $values[$h . '_html'] ) ) { |
|
2264 | + $values[$h . '_html'] = ( isset( $post_values['options'][$h . '_html'] ) ? $post_values['options'][$h . '_html'] : FrmFormsHelper::get_default_html( $h ) ); |
|
2265 | 2265 | } |
2266 | 2266 | unset( $h ); |
2267 | 2267 | } |
@@ -2413,25 +2413,25 @@ discard block |
||
2413 | 2413 | if ( ! is_numeric( $levels ) ) { |
2414 | 2414 | // Show time in specified unit. |
2415 | 2415 | $levels = self::get_unit( $levels ); |
2416 | - if ( isset( $time_strings[ $levels ] ) ) { |
|
2416 | + if ( isset( $time_strings[$levels] ) ) { |
|
2417 | 2417 | $diff = array( |
2418 | 2418 | $levels => self::time_format( $levels, $diff ), |
2419 | 2419 | ); |
2420 | 2420 | $time_strings = array( |
2421 | - $levels => $time_strings[ $levels ], |
|
2421 | + $levels => $time_strings[$levels], |
|
2422 | 2422 | ); |
2423 | 2423 | } |
2424 | 2424 | $levels = 1; |
2425 | 2425 | } |
2426 | 2426 | |
2427 | 2427 | foreach ( $time_strings as $k => $v ) { |
2428 | - if ( isset( $diff[ $k ] ) && $diff[ $k ] ) { |
|
2429 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] ); |
|
2430 | - } elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) { |
|
2428 | + if ( isset( $diff[$k] ) && $diff[$k] ) { |
|
2429 | + $time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] ); |
|
2430 | + } elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) { |
|
2431 | 2431 | // Account for 0. |
2432 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1]; |
|
2432 | + $time_strings[$k] = $diff[$k] . ' ' . $v[1]; |
|
2433 | 2433 | } else { |
2434 | - unset( $time_strings[ $k ] ); |
|
2434 | + unset( $time_strings[$k] ); |
|
2435 | 2435 | } |
2436 | 2436 | } |
2437 | 2437 | |
@@ -2450,8 +2450,8 @@ discard block |
||
2450 | 2450 | 'y' => 'y', |
2451 | 2451 | 'd' => 'days', |
2452 | 2452 | ); |
2453 | - if ( isset( $return[ $unit ] ) ) { |
|
2454 | - return $diff[ $return[ $unit ] ]; |
|
2453 | + if ( isset( $return[$unit] ) ) { |
|
2454 | + return $diff[$return[$unit]]; |
|
2455 | 2455 | } |
2456 | 2456 | |
2457 | 2457 | $total = $diff['days'] * self::convert_time( 'd', $unit ); |
@@ -2459,11 +2459,11 @@ discard block |
||
2459 | 2459 | $times = array( 'h', 'i', 's' ); |
2460 | 2460 | |
2461 | 2461 | foreach ( $times as $time ) { |
2462 | - if ( ! isset( $diff[ $time ] ) ) { |
|
2462 | + if ( ! isset( $diff[$time] ) ) { |
|
2463 | 2463 | continue; |
2464 | 2464 | } |
2465 | 2465 | |
2466 | - $total += $diff[ $time ] * self::convert_time( $time, $unit ); |
|
2466 | + $total += $diff[$time] * self::convert_time( $time, $unit ); |
|
2467 | 2467 | } |
2468 | 2468 | |
2469 | 2469 | return floor( $total ); |
@@ -2483,7 +2483,7 @@ discard block |
||
2483 | 2483 | 'y' => DAY_IN_SECONDS * 365.25, |
2484 | 2484 | ); |
2485 | 2485 | |
2486 | - return $convert[ $from ] / $convert[ $to ]; |
|
2486 | + return $convert[$from] / $convert[$to]; |
|
2487 | 2487 | } |
2488 | 2488 | |
2489 | 2489 | /** |
@@ -2491,7 +2491,7 @@ discard block |
||
2491 | 2491 | */ |
2492 | 2492 | private static function get_unit( $unit ) { |
2493 | 2493 | $units = self::get_time_strings(); |
2494 | - if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) { |
|
2494 | + if ( isset( $units[$unit] ) || is_numeric( $unit ) ) { |
|
2495 | 2495 | return $unit; |
2496 | 2496 | } |
2497 | 2497 | |
@@ -2602,17 +2602,17 @@ discard block |
||
2602 | 2602 | |
2603 | 2603 | case 1: |
2604 | 2604 | $l2 = $name; |
2605 | - self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] ); |
|
2605 | + self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] ); |
|
2606 | 2606 | break; |
2607 | 2607 | |
2608 | 2608 | case 2: |
2609 | 2609 | $l3 = $name; |
2610 | - self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] ); |
|
2610 | + self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] ); |
|
2611 | 2611 | break; |
2612 | 2612 | |
2613 | 2613 | case 3: |
2614 | 2614 | $l4 = $name; |
2615 | - self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] ); |
|
2615 | + self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] ); |
|
2616 | 2616 | } |
2617 | 2617 | |
2618 | 2618 | unset( $this_val, $n ); |
@@ -2631,8 +2631,8 @@ discard block |
||
2631 | 2631 | public static function add_value_to_array( $name, $l1, $val, &$vars ) { |
2632 | 2632 | if ( $name == '' ) { |
2633 | 2633 | $vars[] = $val; |
2634 | - } elseif ( ! isset( $vars[ $l1 ] ) ) { |
|
2635 | - $vars[ $l1 ] = $val; |
|
2634 | + } elseif ( ! isset( $vars[$l1] ) ) { |
|
2635 | + $vars[$l1] = $val; |
|
2636 | 2636 | } |
2637 | 2637 | } |
2638 | 2638 | |
@@ -2648,7 +2648,7 @@ discard block |
||
2648 | 2648 | 'email_subject' => esc_attr( sprintf( __( 'If you leave the subject blank, the default will be used: %1$s Form submitted on %2$s', 'formidable' ), $form_name, self::site_name() ) ), |
2649 | 2649 | ); |
2650 | 2650 | |
2651 | - if ( ! isset( $tooltips[ $name ] ) ) { |
|
2651 | + if ( ! isset( $tooltips[$name] ) ) { |
|
2652 | 2652 | return; |
2653 | 2653 | } |
2654 | 2654 | |
@@ -2658,7 +2658,7 @@ discard block |
||
2658 | 2658 | echo ' class="frm_help"'; |
2659 | 2659 | } |
2660 | 2660 | |
2661 | - echo ' title="' . esc_attr( $tooltips[ $name ] ); |
|
2661 | + echo ' title="' . esc_attr( $tooltips[$name] ); |
|
2662 | 2662 | |
2663 | 2663 | if ( 'open' != $class ) { |
2664 | 2664 | echo '"'; |
@@ -2717,13 +2717,13 @@ discard block |
||
2717 | 2717 | } |
2718 | 2718 | |
2719 | 2719 | private static function prepare_action_slashes( $val, $key, &$post_content ) { |
2720 | - if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) { |
|
2720 | + if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) { |
|
2721 | 2721 | return; |
2722 | 2722 | } |
2723 | 2723 | |
2724 | 2724 | if ( is_array( $val ) ) { |
2725 | 2725 | foreach ( $val as $k1 => $v1 ) { |
2726 | - self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] ); |
|
2726 | + self::prepare_action_slashes( $v1, $k1, $post_content[$key] ); |
|
2727 | 2727 | unset( $k1, $v1 ); |
2728 | 2728 | } |
2729 | 2729 | } else { |
@@ -2731,7 +2731,7 @@ discard block |
||
2731 | 2731 | $val = stripslashes( $val ); |
2732 | 2732 | |
2733 | 2733 | // Add backslashes before double quotes and forward slashes only |
2734 | - $post_content[ $key ] = addcslashes( $val, '"\\/' ); |
|
2734 | + $post_content[$key] = addcslashes( $val, '"\\/' ); |
|
2735 | 2735 | } |
2736 | 2736 | } |
2737 | 2737 | |
@@ -2794,14 +2794,14 @@ discard block |
||
2794 | 2794 | continue; |
2795 | 2795 | } |
2796 | 2796 | $key = $input['name']; |
2797 | - if ( isset( $formatted[ $key ] ) ) { |
|
2798 | - if ( is_array( $formatted[ $key ] ) ) { |
|
2799 | - $formatted[ $key ][] = $input['value']; |
|
2797 | + if ( isset( $formatted[$key] ) ) { |
|
2798 | + if ( is_array( $formatted[$key] ) ) { |
|
2799 | + $formatted[$key][] = $input['value']; |
|
2800 | 2800 | } else { |
2801 | - $formatted[ $key ] = array( $formatted[ $key ], $input['value'] ); |
|
2801 | + $formatted[$key] = array( $formatted[$key], $input['value'] ); |
|
2802 | 2802 | } |
2803 | 2803 | } else { |
2804 | - $formatted[ $key ] = $input['value']; |
|
2804 | + $formatted[$key] = $input['value']; |
|
2805 | 2805 | } |
2806 | 2806 | } |
2807 | 2807 | |
@@ -3463,8 +3463,8 @@ discard block |
||
3463 | 3463 | } |
3464 | 3464 | |
3465 | 3465 | foreach ( $keys as $key ) { |
3466 | - if ( isset( $values[ $key ] ) ) { |
|
3467 | - $values[ $key ] = self::kses( $values[ $key ], 'all' ); |
|
3466 | + if ( isset( $values[$key] ) ) { |
|
3467 | + $values[$key] = self::kses( $values[$key], 'all' ); |
|
3468 | 3468 | } |
3469 | 3469 | } |
3470 | 3470 | |
@@ -3623,7 +3623,7 @@ discard block |
||
3623 | 3623 | return 0; |
3624 | 3624 | } |
3625 | 3625 | |
3626 | - return strlen( $parts[ count( $parts ) - 1 ] ); |
|
3626 | + return strlen( $parts[count( $parts ) - 1] ); |
|
3627 | 3627 | } |
3628 | 3628 | |
3629 | 3629 | /** |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $this->beta = ! empty( $this->api_data['beta'] ) ? true : false; |
45 | 45 | $this->cache_key = md5( serialize( $this->slug . $this->version . $this->api_data['license'] . $this->beta ) ); |
46 | 46 | |
47 | - $frm_edd_plugin_data[ $this->slug ] = $this->api_data; |
|
47 | + $frm_edd_plugin_data[$this->slug] = $this->api_data; |
|
48 | 48 | |
49 | 49 | /** |
50 | 50 | * Fires after the $frm_edd_plugin_data is setup. |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $_transient_data = new stdClass(); |
94 | 94 | } |
95 | 95 | |
96 | - if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[ $this->name ] ) && false === $this->wp_override ) { |
|
96 | + if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[$this->name] ) && false === $this->wp_override ) { |
|
97 | 97 | return $_transient_data; |
98 | 98 | } |
99 | 99 | |
@@ -120,12 +120,12 @@ discard block |
||
120 | 120 | $version_info->plugin = $this->name; |
121 | 121 | } |
122 | 122 | |
123 | - $_transient_data->response[ $this->name ] = $version_info; |
|
123 | + $_transient_data->response[$this->name] = $version_info; |
|
124 | 124 | |
125 | 125 | } |
126 | 126 | |
127 | 127 | $_transient_data->last_checked = time(); |
128 | - $_transient_data->checked[ $this->name ] = $this->version; |
|
128 | + $_transient_data->checked[$this->name] = $this->version; |
|
129 | 129 | |
130 | 130 | } |
131 | 131 | |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | if ( isset( $_data->sections ) && ! is_array( $_data->sections ) ) { |
190 | 190 | $new_sections = array(); |
191 | 191 | foreach ( $_data->sections as $key => $value ) { |
192 | - $new_sections[ $key ] = $value; |
|
192 | + $new_sections[$key] = $value; |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | $_data->sections = $new_sections; |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | if ( isset( $_data->banners ) && ! is_array( $_data->banners ) ) { |
200 | 200 | $new_banners = array(); |
201 | 201 | foreach ( $_data->banners as $key => $value ) { |
202 | - $new_banners[ $key ] = $value; |
|
202 | + $new_banners[$key] = $value; |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | $_data->banners = $new_banners; |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | } |
317 | 317 | |
318 | 318 | $slug = sanitize_text_field( $_REQUEST['slug'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
319 | - $data = $frm_edd_plugin_data[ $slug ]; |
|
319 | + $data = $frm_edd_plugin_data[$slug]; |
|
320 | 320 | $beta = ! empty( $data['beta'] ) ? true : false; |
321 | 321 | $cache_key = md5( 'edd_plugin_' . sanitize_key( $_REQUEST['plugin'] ) . '_' . $beta . '_version_info' ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
322 | 322 | $version_info = $this->get_cached_version_info( $cache_key ); |
@@ -303,11 +303,13 @@ |
||
303 | 303 | |
304 | 304 | global $frm_edd_plugin_data; |
305 | 305 | |
306 | - if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' !== $_REQUEST['edd_sl_action'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
306 | + if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' !== $_REQUEST['edd_sl_action'] ) { |
|
307 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
307 | 308 | return; |
308 | 309 | } |
309 | 310 | |
310 | - if ( empty( $_REQUEST['plugin'] ) || empty( $_REQUEST['slug'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
311 | + if ( empty( $_REQUEST['plugin'] ) || empty( $_REQUEST['slug'] ) ) { |
|
312 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
311 | 313 | return; |
312 | 314 | } |
313 | 315 |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | $info['url'] = $xml; |
12 | 12 | } |
13 | 13 | |
14 | - $disabled = isset( $imported[ $info['form'] ] ) ? ' disabled' : ''; |
|
14 | + $disabled = isset( $imported[$info['form']] ) ? ' disabled' : ''; |
|
15 | 15 | $url = isset( $info['url'] ) ? $info['url'] : ''; |
16 | 16 | $value = $importing === 'form' ? $info['form'] : $info['key']; |
17 | 17 | if ( ! isset( $info['img'] ) ) { |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | continue; |
22 | 22 | } |
23 | 23 | |
24 | - $hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[ $info['form'] ] ) ); |
|
24 | + $hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[$info['form']] ) ); |
|
25 | 25 | ?> |
26 | 26 | <div class="frm_radio radio-inline radio frm_image_option<?php echo esc_attr( $importing === 'view' ? ' show_sub_opt show_' . $info['form'] : '' ); ?>" style="<?php echo esc_attr( $hide_views ? 'display:none' : '' ); ?>"> |
27 | 27 | <?php if ( $importing === 'form' ) { ?> |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | <?php } ?> |
42 | 42 | /> |
43 | 43 | <div class="frm_image_option_container frm_label_with_image"> |
44 | - <?php echo FrmAppHelper::kses( $info['img'], array( 'svg', 'rect', 'path' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
|
44 | + <?php echo FrmAppHelper::kses( $info['img'], array( 'svg', 'rect', 'path' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
|
45 | 45 | <span class="frm_text_label_for_image"> |
46 | 46 | <?php |
47 | 47 | if ( ! empty( $disabled ) ) { |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | if ( $importing === 'form' && $disabled ) { |
57 | - echo FrmAppHelper::kses( FrmFormsHelper::edit_form_link( $imported[ $info['form'] ] ), array( 'a' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
57 | + echo FrmAppHelper::kses( FrmFormsHelper::edit_form_link( $imported[$info['form']] ), array( 'a' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
58 | 58 | } else { |
59 | 59 | echo esc_html( $info['name'] ); |
60 | 60 | } |
@@ -749,8 +749,8 @@ discard block |
||
749 | 749 | */ |
750 | 750 | public static function get_shortcode_tag( $shortcodes, $short_key, $args ) { |
751 | 751 | _deprecated_function( __FUNCTION__, '3.0', 'FrmShortcodeHelper::get_shortcode_tag' ); |
752 | - return FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key, $args ); |
|
753 | - } |
|
752 | + return FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key, $args ); |
|
753 | + } |
|
754 | 754 | |
755 | 755 | /** |
756 | 756 | * @deprecated 3.01 |
@@ -763,52 +763,52 @@ discard block |
||
763 | 763 | /** |
764 | 764 | * @deprecated 3.02.03 |
765 | 765 | */ |
766 | - public static function jquery_themes() { |
|
766 | + public static function jquery_themes() { |
|
767 | 767 | _deprecated_function( __FUNCTION__, '3.02.03', 'FrmProStylesController::jquery_themes' ); |
768 | 768 | |
769 | - $themes = array( |
|
770 | - 'ui-lightness' => 'UI Lightness', |
|
771 | - 'ui-darkness' => 'UI Darkness', |
|
772 | - 'smoothness' => 'Smoothness', |
|
773 | - 'start' => 'Start', |
|
774 | - 'redmond' => 'Redmond', |
|
775 | - 'sunny' => 'Sunny', |
|
776 | - 'overcast' => 'Overcast', |
|
777 | - 'le-frog' => 'Le Frog', |
|
778 | - 'flick' => 'Flick', |
|
769 | + $themes = array( |
|
770 | + 'ui-lightness' => 'UI Lightness', |
|
771 | + 'ui-darkness' => 'UI Darkness', |
|
772 | + 'smoothness' => 'Smoothness', |
|
773 | + 'start' => 'Start', |
|
774 | + 'redmond' => 'Redmond', |
|
775 | + 'sunny' => 'Sunny', |
|
776 | + 'overcast' => 'Overcast', |
|
777 | + 'le-frog' => 'Le Frog', |
|
778 | + 'flick' => 'Flick', |
|
779 | 779 | 'pepper-grinder' => 'Pepper Grinder', |
780 | - 'eggplant' => 'Eggplant', |
|
781 | - 'dark-hive' => 'Dark Hive', |
|
782 | - 'cupertino' => 'Cupertino', |
|
783 | - 'south-street' => 'South Street', |
|
784 | - 'blitzer' => 'Blitzer', |
|
785 | - 'humanity' => 'Humanity', |
|
786 | - 'hot-sneaks' => 'Hot Sneaks', |
|
787 | - 'excite-bike' => 'Excite Bike', |
|
788 | - 'vader' => 'Vader', |
|
789 | - 'dot-luv' => 'Dot Luv', |
|
790 | - 'mint-choc' => 'Mint Choc', |
|
791 | - 'black-tie' => 'Black Tie', |
|
792 | - 'trontastic' => 'Trontastic', |
|
793 | - 'swanky-purse' => 'Swanky Purse', |
|
794 | - ); |
|
780 | + 'eggplant' => 'Eggplant', |
|
781 | + 'dark-hive' => 'Dark Hive', |
|
782 | + 'cupertino' => 'Cupertino', |
|
783 | + 'south-street' => 'South Street', |
|
784 | + 'blitzer' => 'Blitzer', |
|
785 | + 'humanity' => 'Humanity', |
|
786 | + 'hot-sneaks' => 'Hot Sneaks', |
|
787 | + 'excite-bike' => 'Excite Bike', |
|
788 | + 'vader' => 'Vader', |
|
789 | + 'dot-luv' => 'Dot Luv', |
|
790 | + 'mint-choc' => 'Mint Choc', |
|
791 | + 'black-tie' => 'Black Tie', |
|
792 | + 'trontastic' => 'Trontastic', |
|
793 | + 'swanky-purse' => 'Swanky Purse', |
|
794 | + ); |
|
795 | 795 | |
796 | 796 | $themes = apply_filters( 'frm_jquery_themes', $themes ); |
797 | - return $themes; |
|
798 | - } |
|
797 | + return $themes; |
|
798 | + } |
|
799 | 799 | |
800 | 800 | /** |
801 | 801 | * @deprecated 3.02.03 |
802 | 802 | */ |
803 | - public static function enqueue_jquery_css() { |
|
803 | + public static function enqueue_jquery_css() { |
|
804 | 804 | _deprecated_function( __FUNCTION__, '3.02.03', 'FrmProStylesController::enqueue_jquery_css' ); |
805 | 805 | |
806 | 806 | $form = self::get_form_for_page(); |
807 | 807 | $theme_css = FrmStylesController::get_style_val( 'theme_css', $form ); |
808 | - if ( $theme_css != -1 ) { |
|
808 | + if ( $theme_css != -1 ) { |
|
809 | 809 | wp_enqueue_style( 'jquery-theme', self::jquery_css_url( $theme_css ), array(), FrmAppHelper::plugin_version() ); |
810 | - } |
|
811 | - } |
|
810 | + } |
|
811 | + } |
|
812 | 812 | |
813 | 813 | /** |
814 | 814 | * @deprecated 3.02.03 |
@@ -821,7 +821,7 @@ discard block |
||
821 | 821 | } |
822 | 822 | |
823 | 823 | return FrmProStylesController::jquery_css_url( $theme_css ); |
824 | - } |
|
824 | + } |
|
825 | 825 | |
826 | 826 | /** |
827 | 827 | * @deprecated 3.02.03 |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | FrmAppHelper::permission_check( 'frm_edit_forms' ); |
28 | 28 | |
29 | 29 | $action = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action'; |
30 | - $action = empty( $values ) ? FrmAppHelper::get_param( $action, '', 'get', 'sanitize_title' ) : $values[ $action ]; |
|
30 | + $action = empty( $values ) ? FrmAppHelper::get_param( $action, '', 'get', 'sanitize_title' ) : $values[$action]; |
|
31 | 31 | |
32 | 32 | if ( $action === 'create' ) { |
33 | 33 | FrmFormsController::update( $values ); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | } |
36 | 36 | |
37 | 37 | $values = FrmFormsHelper::setup_new_vars( $values ); |
38 | - $id = FrmForm::create( $values ); |
|
38 | + $id = FrmForm::create( $values ); |
|
39 | 39 | $values['id'] = $id; |
40 | 40 | |
41 | 41 | FrmFormsController::edit( $values ); |
@@ -16,7 +16,7 @@ |
||
16 | 16 | 'title' => esc_attr__( 'Toggle Options', 'formidable' ), |
17 | 17 | ) |
18 | 18 | ); |
19 | - $e_args = array( |
|
19 | + $e_args = array( |
|
20 | 20 | 'textarea_name' => 'field_options[description_' . absint( $field['id'] ) . ']', |
21 | 21 | 'textarea_rows' => 8, |
22 | 22 | ); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $metas = FrmEntryMeta::get_entry_meta_info( $entry_exist ); |
81 | 81 | $field_metas = array(); |
82 | 82 | foreach ( $metas as $meta ) { |
83 | - $field_metas[ $meta->field_id ] = $meta->meta_value; |
|
83 | + $field_metas[$meta->field_id] = $meta->meta_value; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | $filtered_vals = array_filter( $values['item_meta'] ); |
@@ -136,10 +136,10 @@ discard block |
||
136 | 136 | $reduced = array(); |
137 | 137 | foreach ( $filter_vals as $field_id => $value ) { |
138 | 138 | $field = FrmFieldFactory::get_field_object( $field_id ); |
139 | - $reduced[ $field_id ] = $field->get_value_to_save( $value, array( 'entry_id' => $entry_id ) ); |
|
140 | - $reduced[ $field_id ] = $field->set_value_before_save( $reduced[ $field_id ] ); |
|
141 | - if ( '' === $reduced[ $field_id ] || ( is_array( $reduced[ $field_id ] ) && 0 === count( $reduced[ $field_id ] ) ) ) { |
|
142 | - unset( $reduced[ $field_id ] ); |
|
139 | + $reduced[$field_id] = $field->get_value_to_save( $value, array( 'entry_id' => $entry_id ) ); |
|
140 | + $reduced[$field_id] = $field->set_value_before_save( $reduced[$field_id] ); |
|
141 | + if ( '' === $reduced[$field_id] || ( is_array( $reduced[$field_id] ) && 0 === count( $reduced[$field_id] ) ) ) { |
|
142 | + unset( $reduced[$field_id] ); |
|
143 | 143 | } |
144 | 144 | } |
145 | 145 | return $reduced; |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | $query = "SELECT it.*, fr.name as form_name, fr.form_key as form_key FROM {$wpdb->prefix}frm_items it |
333 | 333 | LEFT OUTER JOIN {$wpdb->prefix}frm_forms fr ON it.form_id=fr.id WHERE "; |
334 | 334 | |
335 | - $query .= is_numeric( $id ) ? 'it.id=%d' : 'it.item_key=%s'; |
|
335 | + $query .= is_numeric( $id ) ? 'it.id=%d' : 'it.item_key=%s'; |
|
336 | 336 | $query_args = array( $id ); |
337 | 337 | $query = $wpdb->prepare( $query, $query_args ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared |
338 | 338 | |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | private static function prepare_entries( &$entries ) { |
378 | 378 | foreach ( $entries as $k => $entry ) { |
379 | 379 | self::prepare_entry( $entry ); |
380 | - $entries[ $k ] = $entry; |
|
380 | + $entries[$k] = $entry; |
|
381 | 381 | } |
382 | 382 | } |
383 | 383 | |
@@ -402,20 +402,20 @@ discard block |
||
402 | 402 | foreach ( $metas as $meta_val ) { |
403 | 403 | if ( $meta_val->item_id == $entry->id ) { |
404 | 404 | FrmAppHelper::unserialize_or_decode( $meta_val->meta_value ); |
405 | - $entry->metas[ $meta_val->field_id ] = $meta_val->meta_value; |
|
405 | + $entry->metas[$meta_val->field_id] = $meta_val->meta_value; |
|
406 | 406 | if ( $include_key ) { |
407 | - $entry->metas[ $meta_val->field_key ] = $entry->metas[ $meta_val->field_id ]; |
|
407 | + $entry->metas[$meta_val->field_key] = $entry->metas[$meta_val->field_id]; |
|
408 | 408 | } |
409 | 409 | continue; |
410 | 410 | } |
411 | 411 | |
412 | 412 | // include sub entries in an array |
413 | - if ( ! isset( $entry->metas[ $meta_val->field_id ] ) ) { |
|
414 | - $entry->metas[ $meta_val->field_id ] = array(); |
|
413 | + if ( ! isset( $entry->metas[$meta_val->field_id] ) ) { |
|
414 | + $entry->metas[$meta_val->field_id] = array(); |
|
415 | 415 | } |
416 | 416 | |
417 | 417 | FrmAppHelper::unserialize_or_decode( $meta_val->meta_value ); |
418 | - $entry->metas[ $meta_val->field_id ][] = $meta_val->meta_value; |
|
418 | + $entry->metas[$meta_val->field_id][] = $meta_val->meta_value; |
|
419 | 419 | |
420 | 420 | unset( $meta_val ); |
421 | 421 | } |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | |
463 | 463 | if ( $inc_form ) { |
464 | 464 | $fields = 'it.*, fr.name as form_name,fr.form_key as form_key'; |
465 | - $table .= 'LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_forms fr ON it.form_id=fr.id '; |
|
465 | + $table .= 'LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_forms fr ON it.form_id=fr.id '; |
|
466 | 466 | } |
467 | 467 | |
468 | 468 | if ( preg_match( '/ meta_([0-9]+)/', $order_by, $order_matches ) ) { |
@@ -506,16 +506,16 @@ discard block |
||
506 | 506 | } |
507 | 507 | |
508 | 508 | foreach ( $metas as $m_key => $meta_val ) { |
509 | - if ( ! isset( $entries[ $meta_val->item_id ] ) ) { |
|
509 | + if ( ! isset( $entries[$meta_val->item_id] ) ) { |
|
510 | 510 | continue; |
511 | 511 | } |
512 | 512 | |
513 | - if ( ! isset( $entries[ $meta_val->item_id ]->metas ) ) { |
|
514 | - $entries[ $meta_val->item_id ]->metas = array(); |
|
513 | + if ( ! isset( $entries[$meta_val->item_id]->metas ) ) { |
|
514 | + $entries[$meta_val->item_id]->metas = array(); |
|
515 | 515 | } |
516 | 516 | |
517 | 517 | FrmAppHelper::unserialize_or_decode( $meta_val->meta_value ); |
518 | - $entries[ $meta_val->item_id ]->metas[ $meta_val->field_id ] = $meta_val->meta_value; |
|
518 | + $entries[$meta_val->item_id]->metas[$meta_val->field_id] = $meta_val->meta_value; |
|
519 | 519 | unset( $m_key, $meta_val ); |
520 | 520 | } |
521 | 521 | |
@@ -693,7 +693,7 @@ discard block |
||
693 | 693 | } |
694 | 694 | |
695 | 695 | private static function get_entry_value( $values, $name, $default ) { |
696 | - return isset( $values[ $name ] ) ? $values[ $name ] : $default; |
|
696 | + return isset( $values[$name] ) ? $values[$name] : $default; |
|
697 | 697 | } |
698 | 698 | |
699 | 699 | /** |
@@ -874,7 +874,7 @@ discard block |
||
874 | 874 | private static function maybe_add_captcha_meta( $form_id, $entry_id ) { |
875 | 875 | global $frm_vars; |
876 | 876 | if ( array_key_exists( 'captcha_scores', $frm_vars ) && array_key_exists( $form_id, $frm_vars['captcha_scores'] ) ) { |
877 | - $captcha_score_meta = array( 'captcha_score' => $frm_vars['captcha_scores'][ $form_id ] ); |
|
877 | + $captcha_score_meta = array( 'captcha_score' => $frm_vars['captcha_scores'][$form_id] ); |
|
878 | 878 | FrmEntryMeta::add_entry_meta( $entry_id, 0, '', maybe_serialize( $captcha_score_meta ) ); |
879 | 879 | } |
880 | 880 | } |
@@ -6,7 +6,7 @@ |
||
6 | 6 | $data_keys = array_keys( $data ); |
7 | 7 | $params = array(); |
8 | 8 | foreach ( $data_keys as $key ) { |
9 | - $params[ 'data-' . $key ] = $data[ $key ]; |
|
9 | + $params['data-' . $key] = $data[$key]; |
|
10 | 10 | } |
11 | 11 | $params['class'] = 'frm_show_upgrade frm_noallow'; |
12 | 12 | $params['href'] = '#'; |
@@ -28,7 +28,7 @@ discard block |
||
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 |
||
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 | |
@@ -276,8 +276,8 @@ discard block |
||
276 | 276 | 'description' => '', |
277 | 277 | ); |
278 | 278 | foreach ( $defaults as $var => $default ) { |
279 | - if ( ! isset( $values[ $var ] ) ) { |
|
280 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
279 | + if ( ! isset( $values[$var] ) ) { |
|
280 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
281 | 281 | } |
282 | 282 | } |
283 | 283 | |
@@ -292,8 +292,8 @@ discard block |
||
292 | 292 | 'parent_form_id' => 0, |
293 | 293 | ); |
294 | 294 | foreach ( $defaults as $var => $default ) { |
295 | - if ( ! isset( $values[ $var ] ) ) { |
|
296 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
295 | + if ( ! isset( $values[$var] ) ) { |
|
296 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
297 | 297 | } |
298 | 298 | } |
299 | 299 | unset( $defaults ); |
@@ -330,16 +330,16 @@ discard block |
||
330 | 330 | $defaults = self::get_default_opts(); |
331 | 331 | foreach ( $defaults as $var => $default ) { |
332 | 332 | if ( is_array( $default ) ) { |
333 | - if ( ! isset( $values[ $var ] ) ) { |
|
334 | - $values[ $var ] = ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : array(); |
|
333 | + if ( ! isset( $values[$var] ) ) { |
|
334 | + $values[$var] = ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : array(); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | foreach ( $default as $k => $v ) { |
338 | - $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 ); |
|
338 | + $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 ); |
|
339 | 339 | |
340 | 340 | if ( is_array( $v ) ) { |
341 | 341 | foreach ( $v as $k1 => $v1 ) { |
342 | - $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 ); |
|
342 | + $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 ); |
|
343 | 343 | unset( $k1, $v1 ); |
344 | 344 | } |
345 | 345 | } |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | unset( $k, $v ); |
348 | 348 | } |
349 | 349 | } else { |
350 | - $values[ $var ] = ( $post_values && isset( $post_values['options'][ $var ] ) ) ? $post_values['options'][ $var ] : ( ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : $default ); |
|
350 | + $values[$var] = ( $post_values && isset( $post_values['options'][$var] ) ) ? $post_values['options'][$var] : ( ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : $default ); |
|
351 | 351 | } |
352 | 352 | |
353 | 353 | unset( $var, $default ); |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | public static function fill_form_options( &$options, $values ) { |
388 | 388 | $defaults = self::get_default_opts(); |
389 | 389 | foreach ( $defaults as $var => $default ) { |
390 | - $options[ $var ] = isset( $values['options'][ $var ] ) ? $values['options'][ $var ] : $default; |
|
390 | + $options[$var] = isset( $values['options'][$var] ) ? $values['options'][$var] : $default; |
|
391 | 391 | unset( $var, $default ); |
392 | 392 | } |
393 | 393 | } |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | public static function insert_opt_html( $args ) { |
550 | 550 | $class = isset( $args['class'] ) ? $args['class'] : ''; |
551 | 551 | $fields = FrmField::all_field_selection(); |
552 | - $field = isset( $fields[ $args['type'] ] ) ? $fields[ $args['type'] ] : array(); |
|
552 | + $field = isset( $fields[$args['type']] ) ? $fields[$args['type']] : array(); |
|
553 | 553 | |
554 | 554 | self::prepare_field_type( $field ); |
555 | 555 | |
@@ -705,7 +705,7 @@ discard block |
||
705 | 705 | FrmField::update( $field->id, array( 'field_order' => $field->field_order + 2 ) ); |
706 | 706 | } |
707 | 707 | |
708 | - $add_order += 2; |
|
708 | + $add_order += 2; |
|
709 | 709 | $open = false; |
710 | 710 | $reset_fields = true; |
711 | 711 | } |
@@ -1108,10 +1108,10 @@ discard block |
||
1108 | 1108 | $link .= ' onclick="return confirm(\'' . esc_attr( $link_details['confirm'] ) . '\')"'; |
1109 | 1109 | } |
1110 | 1110 | |
1111 | - $label = ( isset( $link_details[ $length ] ) ? $link_details[ $length ] : $link_details['label'] ); |
|
1112 | - if ( $length == 'icon' && isset( $link_details[ $length ] ) ) { |
|
1111 | + $label = ( isset( $link_details[$length] ) ? $link_details[$length] : $link_details['label'] ); |
|
1112 | + if ( $length == 'icon' && isset( $link_details[$length] ) ) { |
|
1113 | 1113 | $label = '<span class="' . $label . '" title="' . esc_attr( $link_details['label'] ) . '" aria-hidden="true"></span>'; |
1114 | - $link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"'; |
|
1114 | + $link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"'; |
|
1115 | 1115 | } |
1116 | 1116 | |
1117 | 1117 | $link .= '>' . $label . '</a>'; |
@@ -1250,7 +1250,7 @@ discard block |
||
1250 | 1250 | $status = 'publish'; |
1251 | 1251 | } |
1252 | 1252 | |
1253 | - $name = $nice_names[ $status ]; |
|
1253 | + $name = $nice_names[$status]; |
|
1254 | 1254 | |
1255 | 1255 | return $name; |
1256 | 1256 | } |
@@ -1283,17 +1283,17 @@ discard block |
||
1283 | 1283 | '' => array( 'align_right' ), |
1284 | 1284 | ); |
1285 | 1285 | |
1286 | - $icons[ __( 'My Templates', 'formidable' ) ] = array( 'user', 'var(--orange)' ); |
|
1286 | + $icons[__( 'My Templates', 'formidable' )] = array( 'user', 'var(--orange)' ); |
|
1287 | 1287 | |
1288 | 1288 | $icon = $icons['']; |
1289 | 1289 | |
1290 | 1290 | if ( count( $categories ) === 1 ) { |
1291 | 1291 | $category = reset( $categories ); |
1292 | - $icon = isset( $icons[ $category ] ) ? $icons[ $category ] : $icon; |
|
1292 | + $icon = isset( $icons[$category] ) ? $icons[$category] : $icon; |
|
1293 | 1293 | } elseif ( ! empty( $categories ) ) { |
1294 | 1294 | foreach ( $icons as $cat => $icon ) { |
1295 | 1295 | if ( ! in_array( $cat, $categories ) ) { |
1296 | - unset( $icons[ $cat ] ); |
|
1296 | + unset( $icons[$cat] ); |
|
1297 | 1297 | } |
1298 | 1298 | } |
1299 | 1299 | $icon = reset( $icons ); |
@@ -1422,7 +1422,7 @@ discard block |
||
1422 | 1422 | |
1423 | 1423 | foreach ( $item['categories'] as $k => $category ) { |
1424 | 1424 | if ( in_array( $category, $plans, true ) ) { |
1425 | - unset( $item['categories'][ $k ] ); |
|
1425 | + unset( $item['categories'][$k] ); |
|
1426 | 1426 | |
1427 | 1427 | if ( in_array( $category, array( 'Creator', 'Personal' ), true ) ) { |
1428 | 1428 | // Show the current package name. |
@@ -1650,9 +1650,9 @@ discard block |
||
1650 | 1650 | } |
1651 | 1651 | |
1652 | 1652 | foreach ( $shortcodes[0] as $key => $shortcode ) { |
1653 | - $options = trim( $shortcodes[3][ $key ] ); |
|
1653 | + $options = trim( $shortcodes[3][$key] ); |
|
1654 | 1654 | |
1655 | - if ( in_array( $shortcodes[1][ $key ], array( 'if ' ), true ) ) { |
|
1655 | + if ( in_array( $shortcodes[1][$key], array( 'if ' ), true ) ) { |
|
1656 | 1656 | // Skip if shortcodes. |
1657 | 1657 | continue; |
1658 | 1658 | } |
@@ -1662,7 +1662,7 @@ discard block |
||
1662 | 1662 | continue; |
1663 | 1663 | } |
1664 | 1664 | |
1665 | - $new_shortcode = '[' . $shortcodes[2][ $key ]; |
|
1665 | + $new_shortcode = '[' . $shortcodes[2][$key]; |
|
1666 | 1666 | if ( $options ) { |
1667 | 1667 | $new_shortcode .= ' ' . $options; |
1668 | 1668 | } |