@@ -285,7 +285,7 @@ |
||
| 285 | 285 | 'type' => $field->type, |
| 286 | 286 | ); |
| 287 | 287 | |
| 288 | - $this->array_content[ $field->id ] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $array, $field ); |
|
| 288 | + $this->array_content[$field->id] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $array, $field ); |
|
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | /** |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | continue; |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | - $this->maybe_convert_migrated_size( $widgets[ $k ]['size'] ); |
|
| 329 | + $this->maybe_convert_migrated_size( $widgets[$k]['size'] ); |
|
| 330 | 330 | } |
| 331 | 331 | update_option( 'widget_frm_show_form', $widgets ); |
| 332 | 332 | } |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | if ( ! is_array( $widget ) || ! isset( $widget['size'] ) ) { |
| 423 | 423 | continue; |
| 424 | 424 | } |
| 425 | - $this->convert_character_to_px( $widgets[ $k ]['size'] ); |
|
| 425 | + $this->convert_character_to_px( $widgets[$k]['size'] ); |
|
| 426 | 426 | } |
| 427 | 427 | update_option( 'widget_frm_show_form', $widgets ); |
| 428 | 428 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | public function set_upgrader( &$upgrader ) { |
| 23 | 23 | if ( is_object( $upgrader ) ) { |
| 24 | - $this->upgrader =& $upgrader; |
|
| 24 | + $this->upgrader = & $upgrader; |
|
| 25 | 25 | } |
| 26 | 26 | } |
| 27 | 27 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | 'sep' => ', ', |
| 40 | 40 | 'html' => false, |
| 41 | 41 | ); |
| 42 | - $atts = wp_parse_args( $atts, $defaults ); |
|
| 42 | + $atts = wp_parse_args( $atts, $defaults ); |
|
| 43 | 43 | |
| 44 | 44 | if ( $atts['html'] ) { |
| 45 | 45 | $atts['sep'] = ' '; |
@@ -61,9 +61,9 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | // validate the url format |
| 63 | 63 | if ( ! empty( $value ) && ! preg_match( '/^http(s)?:\/\/(?:localhost|(?:[\da-z\.-]+\.[\da-z\.-]+))/i', $value ) ) { |
| 64 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
| 64 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
| 65 | 65 | } elseif ( $this->field->required == '1' && empty( $value ) ) { |
| 66 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'blank' ); |
|
| 66 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'blank' ); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | return $errors; |
@@ -59,8 +59,8 @@ |
||
| 59 | 59 | protected function init_saved_value( $entry ) { |
| 60 | 60 | if ( $this->field->type === 'html' ) { |
| 61 | 61 | $this->saved_value = $this->field->description; |
| 62 | - } elseif ( isset( $entry->metas[ $this->field->id ] ) ) { |
|
| 63 | - $this->saved_value = $entry->metas[ $this->field->id ]; |
|
| 62 | + } elseif ( isset( $entry->metas[$this->field->id] ) ) { |
|
| 63 | + $this->saved_value = $entry->metas[$this->field->id]; |
|
| 64 | 64 | } else { |
| 65 | 65 | $this->saved_value = ''; |
| 66 | 66 | } |
@@ -235,7 +235,7 @@ |
||
| 235 | 235 | if ( is_array( $upsell ) ) { |
| 236 | 236 | foreach ( $upsell as $k => $plugin ) { |
| 237 | 237 | if ( strpos( $plugin['slug'], 'wpforms' ) !== false ) { |
| 238 | - unset( $upsell[ $k ] ); |
|
| 238 | + unset( $upsell[$k] ); |
|
| 239 | 239 | } |
| 240 | 240 | } |
| 241 | 241 | } |
@@ -491,7 +491,8 @@ |
||
| 491 | 491 | |
| 492 | 492 | public static function process_entry( $errors = '', $ajax = false ) { |
| 493 | 493 | $form_id = FrmAppHelper::get_post_param( 'form_id', '', 'absint' ); |
| 494 | - if ( FrmAppHelper::is_admin() || empty( $_POST ) || empty( $form_id ) || ! isset( $_POST['item_key'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 494 | + if ( FrmAppHelper::is_admin() || empty( $_POST ) || empty( $form_id ) || ! isset( $_POST['item_key'] ) ) { |
|
| 495 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 495 | 496 | return; |
| 496 | 497 | } |
| 497 | 498 | |
@@ -147,20 +147,20 @@ discard block |
||
| 147 | 147 | global $frm_vars; |
| 148 | 148 | $form_id = FrmForm::get_current_form_id(); |
| 149 | 149 | |
| 150 | - $columns[ $form_id . '_id' ] = 'ID'; |
|
| 151 | - $columns[ $form_id . '_item_key' ] = esc_html__( 'Entry Key', 'formidable' ); |
|
| 150 | + $columns[$form_id . '_id'] = 'ID'; |
|
| 151 | + $columns[$form_id . '_item_key'] = esc_html__( 'Entry Key', 'formidable' ); |
|
| 152 | 152 | |
| 153 | 153 | if ( $form_id ) { |
| 154 | 154 | self::get_columns_for_form( $form_id, $columns ); |
| 155 | 155 | } else { |
| 156 | - $columns[ $form_id . '_form_id' ] = esc_html__( 'Form', 'formidable' ); |
|
| 157 | - $columns[ $form_id . '_name' ] = esc_html__( 'Entry Name', 'formidable' ); |
|
| 158 | - $columns[ $form_id . '_user_id' ] = esc_html__( 'Created By', 'formidable' ); |
|
| 156 | + $columns[$form_id . '_form_id'] = esc_html__( 'Form', 'formidable' ); |
|
| 157 | + $columns[$form_id . '_name'] = esc_html__( 'Entry Name', 'formidable' ); |
|
| 158 | + $columns[$form_id . '_user_id'] = esc_html__( 'Created By', 'formidable' ); |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | - $columns[ $form_id . '_is_draft' ] = esc_html__( 'Entry Status', 'formidable' ); |
|
| 162 | - $columns[ $form_id . '_created_at' ] = __( 'Entry creation date', 'formidable' ); |
|
| 163 | - $columns[ $form_id . '_updated_at' ] = __( 'Entry update date', 'formidable' ); |
|
| 161 | + $columns[$form_id . '_is_draft'] = esc_html__( 'Entry Status', 'formidable' ); |
|
| 162 | + $columns[$form_id . '_created_at'] = __( 'Entry creation date', 'formidable' ); |
|
| 163 | + $columns[$form_id . '_updated_at'] = __( 'Entry update date', 'formidable' ); |
|
| 164 | 164 | self::maybe_add_ip_col( $form_id, $columns ); |
| 165 | 165 | |
| 166 | 166 | $frm_vars['cols'] = $columns; |
@@ -218,10 +218,10 @@ discard block |
||
| 218 | 218 | |
| 219 | 219 | foreach ( $sub_form_cols as $k => $sub_form_col ) { |
| 220 | 220 | if ( FrmField::is_no_save_field( $sub_form_col->type ) ) { |
| 221 | - unset( $sub_form_cols[ $k ] ); |
|
| 221 | + unset( $sub_form_cols[$k] ); |
|
| 222 | 222 | continue; |
| 223 | 223 | } |
| 224 | - $columns[ $form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id ] = FrmAppHelper::truncate( $sub_form_col->name, 35 ); |
|
| 224 | + $columns[$form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id] = FrmAppHelper::truncate( $sub_form_col->name, 35 ); |
|
| 225 | 225 | unset( $sub_form_col ); |
| 226 | 226 | } |
| 227 | 227 | } |
@@ -239,10 +239,10 @@ discard block |
||
| 239 | 239 | $is_post_status = FrmField::is_option_true( $field, 'post_field' ) && $field->field_options['post_field'] === 'post_status'; |
| 240 | 240 | $include_column_for_sep_val = $has_separate_value && ! $is_post_status; |
| 241 | 241 | if ( $include_column_for_sep_val ) { |
| 242 | - $columns[ $form_id . '_frmsep_' . $col_id ] = self::maybe_format_field_name_for_column_title( $field, $include_column_for_sep_val ); |
|
| 242 | + $columns[$form_id . '_frmsep_' . $col_id] = self::maybe_format_field_name_for_column_title( $field, $include_column_for_sep_val ); |
|
| 243 | 243 | } |
| 244 | 244 | |
| 245 | - $columns[ $form_id . '_' . $col_id ] = self::maybe_format_field_name_for_column_title( $field, $include_column_for_sep_val, false ); |
|
| 245 | + $columns[$form_id . '_' . $col_id] = self::maybe_format_field_name_for_column_title( $field, $include_column_for_sep_val, false ); |
|
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | /** |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | |
| 269 | 269 | private static function maybe_add_ip_col( $form_id, &$columns ) { |
| 270 | 270 | if ( FrmAppHelper::ips_saved() ) { |
| 271 | - $columns[ $form_id . '_ip' ] = 'IP'; |
|
| 271 | + $columns[$form_id . '_ip'] = 'IP'; |
|
| 272 | 272 | } |
| 273 | 273 | } |
| 274 | 274 | |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | foreach ( $meta_value as $mk => $mv ) { |
| 308 | 308 | // Remove blank values. |
| 309 | 309 | if ( empty( $mv ) ) { |
| 310 | - unset( $meta_value[ $mk ] ); |
|
| 310 | + unset( $meta_value[$mk] ); |
|
| 311 | 311 | } |
| 312 | 312 | } |
| 313 | 313 | |
@@ -384,14 +384,14 @@ discard block |
||
| 384 | 384 | ); |
| 385 | 385 | |
| 386 | 386 | if ( ! $form_id ) { |
| 387 | - $columns[ $form_id . '_user_id' ] = 'user_id'; |
|
| 388 | - $columns[ $form_id . '_name' ] = 'name'; |
|
| 389 | - $columns[ $form_id . '_form_id' ] = 'form_id'; |
|
| 387 | + $columns[$form_id . '_user_id'] = 'user_id'; |
|
| 388 | + $columns[$form_id . '_name'] = 'name'; |
|
| 389 | + $columns[$form_id . '_form_id'] = 'form_id'; |
|
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | foreach ( $fields as $field ) { |
| 393 | 393 | if ( self::field_supports_sorting( $field ) ) { |
| 394 | - $columns[ $form_id . '_' . $field->field_key ] = 'meta_' . $field->id; |
|
| 394 | + $columns[$form_id . '_' . $field->field_key] = 'meta_' . $field->id; |
|
| 395 | 395 | } |
| 396 | 396 | } |
| 397 | 397 | |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | $atts['form_id'] . '_item_key' => '', |
| 479 | 479 | $atts['form_id'] . '_id' => '', |
| 480 | 480 | ); |
| 481 | - $cols = $remove_first + array_reverse( $frm_vars['cols'], true ); |
|
| 481 | + $cols = $remove_first + array_reverse( $frm_vars['cols'], true ); |
|
| 482 | 482 | |
| 483 | 483 | $i = $atts['i']; |
| 484 | 484 | |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | |
| 490 | 490 | if ( empty( $result ) || ! in_array( $col_key, $result, true ) ) { |
| 491 | 491 | $result[] = $col_key; |
| 492 | - --$i; |
|
| 492 | + -- $i; |
|
| 493 | 493 | } |
| 494 | 494 | |
| 495 | 495 | unset( $col_key, $col ); |
@@ -637,9 +637,9 @@ discard block |
||
| 637 | 637 | if ( ! isset( $frm_vars['form_params'] ) ) { |
| 638 | 638 | $frm_vars['form_params'] = array(); |
| 639 | 639 | } |
| 640 | - $frm_vars['form_params'][ $form->id ] = $params; |
|
| 640 | + $frm_vars['form_params'][$form->id] = $params; |
|
| 641 | 641 | |
| 642 | - if ( isset( $frm_vars['created_entries'][ $form_id ] ) ) { |
|
| 642 | + if ( isset( $frm_vars['created_entries'][$form_id] ) ) { |
|
| 643 | 643 | return; |
| 644 | 644 | } |
| 645 | 645 | |
@@ -655,16 +655,16 @@ discard block |
||
| 655 | 655 | */ |
| 656 | 656 | $errors = apply_filters( 'frm_entries_before_create', $errors, $form ); |
| 657 | 657 | |
| 658 | - $frm_vars['created_entries'][ $form_id ] = array( 'errors' => $errors ); |
|
| 658 | + $frm_vars['created_entries'][$form_id] = array( 'errors' => $errors ); |
|
| 659 | 659 | |
| 660 | 660 | if ( empty( $errors ) ) { |
| 661 | 661 | $_POST['frm_skip_cookie'] = 1; |
| 662 | 662 | $do_success = false; |
| 663 | 663 | if ( $params['action'] === 'create' ) { |
| 664 | - if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) { |
|
| 665 | - $frm_vars['created_entries'][ $form_id ]['entry_id'] = FrmEntry::create( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 664 | + if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ) { |
|
| 665 | + $frm_vars['created_entries'][$form_id]['entry_id'] = FrmEntry::create( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 666 | 666 | |
| 667 | - $params['id'] = $frm_vars['created_entries'][ $form_id ]['entry_id']; |
|
| 667 | + $params['id'] = $frm_vars['created_entries'][$form_id]['entry_id']; |
|
| 668 | 668 | $do_success = true; |
| 669 | 669 | } |
| 670 | 670 | } |
@@ -42,7 +42,8 @@ |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | // Only do this for single site installs. |
| 45 | - if ( isset( $_GET['activate-multi'] ) || is_network_admin() ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 45 | + if ( isset( $_GET['activate-multi'] ) || is_network_admin() ) { |
|
| 46 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 46 | 47 | return; |
| 47 | 48 | } |
| 48 | 49 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | */ |
| 184 | 184 | public function add_settings( $sections ) { |
| 185 | 185 | wp_enqueue_style( 'formidable-pro-fields' ); |
| 186 | - $sections[ $this->plugin_slug ] = array( |
|
| 186 | + $sections[$this->plugin_slug] = array( |
|
| 187 | 187 | 'class' => $this, |
| 188 | 188 | 'function' => 'settings_page', |
| 189 | 189 | 'name' => $this->plugin_name(), |
@@ -349,9 +349,9 @@ discard block |
||
| 349 | 349 | // Set the current step. |
| 350 | 350 | if ( ! isset( $step['current'] ) ) { |
| 351 | 351 | if ( $step['complete'] ) { |
| 352 | - $steps[ $k ]['current'] = false; |
|
| 352 | + $steps[$k]['current'] = false; |
|
| 353 | 353 | } else { |
| 354 | - $steps[ $k ]['current'] = ! $has_current; |
|
| 354 | + $steps[$k]['current'] = ! $has_current; |
|
| 355 | 355 | $has_current = true; |
| 356 | 356 | } |
| 357 | 357 | } elseif ( $step['current'] ) { |
@@ -361,10 +361,10 @@ discard block |
||
| 361 | 361 | // Set disabled buttons. |
| 362 | 362 | $class = $step['button_class'] ?? ''; |
| 363 | 363 | $class .= ' button-primary frm-button-primary'; |
| 364 | - if ( ! $steps[ $k ]['current'] ) { |
|
| 364 | + if ( ! $steps[$k]['current'] ) { |
|
| 365 | 365 | $class .= ' frm_grey disabled'; |
| 366 | 366 | } |
| 367 | - $steps[ $k ]['button_class'] = $class; |
|
| 367 | + $steps[$k]['button_class'] = $class; |
|
| 368 | 368 | }//end foreach |
| 369 | 369 | |
| 370 | 370 | return $steps; |
@@ -519,7 +519,7 @@ discard block |
||
| 519 | 519 | $addons = $api->get_api_info(); |
| 520 | 520 | |
| 521 | 521 | $id = $this->download_id(); |
| 522 | - $has_file = isset( $addons[ $id ] ) && isset( $addons[ $id ]['beta'] ); |
|
| 522 | + $has_file = isset( $addons[$id] ) && isset( $addons[$id]['beta'] ); |
|
| 523 | 523 | |
| 524 | 524 | if ( ! $step['current'] ) { |
| 525 | 525 | ?> |
@@ -534,10 +534,10 @@ discard block |
||
| 534 | 534 | |
| 535 | 535 | if ( ! $has_file ) { |
| 536 | 536 | echo '<p class="frm_error_style">' . esc_html__( 'We didn\'t find anything to import. Please contact our team.', 'formidable' ) . '</p>'; |
| 537 | - } elseif ( ! isset( $addons[ $id ]['beta']['package'] ) ) { |
|
| 537 | + } elseif ( ! isset( $addons[$id]['beta']['package'] ) ) { |
|
| 538 | 538 | echo '<p class="frm_error_style">' . esc_html__( 'Looks like you may not have a current subscription for this solution. Please check your account.', 'formidable' ) . '</p>'; |
| 539 | 539 | } else { |
| 540 | - $xml = $addons[ $id ]['beta']['package']; |
|
| 540 | + $xml = $addons[$id]['beta']['package']; |
|
| 541 | 541 | if ( is_array( $xml ) ) { |
| 542 | 542 | $xml = reset( $xml ); |
| 543 | 543 | } |
@@ -614,7 +614,7 @@ discard block |
||
| 614 | 614 | foreach ( $options as $info ) { |
| 615 | 615 | // Count the number of options displayed for css. |
| 616 | 616 | if ( $count > 1 && ! isset( $info['img'] ) ) { |
| 617 | - --$count; |
|
| 617 | + -- $count; |
|
| 618 | 618 | } |
| 619 | 619 | } |
| 620 | 620 | $width = floor( ( 533 - ( ( $count - 1 ) * 20 ) ) / $count ); |
@@ -704,7 +704,7 @@ discard block |
||
| 704 | 704 | foreach ( $forms as $form ) { |
| 705 | 705 | $was_imported = isset( $form['form'] ) ? FrmForm::get_id_by_key( $form['form'] ) : false; |
| 706 | 706 | if ( $was_imported ) { |
| 707 | - $imported[ $form['form'] ] = $was_imported; |
|
| 707 | + $imported[$form['form']] = $was_imported; |
|
| 708 | 708 | } |
| 709 | 709 | } |
| 710 | 710 | |
@@ -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'] = '#'; |