@@ -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', |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | ); |
| 127 | 127 | |
| 128 | 128 | foreach ( $skipped_keys as $skipped_key ) { |
| 129 | - unset( $data[ $skipped_key ] ); |
|
| 129 | + unset( $data[$skipped_key] ); |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | return $data; |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | |
| 223 | 223 | foreach ( $pass_settings as $setting ) { |
| 224 | 224 | if ( isset( $settings_list->$setting ) ) { |
| 225 | - $settings[ $setting ] = $this->maybe_json( $settings_list->$setting ); |
|
| 225 | + $settings[$setting] = $this->maybe_json( $settings_list->$setting ); |
|
| 226 | 226 | } |
| 227 | 227 | } |
| 228 | 228 | |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | |
| 259 | 259 | $message_settings = array(); |
| 260 | 260 | foreach ( $messages as $message ) { |
| 261 | - $message_settings[ 'changed-' . $message ] = $settings_list->$message === $default[ $message ] ? 0 : 1; |
|
| 261 | + $message_settings['changed-' . $message] = $settings_list->$message === $default[$message] ? 0 : 1; |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | return $message_settings; |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | |
| 279 | 279 | foreach ( $frm_roles as $frm_role => $frm_role_description ) { |
| 280 | 280 | if ( isset( $settings_list->$frm_role ) ) { |
| 281 | - $permissions[ $frm_role ] = $settings_list->$frm_role; |
|
| 281 | + $permissions[$frm_role] = $settings_list->$frm_role; |
|
| 282 | 282 | } |
| 283 | 283 | } |
| 284 | 284 | |
@@ -349,9 +349,9 @@ discard block |
||
| 349 | 349 | ); |
| 350 | 350 | |
| 351 | 351 | foreach ( $settings as $setting ) { |
| 352 | - if ( isset( $form->options[ $setting ] ) ) { |
|
| 352 | + if ( isset( $form->options[$setting] ) ) { |
|
| 353 | 353 | if ( 'custom_style' === $setting ) { |
| 354 | - $style->id = $form->options[ $setting ]; |
|
| 354 | + $style->id = $form->options[$setting]; |
|
| 355 | 355 | |
| 356 | 356 | if ( ! $style->id ) { |
| 357 | 357 | $style_name = 0; |
@@ -362,9 +362,9 @@ discard block |
||
| 362 | 362 | $style_name = $style_post ? $style_post->post_name : 'formidable-style'; |
| 363 | 363 | } |
| 364 | 364 | |
| 365 | - $new_form[ $setting ] = $style_name; |
|
| 365 | + $new_form[$setting] = $style_name; |
|
| 366 | 366 | } else { |
| 367 | - $new_form[ $setting ] = $this->maybe_json( $form->options[ $setting ] ); |
|
| 367 | + $new_form[$setting] = $this->maybe_json( $form->options[$setting] ); |
|
| 368 | 368 | } |
| 369 | 369 | } |
| 370 | 370 | } |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | $fields = FrmDb::get_results( 'frm_fields', array(), 'form_id, name, type, field_options', $args ); |
| 425 | 425 | foreach ( $fields as $k => $field ) { |
| 426 | 426 | FrmAppHelper::unserialize_or_decode( $field->field_options ); |
| 427 | - $fields[ $k ]->field_options = json_encode( $field->field_options ); |
|
| 427 | + $fields[$k]->field_options = json_encode( $field->field_options ); |
|
| 428 | 428 | } |
| 429 | 429 | return $fields; |
| 430 | 430 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | // Validate the number format. |
| 64 | 64 | if ( ! is_numeric( $args['value'] ) && '' !== $args['value'] ) { |
| 65 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
| 65 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | if ( $args['value'] === '' ) { |
@@ -74,9 +74,9 @@ discard block |
||
| 74 | 74 | $maxnum = FrmField::get_option( $this->field, 'maxnum' ); |
| 75 | 75 | |
| 76 | 76 | if ( $minnum !== '' && $value < $minnum ) { |
| 77 | - $errors[ 'field' . $args['id'] ] = __( 'Please select a higher number', 'formidable' ); |
|
| 77 | + $errors['field' . $args['id']] = __( 'Please select a higher number', 'formidable' ); |
|
| 78 | 78 | } elseif ( $maxnum !== '' && $value > $maxnum ) { |
| 79 | - $errors[ 'field' . $args['id'] ] = __( 'Please select a lower number', 'formidable' ); |
|
| 79 | + $errors['field' . $args['id']] = __( 'Please select a lower number', 'formidable' ); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | $this->validate_step( $errors, $args ); |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | * @return void |
| 96 | 96 | */ |
| 97 | 97 | protected function validate_step( &$errors, $args ) { |
| 98 | - if ( isset( $errors[ 'field' . $args['id'] ] ) ) { |
|
| 98 | + if ( isset( $errors['field' . $args['id']] ) ) { |
|
| 99 | 99 | // Don't need to check if value is invalid before. |
| 100 | 100 | return; |
| 101 | 101 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | return; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - $errors[ 'field' . $args['id'] ] = sprintf( |
|
| 113 | + $errors['field' . $args['id']] = sprintf( |
|
| 114 | 114 | // Translators: %1$s: the first nearest value; %2$s: the second nearest value. |
| 115 | 115 | __( 'Please enter a valid value. Two nearest valid values are %1$s and %2$s', 'formidable' ), |
| 116 | 116 | is_numeric( $result[0] ) ? floatval( $result[0] ) : $result[0], |