Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions classes/controllers/FrmEmailStylesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ public static function ajax_send_test_email() {
if ( ! $email || ! is_email( $email ) ) {
continue;
}

$valid_emails[] = $email;
}

Expand Down
1 change: 1 addition & 0 deletions classes/controllers/FrmEntriesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ private static function add_subform_cols( $field, $form_id, &$columns ) {
unset( $sub_form_cols[ $k ] );
continue;
}

$columns[ $form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id ] = FrmAppHelper::truncate( $sub_form_col->name, 35 );
unset( $sub_form_col );
}
Expand Down
1 change: 1 addition & 0 deletions classes/controllers/FrmFormTemplatesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@ private static function organize_and_set_categories() {
'count' => 0,
);
}

$special_categories['all-items'] = array(
'name' => __( 'All Templates', 'formidable' ),
'count' => self::get_template_count(),
Expand Down
2 changes: 2 additions & 0 deletions classes/controllers/FrmFormsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1231,6 +1231,7 @@ public static function get_columns( $columns ) {
if ( 'trash' !== FrmAppHelper::simple_get( 'form_type' ) ) {
$columns['shortcode'] = esc_html__( 'Actions', 'formidable' );
}

$columns['created_at'] = esc_html__( 'Date', 'formidable' );

add_screen_option(
Expand Down Expand Up @@ -1609,6 +1610,7 @@ private static function get_settings_tabs( $values ) {
if ( ! isset( $section['anchor'] ) ) {
$section['anchor'] = $key;
}

$section['anchor'] .= '_settings';

if ( ! isset( $section['title'] ) ) {
Expand Down
2 changes: 2 additions & 0 deletions classes/controllers/FrmStylesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ private static function get_url_to_custom_style( &$stylesheet_urls ) {
} else {
$url = admin_url( 'admin-ajax.php?action=frmpro_css' );
}

$stylesheet_urls['formidable'] = $url;
}

Expand Down Expand Up @@ -1309,6 +1310,7 @@ public static function show_entry_styles( $default_styles ) {
} elseif ( 'alt_bg_color' === $name ) {
$setting = 'bg_color_active';
}

$default_styles[ $name ] = $style->post_content[ $setting ];
unset( $name, $val );
}
Expand Down
1 change: 1 addition & 0 deletions classes/helpers/FrmFieldsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1817,6 +1817,7 @@ public static function switch_field_ids( $val ) {
unset( $k, $v );
continue;
}

$val[ $k ] = str_replace( $replace, $replace_with, $v );
unset( $k, $v );
}
Expand Down
1 change: 1 addition & 0 deletions classes/helpers/FrmStylesCardHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ public static function get_style_param_for_card( $style ) {
} else {
$background_color = str_starts_with( $style->post_content['fieldset_bg_color'], 'rgb' ) ? $style->post_content['fieldset_bg_color'] : '#' . $style->post_content['fieldset_bg_color'];
}

$styles[] = '--preview-background-color: ' . $background_color;

if ( empty( $style->post_content['submit_border_color'] ) ) {
Expand Down
6 changes: 5 additions & 1 deletion classes/helpers/FrmXMLHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -791,8 +791,9 @@ public static function migrate_field_placeholder( $field, $type ) {
break;
}
}

$changes['options'] = $options;
}
}//end if

return $changes;
}
Expand Down Expand Up @@ -2004,6 +2005,7 @@ private static function migrate_post_settings_to_action( $form_options, $form_id

$new_action['post_content'] = self::switch_action_field_ids( $new_action['post_content'], $basic_fields, $array_fields );
}

$new_action['post_content'] = json_encode( $new_action['post_content'] );

$exists = get_posts(
Expand Down Expand Up @@ -2112,6 +2114,7 @@ private static function migrate_email_settings_to_action( $form_options, $form_i
// Switch all other field IDs in email
$new_notification['post_content'] = FrmFieldsHelper::switch_field_ids( $new_notification['post_content'] );
}

$new_notification['post_content'] = FrmAppHelper::prepare_and_encode( $new_notification['post_content'] );

$exists = get_posts(
Expand Down Expand Up @@ -2274,6 +2277,7 @@ private static function format_email_to_data( &$atts, $notification ) {
unset( $email_opt );
}
}

$atts['email_to'] = implode( ', ', $atts['email_to'] );
}

Expand Down
2 changes: 2 additions & 0 deletions classes/models/FrmApplicationTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ function ( $category ) {
// Strip off the " Template" text at the end of the name as it takes up space.
$value = substr( $value, 0, -9 );
}

$application[ $key ] = $value;
}//end if
}//end foreach
Expand All @@ -219,6 +220,7 @@ function ( $category ) {
if ( false !== $purchase_url ) {
$application['forPurchase'] = true;
}

$application['upgradeUrl'] = $this->get_admin_upgrade_link();
$application['link'] = $application['upgradeUrl'];
}
Expand Down
1 change: 1 addition & 0 deletions classes/models/FrmEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public static function is_duplicate( $new_values, $values ) {
if ( 0 === (int) $meta->field_id ) {
continue;
}

$field_metas[ $meta->field_id ] = $meta->meta_value;
}

Expand Down
2 changes: 2 additions & 0 deletions classes/models/FrmEntryMeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ private static function meta_field_query( $field_id, $order, $limit, $args, arra
if ( $args['value'] ) {
$query[] = $wpdb->prepare( ' AND meta_value=%s', $args['value'] );
}

$query[] = $order . $limit;
}

Expand Down Expand Up @@ -551,6 +552,7 @@ function ( $total, $current ) {
if ( ! empty( $args['user_id'] ) ) {
$where['e.user_id'] = $args['user_id'];
}

$query[] = FrmDb::prepend_and_or_where( ' WHERE ', $where ) . $order_by . $limit;

if ( $args['group_by'] ) {
Expand Down
1 change: 1 addition & 0 deletions classes/models/FrmField.php
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,7 @@ public static function update( $id, $values ) {
if ( 'field_options' === $opt ) {
$values[ $opt ] = self::maybe_filter_options( $values[ $opt ] );
}

$values[ $opt ] = serialize( $values[ $opt ] );
}
}
Expand Down
1 change: 1 addition & 0 deletions classes/models/FrmForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ public static function update_fields( $id, $values ) { // phpcs:ignore SlevomatC
if ( ! in_array( $fid->id, $existing_keys ) && ( isset( $values['frm_fields_submitted'] ) && in_array( $fid->id, $values['frm_fields_submitted'] ) ) || isset( $values['options'] ) ) {
$values['item_meta'][ $fid->id ] = '';
}

$field_array[ $fid->id ] = $fid;
}
unset( $all_fields );
Expand Down
1 change: 1 addition & 0 deletions classes/models/FrmInbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ function ( $matches ) {
if ( isset( $parts['query'] ) ) {
parse_str( $parts['query'], $query );
}

$query['utm_medium'] = 'banner';
$parts['query'] = http_build_query( $query );
return 'href="' . $parts['scheme'] . '://' . $parts['host'] . $parts['path'] . '?' . $parts['query'] . '"';
Expand Down
1 change: 1 addition & 0 deletions classes/models/fields/FrmFieldCaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ protected function validate_against_api( $args ) {
if ( $invalid_message === __( 'The reCAPTCHA was not entered correctly', 'formidable' ) ) {
$invalid_message = '';
}

$errors[ 'field' . $args['id'] ] = $invalid_message === '' ? $frm_settings->re_msg : $invalid_message;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function process( File $phpcsFile, $stackPtr ) {
return;
}

// For variables, check if followed by an assignment operator.
// For variables, check if followed by an assignment operator (or array access then assignment).
if ( $tokens[ $stackPtr ]['code'] === T_VARIABLE ) {
$assignmentTokens = array(
T_EQUAL,
Expand All @@ -76,7 +76,24 @@ public function process( File $phpcsFile, $stackPtr ) {
T_COALESCE_EQUAL,
);

if ( ! in_array( $tokens[ $nextToken ]['code'], $assignmentTokens, true ) ) {
$checkToken = $nextToken;

// If followed by array access, skip to after the closing bracket.
if ( $tokens[ $nextToken ]['code'] === T_OPEN_SQUARE_BRACKET ) {
// Find the matching closing bracket.
if ( isset( $tokens[ $nextToken ]['bracket_closer'] ) ) {
$closeBracket = $tokens[ $nextToken ]['bracket_closer'];
$checkToken = $phpcsFile->findNext( T_WHITESPACE, $closeBracket + 1, null, true );

if ( false === $checkToken ) {
return;
}
} else {
return;
}
}

if ( ! in_array( $tokens[ $checkToken ]['code'], $assignmentTokens, true ) ) {
return;
}
} elseif ( $tokens[ $stackPtr ]['code'] === T_STRING ) {
Expand Down
1 change: 1 addition & 0 deletions stripe/models/FrmStrpLiteAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ private static function update_intent_pricing( $form_id, &$intents ) {
if ( $saved->metadata->action != $action->ID ) {
continue;
}

$intents[ $k ] = array(
'id' => $intent,
'action' => $action->ID,
Expand Down
1 change: 1 addition & 0 deletions tests/phpunit/emails/test_FrmEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ public function test_trigger_email_five() {
if ( str_starts_with( $sitename, 'www.' ) ) {
$sitename = substr( $sitename, 4 );
}

$expected['from'] = 'Yahoo <wordpress@' . $sitename . '>';

// Reply to
Expand Down
Loading