@@ -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 ); |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | $params = array(); |
| 9 | 9 | |
| 10 | 10 | foreach ( $data_keys as $key ) { |
| 11 | - $params[ 'data-' . $key ] = $data[ $key ]; |
|
| 11 | + $params['data-' . $key] = $data[$key]; |
|
| 12 | 12 | } |
| 13 | 13 | $params['class'] = 'frm_show_upgrade frm_noallow'; |
| 14 | 14 | $params['href'] = '#'; |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | * |
| 55 | 55 | * @return void |
| 56 | 56 | */ |
| 57 | - function ( $form ) use ( $styles, $default_style, $row_view_file_path ) { |
|
| 57 | + function( $form ) use ( $styles, $default_style, $row_view_file_path ) { |
|
| 58 | 58 | $active_style_id = isset( $form->options['custom_style'] ) ? (int) $form->options['custom_style'] : 1; |
| 59 | 59 | |
| 60 | 60 | if ( 1 === $active_style_id ) { |