@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | } else { |
| 75 | 75 | foreach ( $addons as $k => $addon ) { |
| 76 | 76 | if ( empty( $addon['excerpt'] ) && $k !== 'error' ) { |
| 77 | - unset( $addons[ $k ] ); |
|
| 77 | + unset( $addons[$k] ); |
|
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | 80 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | |
| 171 | 171 | foreach ( $list as $k => $info ) { |
| 172 | 172 | $info['slug'] = $k; |
| 173 | - $list[ $k ] = array_merge( $defaults, $info ); |
|
| 173 | + $list[$k] = array_merge( $defaults, $info ); |
|
| 174 | 174 | } |
| 175 | 175 | return $list; |
| 176 | 176 | } |
@@ -349,16 +349,16 @@ discard block |
||
| 349 | 349 | continue; |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | - $wp_plugin = isset( $wp_plugins[ $folder ] ) ? $wp_plugins[ $folder ] : array(); |
|
| 352 | + $wp_plugin = isset( $wp_plugins[$folder] ) ? $wp_plugins[$folder] : array(); |
|
| 353 | 353 | $wp_version = isset( $wp_plugin['Version'] ) ? $wp_plugin['Version'] : '1.0'; |
| 354 | 354 | |
| 355 | 355 | if ( version_compare( $wp_version, $plugin->new_version, '<' ) ) { |
| 356 | 356 | $slug = explode( '/', $folder ); |
| 357 | 357 | $plugin->slug = $slug[0]; |
| 358 | - $transient->response[ $folder ] = $plugin; |
|
| 358 | + $transient->response[$folder] = $plugin; |
|
| 359 | 359 | } |
| 360 | 360 | |
| 361 | - $transient->checked[ $folder ] = $wp_version; |
|
| 361 | + $transient->checked[$folder] = $wp_version; |
|
| 362 | 362 | |
| 363 | 363 | } |
| 364 | 364 | |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | |
| 382 | 382 | $all_plugins = get_plugins(); |
| 383 | 383 | |
| 384 | - return isset( $all_plugins[ $plugin ] ); |
|
| 384 | + return isset( $all_plugins[$plugin] ); |
|
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | /** |
@@ -420,13 +420,13 @@ discard block |
||
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | $download_id = isset( $plugin['id'] ) ? $plugin['id'] : 0; |
| 423 | - if ( ! empty( $download_id ) && ! isset( $version_info[ $download_id ]['package'] ) ) { |
|
| 423 | + if ( ! empty( $download_id ) && ! isset( $version_info[$download_id]['package'] ) ) { |
|
| 424 | 424 | // if this addon is using its own license, get the update url |
| 425 | 425 | $addon_info = $api->get_api_info(); |
| 426 | 426 | |
| 427 | - $version_info[ $download_id ] = $addon_info[ $download_id ]; |
|
| 427 | + $version_info[$download_id] = $addon_info[$download_id]; |
|
| 428 | 428 | if ( isset( $addon_info['error'] ) ) { |
| 429 | - $version_info[ $download_id ]['error'] = array( |
|
| 429 | + $version_info[$download_id]['error'] = array( |
|
| 430 | 430 | 'message' => $addon_info['error']['message'], |
| 431 | 431 | 'code' => $addon_info['error']['code'], |
| 432 | 432 | ); |
@@ -520,8 +520,8 @@ discard block |
||
| 520 | 520 | return $addon; |
| 521 | 521 | } |
| 522 | 522 | } |
| 523 | - } elseif ( isset( $addons[ $download_id ] ) ) { |
|
| 524 | - $plugin = $addons[ $download_id ]; |
|
| 523 | + } elseif ( isset( $addons[$download_id] ) ) { |
|
| 524 | + $plugin = $addons[$download_id]; |
|
| 525 | 525 | } |
| 526 | 526 | |
| 527 | 527 | return $plugin; |
@@ -575,7 +575,7 @@ discard block |
||
| 575 | 575 | self::prepare_addon_link( $addon['link'] ); |
| 576 | 576 | |
| 577 | 577 | self::set_addon_status( $addon ); |
| 578 | - $addons[ $id ] = $addon; |
|
| 578 | + $addons[$id] = $addon; |
|
| 579 | 579 | } |
| 580 | 580 | } |
| 581 | 581 | |
@@ -593,7 +593,7 @@ discard block |
||
| 593 | 593 | 'utm_medium' => 'addons', |
| 594 | 594 | 'utm_campaign' => 'liteplugin', |
| 595 | 595 | ); |
| 596 | - $link = add_query_arg( $query_args, $link ); |
|
| 596 | + $link = add_query_arg( $query_args, $link ); |
|
| 597 | 597 | } |
| 598 | 598 | |
| 599 | 599 | /** |
@@ -564,6 +564,7 @@ discard block |
||
| 564 | 564 | |
| 565 | 565 | /** |
| 566 | 566 | * @since 3.04.02 |
| 567 | + * @param string $link |
|
| 567 | 568 | */ |
| 568 | 569 | protected static function prepare_addon_link( &$link ) { |
| 569 | 570 | $site_url = 'https://formidableforms.com/'; |
@@ -1100,10 +1101,6 @@ discard block |
||
| 1100 | 1101 | * Render a conditional action button for an add on |
| 1101 | 1102 | * |
| 1102 | 1103 | * @since 4.09.01 |
| 1103 | - * @param array $addon |
|
| 1104 | - * @param string|false $license_type |
|
| 1105 | - * @param string $plan_required |
|
| 1106 | - * @param string $upgrade_link |
|
| 1107 | 1104 | */ |
| 1108 | 1105 | public static function show_conditional_action_button( $atts ) { |
| 1109 | 1106 | if ( is_callable( 'FrmProAddonsController::show_conditional_action_button' ) ) { |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | self::print_file_headers( $filename ); |
| 41 | 41 | unset( $filename ); |
| 42 | 42 | |
| 43 | - $comment_count = FrmDb::get_count( |
|
| 43 | + $comment_count = FrmDb::get_count( |
|
| 44 | 44 | 'frm_item_metas', |
| 45 | 45 | array( |
| 46 | 46 | 'item_id' => $atts['entry_ids'], |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | private static function prepare_csv_headings() { |
| 107 | 107 | $headings = array(); |
| 108 | 108 | self::csv_headings( $headings ); |
| 109 | - $headings = apply_filters( |
|
| 109 | + $headings = apply_filters( |
|
| 110 | 110 | 'frm_csv_columns', |
| 111 | 111 | $headings, |
| 112 | 112 | self::$form_id, |
@@ -123,10 +123,10 @@ discard block |
||
| 123 | 123 | $field_headings = array(); |
| 124 | 124 | $separate_values = array( 'user_id', 'file', 'data', 'date' ); |
| 125 | 125 | if ( isset( $col->field_options['separate_value'] ) && $col->field_options['separate_value'] && ! in_array( $col->type, $separate_values, true ) ) { |
| 126 | - $field_headings[ $col->id . '_label' ] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) ); |
|
| 126 | + $field_headings[$col->id . '_label'] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) ); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | - $field_headings[ $col->id ] = strip_tags( $col->name ); |
|
| 129 | + $field_headings[$col->id] = strip_tags( $col->name ); |
|
| 130 | 130 | $field_headings = apply_filters( |
| 131 | 131 | 'frm_csv_field_columns', |
| 132 | 132 | $field_headings, |
@@ -145,14 +145,14 @@ discard block |
||
| 145 | 145 | foreach ( self::$fields as $col ) { |
| 146 | 146 | if ( self::is_the_child_of_a_repeater( $col ) ) { |
| 147 | 147 | $repeater_id = $col->field_options['in_section']; |
| 148 | - $headings[ 'repeater' . $repeater_id ] = array(); // set a placeholder to maintain order for repeater fields |
|
| 148 | + $headings['repeater' . $repeater_id] = array(); // set a placeholder to maintain order for repeater fields |
|
| 149 | 149 | |
| 150 | - if ( ! isset( $fields_by_repeater_id[ $repeater_id ] ) ) { |
|
| 151 | - $fields_by_repeater_id[ $repeater_id ] = array(); |
|
| 150 | + if ( ! isset( $fields_by_repeater_id[$repeater_id] ) ) { |
|
| 151 | + $fields_by_repeater_id[$repeater_id] = array(); |
|
| 152 | 152 | $repeater_ids[] = $repeater_id; |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | - $fields_by_repeater_id[ $repeater_id ][] = $col; |
|
| 155 | + $fields_by_repeater_id[$repeater_id][] = $col; |
|
| 156 | 156 | } else { |
| 157 | 157 | $headings += self::field_headings( $col ); |
| 158 | 158 | } |
@@ -169,8 +169,8 @@ discard block |
||
| 169 | 169 | $end = strpos( $row->meta_value, ':{' ); |
| 170 | 170 | $length = substr( $row->meta_value, $start, $end - $start ); |
| 171 | 171 | |
| 172 | - if ( $length > $max[ $row->field_id ] ) { |
|
| 173 | - $max[ $row->field_id ] = $length; |
|
| 172 | + if ( $length > $max[$row->field_id] ) { |
|
| 173 | + $max[$row->field_id] = $length; |
|
| 174 | 174 | } |
| 175 | 175 | } |
| 176 | 176 | unset( $start, $end, $length, $row, $repeater_meta, $where ); |
@@ -181,17 +181,17 @@ discard block |
||
| 181 | 181 | $repeater_id = str_replace( 'repeater', '', $key ); |
| 182 | 182 | |
| 183 | 183 | $repeater_headings = array(); |
| 184 | - foreach ( $fields_by_repeater_id[ $repeater_id ] as $col ) { |
|
| 184 | + foreach ( $fields_by_repeater_id[$repeater_id] as $col ) { |
|
| 185 | 185 | $repeater_headings += self::field_headings( $col ); |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | - for ( $i = 0; $i < $max[ $repeater_id ]; $i ++ ) { |
|
| 188 | + for ( $i = 0; $i < $max[$repeater_id]; $i ++ ) { |
|
| 189 | 189 | foreach ( $repeater_headings as $repeater_key => $repeater_name ) { |
| 190 | - $flat[ $repeater_key . '[' . $i . ']' ] = $repeater_name; |
|
| 190 | + $flat[$repeater_key . '[' . $i . ']'] = $repeater_name; |
|
| 191 | 191 | } |
| 192 | 192 | } |
| 193 | 193 | } else { |
| 194 | - $flat[ $key ] = $heading; |
|
| 194 | + $flat[$key] = $heading; |
|
| 195 | 195 | } |
| 196 | 196 | } |
| 197 | 197 | unset( $key, $heading, $max, $repeater_headings, $repeater_id ); |
@@ -202,9 +202,9 @@ discard block |
||
| 202 | 202 | |
| 203 | 203 | if ( self::$comment_count ) { |
| 204 | 204 | for ( $i = 0; $i < self::$comment_count; $i ++ ) { |
| 205 | - $headings[ 'comment' . $i ] = __( 'Comment', 'formidable' ); |
|
| 206 | - $headings[ 'comment_user_id' . $i ] = __( 'Comment User', 'formidable' ); |
|
| 207 | - $headings[ 'comment_created_at' . $i ] = __( 'Comment Date', 'formidable' ); |
|
| 205 | + $headings['comment' . $i] = __( 'Comment', 'formidable' ); |
|
| 206 | + $headings['comment_user_id' . $i] = __( 'Comment User', 'formidable' ); |
|
| 207 | + $headings['comment_created_at' . $i] = __( 'Comment Date', 'formidable' ); |
|
| 208 | 208 | } |
| 209 | 209 | unset( $i ); |
| 210 | 210 | } |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | |
| 248 | 248 | private static function prepare_next_csv_rows( $next_set ) { |
| 249 | 249 | // order by parent_item_id so children will be first |
| 250 | - $where = array( |
|
| 250 | + $where = array( |
|
| 251 | 251 | 'or' => 1, |
| 252 | 252 | 'id' => $next_set, |
| 253 | 253 | 'parent_item_id' => $next_set, |
@@ -292,30 +292,30 @@ discard block |
||
| 292 | 292 | continue; |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | - if ( ! isset( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) { |
|
| 296 | - $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = array(); |
|
| 297 | - } elseif ( ! is_array( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) { |
|
| 295 | + if ( ! isset( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) { |
|
| 296 | + $entries[self::$entry->parent_item_id]->metas[$meta_id] = array(); |
|
| 297 | + } elseif ( ! is_array( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) { |
|
| 298 | 298 | // if the data is here, it should be an array but if this field has collected data |
| 299 | 299 | // both while inside and outside of the repeating section, it's possible this is a string |
| 300 | - $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = (array) $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ]; |
|
| 300 | + $entries[self::$entry->parent_item_id]->metas[$meta_id] = (array) $entries[self::$entry->parent_item_id]->metas[$meta_id]; |
|
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | //add the repeated values |
| 304 | - $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ][] = $meta_value; |
|
| 304 | + $entries[self::$entry->parent_item_id]->metas[$meta_id][] = $meta_value; |
|
| 305 | 305 | } |
| 306 | - $entries[ self::$entry->parent_item_id ]->metas += self::$entry->metas; |
|
| 306 | + $entries[self::$entry->parent_item_id]->metas += self::$entry->metas; |
|
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | // add the embedded form id |
| 310 | - if ( ! isset( $entries[ self::$entry->parent_item_id ]->embedded_fields ) ) { |
|
| 311 | - $entries[ self::$entry->parent_item_id ]->embedded_fields = array(); |
|
| 310 | + if ( ! isset( $entries[self::$entry->parent_item_id]->embedded_fields ) ) { |
|
| 311 | + $entries[self::$entry->parent_item_id]->embedded_fields = array(); |
|
| 312 | 312 | } |
| 313 | - $entries[ self::$entry->parent_item_id ]->embedded_fields[ self::$entry->id ] = self::$entry->form_id; |
|
| 313 | + $entries[self::$entry->parent_item_id]->embedded_fields[self::$entry->id] = self::$entry->form_id; |
|
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | private static function add_field_values_to_csv( &$row ) { |
| 317 | 317 | foreach ( self::$fields as $col ) { |
| 318 | - $field_value = isset( self::$entry->metas[ $col->id ] ) ? self::$entry->metas[ $col->id ] : false; |
|
| 318 | + $field_value = isset( self::$entry->metas[$col->id] ) ? self::$entry->metas[$col->id] : false; |
|
| 319 | 319 | |
| 320 | 320 | FrmAppHelper::unserialize_or_decode( $field_value ); |
| 321 | 321 | self::add_array_values_to_columns( $row, compact( 'col', 'field_value' ) ); |
@@ -340,15 +340,15 @@ discard block |
||
| 340 | 340 | 'show_icon' => false, |
| 341 | 341 | 'entry_id' => self::$entry->id, |
| 342 | 342 | 'sep' => self::$separator, |
| 343 | - 'embedded_field_id' => ( isset( self::$entry->embedded_fields ) && isset( self::$entry->embedded_fields[ self::$entry->id ] ) ) ? 'form' . self::$entry->embedded_fields[ self::$entry->id ] : 0, |
|
| 343 | + 'embedded_field_id' => ( isset( self::$entry->embedded_fields ) && isset( self::$entry->embedded_fields[self::$entry->id] ) ) ? 'form' . self::$entry->embedded_fields[self::$entry->id] : 0, |
|
| 344 | 344 | ) |
| 345 | 345 | ); |
| 346 | 346 | |
| 347 | - $row[ $col->id . '_label' ] = $sep_value; |
|
| 347 | + $row[$col->id . '_label'] = $sep_value; |
|
| 348 | 348 | unset( $sep_value ); |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | - $row[ $col->id ] = $field_value; |
|
| 351 | + $row[$col->id] = $field_value; |
|
| 352 | 352 | |
| 353 | 353 | unset( $col, $field_value ); |
| 354 | 354 | } |
@@ -361,8 +361,8 @@ discard block |
||
| 361 | 361 | if ( is_array( $atts['field_value'] ) ) { |
| 362 | 362 | foreach ( $atts['field_value'] as $key => $sub_value ) { |
| 363 | 363 | $column_key = $atts['col']->id . '_' . $key; |
| 364 | - if ( ! is_numeric( $key ) && isset( self::$headings[ $column_key ] ) ) { |
|
| 365 | - $row[ $column_key ] = $sub_value; |
|
| 364 | + if ( ! is_numeric( $key ) && isset( self::$headings[$column_key] ) ) { |
|
| 365 | + $row[$column_key] = $sub_value; |
|
| 366 | 366 | } |
| 367 | 367 | } |
| 368 | 368 | } |
@@ -386,18 +386,18 @@ discard block |
||
| 386 | 386 | $sep = ''; |
| 387 | 387 | |
| 388 | 388 | foreach ( self::$headings as $k => $heading ) { |
| 389 | - if ( isset( $rows[ $k ] ) ) { |
|
| 390 | - $row = $rows[ $k ]; |
|
| 389 | + if ( isset( $rows[$k] ) ) { |
|
| 390 | + $row = $rows[$k]; |
|
| 391 | 391 | } else { |
| 392 | 392 | $row = ''; |
| 393 | 393 | // array indexed data is not at $rows[ $k ] |
| 394 | - if ( $k[ strlen( $k ) - 1 ] === ']' ) { |
|
| 394 | + if ( $k[strlen( $k ) - 1] === ']' ) { |
|
| 395 | 395 | $start = strrpos( $k, '[' ); |
| 396 | 396 | $key = substr( $k, 0, $start ++ ); |
| 397 | 397 | $index = substr( $k, $start, strlen( $k ) - 1 - $start ); |
| 398 | 398 | |
| 399 | - if ( isset( $rows[ $key ] ) && isset( $rows[ $key ][ $index ] ) ) { |
|
| 400 | - $row = $rows[ $key ][ $index ]; |
|
| 399 | + if ( isset( $rows[$key] ) && isset( $rows[$key][$index] ) ) { |
|
| 400 | + $row = $rows[$key][$index]; |
|
| 401 | 401 | } |
| 402 | 402 | |
| 403 | 403 | unset( $start, $key, $index ); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | $s_query['it.form_id'] = $form_id; |
| 26 | 26 | $join_form_in_query = false; |
| 27 | 27 | } else { |
| 28 | - $s_query[] = array( |
|
| 28 | + $s_query[] = array( |
|
| 29 | 29 | 'or' => 1, |
| 30 | 30 | 'parent_form_id' => null, |
| 31 | 31 | 'parent_form_id <' => 1, |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | if ( strpos( $orderby, 'meta' ) !== false ) { |
| 58 | 58 | $order_field_type = FrmField::get_type( str_replace( 'meta_', '', $orderby ) ); |
| 59 | - $orderby .= in_array( $order_field_type, array( 'number', 'scale', 'star' ) ) ? '+0' : ''; |
|
| 59 | + $orderby .= in_array( $order_field_type, array( 'number', 'scale', 'star' ) ) ? '+0' : ''; |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | $order = self::get_param( |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | $r = "<tr id='item-action-{$item->id}'$style>"; |
| 191 | 191 | |
| 192 | - list( $columns, $hidden, , $primary ) = $this->get_column_info(); |
|
| 192 | + list( $columns, $hidden,, $primary ) = $this->get_column_info(); |
|
| 193 | 193 | $action_col = false; |
| 194 | 194 | $action_columns = $this->get_action_columns(); |
| 195 | 195 | |