@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | return; |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | - $selected_xml = isset( $form['xml'] ) && isset( $form['xml'][ $selected_form ] ) ? $form['xml'][ $selected_form ] : ''; |
|
| 180 | + $selected_xml = isset( $form['xml'] ) && isset( $form['xml'][$selected_form] ) ? $form['xml'][$selected_form] : ''; |
|
| 181 | 181 | |
| 182 | 182 | if ( empty( $selected_xml ) || strpos( $selected_xml, 'http' ) !== 0 ) { |
| 183 | 183 | return; |
@@ -195,8 +195,8 @@ discard block |
||
| 195 | 195 | * @return string |
| 196 | 196 | */ |
| 197 | 197 | private static function get_selected_in_form( $form, $value = 'form' ) { |
| 198 | - if ( ! empty( $form ) && ! empty( $form[ $value ] ) ) { |
|
| 199 | - return $form[ $value ]; |
|
| 198 | + if ( ! empty( $form ) && ! empty( $form[$value] ) ) { |
|
| 199 | + return $form[$value]; |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | return ''; |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | if ( $for === 'view' ) { |
| 229 | - $item_key = is_array( $view_keys ) ? $view_keys[ $form_key ] : $view_keys; |
|
| 229 | + $item_key = is_array( $view_keys ) ? $view_keys[$form_key] : $view_keys; |
|
| 230 | 230 | $shortcode = '[display-frm-data id=%1$s filter=limited]'; |
| 231 | 231 | } elseif ( $for === 'form' ) { |
| 232 | 232 | $item_key = $form_key; |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | continue; |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | - $page_ids[ $for ] = wp_insert_post( |
|
| 244 | + $page_ids[$for] = wp_insert_post( |
|
| 245 | 245 | array( |
| 246 | 246 | 'post_title' => $name, |
| 247 | 247 | 'post_type' => 'page', |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | $file_type = sanitize_option( 'upload_path', $_FILES['frm_import_file']['name'] ); |
| 401 | 401 | $file_type = strtolower( pathinfo( $file_type, PATHINFO_EXTENSION ) ); |
| 402 | 402 | |
| 403 | - if ( 'xml' !== $file_type && isset( $export_format[ $file_type ] ) ) { |
|
| 403 | + if ( 'xml' !== $file_type && isset( $export_format[$file_type] ) ) { |
|
| 404 | 404 | // allow other file types to be imported |
| 405 | 405 | do_action( 'frm_before_import_' . $file_type ); |
| 406 | 406 | |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | foreach ( $type as $tb_type ) { |
| 496 | 496 | $where = array(); |
| 497 | 497 | $join = ''; |
| 498 | - $table = $tables[ $tb_type ]; |
|
| 498 | + $table = $tables[$tb_type]; |
|
| 499 | 499 | |
| 500 | 500 | $select = $table . '.id'; |
| 501 | 501 | $query_vars = array(); |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | $table . '.parent_form_id' => $args['ids'], |
| 511 | 511 | ); |
| 512 | 512 | } else { |
| 513 | - $where[ $table . '.status !' ] = 'draft'; |
|
| 513 | + $where[$table . '.status !'] = 'draft'; |
|
| 514 | 514 | } |
| 515 | 515 | break; |
| 516 | 516 | case 'actions': |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | case 'items': |
| 525 | 525 | // $join = "INNER JOIN {$wpdb->prefix}frm_item_metas im ON ($table.id = im.item_id)"; |
| 526 | 526 | if ( $args['ids'] ) { |
| 527 | - $where[ $table . '.form_id' ] = $args['ids']; |
|
| 527 | + $where[$table . '.form_id'] = $args['ids']; |
|
| 528 | 528 | } |
| 529 | 529 | break; |
| 530 | 530 | case 'styles': |
@@ -568,7 +568,7 @@ discard block |
||
| 568 | 568 | } |
| 569 | 569 | }//end switch |
| 570 | 570 | |
| 571 | - $records[ $tb_type ] = FrmDb::get_col( $table . $join, $where, $select ); |
|
| 571 | + $records[$tb_type] = FrmDb::get_col( $table . $join, $where, $select ); |
|
| 572 | 572 | unset( $tb_type ); |
| 573 | 573 | }//end foreach |
| 574 | 574 | |
@@ -781,7 +781,7 @@ discard block |
||
| 781 | 781 | |
| 782 | 782 | foreach ( $csv_fields as $k => $f ) { |
| 783 | 783 | if ( in_array( $f->type, $no_export_fields, true ) ) { |
| 784 | - unset( $csv_fields[ $k ] ); |
|
| 784 | + unset( $csv_fields[$k] ); |
|
| 785 | 785 | } |
| 786 | 786 | } |
| 787 | 787 | |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | /** |
| 161 | 161 | * Update the form data on the "Manage Styles" tab after global settings are saved. |
| 162 | 162 | */ |
| 163 | - function () { |
|
| 163 | + function() { |
|
| 164 | 164 | self::manage_styles(); |
| 165 | 165 | } |
| 166 | 166 | ); |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | $style_id = self::get_style_id_for_styler(); |
| 348 | 348 | |
| 349 | 349 | if ( ! $style_id ) { |
| 350 | - $error_args = array( |
|
| 350 | + $error_args = array( |
|
| 351 | 351 | 'title' => __( 'No styles', 'formidable' ), |
| 352 | 352 | 'body' => __( 'You must have a style to use the Visual Styler.', 'formidable' ), |
| 353 | 353 | 'cancel_url' => admin_url( 'admin.php?page=formidable' ), |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | $form = FrmForm::getOne( $form_id ); |
| 366 | 366 | |
| 367 | 367 | if ( ! is_object( $form ) ) { |
| 368 | - $error_args = array( |
|
| 368 | + $error_args = array( |
|
| 369 | 369 | 'title' => __( 'No forms', 'formidable' ), |
| 370 | 370 | 'body' => __( 'You must have a form to use the Visual Styler.', 'formidable' ), |
| 371 | 371 | 'cancel_url' => admin_url( 'admin.php?page=formidable' ), |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | if ( ! $form_id ) { |
| 443 | 443 | // TODO: Show a message why a random form is being shown (because no form is assigned to the style). |
| 444 | 444 | // Fallback to any form. |
| 445 | - $where = array( |
|
| 445 | + $where = array( |
|
| 446 | 446 | 'status' => 'published', |
| 447 | 447 | // Make sure it's not a repeater. |
| 448 | 448 | 'parent_form_id' => array( null, 0 ), |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | private static function disable_admin_page_styling_on_submit_buttons() { |
| 462 | 462 | add_filter( |
| 463 | 463 | 'frm_submit_button_class', |
| 464 | - function ( $classes ) { |
|
| 464 | + function( $classes ) { |
|
| 465 | 465 | $classes[] = 'frm_no_style_button'; |
| 466 | 466 | return $classes; |
| 467 | 467 | } |
@@ -694,13 +694,13 @@ discard block |
||
| 694 | 694 | private static function force_form_style( $style ) { |
| 695 | 695 | add_filter( |
| 696 | 696 | 'frm_add_form_style_class', |
| 697 | - function ( $class ) use ( $style ) { |
|
| 698 | - $split = array_filter( |
|
| 697 | + function( $class ) use ( $style ) { |
|
| 698 | + $split = array_filter( |
|
| 699 | 699 | explode( ' ', $class ), |
| 700 | 700 | /** |
| 701 | 701 | * @param string $class |
| 702 | 702 | */ |
| 703 | - function ( $class ) { |
|
| 703 | + function( $class ) { |
|
| 704 | 704 | return $class && 0 !== strpos( $class, 'frm_style_' ); |
| 705 | 705 | } |
| 706 | 706 | ); |
@@ -828,11 +828,11 @@ discard block |
||
| 828 | 828 | $forms = FrmForm::get_published_forms(); |
| 829 | 829 | |
| 830 | 830 | foreach ( $forms as $form ) { |
| 831 | - if ( ! isset( $_POST['style'] ) || ! isset( $_POST['style'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 831 | + if ( ! isset( $_POST['style'] ) || ! isset( $_POST['style'][$form->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 832 | 832 | continue; |
| 833 | 833 | } |
| 834 | 834 | |
| 835 | - $new_style = sanitize_text_field( wp_unslash( $_POST['style'][ $form->id ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 835 | + $new_style = sanitize_text_field( wp_unslash( $_POST['style'][$form->id] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 836 | 836 | |
| 837 | 837 | $form->options['custom_style'] = $new_style; |
| 838 | 838 | $wpdb->update( $wpdb->prefix . 'frm_forms', array( 'options' => maybe_serialize( $form->options ) ), array( 'id' => $form->id ) ); |
@@ -1261,8 +1261,8 @@ discard block |
||
| 1261 | 1261 | public static function get_style_val( $val, $form = 'default' ) { |
| 1262 | 1262 | $style = self::get_form_style( $form ); |
| 1263 | 1263 | |
| 1264 | - if ( $style && isset( $style->post_content[ $val ] ) ) { |
|
| 1265 | - return $style->post_content[ $val ]; |
|
| 1264 | + if ( $style && isset( $style->post_content[$val] ) ) { |
|
| 1265 | + return $style->post_content[$val]; |
|
| 1266 | 1266 | } |
| 1267 | 1267 | } |
| 1268 | 1268 | |
@@ -1287,7 +1287,7 @@ discard block |
||
| 1287 | 1287 | } elseif ( 'alt_bg_color' == $name ) { |
| 1288 | 1288 | $setting = 'bg_color_active'; |
| 1289 | 1289 | } |
| 1290 | - $default_styles[ $name ] = $style->post_content[ $setting ]; |
|
| 1290 | + $default_styles[$name] = $style->post_content[$setting]; |
|
| 1291 | 1291 | unset( $name, $val ); |
| 1292 | 1292 | } |
| 1293 | 1293 | |
@@ -1343,16 +1343,16 @@ discard block |
||
| 1343 | 1343 | $i = 0; |
| 1344 | 1344 | $first_open = false; |
| 1345 | 1345 | |
| 1346 | - if ( isset( $wp_meta_boxes[ $page ][ $context ] ) ) { |
|
| 1346 | + if ( isset( $wp_meta_boxes[$page][$context] ) ) { |
|
| 1347 | 1347 | foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) { |
| 1348 | - if ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) { |
|
| 1349 | - foreach ( $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) { |
|
| 1348 | + if ( isset( $wp_meta_boxes[$page][$context][$priority] ) ) { |
|
| 1349 | + foreach ( $wp_meta_boxes[$page][$context][$priority] as $box ) { |
|
| 1350 | 1350 | if ( false === $box || ! $box['title'] ) { |
| 1351 | 1351 | continue; |
| 1352 | 1352 | } |
| 1353 | 1353 | |
| 1354 | - ++$i; |
|
| 1355 | - $icon_id = array_key_exists( $box['id'], $icon_ids ) ? $icon_ids[ $box['id'] ] : 'frm-' . $box['id']; |
|
| 1354 | + ++ $i; |
|
| 1355 | + $icon_id = array_key_exists( $box['id'], $icon_ids ) ? $icon_ids[$box['id']] : 'frm-' . $box['id']; |
|
| 1356 | 1356 | |
| 1357 | 1357 | $open_class = ''; |
| 1358 | 1358 | |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | 'description' => esc_html__( 'Just add your email address and you\'ll get 30+ free form templates to your account.', 'formidable' ), |
| 242 | 242 | 'submit_button_text' => esc_html_x( 'Get Templates', 'get free templates modal submit button text', 'formidable' ), |
| 243 | 243 | ); |
| 244 | - $view_parts[] = 'modals/leave-email-modal.php'; |
|
| 244 | + $view_parts[] = 'modals/leave-email-modal.php'; |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | // Add 'upgrade' modal view for non-elite users. |
@@ -340,12 +340,12 @@ discard block |
||
| 340 | 340 | |
| 341 | 341 | // Perform add or remove operation. |
| 342 | 342 | if ( 'add' === $operation ) { |
| 343 | - self::$favorite_templates[ $key ][] = $template_id; |
|
| 343 | + self::$favorite_templates[$key][] = $template_id; |
|
| 344 | 344 | } elseif ( 'remove' === $operation ) { |
| 345 | - $position = array_search( $template_id, self::$favorite_templates[ $key ], true ); |
|
| 345 | + $position = array_search( $template_id, self::$favorite_templates[$key], true ); |
|
| 346 | 346 | |
| 347 | 347 | if ( $position !== false ) { |
| 348 | - unset( self::$favorite_templates[ $key ][ $position ] ); |
|
| 348 | + unset( self::$favorite_templates[$key][$position] ); |
|
| 349 | 349 | } |
| 350 | 350 | } |
| 351 | 351 | |
@@ -503,7 +503,7 @@ discard block |
||
| 503 | 503 | foreach ( self::$templates as $key => &$template ) { |
| 504 | 504 | // Skip the template if the categories are not set. |
| 505 | 505 | if ( ! isset( $template['categories'] ) || ! isset( $template['id'] ) ) { |
| 506 | - unset( self::$templates[ $key ] ); |
|
| 506 | + unset( self::$templates[$key] ); |
|
| 507 | 507 | continue; |
| 508 | 508 | } |
| 509 | 509 | |
@@ -517,14 +517,12 @@ discard block |
||
| 517 | 517 | // Add the slug to the new array. |
| 518 | 518 | $template['category_slugs'][] = $category_slug; |
| 519 | 519 | |
| 520 | - if ( ! isset( self::$categories[ $category_slug ] ) ) { |
|
| 521 | - self::$categories[ $category_slug ] = array( |
|
| 520 | + if ( ! isset( self::$categories[$category_slug] ) ) { |
|
| 521 | + self::$categories[$category_slug] = array( |
|
| 522 | 522 | 'name' => $category, |
| 523 | 523 | 'count' => 0, |
| 524 | 524 | ); |
| 525 | - } |
|
| 526 | - |
|
| 527 | - ++self::$categories[ $category_slug ]['count']; |
|
| 525 | + } ++self::$categories[$category_slug]['count']; |
|
| 528 | 526 | } |
| 529 | 527 | |
| 530 | 528 | // Mark the template as favorite if it's in the favorite templates list. |
@@ -540,7 +538,7 @@ discard block |
||
| 540 | 538 | |
| 541 | 539 | foreach ( $redundant_cats as $redundant_cat ) { |
| 542 | 540 | $category_slug = sanitize_title( $redundant_cat ); |
| 543 | - unset( self::$categories[ $category_slug ] ); |
|
| 541 | + unset( self::$categories[$category_slug] ); |
|
| 544 | 542 | } |
| 545 | 543 | |
| 546 | 544 | // Sort the categories by keys alphabetically. |
@@ -566,7 +564,7 @@ discard block |
||
| 566 | 564 | 'count' => 0, |
| 567 | 565 | ); |
| 568 | 566 | } |
| 569 | - $special_categories['all-items'] = array( |
|
| 567 | + $special_categories['all-items'] = array( |
|
| 570 | 568 | 'name' => __( 'All Templates', 'formidable' ), |
| 571 | 569 | 'count' => self::get_template_count(), |
| 572 | 570 | ); |
@@ -589,9 +587,9 @@ discard block |
||
| 589 | 587 | */ |
| 590 | 588 | private static function assign_featured_templates() { |
| 591 | 589 | foreach ( self::FEATURED_TEMPLATES_IDS as $key ) { |
| 592 | - if ( isset( self::$templates[ $key ] ) ) { |
|
| 593 | - self::$templates[ $key ]['is_featured'] = true; |
|
| 594 | - self::$featured_templates[] = self::$templates[ $key ]; |
|
| 590 | + if ( isset( self::$templates[$key] ) ) { |
|
| 591 | + self::$templates[$key]['is_featured'] = true; |
|
| 592 | + self::$featured_templates[] = self::$templates[$key]; |
|
| 595 | 593 | } |
| 596 | 594 | } |
| 597 | 595 | } |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | foreach ( $data as $key => $messages ) { |
| 444 | 444 | if ( in_array( $key, array( 'unread', 'dismissed' ), true ) ) { |
| 445 | 445 | foreach ( $messages as $key_msg => $message ) { |
| 446 | - $data[ $key ][ $key_msg ]['cta'] = self::inbox_clean_messages_cta( $message['cta'] ); |
|
| 446 | + $data[$key][$key_msg]['cta'] = self::inbox_clean_messages_cta( $message['cta'] ); |
|
| 447 | 447 | } |
| 448 | 448 | } |
| 449 | 449 | } |
@@ -536,12 +536,12 @@ discard block |
||
| 536 | 536 | private static function get_dashboard_options( $option_name = null ) { |
| 537 | 537 | $options = get_option( self::OPTION_META_NAME, array() ); |
| 538 | 538 | |
| 539 | - if ( null !== $option_name && ! isset( $options[ $option_name ] ) ) { |
|
| 539 | + if ( null !== $option_name && ! isset( $options[$option_name] ) ) { |
|
| 540 | 540 | return array(); |
| 541 | 541 | } |
| 542 | 542 | |
| 543 | 543 | if ( null !== $option_name ) { |
| 544 | - return $options[ $option_name ]; |
|
| 544 | + return $options[$option_name]; |
|
| 545 | 545 | } |
| 546 | 546 | return $options; |
| 547 | 547 | } |
@@ -556,7 +556,7 @@ discard block |
||
| 556 | 556 | */ |
| 557 | 557 | private static function update_dashboard_options( $data, $option_name ) { |
| 558 | 558 | $options = self::get_dashboard_options(); |
| 559 | - $options[ $option_name ] = $data; |
|
| 559 | + $options[$option_name] = $data; |
|
| 560 | 560 | update_option( self::OPTION_META_NAME, $options, 'no' ); |
| 561 | 561 | } |
| 562 | 562 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | '<span class="frm-upgrade-submenu">' . esc_html( $cta_text ) . '</span>', |
| 120 | 120 | 'frm_view_forms', |
| 121 | 121 | 'formidable-pro-upgrade', |
| 122 | - function () { |
|
| 122 | + function() { |
|
| 123 | 123 | // This function doesn't need to do anything. |
| 124 | 124 | // The redirect is handled earlier to avoid issues with the headers being sent. |
| 125 | 125 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | unset( $addons['error'] ); |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | - $pro = array( |
|
| 153 | + $pro = array( |
|
| 154 | 154 | 'pro' => array( |
| 155 | 155 | 'title' => 'Formidable Forms Pro', |
| 156 | 156 | 'slug' => 'formidable-pro', |
@@ -192,9 +192,9 @@ discard block |
||
| 192 | 192 | |
| 193 | 193 | // Extract the elements to move |
| 194 | 194 | foreach ( $plans as $plan ) { |
| 195 | - if ( isset( self::$categories[ $plan ] ) ) { |
|
| 196 | - $bottom_categories[ $plan ] = self::$categories[ $plan ]; |
|
| 197 | - unset( self::$categories[ $plan ] ); |
|
| 195 | + if ( isset( self::$categories[$plan] ) ) { |
|
| 196 | + $bottom_categories[$plan] = self::$categories[$plan]; |
|
| 197 | + unset( self::$categories[$plan] ); |
|
| 198 | 198 | } |
| 199 | 199 | } |
| 200 | 200 | |
@@ -250,14 +250,12 @@ discard block |
||
| 250 | 250 | // Add the slug to the new array. |
| 251 | 251 | $addon['category-slugs'][] = $category_slug; |
| 252 | 252 | |
| 253 | - if ( ! isset( self::$categories[ $category_slug ] ) ) { |
|
| 254 | - self::$categories[ $category_slug ] = array( |
|
| 253 | + if ( ! isset( self::$categories[$category_slug] ) ) { |
|
| 254 | + self::$categories[$category_slug] = array( |
|
| 255 | 255 | 'name' => $category, |
| 256 | 256 | 'count' => 0, |
| 257 | 257 | ); |
| 258 | - } |
|
| 259 | - |
|
| 260 | - ++self::$categories[ $category_slug ]['count']; |
|
| 258 | + } ++self::$categories[$category_slug]['count']; |
|
| 261 | 259 | } |
| 262 | 260 | } |
| 263 | 261 | |
@@ -290,7 +288,7 @@ discard block |
||
| 290 | 288 | } else { |
| 291 | 289 | foreach ( $addons as $k => $addon ) { |
| 292 | 290 | if ( empty( $addon['excerpt'] ) && $k !== 'error' ) { |
| 293 | - unset( $addons[ $k ] ); |
|
| 291 | + unset( $addons[$k] ); |
|
| 294 | 292 | } |
| 295 | 293 | } |
| 296 | 294 | } |
@@ -405,7 +403,7 @@ discard block |
||
| 405 | 403 | |
| 406 | 404 | foreach ( $list as $k => $info ) { |
| 407 | 405 | $info['slug'] = $k; |
| 408 | - $list[ $k ] = array_merge( $defaults, $info ); |
|
| 406 | + $list[$k] = array_merge( $defaults, $info ); |
|
| 409 | 407 | } |
| 410 | 408 | return $list; |
| 411 | 409 | } |
@@ -575,17 +573,17 @@ discard block |
||
| 575 | 573 | continue; |
| 576 | 574 | } |
| 577 | 575 | |
| 578 | - $wp_plugin = $wp_plugins[ $folder ] ?? array(); |
|
| 576 | + $wp_plugin = $wp_plugins[$folder] ?? array(); |
|
| 579 | 577 | $wp_version = $wp_plugin['Version'] ?? '1.0'; |
| 580 | 578 | $plugin->slug = explode( '/', $folder )[0]; |
| 581 | 579 | |
| 582 | 580 | if ( version_compare( $wp_version, $plugin->new_version, '<' ) ) { |
| 583 | - $transient->response[ $folder ] = $plugin; |
|
| 581 | + $transient->response[$folder] = $plugin; |
|
| 584 | 582 | } else { |
| 585 | - $transient->no_update[ $folder ] = $plugin; |
|
| 583 | + $transient->no_update[$folder] = $plugin; |
|
| 586 | 584 | } |
| 587 | 585 | |
| 588 | - $transient->checked[ $folder ] = $wp_version; |
|
| 586 | + $transient->checked[$folder] = $wp_version; |
|
| 589 | 587 | |
| 590 | 588 | }//end foreach |
| 591 | 589 | |
@@ -619,7 +617,7 @@ discard block |
||
| 619 | 617 | */ |
| 620 | 618 | protected static function is_installed( $plugin ) { |
| 621 | 619 | $all_plugins = self::get_plugins(); |
| 622 | - return isset( $all_plugins[ $plugin ] ); |
|
| 620 | + return isset( $all_plugins[$plugin] ); |
|
| 623 | 621 | } |
| 624 | 622 | |
| 625 | 623 | /** |
@@ -662,14 +660,14 @@ discard block |
||
| 662 | 660 | |
| 663 | 661 | $download_id = $plugin['id'] ?? 0; |
| 664 | 662 | |
| 665 | - if ( ! empty( $download_id ) && ! isset( $version_info[ $download_id ]['package'] ) ) { |
|
| 663 | + if ( ! empty( $download_id ) && ! isset( $version_info[$download_id]['package'] ) ) { |
|
| 666 | 664 | // if this addon is using its own license, get the update url |
| 667 | 665 | $addon_info = $api->get_api_info(); |
| 668 | 666 | |
| 669 | - $version_info[ $download_id ] = $addon_info[ $download_id ]; |
|
| 667 | + $version_info[$download_id] = $addon_info[$download_id]; |
|
| 670 | 668 | |
| 671 | 669 | if ( isset( $addon_info['error'] ) ) { |
| 672 | - $version_info[ $download_id ]['error'] = array( |
|
| 670 | + $version_info[$download_id]['error'] = array( |
|
| 673 | 671 | 'message' => $addon_info['error']['message'], |
| 674 | 672 | 'code' => $addon_info['error']['code'], |
| 675 | 673 | ); |
@@ -777,8 +775,8 @@ discard block |
||
| 777 | 775 | return $addon; |
| 778 | 776 | } |
| 779 | 777 | } |
| 780 | - } elseif ( isset( $addons[ $download_id ] ) ) { |
|
| 781 | - $plugin = $addons[ $download_id ]; |
|
| 778 | + } elseif ( isset( $addons[$download_id] ) ) { |
|
| 779 | + $plugin = $addons[$download_id]; |
|
| 782 | 780 | } |
| 783 | 781 | |
| 784 | 782 | return $plugin; |
@@ -853,7 +851,7 @@ discard block |
||
| 853 | 851 | self::set_addon_status( $addon ); |
| 854 | 852 | self::set_categories( $addon ); |
| 855 | 853 | |
| 856 | - $addons[ $id ] = $addon; |
|
| 854 | + $addons[$id] = $addon; |
|
| 857 | 855 | }//end foreach |
| 858 | 856 | } |
| 859 | 857 | |
@@ -896,7 +894,7 @@ discard block |
||
| 896 | 894 | $link = $site_url . $link; |
| 897 | 895 | } |
| 898 | 896 | |
| 899 | - $link = FrmAppHelper::make_affiliate_url( $link ); |
|
| 897 | + $link = FrmAppHelper::make_affiliate_url( $link ); |
|
| 900 | 898 | |
| 901 | 899 | $utm = array( |
| 902 | 900 | 'campaign' => 'addons', |
@@ -1128,7 +1126,7 @@ discard block |
||
| 1128 | 1126 | */ |
| 1129 | 1127 | public static function ajax_activate_addon() { |
| 1130 | 1128 | self::process_addon_action( |
| 1131 | - function ( $plugin ) { |
|
| 1129 | + function( $plugin ) { |
|
| 1132 | 1130 | return self::handle_addon_action( $plugin, 'activate' ); |
| 1133 | 1131 | }, |
| 1134 | 1132 | array( 'FrmAddonsController', 'get_addon_activation_response' ) |
@@ -1153,7 +1151,7 @@ discard block |
||
| 1153 | 1151 | */ |
| 1154 | 1152 | public static function ajax_deactivate_addon() { |
| 1155 | 1153 | self::process_addon_action( |
| 1156 | - function ( $plugin ) { |
|
| 1154 | + function( $plugin ) { |
|
| 1157 | 1155 | return self::handle_addon_action( $plugin, 'deactivate' ); |
| 1158 | 1156 | } |
| 1159 | 1157 | ); |
@@ -1168,7 +1166,7 @@ discard block |
||
| 1168 | 1166 | */ |
| 1169 | 1167 | public static function ajax_uninstall_addon() { |
| 1170 | 1168 | self::process_addon_action( |
| 1171 | - function ( $plugin ) { |
|
| 1169 | + function( $plugin ) { |
|
| 1172 | 1170 | return self::handle_addon_action( $plugin, 'uninstall' ); |
| 1173 | 1171 | } |
| 1174 | 1172 | ); |
@@ -1582,7 +1580,7 @@ discard block |
||
| 1582 | 1580 | $addons = $api->get_api_info(); |
| 1583 | 1581 | |
| 1584 | 1582 | if ( is_array( $addons ) && array_key_exists( $addon_id, $addons ) ) { |
| 1585 | - $dates = $addons[ $addon_id ]; |
|
| 1583 | + $dates = $addons[$addon_id]; |
|
| 1586 | 1584 | $requires = FrmFormsHelper::get_plan_required( $dates ); |
| 1587 | 1585 | } |
| 1588 | 1586 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $styles = self::get_email_styles(); |
| 97 | 97 | $style = $frm_settings->email_style; |
| 98 | 98 | |
| 99 | - if ( isset( $styles[ $style ] ) && ! empty( $styles[ $style ]['selectable'] ) ) { |
|
| 99 | + if ( isset( $styles[$style] ) && ! empty( $styles[$style]['selectable'] ) ) { |
|
| 100 | 100 | return $style; |
| 101 | 101 | } |
| 102 | 102 | |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | |
| 279 | 279 | $styles = self::get_email_styles(); |
| 280 | 280 | |
| 281 | - if ( ! isset( $styles[ $style_key ] ) ) { |
|
| 281 | + if ( ! isset( $styles[$style_key] ) ) { |
|
| 282 | 282 | die( esc_html( $not_exist_msg ) ); |
| 283 | 283 | } |
| 284 | 284 | |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | |
| 22 | 22 | if ( is_array( $show_messages ) && count( $show_messages ) > 0 ) { |
| 23 | 23 | // Define a callback function to add 'data-action' attribute to allowed HTML tags |
| 24 | - $add_data_action_callback = function ( $allowed_html ) { |
|
| 24 | + $add_data_action_callback = function( $allowed_html ) { |
|
| 25 | 25 | $allowed_html['span']['data-action'] = true; |
| 26 | 26 | return $allowed_html; |
| 27 | 27 | }; |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | |
| 54 | 54 | foreach ( $action_control->action_options['event'] as $event ) { |
| 55 | 55 | ?> |
| 56 | - <option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( $event_labels[ $event ] ?? $event ); ?></option> |
|
| 56 | + <option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( $event_labels[$event] ?? $event ); ?></option> |
|
| 57 | 57 | <?php } ?> |
| 58 | 58 | </select> |
| 59 | 59 | </p> |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | $values['count'] = 0; |
| 54 | 54 | |
| 55 | 55 | foreach ( $values['fields'] as $field ) { |
| 56 | - ++$values['count']; |
|
| 56 | + ++ $values['count']; |
|
| 57 | 57 | $grid_helper->set_field( $field ); |
| 58 | 58 | $grid_helper->maybe_begin_field_wrapper(); |
| 59 | 59 | FrmFieldsController::load_single_field( $field, $values ); |