@@ -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 | } |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | $grid_helper = new FrmFieldGridHelper(); |
| 53 | 53 | $values['count'] = 0; |
| 54 | 54 | foreach ( $values['fields'] as $field ) { |
| 55 | - ++$values['count']; |
|
| 55 | + ++ $values['count']; |
|
| 56 | 56 | $grid_helper->set_field( $field ); |
| 57 | 57 | $grid_helper->maybe_begin_field_wrapper(); |
| 58 | 58 | FrmFieldsController::load_single_field( $field, $values ); |
@@ -328,11 +328,11 @@ discard block |
||
| 328 | 328 | |
| 329 | 329 | // Perform add or remove operation. |
| 330 | 330 | if ( 'add' === $operation ) { |
| 331 | - self::$favorite_templates[ $key ][] = $template_id; |
|
| 331 | + self::$favorite_templates[$key][] = $template_id; |
|
| 332 | 332 | } elseif ( 'remove' === $operation ) { |
| 333 | - $position = array_search( $template_id, self::$favorite_templates[ $key ], true ); |
|
| 333 | + $position = array_search( $template_id, self::$favorite_templates[$key], true ); |
|
| 334 | 334 | if ( $position !== false ) { |
| 335 | - unset( self::$favorite_templates[ $key ][ $position ] ); |
|
| 335 | + unset( self::$favorite_templates[$key][$position] ); |
|
| 336 | 336 | } |
| 337 | 337 | } |
| 338 | 338 | |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | foreach ( self::$templates as $key => &$template ) { |
| 462 | 462 | // Skip the template if the categories are not set. |
| 463 | 463 | if ( ! isset( $template['categories'] ) ) { |
| 464 | - unset( self::$templates[ $key ] ); |
|
| 464 | + unset( self::$templates[$key] ); |
|
| 465 | 465 | continue; |
| 466 | 466 | } |
| 467 | 467 | |
@@ -475,14 +475,12 @@ discard block |
||
| 475 | 475 | // Add the slug to the new array. |
| 476 | 476 | $template['category_slugs'][] = $category_slug; |
| 477 | 477 | |
| 478 | - if ( ! isset( self::$categories[ $category_slug ] ) ) { |
|
| 479 | - self::$categories[ $category_slug ] = array( |
|
| 478 | + if ( ! isset( self::$categories[$category_slug] ) ) { |
|
| 479 | + self::$categories[$category_slug] = array( |
|
| 480 | 480 | 'name' => $category, |
| 481 | 481 | 'count' => 0, |
| 482 | 482 | ); |
| 483 | - } |
|
| 484 | - |
|
| 485 | - ++self::$categories[ $category_slug ]['count']; |
|
| 483 | + } ++self::$categories[$category_slug]['count']; |
|
| 486 | 484 | } |
| 487 | 485 | |
| 488 | 486 | // Mark the template as favorite if it's in the favorite templates list. |
@@ -497,7 +495,7 @@ discard block |
||
| 497 | 495 | $redundant_cats = array_merge( array( 'PayPal', 'Stripe', 'Twilio' ), FrmFormsHelper::ignore_template_categories() ); |
| 498 | 496 | foreach ( $redundant_cats as $redundant_cat ) { |
| 499 | 497 | $category_slug = sanitize_title( $redundant_cat ); |
| 500 | - unset( self::$categories[ $category_slug ] ); |
|
| 498 | + unset( self::$categories[$category_slug] ); |
|
| 501 | 499 | } |
| 502 | 500 | |
| 503 | 501 | // Sort the categories by keys alphabetically. |
@@ -522,7 +520,7 @@ discard block |
||
| 522 | 520 | 'count' => 0, |
| 523 | 521 | ); |
| 524 | 522 | } |
| 525 | - $special_categories['all-templates'] = array( |
|
| 523 | + $special_categories['all-templates'] = array( |
|
| 526 | 524 | 'name' => __( 'All Templates', 'formidable' ), |
| 527 | 525 | 'count' => self::get_template_count(), |
| 528 | 526 | ); |
@@ -550,9 +548,9 @@ discard block |
||
| 550 | 548 | */ |
| 551 | 549 | private static function assign_featured_templates() { |
| 552 | 550 | foreach ( self::FEATURED_TEMPLATES_KEYS as $key ) { |
| 553 | - if ( isset( self::$templates[ $key ] ) ) { |
|
| 554 | - self::$templates[ $key ]['is_featured'] = true; |
|
| 555 | - self::$featured_templates[] = self::$templates[ $key ]; |
|
| 551 | + if ( isset( self::$templates[$key] ) ) { |
|
| 552 | + self::$templates[$key]['is_featured'] = true; |
|
| 553 | + self::$featured_templates[] = self::$templates[$key]; |
|
| 556 | 554 | } |
| 557 | 555 | } |
| 558 | 556 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | unset( $addons['error'] ); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - $pro = array( |
|
| 62 | + $pro = array( |
|
| 63 | 63 | 'pro' => array( |
| 64 | 64 | 'title' => 'Formidable Forms Pro', |
| 65 | 65 | 'slug' => 'formidable-pro', |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | } else { |
| 105 | 105 | foreach ( $addons as $k => $addon ) { |
| 106 | 106 | if ( empty( $addon['excerpt'] ) && $k !== 'error' ) { |
| 107 | - unset( $addons[ $k ] ); |
|
| 107 | + unset( $addons[$k] ); |
|
| 108 | 108 | } |
| 109 | 109 | } |
| 110 | 110 | } |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | |
| 219 | 219 | foreach ( $list as $k => $info ) { |
| 220 | 220 | $info['slug'] = $k; |
| 221 | - $list[ $k ] = array_merge( $defaults, $info ); |
|
| 221 | + $list[$k] = array_merge( $defaults, $info ); |
|
| 222 | 222 | } |
| 223 | 223 | return $list; |
| 224 | 224 | } |
@@ -382,17 +382,17 @@ discard block |
||
| 382 | 382 | continue; |
| 383 | 383 | } |
| 384 | 384 | |
| 385 | - $wp_plugin = isset( $wp_plugins[ $folder ] ) ? $wp_plugins[ $folder ] : array(); |
|
| 385 | + $wp_plugin = isset( $wp_plugins[$folder] ) ? $wp_plugins[$folder] : array(); |
|
| 386 | 386 | $wp_version = isset( $wp_plugin['Version'] ) ? $wp_plugin['Version'] : '1.0'; |
| 387 | 387 | $plugin->slug = explode( '/', $folder )[0]; |
| 388 | 388 | |
| 389 | 389 | if ( version_compare( $wp_version, $plugin->new_version, '<' ) ) { |
| 390 | - $transient->response[ $folder ] = $plugin; |
|
| 390 | + $transient->response[$folder] = $plugin; |
|
| 391 | 391 | } else { |
| 392 | - $transient->no_update[ $folder ] = $plugin; |
|
| 392 | + $transient->no_update[$folder] = $plugin; |
|
| 393 | 393 | } |
| 394 | 394 | |
| 395 | - $transient->checked[ $folder ] = $wp_version; |
|
| 395 | + $transient->checked[$folder] = $wp_version; |
|
| 396 | 396 | |
| 397 | 397 | }//end foreach |
| 398 | 398 | |
@@ -425,7 +425,7 @@ discard block |
||
| 425 | 425 | */ |
| 426 | 426 | protected static function is_installed( $plugin ) { |
| 427 | 427 | $all_plugins = self::get_plugins(); |
| 428 | - return isset( $all_plugins[ $plugin ] ); |
|
| 428 | + return isset( $all_plugins[$plugin] ); |
|
| 429 | 429 | } |
| 430 | 430 | |
| 431 | 431 | /** |
@@ -464,13 +464,13 @@ discard block |
||
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 466 | $download_id = isset( $plugin['id'] ) ? $plugin['id'] : 0; |
| 467 | - if ( ! empty( $download_id ) && ! isset( $version_info[ $download_id ]['package'] ) ) { |
|
| 467 | + if ( ! empty( $download_id ) && ! isset( $version_info[$download_id]['package'] ) ) { |
|
| 468 | 468 | // if this addon is using its own license, get the update url |
| 469 | 469 | $addon_info = $api->get_api_info(); |
| 470 | 470 | |
| 471 | - $version_info[ $download_id ] = $addon_info[ $download_id ]; |
|
| 471 | + $version_info[$download_id] = $addon_info[$download_id]; |
|
| 472 | 472 | if ( isset( $addon_info['error'] ) ) { |
| 473 | - $version_info[ $download_id ]['error'] = array( |
|
| 473 | + $version_info[$download_id]['error'] = array( |
|
| 474 | 474 | 'message' => $addon_info['error']['message'], |
| 475 | 475 | 'code' => $addon_info['error']['code'], |
| 476 | 476 | ); |
@@ -569,8 +569,8 @@ discard block |
||
| 569 | 569 | return $addon; |
| 570 | 570 | } |
| 571 | 571 | } |
| 572 | - } elseif ( isset( $addons[ $download_id ] ) ) { |
|
| 573 | - $plugin = $addons[ $download_id ]; |
|
| 572 | + } elseif ( isset( $addons[$download_id] ) ) { |
|
| 573 | + $plugin = $addons[$download_id]; |
|
| 574 | 574 | } |
| 575 | 575 | |
| 576 | 576 | return $plugin; |
@@ -634,7 +634,7 @@ discard block |
||
| 634 | 634 | self::prepare_addon_link( $addon['link'] ); |
| 635 | 635 | |
| 636 | 636 | self::set_addon_status( $addon ); |
| 637 | - $addons[ $id ] = $addon; |
|
| 637 | + $addons[$id] = $addon; |
|
| 638 | 638 | }//end foreach |
| 639 | 639 | } |
| 640 | 640 | |
@@ -675,7 +675,7 @@ discard block |
||
| 675 | 675 | 'utm_medium' => 'addons', |
| 676 | 676 | 'utm_campaign' => 'liteplugin', |
| 677 | 677 | ); |
| 678 | - $link = add_query_arg( $query_args, $link ); |
|
| 678 | + $link = add_query_arg( $query_args, $link ); |
|
| 679 | 679 | } |
| 680 | 680 | |
| 681 | 681 | /** |
@@ -1105,7 +1105,7 @@ discard block |
||
| 1105 | 1105 | */ |
| 1106 | 1106 | public static function ajax_activate_addon() { |
| 1107 | 1107 | self::process_addon_action( |
| 1108 | - function ( $plugin ) { |
|
| 1108 | + function( $plugin ) { |
|
| 1109 | 1109 | return self::handle_addon_action( $plugin, 'activate' ); |
| 1110 | 1110 | }, |
| 1111 | 1111 | array( 'FrmAddonsController', 'get_addon_activation_response' ) |
@@ -1130,7 +1130,7 @@ discard block |
||
| 1130 | 1130 | */ |
| 1131 | 1131 | public static function ajax_deactivate_addon() { |
| 1132 | 1132 | self::process_addon_action( |
| 1133 | - function ( $plugin ) { |
|
| 1133 | + function( $plugin ) { |
|
| 1134 | 1134 | return self::handle_addon_action( $plugin, 'deactivate' ); |
| 1135 | 1135 | } |
| 1136 | 1136 | ); |
@@ -1145,7 +1145,7 @@ discard block |
||
| 1145 | 1145 | */ |
| 1146 | 1146 | public static function ajax_uninstall_addon() { |
| 1147 | 1147 | self::process_addon_action( |
| 1148 | - function ( $plugin ) { |
|
| 1148 | + function( $plugin ) { |
|
| 1149 | 1149 | return self::handle_addon_action( $plugin, 'uninstall' ); |
| 1150 | 1150 | } |
| 1151 | 1151 | ); |
@@ -1542,7 +1542,7 @@ discard block |
||
| 1542 | 1542 | $addons = $api->get_api_info(); |
| 1543 | 1543 | |
| 1544 | 1544 | if ( is_array( $addons ) && array_key_exists( $addon_id, $addons ) ) { |
| 1545 | - $dates = $addons[ $addon_id ]; |
|
| 1545 | + $dates = $addons[$addon_id]; |
|
| 1546 | 1546 | $requires = FrmFormsHelper::get_plan_required( $dates ); |
| 1547 | 1547 | } |
| 1548 | 1548 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | $_GET['page'] = 'formidable'; |
| 20 | 20 | |
| 21 | - $values = array( |
|
| 21 | + $values = array( |
|
| 22 | 22 | 'id' => FrmAppHelper::get_post_param( 'form_id', '', 'absint' ), |
| 23 | 23 | 'doing_ajax' => true, |
| 24 | 24 | ); |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | ob_start(); |
| 43 | 43 | self::load_single_field( $field, $values ); |
| 44 | - $field_html[ absint( $field->id ) ] = ob_get_contents(); |
|
| 44 | + $field_html[absint( $field->id )] = ob_get_contents(); |
|
| 45 | 45 | ob_end_clean(); |
| 46 | 46 | } |
| 47 | 47 | |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | foreach ( $opts as $opt_key => $opt ) { |
| 252 | 252 | if ( strpos( $opt, '|' ) !== false ) { |
| 253 | 253 | $vals = explode( '|', $opt ); |
| 254 | - $opts[ $opt_key ] = array( |
|
| 254 | + $opts[$opt_key] = array( |
|
| 255 | 255 | 'label' => trim( $vals[0] ), |
| 256 | 256 | 'value' => trim( $vals[1] ), |
| 257 | 257 | ); |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | $other_array = array(); |
| 267 | 267 | foreach ( $field['options'] as $opt_key => $opt ) { |
| 268 | 268 | if ( FrmFieldsHelper::is_other_opt( $opt_key ) ) { |
| 269 | - $other_array[ $opt_key ] = $opt; |
|
| 269 | + $other_array[$opt_key] = $opt; |
|
| 270 | 270 | } |
| 271 | 271 | unset( $opt_key, $opt ); |
| 272 | 272 | } |
@@ -308,18 +308,18 @@ discard block |
||
| 308 | 308 | $disabled_fields = FrmAppHelper::pro_is_installed() ? array() : $pro_field_selection; |
| 309 | 309 | $frm_settings = FrmAppHelper::get_settings(); |
| 310 | 310 | |
| 311 | - if ( ! isset( $all_field_types[ $field['type'] ] ) ) { |
|
| 311 | + if ( ! isset( $all_field_types[$field['type']] ) ) { |
|
| 312 | 312 | // Add fallback for an add-on field type that has been deactivated. |
| 313 | - $all_field_types[ $field['type'] ] = array( |
|
| 313 | + $all_field_types[$field['type']] = array( |
|
| 314 | 314 | 'name' => ucfirst( $field['type'] ), |
| 315 | 315 | 'icon' => 'frm_icon_font frm_pencil_icon', |
| 316 | 316 | ); |
| 317 | - } elseif ( ! is_array( $all_field_types[ $field['type'] ] ) ) { |
|
| 317 | + } elseif ( ! is_array( $all_field_types[$field['type']] ) ) { |
|
| 318 | 318 | // Fallback for fields added in a more basic way. |
| 319 | - FrmFormsHelper::prepare_field_type( $all_field_types[ $field['type'] ] ); |
|
| 319 | + FrmFormsHelper::prepare_field_type( $all_field_types[$field['type']] ); |
|
| 320 | 320 | } |
| 321 | 321 | |
| 322 | - $type_name = $all_field_types[ $field['type'] ]['name']; |
|
| 322 | + $type_name = $all_field_types[$field['type']]['name']; |
|
| 323 | 323 | if ( $field['type'] === 'divider' && FrmField::is_option_true( $field, 'repeat' ) ) { |
| 324 | 324 | $type_name = $all_field_types['divider|repeat']['name']; |
| 325 | 325 | } |
@@ -383,13 +383,13 @@ discard block |
||
| 383 | 383 | $active = 'default_value'; |
| 384 | 384 | |
| 385 | 385 | foreach ( $settings as $type ) { |
| 386 | - if ( ! empty( $field[ $type ] ) ) { |
|
| 386 | + if ( ! empty( $field[$type] ) ) { |
|
| 387 | 387 | $active = $type; |
| 388 | 388 | } |
| 389 | 389 | } |
| 390 | 390 | |
| 391 | - $types[ $active ]['class'] .= ' current'; |
|
| 392 | - $types[ $active ]['current'] = true; |
|
| 391 | + $types[$active]['class'] .= ' current'; |
|
| 392 | + $types[$active]['current'] = true; |
|
| 393 | 393 | |
| 394 | 394 | return $types; |
| 395 | 395 | } |
@@ -403,8 +403,8 @@ discard block |
||
| 403 | 403 | 'website' => 'url', |
| 404 | 404 | 'image' => 'url', |
| 405 | 405 | ); |
| 406 | - if ( isset( $type_switch[ $type ] ) ) { |
|
| 407 | - $type = $type_switch[ $type ]; |
|
| 406 | + if ( isset( $type_switch[$type] ) ) { |
|
| 407 | + $type = $type_switch[$type]; |
|
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 | $pro_fields = FrmField::pro_field_selection(); |
@@ -539,11 +539,11 @@ discard block |
||
| 539 | 539 | // include "col" for valid html |
| 540 | 540 | $unit = trim( preg_replace( '/[0-9]+/', '', $field['size'] ) ); |
| 541 | 541 | |
| 542 | - if ( ! isset( $calc[ $unit ] ) ) { |
|
| 542 | + if ( ! isset( $calc[$unit] ) ) { |
|
| 543 | 543 | return; |
| 544 | 544 | } |
| 545 | 545 | |
| 546 | - $size = (float) str_replace( $unit, '', $field['size'] ) / $calc[ $unit ]; |
|
| 546 | + $size = (float) str_replace( $unit, '', $field['size'] ) / $calc[$unit]; |
|
| 547 | 547 | |
| 548 | 548 | $add_html['cols'] = 'cols="' . absint( $size ) . '"'; |
| 549 | 549 | } |
@@ -775,11 +775,11 @@ discard block |
||
| 775 | 775 | private static function get_form_for_js_validation( $field ) { |
| 776 | 776 | global $frm_vars; |
| 777 | 777 | if ( ! empty( $frm_vars['js_validate_forms'] ) ) { |
| 778 | - if ( isset( $frm_vars['js_validate_forms'][ $field['form_id'] ] ) ) { |
|
| 779 | - return $frm_vars['js_validate_forms'][ $field['form_id'] ]; |
|
| 778 | + if ( isset( $frm_vars['js_validate_forms'][$field['form_id']] ) ) { |
|
| 779 | + return $frm_vars['js_validate_forms'][$field['form_id']]; |
|
| 780 | 780 | } |
| 781 | - if ( ! empty( $field['parent_form_id'] ) && isset( $frm_vars['js_validate_forms'][ $field['parent_form_id'] ] ) ) { |
|
| 782 | - return $frm_vars['js_validate_forms'][ $field['parent_form_id'] ]; |
|
| 781 | + if ( ! empty( $field['parent_form_id'] ) && isset( $frm_vars['js_validate_forms'][$field['parent_form_id']] ) ) { |
|
| 782 | + return $frm_vars['js_validate_forms'][$field['parent_form_id']]; |
|
| 783 | 783 | } |
| 784 | 784 | } |
| 785 | 785 | return false; |
@@ -867,10 +867,10 @@ discard block |
||
| 867 | 867 | |
| 868 | 868 | if ( is_numeric( $k ) && strpos( $v, '=' ) ) { |
| 869 | 869 | $add_html[] = $v; |
| 870 | - } elseif ( ! empty( $k ) && isset( $add_html[ $k ] ) ) { |
|
| 871 | - $add_html[ $k ] = str_replace( $k . '="', $k . '="' . $v, $add_html[ $k ] ); |
|
| 870 | + } elseif ( ! empty( $k ) && isset( $add_html[$k] ) ) { |
|
| 871 | + $add_html[$k] = str_replace( $k . '="', $k . '="' . $v, $add_html[$k] ); |
|
| 872 | 872 | } else { |
| 873 | - $add_html[ $k ] = $k . '="' . esc_attr( $v ) . '"'; |
|
| 873 | + $add_html[$k] = $k . '="' . esc_attr( $v ) . '"'; |
|
| 874 | 874 | } |
| 875 | 875 | |
| 876 | 876 | unset( $k, $v ); |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | return; |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | - $selected_xml = isset( $form['xml'] ) && isset( $form['xml'][ $selected_form ] ) ? $form['xml'][ $selected_form ] : ''; |
|
| 166 | + $selected_xml = isset( $form['xml'] ) && isset( $form['xml'][$selected_form] ) ? $form['xml'][$selected_form] : ''; |
|
| 167 | 167 | if ( empty( $selected_xml ) || strpos( $selected_xml, 'http' ) !== 0 ) { |
| 168 | 168 | return; |
| 169 | 169 | } |
@@ -178,8 +178,8 @@ discard block |
||
| 178 | 178 | * @param string $value |
| 179 | 179 | */ |
| 180 | 180 | private static function get_selected_in_form( $form, $value = 'form' ) { |
| 181 | - if ( ! empty( $form ) && isset( $form[ $value ] ) && ! empty( $form[ $value ] ) ) { |
|
| 182 | - return $form[ $value ]; |
|
| 181 | + if ( ! empty( $form ) && isset( $form[$value] ) && ! empty( $form[$value] ) ) { |
|
| 182 | + return $form[$value]; |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | return ''; |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | if ( $for === 'view' ) { |
| 211 | - $item_key = is_array( $view_keys ) ? $view_keys[ $form_key ] : $view_keys; |
|
| 211 | + $item_key = is_array( $view_keys ) ? $view_keys[$form_key] : $view_keys; |
|
| 212 | 212 | $shortcode = '[display-frm-data id=%1$s filter=limited]'; |
| 213 | 213 | } elseif ( $for === 'form' ) { |
| 214 | 214 | $item_key = $form_key; |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | continue; |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | - $page_ids[ $for ] = wp_insert_post( |
|
| 226 | + $page_ids[$for] = wp_insert_post( |
|
| 227 | 227 | array( |
| 228 | 228 | 'post_title' => $name, |
| 229 | 229 | 'post_type' => 'page', |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing |
| 377 | 377 | $file_type = sanitize_option( 'upload_path', $_FILES['frm_import_file']['name'] ); |
| 378 | 378 | $file_type = strtolower( pathinfo( $file_type, PATHINFO_EXTENSION ) ); |
| 379 | - if ( 'xml' !== $file_type && isset( $export_format[ $file_type ] ) ) { |
|
| 379 | + if ( 'xml' !== $file_type && isset( $export_format[$file_type] ) ) { |
|
| 380 | 380 | // allow other file types to be imported |
| 381 | 381 | do_action( 'frm_before_import_' . $file_type ); |
| 382 | 382 | |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | foreach ( $type as $tb_type ) { |
| 471 | 471 | $where = array(); |
| 472 | 472 | $join = ''; |
| 473 | - $table = $tables[ $tb_type ]; |
|
| 473 | + $table = $tables[$tb_type]; |
|
| 474 | 474 | |
| 475 | 475 | $select = $table . '.id'; |
| 476 | 476 | $query_vars = array(); |
@@ -485,7 +485,7 @@ discard block |
||
| 485 | 485 | $table . '.parent_form_id' => $args['ids'], |
| 486 | 486 | ); |
| 487 | 487 | } else { |
| 488 | - $where[ $table . '.status !' ] = 'draft'; |
|
| 488 | + $where[$table . '.status !'] = 'draft'; |
|
| 489 | 489 | } |
| 490 | 490 | break; |
| 491 | 491 | case 'actions': |
@@ -498,7 +498,7 @@ discard block |
||
| 498 | 498 | case 'items': |
| 499 | 499 | // $join = "INNER JOIN {$wpdb->prefix}frm_item_metas im ON ($table.id = im.item_id)"; |
| 500 | 500 | if ( $args['ids'] ) { |
| 501 | - $where[ $table . '.form_id' ] = $args['ids']; |
|
| 501 | + $where[$table . '.form_id'] = $args['ids']; |
|
| 502 | 502 | } |
| 503 | 503 | break; |
| 504 | 504 | case 'styles': |
@@ -539,7 +539,7 @@ discard block |
||
| 539 | 539 | } |
| 540 | 540 | }//end switch |
| 541 | 541 | |
| 542 | - $records[ $tb_type ] = FrmDb::get_col( $table . $join, $where, $select ); |
|
| 542 | + $records[$tb_type] = FrmDb::get_col( $table . $join, $where, $select ); |
|
| 543 | 543 | unset( $tb_type ); |
| 544 | 544 | }//end foreach |
| 545 | 545 | |
@@ -734,7 +734,7 @@ discard block |
||
| 734 | 734 | $no_export_fields = FrmField::no_save_fields(); |
| 735 | 735 | foreach ( $csv_fields as $k => $f ) { |
| 736 | 736 | if ( in_array( $f->type, $no_export_fields, true ) ) { |
| 737 | - unset( $csv_fields[ $k ] ); |
|
| 737 | + unset( $csv_fields[$k] ); |
|
| 738 | 738 | } |
| 739 | 739 | } |
| 740 | 740 | |
@@ -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 | |
@@ -298,8 +298,8 @@ discard block |
||
| 298 | 298 | 'description' => '', |
| 299 | 299 | ); |
| 300 | 300 | foreach ( $defaults as $var => $default ) { |
| 301 | - if ( ! isset( $values[ $var ] ) ) { |
|
| 302 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 301 | + if ( ! isset( $values[$var] ) ) { |
|
| 302 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 303 | 303 | } |
| 304 | 304 | } |
| 305 | 305 | |
@@ -314,8 +314,8 @@ discard block |
||
| 314 | 314 | 'parent_form_id' => 0, |
| 315 | 315 | ); |
| 316 | 316 | foreach ( $defaults as $var => $default ) { |
| 317 | - if ( ! isset( $values[ $var ] ) ) { |
|
| 318 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 317 | + if ( ! isset( $values[$var] ) ) { |
|
| 318 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 319 | 319 | } |
| 320 | 320 | } |
| 321 | 321 | unset( $defaults ); |
@@ -352,16 +352,16 @@ discard block |
||
| 352 | 352 | $defaults = self::get_default_opts(); |
| 353 | 353 | foreach ( $defaults as $var => $default ) { |
| 354 | 354 | if ( is_array( $default ) ) { |
| 355 | - if ( ! isset( $values[ $var ] ) ) { |
|
| 356 | - $values[ $var ] = ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : array(); |
|
| 355 | + if ( ! isset( $values[$var] ) ) { |
|
| 356 | + $values[$var] = ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : array(); |
|
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | foreach ( $default as $k => $v ) { |
| 360 | - $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 ); |
|
| 360 | + $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 ); |
|
| 361 | 361 | |
| 362 | 362 | if ( is_array( $v ) ) { |
| 363 | 363 | foreach ( $v as $k1 => $v1 ) { |
| 364 | - $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 ); |
|
| 364 | + $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 ); |
|
| 365 | 365 | unset( $k1, $v1 ); |
| 366 | 366 | } |
| 367 | 367 | } |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | unset( $k, $v ); |
| 370 | 370 | } |
| 371 | 371 | } else { |
| 372 | - $values[ $var ] = ( $post_values && isset( $post_values['options'][ $var ] ) ) ? $post_values['options'][ $var ] : ( ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : $default ); |
|
| 372 | + $values[$var] = ( $post_values && isset( $post_values['options'][$var] ) ) ? $post_values['options'][$var] : ( ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : $default ); |
|
| 373 | 373 | } |
| 374 | 374 | |
| 375 | 375 | unset( $var, $default ); |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | public static function fill_form_options( &$options, $values ) { |
| 416 | 416 | $defaults = self::get_default_opts(); |
| 417 | 417 | foreach ( $defaults as $var => $default ) { |
| 418 | - $options[ $var ] = isset( $values['options'][ $var ] ) ? $values['options'][ $var ] : $default; |
|
| 418 | + $options[$var] = isset( $values['options'][$var] ) ? $values['options'][$var] : $default; |
|
| 419 | 419 | unset( $var, $default ); |
| 420 | 420 | } |
| 421 | 421 | } |
@@ -590,7 +590,7 @@ discard block |
||
| 590 | 590 | public static function insert_opt_html( $args ) { |
| 591 | 591 | $class = isset( $args['class'] ) ? $args['class'] : ''; |
| 592 | 592 | $fields = FrmField::all_field_selection(); |
| 593 | - $field = isset( $fields[ $args['type'] ] ) ? $fields[ $args['type'] ] : array(); |
|
| 593 | + $field = isset( $fields[$args['type']] ) ? $fields[$args['type']] : array(); |
|
| 594 | 594 | |
| 595 | 595 | self::prepare_field_type( $field ); |
| 596 | 596 | |
@@ -691,7 +691,7 @@ discard block |
||
| 691 | 691 | $last_field = false; |
| 692 | 692 | foreach ( $fields as $field ) { |
| 693 | 693 | if ( $prev_order === $field->field_order ) { |
| 694 | - ++$add_order; |
|
| 694 | + ++ $add_order; |
|
| 695 | 695 | } |
| 696 | 696 | |
| 697 | 697 | if ( $add_order ) { |
@@ -1155,8 +1155,8 @@ discard block |
||
| 1155 | 1155 | $link .= ' onclick="return confirm(\'' . esc_attr( $link_details['confirm'] ) . '\')"'; |
| 1156 | 1156 | } |
| 1157 | 1157 | |
| 1158 | - $label = ( isset( $link_details[ $length ] ) ? $link_details[ $length ] : $link_details['label'] ); |
|
| 1159 | - if ( $length == 'icon' && isset( $link_details[ $length ] ) ) { |
|
| 1158 | + $label = ( isset( $link_details[$length] ) ? $link_details[$length] : $link_details['label'] ); |
|
| 1159 | + if ( $length == 'icon' && isset( $link_details[$length] ) ) { |
|
| 1160 | 1160 | $label = '<span class="' . $label . '" title="' . esc_attr( $link_details['label'] ) . '" aria-hidden="true"></span>'; |
| 1161 | 1161 | $link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"'; |
| 1162 | 1162 | } |
@@ -1303,7 +1303,7 @@ discard block |
||
| 1303 | 1303 | $status = 'publish'; |
| 1304 | 1304 | } |
| 1305 | 1305 | |
| 1306 | - $name = $nice_names[ $status ]; |
|
| 1306 | + $name = $nice_names[$status]; |
|
| 1307 | 1307 | |
| 1308 | 1308 | return $name; |
| 1309 | 1309 | } |
@@ -1367,7 +1367,7 @@ discard block |
||
| 1367 | 1367 | $icon = $icons['']; |
| 1368 | 1368 | if ( count( $categories ) === 1 ) { |
| 1369 | 1369 | $category = reset( $categories ); |
| 1370 | - $icon = isset( $icons[ $category ] ) ? $icons[ $category ] : $icon; |
|
| 1370 | + $icon = isset( $icons[$category] ) ? $icons[$category] : $icon; |
|
| 1371 | 1371 | } elseif ( ! empty( $categories ) ) { |
| 1372 | 1372 | $icons = array_intersect_key( $icons, array_flip( $categories ) ); |
| 1373 | 1373 | $icon = reset( $icons ); |
@@ -1505,7 +1505,7 @@ discard block |
||
| 1505 | 1505 | |
| 1506 | 1506 | foreach ( $item['categories'] as $k => $category ) { |
| 1507 | 1507 | if ( in_array( $category, $plans, true ) ) { |
| 1508 | - unset( $item['categories'][ $k ] ); |
|
| 1508 | + unset( $item['categories'][$k] ); |
|
| 1509 | 1509 | |
| 1510 | 1510 | if ( in_array( $category, array( 'Creator', 'Personal' ), true ) ) { |
| 1511 | 1511 | // Show the current package name. |
@@ -1707,9 +1707,9 @@ discard block |
||
| 1707 | 1707 | } |
| 1708 | 1708 | |
| 1709 | 1709 | foreach ( $shortcodes[0] as $key => $shortcode ) { |
| 1710 | - $options = trim( $shortcodes[3][ $key ] ); |
|
| 1710 | + $options = trim( $shortcodes[3][$key] ); |
|
| 1711 | 1711 | |
| 1712 | - if ( in_array( $shortcodes[1][ $key ], array( 'if ' ), true ) ) { |
|
| 1712 | + if ( in_array( $shortcodes[1][$key], array( 'if ' ), true ) ) { |
|
| 1713 | 1713 | // Skip if shortcodes. |
| 1714 | 1714 | continue; |
| 1715 | 1715 | } |
@@ -1719,7 +1719,7 @@ discard block |
||
| 1719 | 1719 | continue; |
| 1720 | 1720 | } |
| 1721 | 1721 | |
| 1722 | - $new_shortcode = '[' . $shortcodes[2][ $key ]; |
|
| 1722 | + $new_shortcode = '[' . $shortcodes[2][$key]; |
|
| 1723 | 1723 | if ( $options ) { |
| 1724 | 1724 | $new_shortcode .= ' ' . $options; |
| 1725 | 1725 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | while ( $count > 0 && ! is_null( $one = $this->read_one() ) ) { |
| 80 | 80 | $value .= $one; |
| 81 | - --$count; |
|
| 81 | + -- $count; |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | return $this->strip_quotes( $value ); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | */ |
| 93 | 93 | private function read_one() { |
| 94 | 94 | if ( $this->pos <= $this->max ) { |
| 95 | - $value = $this->string[ $this->pos ]; |
|
| 95 | + $value = $this->string[$this->pos]; |
|
| 96 | 96 | $this->pos += 1; |
| 97 | 97 | } else { |
| 98 | 98 | $value = null; |
@@ -217,7 +217,7 @@ |
||
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | if ( false !== $this->parent_li ) { |
| 220 | - ++$this->current_field_count; |
|
| 220 | + ++ $this->current_field_count; |
|
| 221 | 221 | $this->current_list_size += $this->active_field_size; |
| 222 | 222 | if ( 12 === $this->current_list_size ) { |
| 223 | 223 | $this->close_field_wrapper(); |