@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | 'class' => '', |
| 29 | 29 | 'inc_children' => 'exclude', |
| 30 | 30 | ); |
| 31 | - $args = wp_parse_args( $args, $defaults ); |
|
| 31 | + $args = wp_parse_args( $args, $defaults ); |
|
| 32 | 32 | |
| 33 | 33 | if ( ! $args['field_id'] ) { |
| 34 | 34 | $args['field_id'] = $field_name; |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | */ |
| 71 | 71 | public static function add_html_attr( $class, $param, &$add_html ) { |
| 72 | 72 | if ( ! empty( $class ) ) { |
| 73 | - $add_html[ $param ] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"'; |
|
| 73 | + $add_html[$param] = sanitize_title( $param ) . '="' . esc_attr( trim( sanitize_text_field( $class ) ) ) . '"'; |
|
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | |
@@ -293,8 +293,8 @@ discard block |
||
| 293 | 293 | 'description' => '', |
| 294 | 294 | ); |
| 295 | 295 | foreach ( $defaults as $var => $default ) { |
| 296 | - if ( ! isset( $values[ $var ] ) ) { |
|
| 297 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 296 | + if ( ! isset( $values[$var] ) ) { |
|
| 297 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 298 | 298 | } |
| 299 | 299 | } |
| 300 | 300 | |
@@ -309,8 +309,8 @@ discard block |
||
| 309 | 309 | 'parent_form_id' => 0, |
| 310 | 310 | ); |
| 311 | 311 | foreach ( $defaults as $var => $default ) { |
| 312 | - if ( ! isset( $values[ $var ] ) ) { |
|
| 313 | - $values[ $var ] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 312 | + if ( ! isset( $values[$var] ) ) { |
|
| 313 | + $values[$var] = FrmAppHelper::get_param( $var, $default, 'get', 'sanitize_text_field' ); |
|
| 314 | 314 | } |
| 315 | 315 | } |
| 316 | 316 | unset( $defaults ); |
@@ -347,16 +347,16 @@ discard block |
||
| 347 | 347 | $defaults = self::get_default_opts(); |
| 348 | 348 | foreach ( $defaults as $var => $default ) { |
| 349 | 349 | if ( is_array( $default ) ) { |
| 350 | - if ( ! isset( $values[ $var ] ) ) { |
|
| 351 | - $values[ $var ] = ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : array(); |
|
| 350 | + if ( ! isset( $values[$var] ) ) { |
|
| 351 | + $values[$var] = ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : array(); |
|
| 352 | 352 | } |
| 353 | 353 | |
| 354 | 354 | foreach ( $default as $k => $v ) { |
| 355 | - $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 ); |
|
| 355 | + $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 ); |
|
| 356 | 356 | |
| 357 | 357 | if ( is_array( $v ) ) { |
| 358 | 358 | foreach ( $v as $k1 => $v1 ) { |
| 359 | - $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 ); |
|
| 359 | + $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 ); |
|
| 360 | 360 | unset( $k1, $v1 ); |
| 361 | 361 | } |
| 362 | 362 | } |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | unset( $k, $v ); |
| 365 | 365 | } |
| 366 | 366 | } else { |
| 367 | - $values[ $var ] = ( $post_values && isset( $post_values['options'][ $var ] ) ) ? $post_values['options'][ $var ] : ( ( $record && isset( $record->options[ $var ] ) ) ? $record->options[ $var ] : $default ); |
|
| 367 | + $values[$var] = ( $post_values && isset( $post_values['options'][$var] ) ) ? $post_values['options'][$var] : ( ( $record && isset( $record->options[$var] ) ) ? $record->options[$var] : $default ); |
|
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | unset( $var, $default ); |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | public static function fill_form_options( &$options, $values ) { |
| 411 | 411 | $defaults = self::get_default_opts(); |
| 412 | 412 | foreach ( $defaults as $var => $default ) { |
| 413 | - $options[ $var ] = isset( $values['options'][ $var ] ) ? $values['options'][ $var ] : $default; |
|
| 413 | + $options[$var] = isset( $values['options'][$var] ) ? $values['options'][$var] : $default; |
|
| 414 | 414 | unset( $var, $default ); |
| 415 | 415 | } |
| 416 | 416 | } |
@@ -585,7 +585,7 @@ discard block |
||
| 585 | 585 | public static function insert_opt_html( $args ) { |
| 586 | 586 | $class = isset( $args['class'] ) ? $args['class'] : ''; |
| 587 | 587 | $fields = FrmField::all_field_selection(); |
| 588 | - $field = isset( $fields[ $args['type'] ] ) ? $fields[ $args['type'] ] : array(); |
|
| 588 | + $field = isset( $fields[$args['type']] ) ? $fields[$args['type']] : array(); |
|
| 589 | 589 | |
| 590 | 590 | self::prepare_field_type( $field ); |
| 591 | 591 | |
@@ -741,7 +741,7 @@ discard block |
||
| 741 | 741 | FrmField::update( $field->id, array( 'field_order' => $field->field_order + 2 ) ); |
| 742 | 742 | } |
| 743 | 743 | |
| 744 | - $add_order += 2; |
|
| 744 | + $add_order += 2; |
|
| 745 | 745 | $open = false; |
| 746 | 746 | $reset_fields = true; |
| 747 | 747 | } |
@@ -1148,10 +1148,10 @@ discard block |
||
| 1148 | 1148 | $link .= ' onclick="return confirm(\'' . esc_attr( $link_details['confirm'] ) . '\')"'; |
| 1149 | 1149 | } |
| 1150 | 1150 | |
| 1151 | - $label = ( isset( $link_details[ $length ] ) ? $link_details[ $length ] : $link_details['label'] ); |
|
| 1152 | - if ( $length == 'icon' && isset( $link_details[ $length ] ) ) { |
|
| 1151 | + $label = ( isset( $link_details[$length] ) ? $link_details[$length] : $link_details['label'] ); |
|
| 1152 | + if ( $length == 'icon' && isset( $link_details[$length] ) ) { |
|
| 1153 | 1153 | $label = '<span class="' . $label . '" title="' . esc_attr( $link_details['label'] ) . '" aria-hidden="true"></span>'; |
| 1154 | - $link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"'; |
|
| 1154 | + $link .= ' aria-label="' . esc_attr( $link_details['label'] ) . '"'; |
|
| 1155 | 1155 | } |
| 1156 | 1156 | |
| 1157 | 1157 | $link .= '>' . $label . '</a>'; |
@@ -1296,7 +1296,7 @@ discard block |
||
| 1296 | 1296 | $status = 'publish'; |
| 1297 | 1297 | } |
| 1298 | 1298 | |
| 1299 | - $name = $nice_names[ $status ]; |
|
| 1299 | + $name = $nice_names[$status]; |
|
| 1300 | 1300 | |
| 1301 | 1301 | return $name; |
| 1302 | 1302 | } |
@@ -1360,7 +1360,7 @@ discard block |
||
| 1360 | 1360 | $icon = $icons['']; |
| 1361 | 1361 | if ( count( $categories ) === 1 ) { |
| 1362 | 1362 | $category = reset( $categories ); |
| 1363 | - $icon = isset( $icons[ $category ] ) ? $icons[ $category ] : $icon; |
|
| 1363 | + $icon = isset( $icons[$category] ) ? $icons[$category] : $icon; |
|
| 1364 | 1364 | } elseif ( ! empty( $categories ) ) { |
| 1365 | 1365 | $icons = array_intersect_key( $icons, array_flip( $categories ) ); |
| 1366 | 1366 | $icon = reset( $icons ); |
@@ -1498,7 +1498,7 @@ discard block |
||
| 1498 | 1498 | |
| 1499 | 1499 | foreach ( $item['categories'] as $k => $category ) { |
| 1500 | 1500 | if ( in_array( $category, $plans, true ) ) { |
| 1501 | - unset( $item['categories'][ $k ] ); |
|
| 1501 | + unset( $item['categories'][$k] ); |
|
| 1502 | 1502 | |
| 1503 | 1503 | if ( in_array( $category, array( 'Creator', 'Personal' ), true ) ) { |
| 1504 | 1504 | // Show the current package name. |
@@ -1700,9 +1700,9 @@ discard block |
||
| 1700 | 1700 | } |
| 1701 | 1701 | |
| 1702 | 1702 | foreach ( $shortcodes[0] as $key => $shortcode ) { |
| 1703 | - $options = trim( $shortcodes[3][ $key ] ); |
|
| 1703 | + $options = trim( $shortcodes[3][$key] ); |
|
| 1704 | 1704 | |
| 1705 | - if ( in_array( $shortcodes[1][ $key ], array( 'if ' ), true ) ) { |
|
| 1705 | + if ( in_array( $shortcodes[1][$key], array( 'if ' ), true ) ) { |
|
| 1706 | 1706 | // Skip if shortcodes. |
| 1707 | 1707 | continue; |
| 1708 | 1708 | } |
@@ -1712,7 +1712,7 @@ discard block |
||
| 1712 | 1712 | continue; |
| 1713 | 1713 | } |
| 1714 | 1714 | |
| 1715 | - $new_shortcode = '[' . $shortcodes[2][ $key ]; |
|
| 1715 | + $new_shortcode = '[' . $shortcodes[2][$key]; |
|
| 1716 | 1716 | if ( $options ) { |
| 1717 | 1717 | $new_shortcode .= ' ' . $options; |
| 1718 | 1718 | } |
@@ -126,11 +126,11 @@ |
||
| 126 | 126 | foreach ( $payments as $payment ) { |
| 127 | 127 | list( $amount, $currency ) = FrmTransLiteAppHelper::get_amount_and_currency_from_payment( $payment ); |
| 128 | 128 | |
| 129 | - if ( ! isset( $data[ $currency ] ) ) { |
|
| 130 | - $data[ $currency ] = 0; |
|
| 129 | + if ( ! isset( $data[$currency] ) ) { |
|
| 130 | + $data[$currency] = 0; |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - $data[ $currency ] += floatval( $amount ); |
|
| 133 | + $data[$currency] += floatval( $amount ); |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | return $data; |
@@ -236,11 +236,11 @@ discard block |
||
| 236 | 236 | */ |
| 237 | 237 | public static function get_last_sent_date( $type ) { |
| 238 | 238 | $options = self::get_options(); |
| 239 | - if ( empty( $options[ 'last_' . $type ] ) ) { |
|
| 239 | + if ( empty( $options['last_' . $type] ) ) { |
|
| 240 | 240 | return false; |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | - return $options[ 'last_' . $type ]; |
|
| 243 | + return $options['last_' . $type]; |
|
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | /** |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | public static function set_last_sent_date( $type, $value = null ) { |
| 253 | 253 | $options = self::get_options(); |
| 254 | 254 | |
| 255 | - $options[ 'last_' . $type ] = null === $value ? self::get_date_from_today() : ''; |
|
| 255 | + $options['last_' . $type] = null === $value ? self::get_date_from_today() : ''; |
|
| 256 | 256 | self::save_options( $options ); |
| 257 | 257 | } |
| 258 | 258 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | public function insert_installed_addon( $plugins ) { |
| 45 | - $plugins[ $this->plugin_slug ] = $this; |
|
| 45 | + $plugins[$this->plugin_slug] = $this; |
|
| 46 | 46 | |
| 47 | 47 | return $plugins; |
| 48 | 48 | } |
@@ -50,8 +50,8 @@ discard block |
||
| 50 | 50 | public static function get_addon( $plugin_slug ) { |
| 51 | 51 | $plugins = apply_filters( 'frm_installed_addons', array() ); |
| 52 | 52 | $plugin = false; |
| 53 | - if ( isset( $plugins[ $plugin_slug ] ) ) { |
|
| 54 | - $plugin = $plugins[ $plugin_slug ]; |
|
| 53 | + if ( isset( $plugins[$plugin_slug] ) ) { |
|
| 54 | + $plugin = $plugins[$plugin_slug]; |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | return $plugin; |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | } else { |
| 112 | 112 | $api = new FrmFormApi( $this->license ); |
| 113 | 113 | $plugins = $api->get_api_info(); |
| 114 | - $_data = $plugins[ $item_id ]; |
|
| 114 | + $_data = $plugins[$item_id]; |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | $_data['sections'] = array( |
@@ -340,19 +340,19 @@ discard block |
||
| 340 | 340 | |
| 341 | 341 | if ( $this->is_current_version( $transient ) ) { |
| 342 | 342 | // Make sure it doesn't show there is an update if plugin is up-to-date. |
| 343 | - if ( isset( $transient->response[ $this->plugin_folder ] ) ) { |
|
| 344 | - unset( $transient->response[ $this->plugin_folder ] ); |
|
| 343 | + if ( isset( $transient->response[$this->plugin_folder] ) ) { |
|
| 344 | + unset( $transient->response[$this->plugin_folder] ); |
|
| 345 | 345 | } |
| 346 | - } elseif ( isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) ) { |
|
| 347 | - $this->prepare_update_details( $transient->response[ $this->plugin_folder ] ); |
|
| 346 | + } elseif ( isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) ) { |
|
| 347 | + $this->prepare_update_details( $transient->response[$this->plugin_folder] ); |
|
| 348 | 348 | |
| 349 | 349 | // if the transient has expired, clear the update and trigger it again |
| 350 | - if ( $transient->response[ $this->plugin_folder ] === false ) { |
|
| 350 | + if ( $transient->response[$this->plugin_folder] === false ) { |
|
| 351 | 351 | if ( ! $this->has_been_cleared() ) { |
| 352 | 352 | $this->cleared_plugins(); |
| 353 | 353 | $this->manually_queue_update(); |
| 354 | 354 | } |
| 355 | - unset( $transient->response[ $this->plugin_folder ] ); |
|
| 355 | + unset( $transient->response[$this->plugin_folder] ); |
|
| 356 | 356 | } |
| 357 | 357 | } |
| 358 | 358 | |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | private function is_current_version( $transient ) { |
| 443 | - if ( empty( $transient->checked ) || ! isset( $transient->checked[ $this->plugin_folder ] ) ) { |
|
| 443 | + if ( empty( $transient->checked ) || ! isset( $transient->checked[$this->plugin_folder] ) ) { |
|
| 444 | 444 | return false; |
| 445 | 445 | } |
| 446 | 446 | |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | return true; |
| 450 | 450 | } |
| 451 | 451 | |
| 452 | - return isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) && $transient->checked[ $this->plugin_folder ] === $transient->response[ $this->plugin_folder ]->new_version; |
|
| 452 | + return isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) && $transient->checked[$this->plugin_folder] === $transient->response[$this->plugin_folder]->new_version; |
|
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | private function has_been_cleared() { |
@@ -564,8 +564,8 @@ discard block |
||
| 564 | 564 | $response['message'] = $response['status']; |
| 565 | 565 | } else { |
| 566 | 566 | $messages = $this->get_messages(); |
| 567 | - if ( is_string( $response['status'] ) && isset( $messages[ $response['status'] ] ) ) { |
|
| 568 | - $response['message'] = $messages[ $response['status'] ]; |
|
| 567 | + if ( is_string( $response['status'] ) && isset( $messages[$response['status']] ) ) { |
|
| 568 | + $response['message'] = $messages[$response['status']]; |
|
| 569 | 569 | } else { |
| 570 | 570 | $response['message'] = FrmAppHelper::kses( $response['status'], array( 'a' ) ); |
| 571 | 571 | } |
@@ -479,7 +479,8 @@ |
||
| 479 | 479 | return; |
| 480 | 480 | } |
| 481 | 481 | |
| 482 | - if ( empty( $this->license ) || empty( $this->plugin_slug ) || isset( $_POST['license'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 482 | + if ( empty( $this->license ) || empty( $this->plugin_slug ) || isset( $_POST['license'] ) ) { |
|
| 483 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 483 | 484 | return; |
| 484 | 485 | } |
| 485 | 486 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | 'user_id' => get_current_user_id(), |
| 109 | 109 | 'frm_strp_connect_mode' => $mode, |
| 110 | 110 | ); |
| 111 | - $data = self::post_to_connect_server( 'initialize', $additional_body ); |
|
| 111 | + $data = self::post_to_connect_server( 'initialize', $additional_body ); |
|
| 112 | 112 | |
| 113 | 113 | if ( is_string( $data ) ) { |
| 114 | 114 | return $data; |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | * @return object|string |
| 144 | 144 | */ |
| 145 | 145 | private static function post_to_connect_server( $action, $additional_body = array() ) { |
| 146 | - $body = array( |
|
| 146 | + $body = array( |
|
| 147 | 147 | 'frm_strp_connect_action' => $action, |
| 148 | 148 | 'frm_strp_connect_mode' => FrmStrpLiteAppHelper::active_mode(), |
| 149 | 149 | ); |
@@ -18,17 +18,17 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | foreach ( $type as $tb_type ) { |
| 20 | 20 | |
| 21 | - if ( ! isset( $tables[ $tb_type ] ) ) { |
|
| 21 | + if ( ! isset( $tables[$tb_type] ) ) { |
|
| 22 | 22 | do_action( 'frm_xml_import_' . $tb_type, $args ); |
| 23 | 23 | continue; |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - if ( ! isset( $records[ $tb_type ] ) ) { |
|
| 26 | + if ( ! isset( $records[$tb_type] ) ) { |
|
| 27 | 27 | // No records. |
| 28 | 28 | continue; |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - $item_ids = $records[ $tb_type ]; |
|
| 31 | + $item_ids = $records[$tb_type]; |
|
| 32 | 32 | |
| 33 | 33 | if ( in_array( $tb_type, array( 'styles', 'actions' ), true ) ) { |
| 34 | 34 | include dirname( __FILE__ ) . '/posts_xml.php'; |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | include FrmProAppHelper::plugin_path() . '/classes/views/xml/' . $tb_type . '_xml.php'; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - unset( $item_ids, $records[ $tb_type ], $tb_type ); |
|
| 41 | + unset( $item_ids, $records[$tb_type], $tb_type ); |
|
| 42 | 42 | }//end foreach |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -87,6 +87,6 @@ |
||
| 87 | 87 | |
| 88 | 88 | ?></div> |
| 89 | 89 | <?php |
| 90 | - ++$option_index; |
|
| 90 | + ++ $option_index; |
|
| 91 | 91 | }//end foreach |
| 92 | 92 | }//end if |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $sub_field_class = "frm_form_field form-field frm_form_subfield-{$name} {$sub_field['wrapper_classes']}"; |
| 42 | 42 | $sub_field_desc = FrmField::get_option( $field, $name . '_desc' ); |
| 43 | 43 | |
| 44 | - if ( isset( $errors[ 'field' . $field_id . '-' . $name ] ) ) { |
|
| 44 | + if ( isset( $errors['field' . $field_id . '-' . $name] ) ) { |
|
| 45 | 45 | $sub_field_class .= ' frm_blank_field'; |
| 46 | 46 | } |
| 47 | 47 | ?> |
@@ -61,10 +61,10 @@ discard block |
||
| 61 | 61 | <input |
| 62 | 62 | type="<?php echo esc_attr( $sub_field['type'] ); ?>" |
| 63 | 63 | id="<?php echo esc_attr( $html_id . '_' . $name ); ?>" |
| 64 | - value="<?php echo esc_attr( isset( $field_value[ $name ] ) ? $field_value[ $name ] : '' ); ?>" |
|
| 64 | + value="<?php echo esc_attr( isset( $field_value[$name] ) ? $field_value[$name] : '' ); ?>" |
|
| 65 | 65 | <?php |
| 66 | - if ( ! empty( $field_value[ $name ] ) ) { |
|
| 67 | - echo 'data-frmval="' . esc_attr( $field_value[ $name ] ) . '" '; |
|
| 66 | + if ( ! empty( $field_value[$name] ) ) { |
|
| 67 | + echo 'data-frmval="' . esc_attr( $field_value[$name] ) . '" '; |
|
| 68 | 68 | } |
| 69 | 69 | if ( empty( $args['remove_names'] ) ) { |
| 70 | 70 | echo 'name="' . esc_attr( $field_name ) . '[' . esc_attr( $name ) . ']" '; |
@@ -81,9 +81,9 @@ discard block |
||
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | // Don't show individual field errors when there is a combo field error. |
| 84 | - if ( ! empty( $errors ) && isset( $errors[ 'field' . $field_id . '-' . $name ] ) && ! isset( $errors[ 'field' . $field_id ] ) ) { |
|
| 84 | + if ( ! empty( $errors ) && isset( $errors['field' . $field_id . '-' . $name] ) && ! isset( $errors['field' . $field_id] ) ) { |
|
| 85 | 85 | ?> |
| 86 | - <div class="frm_error" role="alert"><?php echo esc_html( $errors[ 'field' . $field_id . '-' . $name ] ); ?></div> |
|
| 86 | + <div class="frm_error" role="alert"><?php echo esc_html( $errors['field' . $field_id . '-' . $name] ); ?></div> |
|
| 87 | 87 | <?php } ?> |
| 88 | 88 | </div> |
| 89 | 89 | <?php |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | } else { |
| 102 | 102 | foreach ( $addons as $k => $addon ) { |
| 103 | 103 | if ( empty( $addon['excerpt'] ) && $k !== 'error' ) { |
| 104 | - unset( $addons[ $k ] ); |
|
| 104 | + unset( $addons[$k] ); |
|
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | 107 | } |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | |
| 203 | 203 | foreach ( $list as $k => $info ) { |
| 204 | 204 | $info['slug'] = $k; |
| 205 | - $list[ $k ] = array_merge( $defaults, $info ); |
|
| 205 | + $list[$k] = array_merge( $defaults, $info ); |
|
| 206 | 206 | } |
| 207 | 207 | return $list; |
| 208 | 208 | } |
@@ -353,17 +353,17 @@ discard block |
||
| 353 | 353 | continue; |
| 354 | 354 | } |
| 355 | 355 | |
| 356 | - $wp_plugin = isset( $wp_plugins[ $folder ] ) ? $wp_plugins[ $folder ] : array(); |
|
| 356 | + $wp_plugin = isset( $wp_plugins[$folder] ) ? $wp_plugins[$folder] : array(); |
|
| 357 | 357 | $wp_version = isset( $wp_plugin['Version'] ) ? $wp_plugin['Version'] : '1.0'; |
| 358 | 358 | $plugin->slug = explode( '/', $folder )[0]; |
| 359 | 359 | |
| 360 | 360 | if ( version_compare( $wp_version, $plugin->new_version, '<' ) ) { |
| 361 | - $transient->response[ $folder ] = $plugin; |
|
| 361 | + $transient->response[$folder] = $plugin; |
|
| 362 | 362 | } else { |
| 363 | - $transient->no_update[ $folder ] = $plugin; |
|
| 363 | + $transient->no_update[$folder] = $plugin; |
|
| 364 | 364 | } |
| 365 | 365 | |
| 366 | - $transient->checked[ $folder ] = $wp_version; |
|
| 366 | + $transient->checked[$folder] = $wp_version; |
|
| 367 | 367 | |
| 368 | 368 | }//end foreach |
| 369 | 369 | |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | */ |
| 397 | 397 | protected static function is_installed( $plugin ) { |
| 398 | 398 | $all_plugins = self::get_plugins(); |
| 399 | - return isset( $all_plugins[ $plugin ] ); |
|
| 399 | + return isset( $all_plugins[$plugin] ); |
|
| 400 | 400 | } |
| 401 | 401 | |
| 402 | 402 | /** |
@@ -435,13 +435,13 @@ discard block |
||
| 435 | 435 | } |
| 436 | 436 | |
| 437 | 437 | $download_id = isset( $plugin['id'] ) ? $plugin['id'] : 0; |
| 438 | - if ( ! empty( $download_id ) && ! isset( $version_info[ $download_id ]['package'] ) ) { |
|
| 438 | + if ( ! empty( $download_id ) && ! isset( $version_info[$download_id]['package'] ) ) { |
|
| 439 | 439 | // if this addon is using its own license, get the update url |
| 440 | 440 | $addon_info = $api->get_api_info(); |
| 441 | 441 | |
| 442 | - $version_info[ $download_id ] = $addon_info[ $download_id ]; |
|
| 442 | + $version_info[$download_id] = $addon_info[$download_id]; |
|
| 443 | 443 | if ( isset( $addon_info['error'] ) ) { |
| 444 | - $version_info[ $download_id ]['error'] = array( |
|
| 444 | + $version_info[$download_id]['error'] = array( |
|
| 445 | 445 | 'message' => $addon_info['error']['message'], |
| 446 | 446 | 'code' => $addon_info['error']['code'], |
| 447 | 447 | ); |
@@ -540,8 +540,8 @@ discard block |
||
| 540 | 540 | return $addon; |
| 541 | 541 | } |
| 542 | 542 | } |
| 543 | - } elseif ( isset( $addons[ $download_id ] ) ) { |
|
| 544 | - $plugin = $addons[ $download_id ]; |
|
| 543 | + } elseif ( isset( $addons[$download_id] ) ) { |
|
| 544 | + $plugin = $addons[$download_id]; |
|
| 545 | 545 | } |
| 546 | 546 | |
| 547 | 547 | return $plugin; |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | self::prepare_addon_link( $addon['link'] ); |
| 606 | 606 | |
| 607 | 607 | self::set_addon_status( $addon ); |
| 608 | - $addons[ $id ] = $addon; |
|
| 608 | + $addons[$id] = $addon; |
|
| 609 | 609 | }//end foreach |
| 610 | 610 | } |
| 611 | 611 | |
@@ -646,7 +646,7 @@ discard block |
||
| 646 | 646 | 'utm_medium' => 'addons', |
| 647 | 647 | 'utm_campaign' => 'liteplugin', |
| 648 | 648 | ); |
| 649 | - $link = add_query_arg( $query_args, $link ); |
|
| 649 | + $link = add_query_arg( $query_args, $link ); |
|
| 650 | 650 | } |
| 651 | 651 | |
| 652 | 652 | /** |
@@ -1389,7 +1389,7 @@ discard block |
||
| 1389 | 1389 | $addons = $api->get_api_info(); |
| 1390 | 1390 | |
| 1391 | 1391 | if ( is_array( $addons ) && array_key_exists( $addon_id, $addons ) ) { |
| 1392 | - $dates = $addons[ $addon_id ]; |
|
| 1392 | + $dates = $addons[$addon_id]; |
|
| 1393 | 1393 | $requires = FrmFormsHelper::get_plan_required( $dates ); |
| 1394 | 1394 | } |
| 1395 | 1395 | |