@@ -49,7 +49,7 @@ |
||
| 49 | 49 | } |
| 50 | 50 | $errors = array(); |
| 51 | 51 | if ( false !== strpos( $args['value'], '.@' ) || ! is_email( $args['value'] ) ) { |
| 52 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
| 52 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
| 53 | 53 | } |
| 54 | 54 | return $errors; |
| 55 | 55 | } |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | |
| 11 | 11 | $button_upgrade_link = FrmSalesApi::get_best_sale_value( 'global_settings_license_cta_link' ); |
| 12 | 12 | if ( ! $button_upgrade_link ) { |
| 13 | - $button_upgrade_link = FrmAppHelper::admin_upgrade_link( |
|
| 13 | + $button_upgrade_link = FrmAppHelper::admin_upgrade_link( |
|
| 14 | 14 | array( |
| 15 | 15 | 'medium' => 'settings-license', |
| 16 | 16 | 'content' => 'global-settings-license-box-get-formidable-button', |
@@ -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 = isset( $wp_plugins[ $folder ] ) ? $wp_plugins[ $folder ] : array(); |
|
| 550 | + $wp_plugin = isset( $wp_plugins[$folder] ) ? $wp_plugins[$folder] : array(); |
|
| 553 | 551 | $wp_version = isset( $wp_plugin['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 = isset( $plugin['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 | |
@@ -844,7 +842,7 @@ discard block |
||
| 844 | 842 | 'utm_medium' => 'addons', |
| 845 | 843 | 'utm_campaign' => 'liteplugin', |
| 846 | 844 | ); |
| 847 | - $link = add_query_arg( $query_args, $link ); |
|
| 845 | + $link = add_query_arg( $query_args, $link ); |
|
| 848 | 846 | } |
| 849 | 847 | |
| 850 | 848 | /** |
@@ -1062,7 +1060,7 @@ discard block |
||
| 1062 | 1060 | */ |
| 1063 | 1061 | public static function ajax_activate_addon() { |
| 1064 | 1062 | self::process_addon_action( |
| 1065 | - function ( $plugin ) { |
|
| 1063 | + function( $plugin ) { |
|
| 1066 | 1064 | return self::handle_addon_action( $plugin, 'activate' ); |
| 1067 | 1065 | }, |
| 1068 | 1066 | array( 'FrmAddonsController', 'get_addon_activation_response' ) |
@@ -1087,7 +1085,7 @@ discard block |
||
| 1087 | 1085 | */ |
| 1088 | 1086 | public static function ajax_deactivate_addon() { |
| 1089 | 1087 | self::process_addon_action( |
| 1090 | - function ( $plugin ) { |
|
| 1088 | + function( $plugin ) { |
|
| 1091 | 1089 | return self::handle_addon_action( $plugin, 'deactivate' ); |
| 1092 | 1090 | } |
| 1093 | 1091 | ); |
@@ -1102,7 +1100,7 @@ discard block |
||
| 1102 | 1100 | */ |
| 1103 | 1101 | public static function ajax_uninstall_addon() { |
| 1104 | 1102 | self::process_addon_action( |
| 1105 | - function ( $plugin ) { |
|
| 1103 | + function( $plugin ) { |
|
| 1106 | 1104 | return self::handle_addon_action( $plugin, 'uninstall' ); |
| 1107 | 1105 | } |
| 1108 | 1106 | ); |
@@ -1500,7 +1498,7 @@ discard block |
||
| 1500 | 1498 | $addons = $api->get_api_info(); |
| 1501 | 1499 | |
| 1502 | 1500 | if ( is_array( $addons ) && array_key_exists( $addon_id, $addons ) ) { |
| 1503 | - $dates = $addons[ $addon_id ]; |
|
| 1501 | + $dates = $addons[$addon_id]; |
|
| 1504 | 1502 | $requires = FrmFormsHelper::get_plan_required( $dates ); |
| 1505 | 1503 | } |
| 1506 | 1504 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | return; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - self::$sales[ $sale['key'] ] = $this->fill_sale( $sale ); |
|
| 92 | + self::$sales[$sale['key']] = $this->fill_sale( $sale ); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | |
| 188 | 188 | $sale = self::$instance->get_best_sale(); |
| 189 | 189 | |
| 190 | - return is_array( $sale ) && ! empty( $sale[ $key ] ) ? $sale[ $key ] : false; |
|
| 190 | + return is_array( $sale ) && ! empty( $sale[$key] ) ? $sale[$key] : false; |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | /** |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | public static function load_admin_hooks() { |
| 37 | 37 | add_action( |
| 38 | 38 | 'admin_init', |
| 39 | - function () { |
|
| 39 | + function() { |
|
| 40 | 40 | self::fix_addon_hooks(); |
| 41 | 41 | } |
| 42 | 42 | ); |
@@ -223,8 +223,8 @@ discard block |
||
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | foreach ( $settings as $setting => $default ) { |
| 226 | - if ( isset( $params[ 'frm_' . $setting ] ) ) { |
|
| 227 | - $this->{$setting} = $params[ 'frm_' . $setting ]; |
|
| 226 | + if ( isset( $params['frm_' . $setting] ) ) { |
|
| 227 | + $this->{$setting} = $params['frm_' . $setting]; |
|
| 228 | 228 | } elseif ( ! isset( $this->{$setting} ) ) { |
| 229 | 229 | $this->{$setting} = $default; |
| 230 | 230 | } |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | |
| 403 | 403 | $checkboxes = array( 'mu_menu', 're_multi', 'fade_form', 'no_ips', 'no_gdpr_cookies', 'enable_gdpr', 'custom_header_ip', 'tracking', 'admin_bar', 'summary_emails' ); |
| 404 | 404 | foreach ( $checkboxes as $set ) { |
| 405 | - $this->$set = isset( $params[ 'frm_' . $set ] ) ? absint( $params[ 'frm_' . $set ] ) : 0; |
|
| 405 | + $this->$set = isset( $params['frm_' . $set] ) ? absint( $params['frm_' . $set] ) : 0; |
|
| 406 | 406 | } |
| 407 | 407 | } |
| 408 | 408 | |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | $frm_roles = FrmAppHelper::frm_capabilities(); |
| 416 | 416 | $roles = get_editable_roles(); |
| 417 | 417 | foreach ( $frm_roles as $frm_role => $frm_role_description ) { |
| 418 | - $this->$frm_role = (array) ( isset( $params[ $frm_role ] ) ? $params[ $frm_role ] : 'administrator' ); |
|
| 418 | + $this->$frm_role = (array) ( isset( $params[$frm_role] ) ? $params[$frm_role] : 'administrator' ); |
|
| 419 | 419 | |
| 420 | 420 | // Make sure administrators always have permissions |
| 421 | 421 | if ( ! in_array( 'administrator', $this->$frm_role, true ) ) { |
@@ -127,7 +127,7 @@ |
||
| 127 | 127 | * @return bool |
| 128 | 128 | */ |
| 129 | 129 | private static function check_free_segments( $who ) { |
| 130 | - $segments = array( |
|
| 130 | + $segments = array( |
|
| 131 | 131 | 'free_first_1', |
| 132 | 132 | 'free_first_2_3', |
| 133 | 133 | 'free_first_4_7', |
@@ -84,8 +84,8 @@ |
||
| 84 | 84 | $settings = $this->default_options(); |
| 85 | 85 | |
| 86 | 86 | foreach ( $settings as $setting => $default ) { |
| 87 | - if ( isset( $params[ 'frm_' . $this->param() . '_' . $setting ] ) ) { |
|
| 88 | - $this->settings->{$setting} = trim( sanitize_text_field( $params[ 'frm_' . $this->param() . '_' . $setting ] ) ); |
|
| 87 | + if ( isset( $params['frm_' . $this->param() . '_' . $setting] ) ) { |
|
| 88 | + $this->settings->{$setting} = trim( sanitize_text_field( $params['frm_' . $this->param() . '_' . $setting] ) ); |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | // This filter flags the Pro credit card field that Stripe is enabled. |
| 18 | 18 | add_filter( |
| 19 | 19 | 'frm_pro_show_card_callback', |
| 20 | - function () { |
|
| 20 | + function() { |
|
| 21 | 21 | return 'FrmSquareLiteActionsController::show_card'; |
| 22 | 22 | } |
| 23 | 23 | ); |