@@ -285,7 +285,8 @@ |
||
285 | 285 | public static function get_settings_for_output( $style ) { |
286 | 286 | if ( self::previewing_style() ) { |
287 | 287 | $frm_style = new FrmStyle(); |
288 | - if ( isset( $_POST['frm_style_setting'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
288 | + if ( isset( $_POST['frm_style_setting'] ) ) { |
|
289 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
289 | 290 | |
290 | 291 | // Sanitizing is done later. |
291 | 292 | $posted = wp_unslash( $_POST['frm_style_setting'] ); //phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | '-' => 'down', |
136 | 136 | '+' => 'up', |
137 | 137 | ); |
138 | - $class = 'frm_arrow' . $arrow[ $icon ]; |
|
138 | + $class = 'frm_arrow' . $arrow[$icon]; |
|
139 | 139 | } else { |
140 | 140 | //frm_minus1_icon |
141 | 141 | $key = str_replace( 'p', '', $key ); |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | '-' => 'minus', |
144 | 144 | '+' => 'plus', |
145 | 145 | ); |
146 | - $class = 'frm_' . $plus[ $icon ]; |
|
146 | + $class = 'frm_' . $plus[$icon]; |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | if ( $key ) { |
@@ -169,8 +169,8 @@ discard block |
||
169 | 169 | ?> |
170 | 170 | <div class="btn-group" id="frm_<?php echo esc_attr( $name ); ?>_select"> |
171 | 171 | <button class="multiselect dropdown-toggle btn btn-default" data-toggle="dropdown" type="button"> |
172 | - <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '+', $type ) ); ?> |
|
173 | - <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '-', $type ) ); ?> |
|
172 | + <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '+', $type ) ); ?> |
|
173 | + <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '-', $type ) ); ?> |
|
174 | 174 | <b class="caret"></b> |
175 | 175 | </button> |
176 | 176 | <ul class="multiselect-container frm-dropdown-menu"> |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | <li <?php echo ( $style->post_content['collapse_icon'] == $key ) ? 'class="active"' : ''; ?>> |
179 | 179 | <a href="javascript:void(0);"> |
180 | 180 | <label> |
181 | - <input type="radio" value="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ); ?>" <?php checked( $style->post_content[ $name ], $key ); ?> /> |
|
181 | + <input type="radio" value="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ); ?>" <?php checked( $style->post_content[$name], $key ); ?> /> |
|
182 | 182 | <span> |
183 | 183 | <?php |
184 | 184 | FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $key, '+', $type ) ); |
@@ -271,15 +271,15 @@ discard block |
||
271 | 271 | $vars = array_diff( $vars, $remove ); |
272 | 272 | |
273 | 273 | foreach ( $vars as $var ) { |
274 | - if ( ! isset( $settings[ $var ] ) ) { |
|
274 | + if ( ! isset( $settings[$var] ) ) { |
|
275 | 275 | continue; |
276 | 276 | } |
277 | - if ( ! isset( $defaults[ $var ] ) ) { |
|
278 | - $defaults[ $var ] = ''; |
|
277 | + if ( ! isset( $defaults[$var] ) ) { |
|
278 | + $defaults[$var] = ''; |
|
279 | 279 | } |
280 | - $show = empty( $defaults ) || ( $settings[ $var ] !== '' && $settings[ $var ] !== $defaults[ $var ] ); |
|
280 | + $show = empty( $defaults ) || ( $settings[$var] !== '' && $settings[$var] !== $defaults[$var] ); |
|
281 | 281 | if ( $show ) { |
282 | - echo '--' . esc_html( str_replace( '_', '-', $var ) ) . ':' . ( $var === 'font' ? FrmAppHelper::kses( $settings[ $var ] ) : esc_html( $settings[ $var ] ) ) . ';'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
282 | + echo '--' . esc_html( str_replace( '_', '-', $var ) ) . ':' . ( $var === 'font' ? FrmAppHelper::kses( $settings[$var] ) : esc_html( $settings[$var] ) ) . ';'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
283 | 283 | } |
284 | 284 | } |
285 | 285 | } |
@@ -328,8 +328,8 @@ discard block |
||
328 | 328 | |
329 | 329 | $checkbox_opts = array( 'important_style', 'auto_width', 'submit_style', 'collapse_icon', 'center_form' ); |
330 | 330 | foreach ( $checkbox_opts as $opt ) { |
331 | - if ( ! isset( $settings[ $opt ] ) ) { |
|
332 | - $settings[ $opt ] = 0; |
|
331 | + if ( ! isset( $settings[$opt] ) ) { |
|
332 | + $settings[$opt] = 0; |
|
333 | 333 | } |
334 | 334 | } |
335 | 335 | |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | $css = ''; |
358 | 358 | } |
359 | 359 | foreach ( $opts as $opt ) { |
360 | - self::get_color_output( $css, $settings[ $opt ] ); |
|
360 | + self::get_color_output( $css, $settings[$opt] ); |
|
361 | 361 | } |
362 | 362 | } |
363 | 363 | } |
@@ -168,7 +168,7 @@ |
||
168 | 168 | return; |
169 | 169 | } |
170 | 170 | |
171 | - unset( $dependencies[ $index ] ); |
|
171 | + unset( $dependencies[$index] ); |
|
172 | 172 | $dependencies = array_values( $dependencies ); |
173 | 173 | |
174 | 174 | $styles->registered['wp-admin']->deps = $dependencies; |
@@ -349,12 +349,12 @@ |
||
349 | 349 | array_walk( |
350 | 350 | $styles, |
351 | 351 | /** |
352 | - * Echo a style card for a single style in the $styles array. |
|
353 | - * |
|
354 | - * @param WP_Post $style |
|
355 | - * @param int $count Used for pagination. |
|
356 | - * @return void |
|
357 | - */ |
|
352 | + * Echo a style card for a single style in the $styles array. |
|
353 | + * |
|
354 | + * @param WP_Post $style |
|
355 | + * @param int $count Used for pagination. |
|
356 | + * @return void |
|
357 | + */ |
|
358 | 358 | function( $style ) use ( &$count ) { |
359 | 359 | $hidden = $count > ( self::PAGE_SIZE - 1 ); |
360 | 360 | $this->echo_style_card( $style, $hidden ); |
@@ -130,11 +130,11 @@ discard block |
||
130 | 130 | private static function has_dark_background( $style ) { |
131 | 131 | $key = 'fieldset_bg_color'; |
132 | 132 | |
133 | - if ( empty( $style->post_content[ $key ] ) ) { |
|
133 | + if ( empty( $style->post_content[$key] ) ) { |
|
134 | 134 | return false; |
135 | 135 | } |
136 | 136 | |
137 | - $color = $style->post_content[ $key ]; |
|
137 | + $color = $style->post_content[$key]; |
|
138 | 138 | |
139 | 139 | if ( 0 === strpos( $color, 'rgba' ) ) { |
140 | 140 | preg_match_all( '/([\\d.]+)/', $color, $matches ); |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | ), |
205 | 205 | '/style-templates/' . $style['slug'] |
206 | 206 | ); |
207 | - $params['data-requires'] = FrmFormsHelper::get_plan_required( $style ); |
|
207 | + $params['data-requires'] = FrmFormsHelper::get_plan_required( $style ); |
|
208 | 208 | return $params; |
209 | 209 | }; |
210 | 210 | } else { |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | continue; |
266 | 266 | } |
267 | 267 | |
268 | - $value = $style->post_content[ $key ]; |
|
268 | + $value = $style->post_content[$key]; |
|
269 | 269 | |
270 | 270 | $is_hex = in_array( $key, $color_settings, true ) && $value && '#' !== $value[0] && false === strpos( $value, 'rgb' ) && $value !== 'transparent'; |
271 | 271 | if ( $is_hex ) { |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | function( $style ) use ( &$count ) { |
414 | 414 | $hidden = $count > ( self::PAGE_SIZE - 1 ); |
415 | 415 | $this->echo_style_card( $style, $hidden ); |
416 | - ++$count; |
|
416 | + ++ $count; |
|
417 | 417 | } |
418 | 418 | ); |
419 | 419 |
@@ -50,7 +50,7 @@ |
||
50 | 50 | // Remove 'Styling Template' from titles. |
51 | 51 | foreach ( $api_info as $id => $template ) { |
52 | 52 | if ( isset( $template['name'] ) ) { |
53 | - $api_info[ $id ]['name'] = preg_replace( '/(\sStyle|Styling)?(\sTemplate)?$/', '', $template['name'] ); |
|
53 | + $api_info[$id]['name'] = preg_replace( '/(\sStyle|Styling)?(\sTemplate)?$/', '', $template['name'] ); |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | 'text-color' => $style->post_content['text_color'], |
41 | 41 | 'submit-bg-color' => $style->post_content['submit_bg_color'], |
42 | 42 | ); |
43 | - $index = 0; |
|
43 | + $index = 0; |
|
44 | 44 | foreach ( $colors as $css_var_name => $color ) { |
45 | 45 | if ( 0 !== strpos( $color, 'rgb' ) ) { |
46 | 46 | $color = '#' . $color; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | 'style' => 'background-color: var(--' . $css_var_name . ')', |
52 | 52 | ); |
53 | 53 | |
54 | - ++$index; |
|
54 | + ++ $index; |
|
55 | 55 | ?> |
56 | 56 | <div <?php FrmAppHelper::array_to_html_params( $circle_params, true ); ?>></div> |
57 | 57 | <?php |
@@ -105,13 +105,13 @@ discard block |
||
105 | 105 | if ( isset( $addon['categories'] ) ) { |
106 | 106 | $cats = array_intersect( $this->skip_categories(), $addon['categories'] ); |
107 | 107 | if ( ! empty( $cats ) ) { |
108 | - unset( $addons[ $k ] ); |
|
108 | + unset( $addons[$k] ); |
|
109 | 109 | continue; |
110 | 110 | } |
111 | 111 | } |
112 | 112 | |
113 | 113 | if ( ! array_key_exists( 'is_new', $addon ) && array_key_exists( 'released', $addon ) ) { |
114 | - $addons[ $k ]['is_new'] = $this->is_new( $addon ); |
|
114 | + $addons[$k]['is_new'] = $this->is_new( $addon ); |
|
115 | 115 | } |
116 | 116 | } |
117 | 117 | |
@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | return $addon; |
154 | 154 | } |
155 | 155 | } |
156 | - } elseif ( isset( $addons[ $download_id ] ) ) { |
|
157 | - $plugin = $addons[ $download_id ]; |
|
156 | + } elseif ( isset( $addons[$download_id] ) ) { |
|
157 | + $plugin = $addons[$download_id]; |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | return $plugin; |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $page = $this->get_pagenum(); |
21 | 21 | $per_page = $this->get_items_per_page( 'formidable_page_formidable_per_page' ); |
22 | 22 | |
23 | - $mode = self::get_param( |
|
23 | + $mode = self::get_param( |
|
24 | 24 | array( |
25 | 25 | 'param' => 'mode', |
26 | 26 | 'default' => 'list', |
@@ -32,13 +32,13 @@ discard block |
||
32 | 32 | 'default' => 'name', |
33 | 33 | ) |
34 | 34 | ); |
35 | - $order = self::get_param( |
|
35 | + $order = self::get_param( |
|
36 | 36 | array( |
37 | 37 | 'param' => 'order', |
38 | 38 | 'default' => 'ASC', |
39 | 39 | ) |
40 | 40 | ); |
41 | - $start = self::get_param( |
|
41 | + $start = self::get_param( |
|
42 | 42 | array( |
43 | 43 | 'param' => 'start', |
44 | 44 | 'default' => ( $page - 1 ) * $per_page, |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $counts = FrmForm::get_count(); |
163 | 163 | $form_type = FrmAppHelper::simple_get( 'form_type', 'sanitize_title', 'published' ); |
164 | 164 | |
165 | - if ( isset( $statuses[ $form_type ] ) ) { |
|
165 | + if ( isset( $statuses[$form_type] ) ) { |
|
166 | 166 | $counts->$form_type = $this->total_items; |
167 | 167 | } |
168 | 168 | |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | |
184 | 184 | if ( $counts->{$status} || 'draft' !== $status ) { |
185 | 185 | /* translators: %1$s: Status, %2$s: Number of items */ |
186 | - $links[ $status ] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>'; |
|
186 | + $links[$status] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>'; |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | unset( $status, $name ); |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | private function get_actions( &$actions, $item, $edit_link ) { |
349 | 349 | $new_actions = FrmFormsHelper::get_action_links( $item->id, $item ); |
350 | 350 | foreach ( $new_actions as $link => $action ) { |
351 | - $new_actions[ $link ] = FrmFormsHelper::format_link_html( $action, 'short' ); |
|
351 | + $new_actions[$link] = FrmFormsHelper::format_link_html( $action, 'short' ); |
|
352 | 352 | } |
353 | 353 | |
354 | 354 | if ( 'trash' == $this->status ) { |
@@ -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 array $form |
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', |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash |
378 | 378 | $file_type = sanitize_option( 'upload_path', $_FILES['frm_import_file']['name'] ); |
379 | 379 | $file_type = strtolower( pathinfo( $file_type, PATHINFO_EXTENSION ) ); |
380 | - if ( 'xml' !== $file_type && isset( $export_format[ $file_type ] ) ) { |
|
380 | + if ( 'xml' !== $file_type && isset( $export_format[$file_type] ) ) { |
|
381 | 381 | // allow other file types to be imported |
382 | 382 | do_action( 'frm_before_import_' . $file_type ); |
383 | 383 | |
@@ -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 | } |
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 | } |
545 | 545 | |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | $no_export_fields = FrmField::no_save_fields(); |
711 | 711 | foreach ( $csv_fields as $k => $f ) { |
712 | 712 | if ( in_array( $f->type, $no_export_fields, true ) ) { |
713 | - unset( $csv_fields[ $k ] ); |
|
713 | + unset( $csv_fields[$k] ); |
|
714 | 714 | } |
715 | 715 | } |
716 | 716 |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | //validate the number format |
65 | 65 | if ( ! is_numeric( $args['value'] ) && '' !== $args['value'] ) { |
66 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
66 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | // validate number settings |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | if ( $frm_settings->use_html && $maxnum !== '' && $minnum !== '' ) { |
76 | 76 | $value = (float) $args['value']; |
77 | 77 | if ( $value < $minnum ) { |
78 | - $errors[ 'field' . $args['id'] ] = __( 'Please select a higher number', 'formidable' ); |
|
78 | + $errors['field' . $args['id']] = __( 'Please select a higher number', 'formidable' ); |
|
79 | 79 | } elseif ( $value > $maxnum ) { |
80 | - $errors[ 'field' . $args['id'] ] = __( 'Please select a lower number', 'formidable' ); |
|
80 | + $errors['field' . $args['id']] = __( 'Please select a lower number', 'formidable' ); |
|
81 | 81 | } |
82 | 82 | } |
83 | 83 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * @return void |
99 | 99 | */ |
100 | 100 | private function validate_step( &$errors, $args ) { |
101 | - if ( isset( $errors[ 'field' . $args['id'] ] ) ) { |
|
101 | + if ( isset( $errors['field' . $args['id']] ) ) { |
|
102 | 102 | return; // Don't need to check if value is invalid before. |
103 | 103 | } |
104 | 104 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | return; |
113 | 113 | } |
114 | 114 | |
115 | - $errors[ 'field' . $args['id'] ] = sprintf( |
|
115 | + $errors['field' . $args['id']] = sprintf( |
|
116 | 116 | // Translators: %1$s: the first nearest value; %2$s: the second nearest value. |
117 | 117 | __( 'Please enter a valid value. Two nearest valid values are %1$s and %2$s', 'formidable' ), |
118 | 118 | floatval( $result[0] ), |