@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | 'payments' => $frm_payment->get_count(), |
| 113 | 113 | 'subscriptions' => $frm_sub->get_count(), |
| 114 | 114 | ); |
| 115 | - $type = FrmAppHelper::get_simple_request( |
|
| 115 | + $type = FrmAppHelper::get_simple_request( |
|
| 116 | 116 | array( |
| 117 | 117 | 'param' => 'trans_type', |
| 118 | 118 | 'type' => 'request', |
@@ -127,10 +127,10 @@ discard block |
||
| 127 | 127 | $class = ''; |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - if ( $counts[ $status ] || 'published' === $status ) { |
|
| 131 | - $links[ $status ] = '<a href="' . esc_url( '?page=formidable-payments&trans_type=' . $status ) . '" ' . $class . '>' |
|
| 130 | + if ( $counts[$status] || 'published' === $status ) { |
|
| 131 | + $links[$status] = '<a href="' . esc_url( '?page=formidable-payments&trans_type=' . $status ) . '" ' . $class . '>' |
|
| 132 | 132 | // translators: %1$s: Transaction type (Payments or Subscriptions), %2$s: Span start tag, %3$s: Count, %3$s: Span close tag. |
| 133 | - . sprintf( esc_html__( '%1$s %2$s(%3$s)%4$s', 'formidable' ), esc_html( $name ), '<span class="count">', number_format_i18n( $counts[ $status ] ), '</span>' ) |
|
| 133 | + . sprintf( esc_html__( '%1$s %2$s(%3$s)%4$s', 'formidable' ), esc_html( $name ), '<span class="count">', number_format_i18n( $counts[$status] ), '</span>' ) |
|
| 134 | 134 | . '</a>'; |
| 135 | 135 | } |
| 136 | 136 | |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | echo '<tr id="payment-' . esc_attr( $item->id ) . '" '; |
| 207 | 207 | |
| 208 | 208 | $is_alternate = 0 === $alt % 2; |
| 209 | - $alt++; |
|
| 209 | + $alt ++; |
|
| 210 | 210 | |
| 211 | 211 | if ( $is_alternate ) { |
| 212 | 212 | echo 'class="alternate"'; |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | |
| 296 | 296 | $form_ids = array(); |
| 297 | 297 | foreach ( $forms as $form ) { |
| 298 | - $form_ids[ $form->id ] = $form; |
|
| 298 | + $form_ids[$form->id] = $form; |
|
| 299 | 299 | unset( $form ); |
| 300 | 300 | } |
| 301 | 301 | |
@@ -395,8 +395,8 @@ discard block |
||
| 395 | 395 | * @return mixed |
| 396 | 396 | */ |
| 397 | 397 | private function get_form_id_column( $item, $atts ) { |
| 398 | - if ( isset( $atts['form_ids'][ $item->item_id ] ) ) { |
|
| 399 | - $form_link = FrmFormsHelper::edit_form_link( $atts['form_ids'][ $item->item_id ]->form_id ); |
|
| 398 | + if ( isset( $atts['form_ids'][$item->item_id] ) ) { |
|
| 399 | + $form_link = FrmFormsHelper::edit_form_link( $atts['form_ids'][$item->item_id]->form_id ); |
|
| 400 | 400 | return $form_link; |
| 401 | 401 | } |
| 402 | 402 | |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | |
| 453 | 453 | foreach ( $completed_payments as $completed_payment ) { |
| 454 | 454 | if ( $completed_payment->status === 'complete' ) { |
| 455 | - $count++; |
|
| 455 | + $count ++; |
|
| 456 | 456 | } |
| 457 | 457 | } |
| 458 | 458 | |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | 'canceled' => __( 'Canceled', 'formidable' ), |
| 70 | 70 | 'confirm' => __( 'Are you sure you want to cancel that subscription?', 'formidable' ), |
| 71 | 71 | ); |
| 72 | - $atts = array_merge( $defaults, $atts ); |
|
| 72 | + $atts = array_merge( $defaults, $atts ); |
|
| 73 | 73 | |
| 74 | 74 | if ( $sub->status === 'active' ) { |
| 75 | 75 | $link = admin_url( 'admin-ajax.php?action=frm_trans_cancel&sub=' . $sub->id . '&nonce=' . wp_create_nonce( 'frm_trans_ajax' ) ); |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | private function update_next_execution_time() { |
| 86 | 86 | $config_option_name = $this->config['config-option-name']; |
| 87 | 87 | |
| 88 | - $this->options_data[ $config_option_name ] = $this->get_next_execution(); |
|
| 88 | + $this->options_data[$config_option_name] = $this->get_next_execution(); |
|
| 89 | 89 | $this->update_options_data(); |
| 90 | 90 | } |
| 91 | 91 | |
@@ -104,11 +104,11 @@ discard block |
||
| 104 | 104 | * @return boolean |
| 105 | 105 | */ |
| 106 | 106 | private function is_time_to_execute() { |
| 107 | - if ( ! isset( $this->options_data[ $this->config['config-option-name'] ] ) ) { |
|
| 107 | + if ( ! isset( $this->options_data[$this->config['config-option-name']] ) ) { |
|
| 108 | 108 | return true; |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - $options = $this->options_data[ $this->config['config-option-name'] ]; |
|
| 111 | + $options = $this->options_data[$this->config['config-option-name']]; |
|
| 112 | 112 | |
| 113 | 113 | return ! ( isset( $options['timestamp'] ) && (int) $options['timestamp'] > $this->get_time() ); |
| 114 | 114 | } |
@@ -146,9 +146,9 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | $is_setup_intent = 0 === strpos( $intent->id, 'seti_' ); |
| 148 | 148 | if ( $is_setup_intent ) { |
| 149 | - $errors[ 'field' . $cc_field_id ] = $intent->last_setup_error->message; |
|
| 149 | + $errors['field' . $cc_field_id] = $intent->last_setup_error->message; |
|
| 150 | 150 | } else { |
| 151 | - $errors[ 'field' . $cc_field_id ] = $intent->last_payment_error->message; |
|
| 151 | + $errors['field' . $cc_field_id] = $intent->last_payment_error->message; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | global $frm_vars; |
@@ -176,9 +176,9 @@ discard block |
||
| 176 | 176 | $save_draft = ! empty( $form->options['save_draft'] ); |
| 177 | 177 | |
| 178 | 178 | global $frm_vars; |
| 179 | - $frm_vars['created_entries'][ $form_id ]['errors'] = $errors; |
|
| 179 | + $frm_vars['created_entries'][$form_id]['errors'] = $errors; |
|
| 180 | 180 | |
| 181 | - $_POST[ 'frm_page_order_' . $form_id ] = true; // Set to true to get FrmProFieldsHelper::get_page_with_error() run |
|
| 181 | + $_POST['frm_page_order_' . $form_id] = true; // Set to true to get FrmProFieldsHelper::get_page_with_error() run |
|
| 182 | 182 | |
| 183 | 183 | if ( ! $save_draft ) { |
| 184 | 184 | // If draft saving is not on, delete the entry. |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | // If draft saving is on, load the draft entry. |
| 190 | - $frm_vars['created_entries'][ $form_id ]['entry_id'] = $entry_id; |
|
| 190 | + $frm_vars['created_entries'][$form_id]['entry_id'] = $entry_id; |
|
| 191 | 191 | add_action( |
| 192 | 192 | 'frm_filter_final_form', |
| 193 | 193 | /** |
@@ -391,8 +391,8 @@ |
||
| 391 | 391 | return $values; |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | - if ( is_array( $previous_entry->metas ) && isset( $previous_entry->metas[ $field->id ] ) ) { |
|
| 395 | - $values['value'] = $previous_entry->metas[ $field->id ]; |
|
| 394 | + if ( is_array( $previous_entry->metas ) && isset( $previous_entry->metas[$field->id] ) ) { |
|
| 395 | + $values['value'] = $previous_entry->metas[$field->id]; |
|
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | $frm_vars['trans_filled'] = true; |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | return $html; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - $atts = array( |
|
| 42 | + $atts = array( |
|
| 43 | 43 | 'fields' => FrmFieldsHelper::get_form_fields( $form_id ), |
| 44 | 44 | 'entry' => $details['entry'], |
| 45 | 45 | ); |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $atts['form'] = FrmForm::getOne( $atts['entry']->form_id ); |
| 162 | 162 | $atts['entry_id'] = $atts['entry']->id; |
| 163 | 163 | $opt = 'success_action'; |
| 164 | - $atts['conf_method'] = ! empty( $atts['form']->options[ $opt ] ) ? $atts['form']->options[ $opt ] : 'message'; |
|
| 164 | + $atts['conf_method'] = ! empty( $atts['form']->options[$opt] ) ? $atts['form']->options[$opt] : 'message'; |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | /** |
@@ -238,10 +238,10 @@ discard block |
||
| 238 | 238 | */ |
| 239 | 239 | public static function get_payment_intents( $name ) { |
| 240 | 240 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 241 | - if ( ! isset( $_POST[ $name ] ) ) { |
|
| 241 | + if ( ! isset( $_POST[$name] ) ) { |
|
| 242 | 242 | return array(); |
| 243 | 243 | } |
| 244 | - $intents = $_POST[ $name ]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 244 | + $intents = $_POST[$name]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 245 | 245 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $intents ); |
| 246 | 246 | return $intents; |
| 247 | 247 | } |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | self::format_form_data( $form ); |
| 269 | 269 | |
| 270 | 270 | $form_id = absint( $form['form_id'] ); |
| 271 | - $intents = isset( $form[ 'frmintent' . $form_id ] ) ? $form[ 'frmintent' . $form_id ] : array(); |
|
| 271 | + $intents = isset( $form['frmintent' . $form_id] ) ? $form['frmintent' . $form_id] : array(); |
|
| 272 | 272 | |
| 273 | 273 | if ( empty( $intents ) ) { |
| 274 | 274 | wp_die(); |
@@ -278,8 +278,8 @@ discard block |
||
| 278 | 278 | $intents = array( $intents ); |
| 279 | 279 | } else { |
| 280 | 280 | foreach ( $intents as $k => $intent ) { |
| 281 | - if ( is_array( $intent ) && isset( $intent[ $k ] ) ) { |
|
| 282 | - $intents[ $k ] = $intent[ $k ]; |
|
| 281 | + if ( is_array( $intent ) && isset( $intent[$k] ) ) { |
|
| 282 | + $intents[$k] = $intent[$k]; |
|
| 283 | 283 | } |
| 284 | 284 | } |
| 285 | 285 | } |
@@ -327,12 +327,12 @@ discard block |
||
| 327 | 327 | continue; |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | - $saved = FrmStrpLiteAppHelper::call_stripe_helper_class( 'get_intent', $intent_id ); |
|
| 330 | + $saved = FrmStrpLiteAppHelper::call_stripe_helper_class( 'get_intent', $intent_id ); |
|
| 331 | 331 | foreach ( $actions as $action ) { |
| 332 | 332 | if ( $saved->metadata->action != $action->ID ) { |
| 333 | 333 | continue; |
| 334 | 334 | } |
| 335 | - $intents[ $k ] = array( |
|
| 335 | + $intents[$k] = array( |
|
| 336 | 336 | 'id' => $intent, |
| 337 | 337 | 'action' => $action->ID, |
| 338 | 338 | ); |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | if ( $k === 'item_meta' ) { |
| 376 | 376 | foreach ( $v as $f => $value ) { |
| 377 | 377 | FrmAppHelper::sanitize_value( 'wp_kses_post', $value ); |
| 378 | - $entry->metas[ absint( $f ) ] = $value; |
|
| 378 | + $entry->metas[absint( $f )] = $value; |
|
| 379 | 379 | } |
| 380 | 380 | } else { |
| 381 | 381 | FrmAppHelper::sanitize_value( 'wp_kses_post', $v ); |
@@ -399,14 +399,14 @@ discard block |
||
| 399 | 399 | |
| 400 | 400 | foreach ( $form as $input ) { |
| 401 | 401 | $key = $input['name']; |
| 402 | - if ( isset( $formatted[ $key ] ) ) { |
|
| 403 | - if ( is_array( $formatted[ $key ] ) ) { |
|
| 404 | - $formatted[ $key ][] = $input['value']; |
|
| 402 | + if ( isset( $formatted[$key] ) ) { |
|
| 403 | + if ( is_array( $formatted[$key] ) ) { |
|
| 404 | + $formatted[$key][] = $input['value']; |
|
| 405 | 405 | } else { |
| 406 | - $formatted[ $key ] = array( $formatted[ $key ], $input['value'] ); |
|
| 406 | + $formatted[$key] = array( $formatted[$key], $input['value'] ); |
|
| 407 | 407 | } |
| 408 | 408 | } else { |
| 409 | - $formatted[ $key ] = $input['value']; |
|
| 409 | + $formatted[$key] = $input['value']; |
|
| 410 | 410 | } |
| 411 | 411 | } |
| 412 | 412 | |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | |
| 543 | 543 | foreach ( $actions as $k => $action ) { |
| 544 | 544 | $amount = self::get_amount_before_submit( compact( 'action', 'form' ) ); |
| 545 | - $actions[ $k ]->post_content['amount'] = $amount; |
|
| 545 | + $actions[$k]->post_content['amount'] = $amount; |
|
| 546 | 546 | } |
| 547 | 547 | } |
| 548 | 548 | |
@@ -23,10 +23,10 @@ discard block |
||
| 23 | 23 | * @return array|false |
| 24 | 24 | */ |
| 25 | 25 | public static function get_details_for_form( $form_id ) { |
| 26 | - if ( ! isset( self::$details_by_form_id[ $form_id ] ) ) { |
|
| 26 | + if ( ! isset( self::$details_by_form_id[$form_id] ) ) { |
|
| 27 | 27 | self::set_details_for_form( (int) $form_id ); |
| 28 | 28 | } |
| 29 | - return isset( self::$details_by_form_id[ $form_id ] ) ? self::$details_by_form_id[ $form_id ] : false; |
|
| 29 | + return isset( self::$details_by_form_id[$form_id] ) ? self::$details_by_form_id[$form_id] : false; |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | /** |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | return; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - self::$details_by_form_id[ $form_id ] = array( |
|
| 90 | + self::$details_by_form_id[$form_id] = array( |
|
| 91 | 91 | 'entry' => $entry, |
| 92 | 92 | 'intent' => $intent, |
| 93 | 93 | 'payment' => $payment, |
@@ -388,7 +388,7 @@ |
||
| 388 | 388 | * @return void |
| 389 | 389 | */ |
| 390 | 390 | public static function api_email_form( $form_key, $title, $description ) { |
| 391 | - $user = wp_get_current_user(); |
|
| 391 | + $user = wp_get_current_user(); |
|
| 392 | 392 | $args = array( |
| 393 | 393 | 'api_url' => 'https://sandbox.formidableforms.com/api/wp-json/frm/v2/forms/' . $form_key . '?return=html&exclude_script=jquery&exclude_style=formidable-css', |
| 394 | 394 | 'title' => $title, |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | if ( strpos( $orderby, 'meta' ) !== false ) { |
| 72 | 72 | $order_field_type = FrmField::get_type( str_replace( 'meta_', '', $orderby ) ); |
| 73 | - $orderby .= in_array( $order_field_type, array( 'number', 'scale', 'star' ) ) ? '+0' : ''; |
|
| 73 | + $orderby .= in_array( $order_field_type, array( 'number', 'scale', 'star' ) ) ? '+0' : ''; |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | $order = self::get_param( |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | $form_ids = $this->get_form_ids( $form_id ); |
| 117 | 117 | $s_query['it.form_id'] = count( $form_ids ) > 1 ? $form_ids : $form_ids[0]; |
| 118 | 118 | } else { |
| 119 | - $s_query[] = array( |
|
| 119 | + $s_query[] = array( |
|
| 120 | 120 | 'or' => 1, |
| 121 | 121 | 'parent_form_id' => null, |
| 122 | 122 | 'parent_form_id <' => 1, |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | |
| 266 | 266 | $r = "<tr id='item-action-{$item->id}'$style>"; |
| 267 | 267 | |
| 268 | - list( $columns, $hidden, , $primary ) = $this->get_column_info(); |
|
| 268 | + list( $columns, $hidden,, $primary ) = $this->get_column_info(); |
|
| 269 | 269 | $action_col = false; |
| 270 | 270 | $action_columns = $this->get_action_columns(); |
| 271 | 271 | |