@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | 'class' => '', |
| 38 | 38 | 'inc_children' => 'exclude', |
| 39 | 39 | ); |
| 40 | - $args = wp_parse_args( $args, $defaults ); |
|
| 40 | + $args = wp_parse_args( $args, $defaults ); |
|
| 41 | 41 | |
| 42 | 42 | if ( ! $args['field_id'] ) { |
| 43 | 43 | $args['field_id'] = $field_name; |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | public static function add_html_attr( $class, $param, &$add_html ) { |
| 80 | 80 | if ( ! empty( $class ) ) { |
| 81 | - $add_html[ $param ] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"'; |
|
| 81 | + $add_html[$param] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"'; |
|
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | |
@@ -322,8 +322,8 @@ discard block |
||
| 322 | 322 | 'description' => '', |
| 323 | 323 | ); |
| 324 | 324 | foreach ( $defaults as $var => $default ) { |
| 325 | - if ( ! isset( $values[ $var ] ) ) { |
|
| 326 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 325 | + if ( ! isset( $values[$var] ) ) { |
|
| 326 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 327 | 327 | } |
| 328 | 328 | } |
| 329 | 329 | |
@@ -338,8 +338,8 @@ discard block |
||
| 338 | 338 | 'parent_form_id' => 0, |
| 339 | 339 | ); |
| 340 | 340 | foreach ( $defaults as $var => $default ) { |
| 341 | - if ( ! isset( $values[ $var ] ) ) { |
|
| 342 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 341 | + if ( ! isset( $values[$var] ) ) { |
|
| 342 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 343 | 343 | } |
| 344 | 344 | } |
| 345 | 345 | unset( $defaults ); |
@@ -376,16 +376,16 @@ discard block |
||
| 376 | 376 | $defaults = self::get_default_opts(); |
| 377 | 377 | foreach ( $defaults as $var => $default ) { |
| 378 | 378 | if ( is_array( $default ) ) { |
| 379 | - if ( ! isset( $values[ $var ] ) ) { |
|
| 380 | - $values[ $var ] = $record && isset( $record->options[ $var ] ) ? $record->options[ $var ] : array(); |
|
| 379 | + if ( ! isset( $values[$var] ) ) { |
|
| 380 | + $values[$var] = $record && isset( $record->options[$var] ) ? $record->options[$var] : array(); |
|
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | foreach ( $default as $k => $v ) { |
| 384 | - $values[ $var ][ $k ] = $post_values && isset( $post_values[ $var ][ $k ] ) ? $post_values[ $var ][ $k ] : ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) ? $record->options[ $var ][ $k ] : $v ); |
|
| 384 | + $values[$var][$k] = $post_values && isset( $post_values[$var][$k] ) ? $post_values[$var][$k] : ( $record && isset( $record->options[$var] ) && isset( $record->options[$var][$k] ) ? $record->options[$var][$k] : $v ); |
|
| 385 | 385 | |
| 386 | 386 | if ( is_array( $v ) ) { |
| 387 | 387 | foreach ( $v as $k1 => $v1 ) { |
| 388 | - $values[ $var ][ $k ][ $k1 ] = $post_values && isset( $post_values[ $var ][ $k ][ $k1 ] ) ? $post_values[ $var ][ $k ][ $k1 ] : ( $record && isset( $record->options[ $var ] ) && isset( $record->options[ $var ][ $k ] ) && isset( $record->options[ $var ][ $k ][ $k1 ] ) ? $record->options[ $var ][ $k ][ $k1 ] : $v1 ); |
|
| 388 | + $values[$var][$k][$k1] = $post_values && isset( $post_values[$var][$k][$k1] ) ? $post_values[$var][$k][$k1] : ( $record && isset( $record->options[$var] ) && isset( $record->options[$var][$k] ) && isset( $record->options[$var][$k][$k1] ) ? $record->options[$var][$k][$k1] : $v1 ); |
|
| 389 | 389 | unset( $k1, $v1 ); |
| 390 | 390 | } |
| 391 | 391 | } |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | unset( $k, $v ); |
| 394 | 394 | } |
| 395 | 395 | } else { |
| 396 | - $values[ $var ] = $post_values && isset( $post_values['options'][ $var ] ) ? $post_values['options'][ $var ] : ( $record && isset( $record->options[ $var ] ) ? $record->options[ $var ] : $default ); |
|
| 396 | + $values[$var] = $post_values && isset( $post_values['options'][$var] ) ? $post_values['options'][$var] : ( $record && isset( $record->options[$var] ) ? $record->options[$var] : $default ); |
|
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | unset( $var, $default ); |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | public static function fill_form_options( &$options, $values ) { |
| 439 | 439 | $defaults = self::get_default_opts(); |
| 440 | 440 | foreach ( $defaults as $var => $default ) { |
| 441 | - $options[ $var ] = $values['options'][ $var ] ?? $default; |
|
| 441 | + $options[$var] = $values['options'][$var] ?? $default; |
|
| 442 | 442 | unset( $var, $default ); |
| 443 | 443 | } |
| 444 | 444 | } |
@@ -615,7 +615,7 @@ discard block |
||
| 615 | 615 | public static function insert_opt_html( $args ) { |
| 616 | 616 | $class = $args['class'] ?? ''; |
| 617 | 617 | $fields = self::get_field_type_data_for_insert_opt_html(); |
| 618 | - $field = $fields[ $args['type'] ] ?? array(); |
|
| 618 | + $field = $fields[$args['type']] ?? array(); |
|
| 619 | 619 | |
| 620 | 620 | self::prepare_field_type( $field ); |
| 621 | 621 | |
@@ -747,7 +747,7 @@ discard block |
||
| 747 | 747 | $last_field = false; |
| 748 | 748 | foreach ( $fields as $field ) { |
| 749 | 749 | if ( $prev_order === $field->field_order ) { |
| 750 | - ++$add_order; |
|
| 750 | + ++ $add_order; |
|
| 751 | 751 | } |
| 752 | 752 | |
| 753 | 753 | if ( $add_order ) { |
@@ -1221,8 +1221,8 @@ discard block |
||
| 1221 | 1221 | $link .= ' onclick="return confirm(\'' . esc_attr( $link_details['confirm'] ) . '\')"'; |
| 1222 | 1222 | } |
| 1223 | 1223 | |
| 1224 | - $label = ( $link_details[ $length ] ?? $link_details['label'] ); |
|
| 1225 | - if ( $length === 'icon' && isset( $link_details[ $length ] ) ) { |
|
| 1224 | + $label = ( $link_details[$length] ?? $link_details['label'] ); |
|
| 1225 | + if ( $length === 'icon' && isset( $link_details[$length] ) ) { |
|
| 1226 | 1226 | $label = '<span class="' . $label . '" title="' . esc_attr( $link_details['label'] ) . '" aria-hidden="true"></span>'; |
| 1227 | 1227 | $link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"'; |
| 1228 | 1228 | } |
@@ -1369,7 +1369,7 @@ discard block |
||
| 1369 | 1369 | $status = 'publish'; |
| 1370 | 1370 | } |
| 1371 | 1371 | |
| 1372 | - $name = $nice_names[ $status ]; |
|
| 1372 | + $name = $nice_names[$status]; |
|
| 1373 | 1373 | |
| 1374 | 1374 | return $name; |
| 1375 | 1375 | } |
@@ -1433,7 +1433,7 @@ discard block |
||
| 1433 | 1433 | $icon = $icons['']; |
| 1434 | 1434 | if ( count( $categories ) === 1 ) { |
| 1435 | 1435 | $category = reset( $categories ); |
| 1436 | - $icon = $icons[ $category ] ?? $icon; |
|
| 1436 | + $icon = $icons[$category] ?? $icon; |
|
| 1437 | 1437 | } elseif ( ! empty( $categories ) ) { |
| 1438 | 1438 | $icons = array_intersect_key( $icons, array_flip( $categories ) ); |
| 1439 | 1439 | $icon = reset( $icons ); |
@@ -1555,7 +1555,7 @@ discard block |
||
| 1555 | 1555 | |
| 1556 | 1556 | foreach ( $item['categories'] as $k => $category ) { |
| 1557 | 1557 | if ( in_array( $category, $plans, true ) ) { |
| 1558 | - unset( $item['categories'][ $k ] ); |
|
| 1558 | + unset( $item['categories'][$k] ); |
|
| 1559 | 1559 | |
| 1560 | 1560 | $category = self::convert_legacy_package_names( $category ); |
| 1561 | 1561 | |
@@ -1594,7 +1594,7 @@ discard block |
||
| 1594 | 1594 | 'include_all' => true, |
| 1595 | 1595 | 'case_lower' => false, |
| 1596 | 1596 | ); |
| 1597 | - $args = wp_parse_args( $args, $defaults ); |
|
| 1597 | + $args = wp_parse_args( $args, $defaults ); |
|
| 1598 | 1598 | |
| 1599 | 1599 | $license_types = array( 'Basic', 'Plus', 'Business', 'Elite' ); |
| 1600 | 1600 | |
@@ -1797,9 +1797,9 @@ discard block |
||
| 1797 | 1797 | } |
| 1798 | 1798 | |
| 1799 | 1799 | foreach ( $shortcodes[0] as $key => $shortcode ) { |
| 1800 | - $options = trim( $shortcodes[3][ $key ] ); |
|
| 1800 | + $options = trim( $shortcodes[3][$key] ); |
|
| 1801 | 1801 | |
| 1802 | - if ( in_array( $shortcodes[1][ $key ], array( 'if ' ), true ) ) { |
|
| 1802 | + if ( in_array( $shortcodes[1][$key], array( 'if ' ), true ) ) { |
|
| 1803 | 1803 | // Skip if shortcodes. |
| 1804 | 1804 | continue; |
| 1805 | 1805 | } |
@@ -1809,7 +1809,7 @@ discard block |
||
| 1809 | 1809 | continue; |
| 1810 | 1810 | } |
| 1811 | 1811 | |
| 1812 | - $new_shortcode = '[' . $shortcodes[2][ $key ]; |
|
| 1812 | + $new_shortcode = '[' . $shortcodes[2][$key]; |
|
| 1813 | 1813 | if ( $options ) { |
| 1814 | 1814 | $new_shortcode .= ' ' . $options; |
| 1815 | 1815 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | return; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - if ( isset( self::$messages[ $message['key'] ] ) && ! isset( $message['force'] ) ) { |
|
| 108 | + if ( isset( self::$messages[$message['key']] ) && ! isset( $message['force'] ) ) { |
|
| 109 | 109 | // Don't replace messages unless required. |
| 110 | 110 | return; |
| 111 | 111 | } |
@@ -114,13 +114,13 @@ discard block |
||
| 114 | 114 | return; |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - if ( isset( self::$messages[ $message['key'] ] ) ) { |
|
| 117 | + if ( isset( self::$messages[$message['key']] ) ) { |
|
| 118 | 118 | // Move up and mark as new. |
| 119 | - unset( self::$messages[ $message['key'] ] ); |
|
| 119 | + unset( self::$messages[$message['key']] ); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | $this->fill_message( $message ); |
| 123 | - self::$messages[ $message['key'] ] = $message; |
|
| 123 | + self::$messages[$message['key']] = $message; |
|
| 124 | 124 | |
| 125 | 125 | $this->update_list(); |
| 126 | 126 | |
@@ -157,11 +157,11 @@ discard block |
||
| 157 | 157 | private function clean_messages() { |
| 158 | 158 | $removed = false; |
| 159 | 159 | foreach ( self::$messages as $t => $message ) { |
| 160 | - $read = ! empty( $message['read'] ) && isset( $message['read'][ get_current_user_id() ] ) && $message['read'][ get_current_user_id() ] < strtotime( '-1 month' ); |
|
| 161 | - $dismissed = ! empty( $message['dismissed'] ) && isset( $message['dismissed'][ get_current_user_id() ] ) && $message['dismissed'][ get_current_user_id() ] < strtotime( '-1 week' ); |
|
| 160 | + $read = ! empty( $message['read'] ) && isset( $message['read'][get_current_user_id()] ) && $message['read'][get_current_user_id()] < strtotime( '-1 month' ); |
|
| 161 | + $dismissed = ! empty( $message['dismissed'] ) && isset( $message['dismissed'][get_current_user_id()] ) && $message['dismissed'][get_current_user_id()] < strtotime( '-1 week' ); |
|
| 162 | 162 | |
| 163 | 163 | if ( $read || $dismissed || ! $this->within_valid_timeframe( $message ) ) { |
| 164 | - unset( self::$messages[ $t ] ); |
|
| 164 | + unset( self::$messages[$t] ); |
|
| 165 | 165 | $removed = true; |
| 166 | 166 | } |
| 167 | 167 | } |
@@ -179,11 +179,11 @@ discard block |
||
| 179 | 179 | public function filter_messages( &$messages, $type = 'unread' ) { |
| 180 | 180 | $user_id = get_current_user_id(); |
| 181 | 181 | foreach ( $messages as $k => $message ) { |
| 182 | - $dismissed = isset( $message['dismissed'] ) && isset( $message['dismissed'][ $user_id ] ); |
|
| 182 | + $dismissed = isset( $message['dismissed'] ) && isset( $message['dismissed'][$user_id] ); |
|
| 183 | 183 | if ( empty( $k ) || ! $this->within_valid_timeframe( $message ) || ( $type === 'dismissed' ) !== $dismissed ) { |
| 184 | - unset( $messages[ $k ] ); |
|
| 184 | + unset( $messages[$k] ); |
|
| 185 | 185 | } elseif ( ! $this->is_for_user( $message ) ) { |
| 186 | - unset( $messages[ $k ] ); |
|
| 186 | + unset( $messages[$k] ); |
|
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | $messages = apply_filters( 'frm_filter_inbox', $messages ); |
@@ -257,14 +257,14 @@ discard block |
||
| 257 | 257 | * @return void |
| 258 | 258 | */ |
| 259 | 259 | public function mark_read( $key ) { |
| 260 | - if ( ! $key || ! isset( self::$messages[ $key ] ) ) { |
|
| 260 | + if ( ! $key || ! isset( self::$messages[$key] ) ) { |
|
| 261 | 261 | return; |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | - if ( ! isset( self::$messages[ $key ]['read'] ) ) { |
|
| 265 | - self::$messages[ $key ]['read'] = array(); |
|
| 264 | + if ( ! isset( self::$messages[$key]['read'] ) ) { |
|
| 265 | + self::$messages[$key]['read'] = array(); |
|
| 266 | 266 | } |
| 267 | - self::$messages[ $key ]['read'][ get_current_user_id() ] = time(); |
|
| 267 | + self::$messages[$key]['read'][get_current_user_id()] = time(); |
|
| 268 | 268 | |
| 269 | 269 | $this->update_list(); |
| 270 | 270 | } |
@@ -276,9 +276,9 @@ discard block |
||
| 276 | 276 | * @return void |
| 277 | 277 | */ |
| 278 | 278 | public function mark_unread( $key ) { |
| 279 | - $is_read = isset( self::$messages[ $key ] ) && isset( self::$messages[ $key ]['read'] ) && isset( self::$messages[ $key ]['read'][ get_current_user_id() ] ); |
|
| 279 | + $is_read = isset( self::$messages[$key] ) && isset( self::$messages[$key]['read'] ) && isset( self::$messages[$key]['read'][get_current_user_id()] ); |
|
| 280 | 280 | if ( $is_read ) { |
| 281 | - unset( self::$messages[ $key ]['read'][ get_current_user_id() ] ); |
|
| 281 | + unset( self::$messages[$key]['read'][get_current_user_id()] ); |
|
| 282 | 282 | $this->update_list(); |
| 283 | 283 | } |
| 284 | 284 | } |
@@ -294,14 +294,14 @@ discard block |
||
| 294 | 294 | return; |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | - if ( ! isset( self::$messages[ $key ] ) ) { |
|
| 297 | + if ( ! isset( self::$messages[$key] ) ) { |
|
| 298 | 298 | return; |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | - if ( ! isset( self::$messages[ $key ]['dismissed'] ) ) { |
|
| 302 | - self::$messages[ $key ]['dismissed'] = array(); |
|
| 301 | + if ( ! isset( self::$messages[$key]['dismissed'] ) ) { |
|
| 302 | + self::$messages[$key]['dismissed'] = array(); |
|
| 303 | 303 | } |
| 304 | - self::$messages[ $key ]['dismissed'][ get_current_user_id() ] = time(); |
|
| 304 | + self::$messages[$key]['dismissed'][get_current_user_id()] = time(); |
|
| 305 | 305 | |
| 306 | 306 | $this->update_list(); |
| 307 | 307 | } |
@@ -315,11 +315,11 @@ discard block |
||
| 315 | 315 | $user_id = get_current_user_id(); |
| 316 | 316 | foreach ( self::$messages as $key => $message ) { |
| 317 | 317 | if ( ! isset( $message['dismissed'] ) ) { |
| 318 | - self::$messages[ $key ]['dismissed'] = array(); |
|
| 318 | + self::$messages[$key]['dismissed'] = array(); |
|
| 319 | 319 | } |
| 320 | 320 | |
| 321 | - if ( ! isset( $message['dismissed'][ $user_id ] ) ) { |
|
| 322 | - self::$messages[ $key ]['dismissed'][ $user_id ] = time(); |
|
| 321 | + if ( ! isset( $message['dismissed'][$user_id] ) ) { |
|
| 322 | + self::$messages[$key]['dismissed'][$user_id] = time(); |
|
| 323 | 323 | } |
| 324 | 324 | } |
| 325 | 325 | $this->update_list(); |
@@ -329,8 +329,8 @@ discard block |
||
| 329 | 329 | $messages = $this->get_messages( 'filter' ); |
| 330 | 330 | $user_id = get_current_user_id(); |
| 331 | 331 | foreach ( $messages as $t => $message ) { |
| 332 | - if ( isset( $message['read'] ) && isset( $message['read'][ $user_id ] ) ) { |
|
| 333 | - unset( $messages[ $t ] ); |
|
| 332 | + if ( isset( $message['read'] ) && isset( $message['read'][$user_id] ) ) { |
|
| 333 | + unset( $messages[$t] ); |
|
| 334 | 334 | } |
| 335 | 335 | } |
| 336 | 336 | return $messages; |
@@ -369,8 +369,8 @@ discard block |
||
| 369 | 369 | * @return void |
| 370 | 370 | */ |
| 371 | 371 | public function remove( $key ) { |
| 372 | - if ( isset( self::$messages[ $key ] ) ) { |
|
| 373 | - unset( self::$messages[ $key ] ); |
|
| 372 | + if ( isset( self::$messages[$key] ) ) { |
|
| 373 | + unset( self::$messages[$key] ); |
|
| 374 | 374 | $this->update_list(); |
| 375 | 375 | } |
| 376 | 376 | } |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | * @param array $matches The regex results for a single match. |
| 417 | 417 | * @return string |
| 418 | 418 | */ |
| 419 | - function ( $matches ) { |
|
| 419 | + function( $matches ) { |
|
| 420 | 420 | $url = $matches[2]; |
| 421 | 421 | $parts = parse_url( $url ); |
| 422 | 422 | |
@@ -479,8 +479,8 @@ discard block |
||
| 479 | 479 | $inbox = new self(); |
| 480 | 480 | return array_filter( |
| 481 | 481 | $inbox->get_messages( 'filter' ), |
| 482 | - function ( $message ) use ( $key ) { |
|
| 483 | - return ! empty( $message[ $key ] ); |
|
| 482 | + function( $message ) use ( $key ) { |
|
| 483 | + return ! empty( $message[$key] ); |
|
| 484 | 484 | } |
| 485 | 485 | ); |
| 486 | 486 | } |
@@ -526,8 +526,8 @@ discard block |
||
| 526 | 526 | |
| 527 | 527 | return array_reduce( |
| 528 | 528 | $keys_to_return, |
| 529 | - function ( $total, $key ) use ( $message ) { |
|
| 530 | - $total[ $key ] = $message[ $key ] ?? ''; |
|
| 529 | + function( $total, $key ) use ( $message ) { |
|
| 530 | + $total[$key] = $message[$key] ?? ''; |
|
| 531 | 531 | return $total; |
| 532 | 532 | }, |
| 533 | 533 | array() |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | unset( $filename ); |
| 156 | 156 | |
| 157 | - $comment_count = FrmDb::get_count( |
|
| 157 | + $comment_count = FrmDb::get_count( |
|
| 158 | 158 | 'frm_item_metas', |
| 159 | 159 | array( |
| 160 | 160 | 'item_id' => $atts['entry_ids'], |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | private static function prepare_csv_headings() { |
| 301 | 301 | $headings = array(); |
| 302 | 302 | self::csv_headings( $headings ); |
| 303 | - $headings = apply_filters( |
|
| 303 | + $headings = apply_filters( |
|
| 304 | 304 | 'frm_csv_columns', |
| 305 | 305 | $headings, |
| 306 | 306 | self::$form_id, |
@@ -324,15 +324,15 @@ discard block |
||
| 324 | 324 | $field_headings = array(); |
| 325 | 325 | $separate_values = array( 'user_id', 'file', 'data', 'date' ); |
| 326 | 326 | if ( ! empty( $col->field_options['separate_value'] ) && ! in_array( $col->type, $separate_values, true ) ) { |
| 327 | - $field_headings[ $col->id . '_label' ] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) ); |
|
| 327 | + $field_headings[$col->id . '_label'] = strip_tags( $col->name . ' ' . __( '(label)', 'formidable' ) ); |
|
| 328 | 328 | } |
| 329 | 329 | |
| 330 | - if ( ! empty( $field_headings[ $col->id . '_label' ] ) ) { |
|
| 331 | - $field_headings[ $col->id ] = strip_tags( $col->name . ' ' . __( '(value)', 'formidable' ) ); |
|
| 330 | + if ( ! empty( $field_headings[$col->id . '_label'] ) ) { |
|
| 331 | + $field_headings[$col->id] = strip_tags( $col->name . ' ' . __( '(value)', 'formidable' ) ); |
|
| 332 | 332 | } else { |
| 333 | - $field_headings[ $col->id ] = strip_tags( $col->name ); |
|
| 333 | + $field_headings[$col->id] = strip_tags( $col->name ); |
|
| 334 | 334 | } |
| 335 | - $field_headings = apply_filters( |
|
| 335 | + $field_headings = apply_filters( |
|
| 336 | 336 | 'frm_csv_field_columns', |
| 337 | 337 | $field_headings, |
| 338 | 338 | array_merge( |
@@ -352,14 +352,14 @@ discard block |
||
| 352 | 352 | if ( self::is_the_child_of_a_repeater( $col ) ) { |
| 353 | 353 | $repeater_id = $col->field_options['in_section']; |
| 354 | 354 | // Set a placeholder to maintain order for repeater fields. |
| 355 | - $headings[ 'repeater' . $repeater_id ] = array(); |
|
| 355 | + $headings['repeater' . $repeater_id] = array(); |
|
| 356 | 356 | |
| 357 | - if ( ! isset( $fields_by_repeater_id[ $repeater_id ] ) ) { |
|
| 358 | - $fields_by_repeater_id[ $repeater_id ] = array(); |
|
| 357 | + if ( ! isset( $fields_by_repeater_id[$repeater_id] ) ) { |
|
| 358 | + $fields_by_repeater_id[$repeater_id] = array(); |
|
| 359 | 359 | $repeater_ids[] = $repeater_id; |
| 360 | 360 | } |
| 361 | 361 | |
| 362 | - $fields_by_repeater_id[ $repeater_id ][] = $col; |
|
| 362 | + $fields_by_repeater_id[$repeater_id][] = $col; |
|
| 363 | 363 | |
| 364 | 364 | continue; |
| 365 | 365 | } |
@@ -378,8 +378,8 @@ discard block |
||
| 378 | 378 | $end = strpos( $row->meta_value, ':{' ); |
| 379 | 379 | $length = substr( $row->meta_value, $start, $end - $start ); |
| 380 | 380 | |
| 381 | - if ( $length > $max[ $row->field_id ] ) { |
|
| 382 | - $max[ $row->field_id ] = $length; |
|
| 381 | + if ( $length > $max[$row->field_id] ) { |
|
| 382 | + $max[$row->field_id] = $length; |
|
| 383 | 383 | } |
| 384 | 384 | } |
| 385 | 385 | unset( $start, $end, $length, $row, $repeater_meta, $where ); |
@@ -390,17 +390,17 @@ discard block |
||
| 390 | 390 | $repeater_id = str_replace( 'repeater', '', $key ); |
| 391 | 391 | |
| 392 | 392 | $repeater_headings = array(); |
| 393 | - foreach ( $fields_by_repeater_id[ $repeater_id ] as $col ) { |
|
| 393 | + foreach ( $fields_by_repeater_id[$repeater_id] as $col ) { |
|
| 394 | 394 | $repeater_headings += self::field_headings( $col ); |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | - for ( $i = 0; $i < $max[ $repeater_id ]; $i++ ) { |
|
| 397 | + for ( $i = 0; $i < $max[$repeater_id]; $i ++ ) { |
|
| 398 | 398 | foreach ( $repeater_headings as $repeater_key => $repeater_name ) { |
| 399 | - $flat[ $repeater_key . '[' . $i . ']' ] = $repeater_name; |
|
| 399 | + $flat[$repeater_key . '[' . $i . ']'] = $repeater_name; |
|
| 400 | 400 | } |
| 401 | 401 | } |
| 402 | 402 | } else { |
| 403 | - $flat[ $key ] = $heading; |
|
| 403 | + $flat[$key] = $heading; |
|
| 404 | 404 | } |
| 405 | 405 | } |
| 406 | 406 | |
@@ -413,10 +413,10 @@ discard block |
||
| 413 | 413 | }//end if |
| 414 | 414 | |
| 415 | 415 | if ( self::$comment_count ) { |
| 416 | - for ( $i = 0; $i < self::$comment_count; $i++ ) { |
|
| 417 | - $headings[ 'comment' . $i ] = __( 'Comment', 'formidable' ); |
|
| 418 | - $headings[ 'comment_user_id' . $i ] = __( 'Comment User', 'formidable' ); |
|
| 419 | - $headings[ 'comment_created_at' . $i ] = __( 'Comment Date', 'formidable' ); |
|
| 416 | + for ( $i = 0; $i < self::$comment_count; $i ++ ) { |
|
| 417 | + $headings['comment' . $i] = __( 'Comment', 'formidable' ); |
|
| 418 | + $headings['comment_user_id' . $i] = __( 'Comment User', 'formidable' ); |
|
| 419 | + $headings['comment_created_at' . $i] = __( 'Comment Date', 'formidable' ); |
|
| 420 | 420 | } |
| 421 | 421 | unset( $i ); |
| 422 | 422 | } |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | |
| 462 | 462 | private static function prepare_next_csv_rows( $next_set ) { |
| 463 | 463 | if ( FrmAppHelper::pro_is_installed() ) { |
| 464 | - $where = array( |
|
| 464 | + $where = array( |
|
| 465 | 465 | 'or' => 1, |
| 466 | 466 | 'id' => $next_set, |
| 467 | 467 | 'parent_item_id' => $next_set, |
@@ -518,32 +518,32 @@ discard block |
||
| 518 | 518 | continue; |
| 519 | 519 | } |
| 520 | 520 | |
| 521 | - if ( ! isset( $entries[ self::$entry->parent_item_id ] ) ) { |
|
| 522 | - $entries[ self::$entry->parent_item_id ] = new stdClass(); |
|
| 523 | - $entries[ self::$entry->parent_item_id ]->metas = array(); |
|
| 521 | + if ( ! isset( $entries[self::$entry->parent_item_id] ) ) { |
|
| 522 | + $entries[self::$entry->parent_item_id] = new stdClass(); |
|
| 523 | + $entries[self::$entry->parent_item_id]->metas = array(); |
|
| 524 | 524 | } |
| 525 | 525 | |
| 526 | - if ( ! isset( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) { |
|
| 527 | - $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = array(); |
|
| 528 | - } elseif ( ! is_array( $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] ) ) { |
|
| 526 | + if ( ! isset( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) { |
|
| 527 | + $entries[self::$entry->parent_item_id]->metas[$meta_id] = array(); |
|
| 528 | + } elseif ( ! is_array( $entries[self::$entry->parent_item_id]->metas[$meta_id] ) ) { |
|
| 529 | 529 | // if the data is here, it should be an array but if this field has collected data |
| 530 | 530 | // both while inside and outside of the repeating section, it's possible this is a string. |
| 531 | - $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ] = (array) $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ]; |
|
| 531 | + $entries[self::$entry->parent_item_id]->metas[$meta_id] = (array) $entries[self::$entry->parent_item_id]->metas[$meta_id]; |
|
| 532 | 532 | } |
| 533 | 533 | |
| 534 | 534 | // Add the repeated values. |
| 535 | - $entries[ self::$entry->parent_item_id ]->metas[ $meta_id ][] = $meta_value; |
|
| 535 | + $entries[self::$entry->parent_item_id]->metas[$meta_id][] = $meta_value; |
|
| 536 | 536 | }//end foreach |
| 537 | 537 | |
| 538 | 538 | self::$entry->metas = self::fill_missing_repeater_metas( self::$entry->metas, $entries ); |
| 539 | - $entries[ self::$entry->parent_item_id ]->metas += self::$entry->metas; |
|
| 539 | + $entries[self::$entry->parent_item_id]->metas += self::$entry->metas; |
|
| 540 | 540 | }//end if |
| 541 | 541 | |
| 542 | 542 | // add the embedded form id |
| 543 | - if ( ! isset( $entries[ self::$entry->parent_item_id ]->embedded_fields ) ) { |
|
| 544 | - $entries[ self::$entry->parent_item_id ]->embedded_fields = array(); |
|
| 543 | + if ( ! isset( $entries[self::$entry->parent_item_id]->embedded_fields ) ) { |
|
| 544 | + $entries[self::$entry->parent_item_id]->embedded_fields = array(); |
|
| 545 | 545 | } |
| 546 | - $entries[ self::$entry->parent_item_id ]->embedded_fields[ self::$entry->id ] = self::$entry->form_id; |
|
| 546 | + $entries[self::$entry->parent_item_id]->embedded_fields[self::$entry->id] = self::$entry->form_id; |
|
| 547 | 547 | } |
| 548 | 548 | |
| 549 | 549 | /** |
@@ -564,19 +564,19 @@ discard block |
||
| 564 | 564 | } |
| 565 | 565 | |
| 566 | 566 | $repeater_id = $field->field_options['in_section']; |
| 567 | - if ( ! isset( self::$fields_by_repeater_id[ $repeater_id ] ) ) { |
|
| 567 | + if ( ! isset( self::$fields_by_repeater_id[$repeater_id] ) ) { |
|
| 568 | 568 | return $metas; |
| 569 | 569 | } |
| 570 | 570 | |
| 571 | - foreach ( self::$fields_by_repeater_id[ $repeater_id ] as $repeater_child ) { |
|
| 572 | - if ( ! isset( $metas[ $repeater_child->id ] ) ) { |
|
| 573 | - $metas[ $repeater_child->id ] = ''; |
|
| 571 | + foreach ( self::$fields_by_repeater_id[$repeater_id] as $repeater_child ) { |
|
| 572 | + if ( ! isset( $metas[$repeater_child->id] ) ) { |
|
| 573 | + $metas[$repeater_child->id] = ''; |
|
| 574 | 574 | |
| 575 | - if ( ! isset( $entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ] ) || ! is_array( $entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ] ) ) { |
|
| 576 | - $entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ] = array(); |
|
| 575 | + if ( ! isset( $entries[self::$entry->parent_item_id]->metas[$repeater_child->id] ) || ! is_array( $entries[self::$entry->parent_item_id]->metas[$repeater_child->id] ) ) { |
|
| 576 | + $entries[self::$entry->parent_item_id]->metas[$repeater_child->id] = array(); |
|
| 577 | 577 | } |
| 578 | 578 | |
| 579 | - $entries[ self::$entry->parent_item_id ]->metas[ $repeater_child->id ][] = ''; |
|
| 579 | + $entries[self::$entry->parent_item_id]->metas[$repeater_child->id][] = ''; |
|
| 580 | 580 | } |
| 581 | 581 | } |
| 582 | 582 | |
@@ -595,7 +595,7 @@ discard block |
||
| 595 | 595 | |
| 596 | 596 | private static function add_field_values_to_csv( &$row ) { |
| 597 | 597 | foreach ( self::$fields as $col ) { |
| 598 | - $field_value = self::$entry->metas[ $col->id ] ?? false; |
|
| 598 | + $field_value = self::$entry->metas[$col->id] ?? false; |
|
| 599 | 599 | |
| 600 | 600 | FrmFieldsHelper::prepare_field_value( $field_value, $col->type ); |
| 601 | 601 | self::add_array_values_to_columns( $row, compact( 'col', 'field_value' ) ); |
@@ -614,20 +614,20 @@ discard block |
||
| 614 | 614 | if ( ! empty( $col->field_options['separate_value'] ) ) { |
| 615 | 615 | $label_key = $col->id . '_label'; |
| 616 | 616 | if ( self::is_the_child_of_a_repeater( $col ) ) { |
| 617 | - $row[ $label_key ] = array(); |
|
| 617 | + $row[$label_key] = array(); |
|
| 618 | 618 | |
| 619 | 619 | if ( is_array( $field_value ) ) { |
| 620 | 620 | foreach ( $field_value as $value ) { |
| 621 | - $row[ $label_key ][] = self::get_separate_value_label( $value, $col ); |
|
| 621 | + $row[$label_key][] = self::get_separate_value_label( $value, $col ); |
|
| 622 | 622 | } |
| 623 | 623 | } |
| 624 | 624 | } else { |
| 625 | - $row[ $label_key ] = self::get_separate_value_label( $field_value, $col ); |
|
| 625 | + $row[$label_key] = self::get_separate_value_label( $field_value, $col ); |
|
| 626 | 626 | } |
| 627 | 627 | unset( $label_key ); |
| 628 | 628 | } |
| 629 | 629 | |
| 630 | - $row[ $col->id ] = $field_value; |
|
| 630 | + $row[$col->id] = $field_value; |
|
| 631 | 631 | |
| 632 | 632 | unset( $col, $field_value ); |
| 633 | 633 | }//end foreach |
@@ -650,7 +650,7 @@ discard block |
||
| 650 | 650 | 'show_icon' => false, |
| 651 | 651 | 'entry_id' => self::$entry->id, |
| 652 | 652 | 'sep' => self::$separator, |
| 653 | - '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, |
|
| 653 | + '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, |
|
| 654 | 654 | ) |
| 655 | 655 | ); |
| 656 | 656 | } |
@@ -665,8 +665,8 @@ discard block |
||
| 665 | 665 | // This is combo field inside repeater. The heading key has this format: [86_first[0]]. |
| 666 | 666 | foreach ( $sub_value as $sub_key => $sub_sub_value ) { |
| 667 | 667 | $column_key = $atts['col']->id . '_' . $sub_key . '[' . $key . ']'; |
| 668 | - if ( ! is_numeric( $sub_key ) && isset( self::$headings[ $column_key ] ) ) { |
|
| 669 | - $row[ $column_key ] = $sub_sub_value; |
|
| 668 | + if ( ! is_numeric( $sub_key ) && isset( self::$headings[$column_key] ) ) { |
|
| 669 | + $row[$column_key] = $sub_sub_value; |
|
| 670 | 670 | } |
| 671 | 671 | } |
| 672 | 672 | |
@@ -674,8 +674,8 @@ discard block |
||
| 674 | 674 | } |
| 675 | 675 | |
| 676 | 676 | $column_key = $atts['col']->id . '_' . $key; |
| 677 | - if ( ! is_numeric( $key ) && isset( self::$headings[ $column_key ] ) ) { |
|
| 678 | - $row[ $column_key ] = $sub_value; |
|
| 677 | + if ( ! is_numeric( $key ) && isset( self::$headings[$column_key] ) ) { |
|
| 678 | + $row[$column_key] = $sub_value; |
|
| 679 | 679 | } |
| 680 | 680 | } |
| 681 | 681 | } |
@@ -700,18 +700,18 @@ discard block |
||
| 700 | 700 | $echo = 'echo' === self::$mode; |
| 701 | 701 | |
| 702 | 702 | foreach ( self::$headings as $k => $heading ) { |
| 703 | - if ( isset( $rows[ $k ] ) ) { |
|
| 704 | - $row = $rows[ $k ]; |
|
| 703 | + if ( isset( $rows[$k] ) ) { |
|
| 704 | + $row = $rows[$k]; |
|
| 705 | 705 | } else { |
| 706 | 706 | $row = ''; |
| 707 | 707 | // array indexed data is not at $rows[ $k ] |
| 708 | - if ( $k[ strlen( $k ) - 1 ] === ']' ) { |
|
| 708 | + if ( $k[strlen( $k ) - 1] === ']' ) { |
|
| 709 | 709 | $start = strrpos( $k, '[' ); |
| 710 | - $key = substr( $k, 0, $start++ ); |
|
| 710 | + $key = substr( $k, 0, $start ++ ); |
|
| 711 | 711 | $index = substr( $k, $start, strlen( $k ) - 1 - $start ); |
| 712 | 712 | |
| 713 | - if ( isset( $rows[ $key ] ) && isset( $rows[ $key ][ $index ] ) ) { |
|
| 714 | - $row = $rows[ $key ][ $index ]; |
|
| 713 | + if ( isset( $rows[$key] ) && isset( $rows[$key][$index] ) ) { |
|
| 714 | + $row = $rows[$key][$index]; |
|
| 715 | 715 | } |
| 716 | 716 | |
| 717 | 717 | unset( $start, $key, $index ); |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | public static function get_current_action_from_global_var( $form_id ) { |
| 86 | 86 | global $frm_vars; |
| 87 | 87 | |
| 88 | - return $frm_vars['form_params'][ $form_id ]['action'] ?? 'create'; |
|
| 88 | + return $frm_vars['form_params'][$form_id]['action'] ?? 'create'; |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | /** |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | public static function remove_submit_field_from_list( &$fields ) { |
| 178 | 178 | foreach ( $fields as $key => $field ) { |
| 179 | 179 | if ( self::FIELD_TYPE === FrmField::get_field_type( $field ) ) { |
| 180 | - unset( $fields[ $key ] ); |
|
| 180 | + unset( $fields[$key] ); |
|
| 181 | 181 | return; |
| 182 | 182 | } |
| 183 | 183 | } |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | array( 'field_order' => $new_order ) |
| 225 | 225 | ); |
| 226 | 226 | if ( false !== $updated ) { |
| 227 | - self::$last_row_fields_order[ $last_row_field_id ] = $new_order; |
|
| 227 | + self::$last_row_fields_order[$last_row_field_id] = $new_order; |
|
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | 230 | } |
@@ -112,8 +112,8 @@ discard block |
||
| 112 | 112 | $cross_sell_links = $data['cross_sell_link']; |
| 113 | 113 | $index = self::determine_cross_sell_index( $cross_sell_text ); |
| 114 | 114 | |
| 115 | - self::$cross_sell_text = sanitize_text_field( $cross_sell_text[ $index ] ); |
|
| 116 | - self::$cross_sell_link = esc_url_raw( $cross_sell_links[ $index ] ); |
|
| 115 | + self::$cross_sell_text = sanitize_text_field( $cross_sell_text[$index] ); |
|
| 116 | + self::$cross_sell_link = esc_url_raw( $cross_sell_links[$index] ); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
@@ -158,13 +158,13 @@ discard block |
||
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | foreach ( $cross_sell_text as $index => $current_text ) { |
| 161 | - if ( ! isset( $cross_sell_settings[ $current_text ] ) ) { |
|
| 162 | - $cross_sell_settings[ $current_text ] = time(); |
|
| 161 | + if ( ! isset( $cross_sell_settings[$current_text] ) ) { |
|
| 162 | + $cross_sell_settings[$current_text] = time(); |
|
| 163 | 163 | update_option( $option_name, $cross_sell_settings ); |
| 164 | 164 | return $index; |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - $time_elapsed = time() - $cross_sell_settings[ $current_text ]; |
|
| 167 | + $time_elapsed = time() - $cross_sell_settings[$current_text]; |
|
| 168 | 168 | if ( $time_elapsed < DAY_IN_SECONDS * 30 ) { |
| 169 | 169 | return $index; |
| 170 | 170 | } |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | return; |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | - self::$sales[ $sale['key'] ] = $this->fill_sale( $sale ); |
|
| 200 | + self::$sales[$sale['key']] = $this->fill_sale( $sale ); |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | /** |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | |
| 305 | 305 | $sale = self::$instance->get_best_sale(); |
| 306 | 306 | |
| 307 | - return is_array( $sale ) && ! empty( $sale[ $key ] ) ? $sale[ $key ] : false; |
|
| 307 | + return is_array( $sale ) && ! empty( $sale[$key] ) ? $sale[$key] : false; |
|
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | /** |
@@ -501,14 +501,14 @@ discard block |
||
| 501 | 501 | esc_html( self::$cross_sell_text ), |
| 502 | 502 | 'activate_plugins', |
| 503 | 503 | 'frm-sales-api-cross-sell', |
| 504 | - function () { |
|
| 504 | + function() { |
|
| 505 | 505 | // There is no page. The redirect logic is handled below, before this callback is triggered. |
| 506 | 506 | } |
| 507 | 507 | ); |
| 508 | 508 | |
| 509 | 509 | add_action( |
| 510 | 510 | 'admin_init', |
| 511 | - function () { |
|
| 511 | + function() { |
|
| 512 | 512 | if ( ! current_user_can( 'activate_plugins' ) ) { |
| 513 | 513 | return; |
| 514 | 514 | } |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | '<span class="frm-upgrade-submenu">' . esc_html( $cta_text ) . '</span>', |
| 117 | 117 | 'frm_view_forms', |
| 118 | 118 | 'formidable-pro-upgrade', |
| 119 | - function () { |
|
| 119 | + function() { |
|
| 120 | 120 | // This function doesn't need to do anything. |
| 121 | 121 | // The redirect is handled earlier to avoid issues with the headers being sent. |
| 122 | 122 | } |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | unset( $addons['error'] ); |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | - $pro = array( |
|
| 150 | + $pro = array( |
|
| 151 | 151 | 'pro' => array( |
| 152 | 152 | 'title' => 'Formidable Forms Pro', |
| 153 | 153 | 'slug' => 'formidable-pro', |
@@ -189,9 +189,9 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | // Extract the elements to move |
| 191 | 191 | foreach ( $plans as $plan ) { |
| 192 | - if ( isset( self::$categories[ $plan ] ) ) { |
|
| 193 | - $bottom_categories[ $plan ] = self::$categories[ $plan ]; |
|
| 194 | - unset( self::$categories[ $plan ] ); |
|
| 192 | + if ( isset( self::$categories[$plan] ) ) { |
|
| 193 | + $bottom_categories[$plan] = self::$categories[$plan]; |
|
| 194 | + unset( self::$categories[$plan] ); |
|
| 195 | 195 | } |
| 196 | 196 | } |
| 197 | 197 | |
@@ -245,14 +245,12 @@ discard block |
||
| 245 | 245 | // Add the slug to the new array. |
| 246 | 246 | $addon['category-slugs'][] = $category_slug; |
| 247 | 247 | |
| 248 | - if ( ! isset( self::$categories[ $category_slug ] ) ) { |
|
| 249 | - self::$categories[ $category_slug ] = array( |
|
| 248 | + if ( ! isset( self::$categories[$category_slug] ) ) { |
|
| 249 | + self::$categories[$category_slug] = array( |
|
| 250 | 250 | 'name' => $category, |
| 251 | 251 | 'count' => 0, |
| 252 | 252 | ); |
| 253 | - } |
|
| 254 | - |
|
| 255 | - ++self::$categories[ $category_slug ]['count']; |
|
| 253 | + } ++self::$categories[$category_slug]['count']; |
|
| 256 | 254 | } |
| 257 | 255 | } |
| 258 | 256 | |
@@ -284,7 +282,7 @@ discard block |
||
| 284 | 282 | } else { |
| 285 | 283 | foreach ( $addons as $k => $addon ) { |
| 286 | 284 | if ( empty( $addon['excerpt'] ) && $k !== 'error' ) { |
| 287 | - unset( $addons[ $k ] ); |
|
| 285 | + unset( $addons[$k] ); |
|
| 288 | 286 | } |
| 289 | 287 | } |
| 290 | 288 | } |
@@ -398,7 +396,7 @@ discard block |
||
| 398 | 396 | |
| 399 | 397 | foreach ( $list as $k => $info ) { |
| 400 | 398 | $info['slug'] = $k; |
| 401 | - $list[ $k ] = array_merge( $defaults, $info ); |
|
| 399 | + $list[$k] = array_merge( $defaults, $info ); |
|
| 402 | 400 | } |
| 403 | 401 | return $list; |
| 404 | 402 | } |
@@ -549,17 +547,17 @@ discard block |
||
| 549 | 547 | continue; |
| 550 | 548 | } |
| 551 | 549 | |
| 552 | - $wp_plugin = $wp_plugins[ $folder ] ?? array(); |
|
| 550 | + $wp_plugin = $wp_plugins[$folder] ?? array(); |
|
| 553 | 551 | $wp_version = $wp_plugin['Version'] ?? '1.0'; |
| 554 | 552 | $plugin->slug = explode( '/', $folder )[0]; |
| 555 | 553 | |
| 556 | 554 | if ( version_compare( $wp_version, $plugin->new_version, '<' ) ) { |
| 557 | - $transient->response[ $folder ] = $plugin; |
|
| 555 | + $transient->response[$folder] = $plugin; |
|
| 558 | 556 | } else { |
| 559 | - $transient->no_update[ $folder ] = $plugin; |
|
| 557 | + $transient->no_update[$folder] = $plugin; |
|
| 560 | 558 | } |
| 561 | 559 | |
| 562 | - $transient->checked[ $folder ] = $wp_version; |
|
| 560 | + $transient->checked[$folder] = $wp_version; |
|
| 563 | 561 | |
| 564 | 562 | }//end foreach |
| 565 | 563 | |
@@ -592,7 +590,7 @@ discard block |
||
| 592 | 590 | */ |
| 593 | 591 | protected static function is_installed( $plugin ) { |
| 594 | 592 | $all_plugins = self::get_plugins(); |
| 595 | - return isset( $all_plugins[ $plugin ] ); |
|
| 593 | + return isset( $all_plugins[$plugin] ); |
|
| 596 | 594 | } |
| 597 | 595 | |
| 598 | 596 | /** |
@@ -631,13 +629,13 @@ discard block |
||
| 631 | 629 | } |
| 632 | 630 | |
| 633 | 631 | $download_id = $plugin['id'] ?? 0; |
| 634 | - if ( ! empty( $download_id ) && ! isset( $version_info[ $download_id ]['package'] ) ) { |
|
| 632 | + if ( ! empty( $download_id ) && ! isset( $version_info[$download_id]['package'] ) ) { |
|
| 635 | 633 | // if this addon is using its own license, get the update url |
| 636 | 634 | $addon_info = $api->get_api_info(); |
| 637 | 635 | |
| 638 | - $version_info[ $download_id ] = $addon_info[ $download_id ]; |
|
| 636 | + $version_info[$download_id] = $addon_info[$download_id]; |
|
| 639 | 637 | if ( isset( $addon_info['error'] ) ) { |
| 640 | - $version_info[ $download_id ]['error'] = array( |
|
| 638 | + $version_info[$download_id]['error'] = array( |
|
| 641 | 639 | 'message' => $addon_info['error']['message'], |
| 642 | 640 | 'code' => $addon_info['error']['code'], |
| 643 | 641 | ); |
@@ -736,8 +734,8 @@ discard block |
||
| 736 | 734 | return $addon; |
| 737 | 735 | } |
| 738 | 736 | } |
| 739 | - } elseif ( isset( $addons[ $download_id ] ) ) { |
|
| 740 | - $plugin = $addons[ $download_id ]; |
|
| 737 | + } elseif ( isset( $addons[$download_id] ) ) { |
|
| 738 | + $plugin = $addons[$download_id]; |
|
| 741 | 739 | } |
| 742 | 740 | |
| 743 | 741 | return $plugin; |
@@ -803,7 +801,7 @@ discard block |
||
| 803 | 801 | self::set_addon_status( $addon ); |
| 804 | 802 | self::set_categories( $addon ); |
| 805 | 803 | |
| 806 | - $addons[ $id ] = $addon; |
|
| 804 | + $addons[$id] = $addon; |
|
| 807 | 805 | }//end foreach |
| 808 | 806 | } |
| 809 | 807 | |
@@ -838,7 +836,7 @@ discard block |
||
| 838 | 836 | if ( strpos( $link, 'http' ) !== 0 ) { |
| 839 | 837 | $link = $site_url . $link; |
| 840 | 838 | } |
| 841 | - $link = FrmAppHelper::make_affiliate_url( $link ); |
|
| 839 | + $link = FrmAppHelper::make_affiliate_url( $link ); |
|
| 842 | 840 | |
| 843 | 841 | $utm = array( |
| 844 | 842 | 'campaign' => 'addons', |
@@ -1061,7 +1059,7 @@ discard block |
||
| 1061 | 1059 | */ |
| 1062 | 1060 | public static function ajax_activate_addon() { |
| 1063 | 1061 | self::process_addon_action( |
| 1064 | - function ( $plugin ) { |
|
| 1062 | + function( $plugin ) { |
|
| 1065 | 1063 | return self::handle_addon_action( $plugin, 'activate' ); |
| 1066 | 1064 | }, |
| 1067 | 1065 | array( 'FrmAddonsController', 'get_addon_activation_response' ) |
@@ -1086,7 +1084,7 @@ discard block |
||
| 1086 | 1084 | */ |
| 1087 | 1085 | public static function ajax_deactivate_addon() { |
| 1088 | 1086 | self::process_addon_action( |
| 1089 | - function ( $plugin ) { |
|
| 1087 | + function( $plugin ) { |
|
| 1090 | 1088 | return self::handle_addon_action( $plugin, 'deactivate' ); |
| 1091 | 1089 | } |
| 1092 | 1090 | ); |
@@ -1101,7 +1099,7 @@ discard block |
||
| 1101 | 1099 | */ |
| 1102 | 1100 | public static function ajax_uninstall_addon() { |
| 1103 | 1101 | self::process_addon_action( |
| 1104 | - function ( $plugin ) { |
|
| 1102 | + function( $plugin ) { |
|
| 1105 | 1103 | return self::handle_addon_action( $plugin, 'uninstall' ); |
| 1106 | 1104 | } |
| 1107 | 1105 | ); |
@@ -1499,7 +1497,7 @@ discard block |
||
| 1499 | 1497 | $addons = $api->get_api_info(); |
| 1500 | 1498 | |
| 1501 | 1499 | if ( is_array( $addons ) && array_key_exists( $addon_id, $addons ) ) { |
| 1502 | - $dates = $addons[ $addon_id ]; |
|
| 1500 | + $dates = $addons[$addon_id]; |
|
| 1503 | 1501 | $requires = FrmFormsHelper::get_plan_required( $dates ); |
| 1504 | 1502 | } |
| 1505 | 1503 | |
@@ -1334,11 +1334,11 @@ discard block |
||
| 1334 | 1334 | wp_set_script_translations( 's11-floating-links-config', 's11-' ); |
| 1335 | 1335 | } |
| 1336 | 1336 | |
| 1337 | - $upgrade_utm = array( |
|
| 1337 | + $upgrade_utm = array( |
|
| 1338 | 1338 | 'campaign' => 'floating-links', |
| 1339 | 1339 | 'content' => 'floating-links-upgrade', |
| 1340 | 1340 | ); |
| 1341 | - $docs_utm = array( |
|
| 1341 | + $docs_utm = array( |
|
| 1342 | 1342 | 'campaign' => 'floating-links', |
| 1343 | 1343 | 'content' => 'floating-links-docs', |
| 1344 | 1344 | ); |
@@ -1412,15 +1412,15 @@ discard block |
||
| 1412 | 1412 | global $wp_filter; |
| 1413 | 1413 | |
| 1414 | 1414 | foreach ( $actions as $action ) { |
| 1415 | - if ( empty( $wp_filter[ $action ]->callbacks ) ) { |
|
| 1415 | + if ( empty( $wp_filter[$action]->callbacks ) ) { |
|
| 1416 | 1416 | continue; |
| 1417 | 1417 | } |
| 1418 | - foreach ( $wp_filter[ $action ]->callbacks as $priority => $callbacks ) { |
|
| 1418 | + foreach ( $wp_filter[$action]->callbacks as $priority => $callbacks ) { |
|
| 1419 | 1419 | foreach ( $callbacks as $callback_name => $callback ) { |
| 1420 | 1420 | if ( self::is_our_callback_string( $callback_name ) || self::is_our_callback_array( $callback ) ) { |
| 1421 | 1421 | continue; |
| 1422 | 1422 | } |
| 1423 | - unset( $wp_filter[ $action ]->callbacks[ $priority ][ $callback_name ] ); |
|
| 1423 | + unset( $wp_filter[$action]->callbacks[$priority][$callback_name] ); |
|
| 1424 | 1424 | } |
| 1425 | 1425 | } |
| 1426 | 1426 | } |
@@ -1458,8 +1458,8 @@ discard block |
||
| 1458 | 1458 | $current_sort = $previous_meta; |
| 1459 | 1459 | $form_id = $is_entry_list ? FrmAppHelper::simple_get( 'form', 'absint' ) : 0; |
| 1460 | 1460 | |
| 1461 | - if ( is_array( $current_sort ) && $form_id && is_int( $form_id ) && isset( $current_sort[ $form_id ] ) ) { |
|
| 1462 | - $current_sort = $current_sort[ $form_id ]; |
|
| 1461 | + if ( is_array( $current_sort ) && $form_id && is_int( $form_id ) && isset( $current_sort[$form_id] ) ) { |
|
| 1462 | + $current_sort = $current_sort[$form_id]; |
|
| 1463 | 1463 | } |
| 1464 | 1464 | |
| 1465 | 1465 | if ( $new_sort !== $current_sort ) { |
@@ -1468,7 +1468,7 @@ discard block |
||
| 1468 | 1468 | if ( $is_entry_list && $form_id && is_int( $form_id ) ) { |
| 1469 | 1469 | // Index meta by form ID. |
| 1470 | 1470 | $temp_meta = is_array( $previous_meta ) ? $previous_meta : array(); |
| 1471 | - $temp_meta[ $form_id ] = $new_meta; |
|
| 1471 | + $temp_meta[$form_id] = $new_meta; |
|
| 1472 | 1472 | $new_meta = $temp_meta; |
| 1473 | 1473 | unset( $temp_meta ); |
| 1474 | 1474 | } |
@@ -1496,8 +1496,8 @@ discard block |
||
| 1496 | 1496 | $preferred_list_sort = get_user_meta( $user_id, $meta_key, true ); |
| 1497 | 1497 | $form_id = FrmAppHelper::simple_get( 'form', 'absint' ); |
| 1498 | 1498 | |
| 1499 | - if ( is_array( $preferred_list_sort ) && $form_id && is_int( $form_id ) && isset( $preferred_list_sort[ $form_id ] ) ) { |
|
| 1500 | - $preferred_list_sort = $preferred_list_sort[ $form_id ]; |
|
| 1499 | + if ( is_array( $preferred_list_sort ) && $form_id && is_int( $form_id ) && isset( $preferred_list_sort[$form_id] ) ) { |
|
| 1500 | + $preferred_list_sort = $preferred_list_sort[$form_id]; |
|
| 1501 | 1501 | } |
| 1502 | 1502 | |
| 1503 | 1503 | if ( is_array( $preferred_list_sort ) && ! empty( $preferred_list_sort['orderby'] ) ) { |
@@ -14,7 +14,10 @@ |
||
| 14 | 14 | ); |
| 15 | 15 | ?> |
| 16 | 16 | Please <a href="<?php echo esc_url( FrmAppHelper::admin_upgrade_link( $utm, 'account/downloads/' ) ); ?>">renew now</a> to get the latest version. |
| 17 | - <?php else : ?> |
|
| 18 | - Please <a href="<?php echo esc_url( admin_url( 'plugins.php?s=formidable%20forms%20pro' ) ); ?>">update now</a>. |
|
| 17 | + <?php else { |
|
| 18 | + : ?> |
|
| 19 | + Please <a href="<?php echo esc_url( admin_url( 'plugins.php?s=formidable%20forms%20pro' ) ); |
|
| 20 | +} |
|
| 21 | +?>">update now</a>. |
|
| 19 | 22 | <?php endif; ?> |
| 20 | 23 | </div> |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | $active_step = 0; |
| 119 | 119 | |
| 120 | 120 | foreach ( $step_keys as $index => $step_key ) { |
| 121 | - $completed_step = isset( self::$checklist['completed_steps'][ $step_key ] ); |
|
| 121 | + $completed_step = isset( self::$checklist['completed_steps'][$step_key] ); |
|
| 122 | 122 | |
| 123 | 123 | if ( false === $completed_step ) { |
| 124 | 124 | switch ( $step_key ) { |
@@ -132,15 +132,15 @@ discard block |
||
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if ( $completed_step ) { |
| 135 | - self::$checklist['completed_steps'][ $step_key ] = true; |
|
| 135 | + self::$checklist['completed_steps'][$step_key] = true; |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | // Count completed steps from start until gap found. |
| 139 | 139 | if ( $completed_step && $index === $active_step ) { |
| 140 | - $active_step++; |
|
| 140 | + $active_step ++; |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | - self::$steps['steps'][ $index ]['completed'] = $completed_step; |
|
| 143 | + self::$steps['steps'][$index]['completed'] = $completed_step; |
|
| 144 | 144 | }//end foreach |
| 145 | 145 | |
| 146 | 146 | self::$checklist['active_step'] = $active_step; |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | self::$checklist['done'] = true; |
| 150 | 150 | self::$checklist['active_step_key'] = 'completed'; |
| 151 | 151 | } else { |
| 152 | - self::$checklist['active_step_key'] = $step_keys[ $active_step ]; |
|
| 152 | + self::$checklist['active_step_key'] = $step_keys[$active_step]; |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | self::save_checklist(); |
@@ -199,8 +199,8 @@ discard block |
||
| 199 | 199 | */ |
| 200 | 200 | private static function fill_step_completed_data( $steps, $steps_keys ) { |
| 201 | 201 | return array_map( |
| 202 | - function ( $step, $step_key ) { |
|
| 203 | - $step['completed'] = isset( self::$checklist['completed_steps'][ $step_key ] ); |
|
| 202 | + function( $step, $step_key ) { |
|
| 203 | + $step['completed'] = isset( self::$checklist['completed_steps'][$step_key] ); |
|
| 204 | 204 | return $step; |
| 205 | 205 | }, |
| 206 | 206 | $steps, |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | 'target' => '#frm_style_sidebar .frm-style-card > div', |
| 235 | 235 | 'left-position' => 'end', |
| 236 | 236 | 'offset' => array( |
| 237 | - 'top' => -22, |
|
| 237 | + 'top' => - 22, |
|
| 238 | 238 | 'left' => 16, |
| 239 | 239 | ), |
| 240 | 240 | ); |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | break; |
| 251 | 251 | }//end switch |
| 252 | 252 | |
| 253 | - return array_merge( self::$steps['steps'][ self::$checklist['active_step'] ], $spotlight_data ); |
|
| 253 | + return array_merge( self::$steps['steps'][self::$checklist['active_step']], $spotlight_data ); |
|
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | /** |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | } |
| 378 | 378 | |
| 379 | 379 | self::$checklist = self::get_checklist(); |
| 380 | - self::$checklist['completed_steps'][ $step_key ] = true; |
|
| 380 | + self::$checklist['completed_steps'][$step_key] = true; |
|
| 381 | 381 | self::save_checklist(); |
| 382 | 382 | |
| 383 | 383 | wp_send_json_success(); |
@@ -591,7 +591,7 @@ discard block |
||
| 591 | 591 | $steps = self::get_steps(); |
| 592 | 592 | |
| 593 | 593 | foreach ( $steps as $key => $step ) { |
| 594 | - $usage_data[ 'completed_step_' . $key ] = empty( $option['completed_steps'][ $key ] ) ? 0 : 1; |
|
| 594 | + $usage_data['completed_step_' . $key] = empty( $option['completed_steps'][$key] ) ? 0 : 1; |
|
| 595 | 595 | } |
| 596 | 596 | |
| 597 | 597 | $usage_data['done'] = empty( $option['done'] ) ? 0 : 1; |