@@ -285,7 +285,7 @@ |
||
| 285 | 285 | 'type' => $field->type, |
| 286 | 286 | ); |
| 287 | 287 | |
| 288 | - $this->array_content[ $field->id ] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $array, $field ); |
|
| 288 | + $this->array_content[$field->id] = apply_filters( 'frm_field_shortcodes_for_default_html_email', $array, $field ); |
|
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | /** |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | continue; |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | - $this->maybe_convert_migrated_size( $widgets[ $k ]['size'] ); |
|
| 329 | + $this->maybe_convert_migrated_size( $widgets[$k]['size'] ); |
|
| 330 | 330 | } |
| 331 | 331 | update_option( 'widget_frm_show_form', $widgets ); |
| 332 | 332 | } |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | if ( ! is_array( $widget ) || ! isset( $widget['size'] ) ) { |
| 423 | 423 | continue; |
| 424 | 424 | } |
| 425 | - $this->convert_character_to_px( $widgets[ $k ]['size'] ); |
|
| 425 | + $this->convert_character_to_px( $widgets[$k]['size'] ); |
|
| 426 | 426 | } |
| 427 | 427 | update_option( 'widget_frm_show_form', $widgets ); |
| 428 | 428 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | public function set_upgrader( &$upgrader ) { |
| 23 | 23 | if ( is_object( $upgrader ) ) { |
| 24 | - $this->upgrader =& $upgrader; |
|
| 24 | + $this->upgrader = & $upgrader; |
|
| 25 | 25 | } |
| 26 | 26 | } |
| 27 | 27 | |
@@ -59,8 +59,8 @@ |
||
| 59 | 59 | protected function init_saved_value( $entry ) { |
| 60 | 60 | if ( $this->field->type === 'html' ) { |
| 61 | 61 | $this->saved_value = $this->field->description; |
| 62 | - } elseif ( isset( $entry->metas[ $this->field->id ] ) ) { |
|
| 63 | - $this->saved_value = $entry->metas[ $this->field->id ]; |
|
| 62 | + } elseif ( isset( $entry->metas[$this->field->id] ) ) { |
|
| 63 | + $this->saved_value = $entry->metas[$this->field->id]; |
|
| 64 | 64 | } else { |
| 65 | 65 | $this->saved_value = ''; |
| 66 | 66 | } |
@@ -42,7 +42,8 @@ |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | // Only do this for single site installs. |
| 45 | - if ( isset( $_GET['activate-multi'] ) || is_network_admin() ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 45 | + if ( isset( $_GET['activate-multi'] ) || is_network_admin() ) { |
|
| 46 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 46 | 47 | return; |
| 47 | 48 | } |
| 48 | 49 | |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | */ |
| 206 | 206 | public function add_settings( $sections ) { |
| 207 | 207 | wp_enqueue_style( 'formidable-pro-fields' ); |
| 208 | - $sections[ $this->plugin_slug ] = array( |
|
| 208 | + $sections[$this->plugin_slug] = array( |
|
| 209 | 209 | 'class' => $this, |
| 210 | 210 | 'function' => 'settings_page', |
| 211 | 211 | 'name' => $this->plugin_name(), |
@@ -377,9 +377,9 @@ discard block |
||
| 377 | 377 | // Set the current step. |
| 378 | 378 | if ( ! isset( $step['current'] ) ) { |
| 379 | 379 | if ( $step['complete'] ) { |
| 380 | - $steps[ $k ]['current'] = false; |
|
| 380 | + $steps[$k]['current'] = false; |
|
| 381 | 381 | } else { |
| 382 | - $steps[ $k ]['current'] = ! $has_current; |
|
| 382 | + $steps[$k]['current'] = ! $has_current; |
|
| 383 | 383 | $has_current = true; |
| 384 | 384 | } |
| 385 | 385 | } elseif ( $step['current'] ) { |
@@ -390,10 +390,10 @@ discard block |
||
| 390 | 390 | $class = $step['button_class'] ?? ''; |
| 391 | 391 | $class .= ' button-primary frm-button-primary'; |
| 392 | 392 | |
| 393 | - if ( ! $steps[ $k ]['current'] ) { |
|
| 393 | + if ( ! $steps[$k]['current'] ) { |
|
| 394 | 394 | $class .= ' frm_grey disabled'; |
| 395 | 395 | } |
| 396 | - $steps[ $k ]['button_class'] = $class; |
|
| 396 | + $steps[$k]['button_class'] = $class; |
|
| 397 | 397 | }//end foreach |
| 398 | 398 | |
| 399 | 399 | return $steps; |
@@ -563,7 +563,7 @@ discard block |
||
| 563 | 563 | $api = new FrmFormApi(); |
| 564 | 564 | $addons = $api->get_api_info(); |
| 565 | 565 | $id = $this->download_id(); |
| 566 | - $has_file = isset( $addons[ $id ] ) && isset( $addons[ $id ]['beta'] ); |
|
| 566 | + $has_file = isset( $addons[$id] ) && isset( $addons[$id]['beta'] ); |
|
| 567 | 567 | |
| 568 | 568 | if ( ! $step['current'] ) { |
| 569 | 569 | ?> |
@@ -578,10 +578,10 @@ discard block |
||
| 578 | 578 | |
| 579 | 579 | if ( ! $has_file ) { |
| 580 | 580 | echo '<p class="frm_error_style">' . esc_html__( 'We didn\'t find anything to import. Please contact our team.', 'formidable' ) . '</p>'; |
| 581 | - } elseif ( ! isset( $addons[ $id ]['beta']['package'] ) ) { |
|
| 581 | + } elseif ( ! isset( $addons[$id]['beta']['package'] ) ) { |
|
| 582 | 582 | echo '<p class="frm_error_style">' . esc_html__( 'Looks like you may not have a current subscription for this solution. Please check your account.', 'formidable' ) . '</p>'; |
| 583 | 583 | } else { |
| 584 | - $xml = $addons[ $id ]['beta']['package']; |
|
| 584 | + $xml = $addons[$id]['beta']['package']; |
|
| 585 | 585 | |
| 586 | 586 | if ( is_array( $xml ) ) { |
| 587 | 587 | $xml = reset( $xml ); |
@@ -662,7 +662,7 @@ discard block |
||
| 662 | 662 | foreach ( $options as $info ) { |
| 663 | 663 | // Count the number of options displayed for css. |
| 664 | 664 | if ( $count > 1 && ! isset( $info['img'] ) ) { |
| 665 | - --$count; |
|
| 665 | + -- $count; |
|
| 666 | 666 | } |
| 667 | 667 | } |
| 668 | 668 | |
@@ -761,7 +761,7 @@ discard block |
||
| 761 | 761 | $was_imported = isset( $form['form'] ) ? FrmForm::get_id_by_key( $form['form'] ) : false; |
| 762 | 762 | |
| 763 | 763 | if ( $was_imported ) { |
| 764 | - $imported[ $form['form'] ] = $was_imported; |
|
| 764 | + $imported[$form['form']] = $was_imported; |
|
| 765 | 765 | } |
| 766 | 766 | } |
| 767 | 767 | |
@@ -336,7 +336,8 @@ |
||
| 336 | 336 | if ( self::previewing_style() ) { |
| 337 | 337 | |
| 338 | 338 | $frm_style = new FrmStyle(); |
| 339 | - if ( isset( $_POST['frm_style_setting'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 339 | + if ( isset( $_POST['frm_style_setting'] ) ) { |
|
| 340 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 340 | 341 | |
| 341 | 342 | // Sanitizing is done later. |
| 342 | 343 | $posted = wp_unslash( $_POST['frm_style_setting'] ); //phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | '-' => 'down', |
| 163 | 163 | '+' => 'up', |
| 164 | 164 | ); |
| 165 | - $class = 'frm_arrow' . $arrow[ $icon ]; |
|
| 165 | + $class = 'frm_arrow' . $arrow[$icon]; |
|
| 166 | 166 | } else { |
| 167 | 167 | // frm_minus1_icon. |
| 168 | 168 | $key = str_replace( 'p', '', $key ); |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | '-' => 'minus', |
| 171 | 171 | '+' => 'plus', |
| 172 | 172 | ); |
| 173 | - $class = 'frm_' . $plus[ $icon ]; |
|
| 173 | + $class = 'frm_' . $plus[$icon]; |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | if ( $key ) { |
@@ -196,8 +196,8 @@ discard block |
||
| 196 | 196 | ?> |
| 197 | 197 | <div class="btn-group" id="frm_<?php echo esc_attr( $name ); ?>_select"> |
| 198 | 198 | <button class="multiselect dropdown-toggle btn btn-default" data-toggle="dropdown" type="button"> |
| 199 | - <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '+', $type ) ); ?> |
|
| 200 | - <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '-', $type ) ); ?> |
|
| 199 | + <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '+', $type ) ); ?> |
|
| 200 | + <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '-', $type ) ); ?> |
|
| 201 | 201 | <b class="caret"></b> |
| 202 | 202 | </button> |
| 203 | 203 | <ul class="multiselect-container frm-dropdown-menu"> |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | <li <?php echo $style->post_content['collapse_icon'] == $key ? 'class="active"' : ''; // phpcs:ignore Universal.Operators.StrictComparisons ?>> |
| 206 | 206 | <a href="javascript:void(0);"> |
| 207 | 207 | <label> |
| 208 | - <input type="radio" value="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ); ?>" <?php checked( $style->post_content[ $name ], $key ); ?> /> |
|
| 208 | + <input type="radio" value="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ); ?>" <?php checked( $style->post_content[$name], $key ); ?> /> |
|
| 209 | 209 | <span> |
| 210 | 210 | <?php |
| 211 | 211 | FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $key, '+', $type ) ); |
@@ -478,12 +478,12 @@ discard block |
||
| 478 | 478 | $vars = array_diff( $vars, self::get_style_keys_to_remove_from_output_vars() ); |
| 479 | 479 | |
| 480 | 480 | foreach ( $vars as $var ) { |
| 481 | - if ( ! isset( $settings[ $var ] ) || ! self::css_key_is_valid( $var ) ) { |
|
| 481 | + if ( ! isset( $settings[$var] ) || ! self::css_key_is_valid( $var ) ) { |
|
| 482 | 482 | continue; |
| 483 | 483 | } |
| 484 | 484 | |
| 485 | - if ( ! isset( $defaults[ $var ] ) ) { |
|
| 486 | - $defaults[ $var ] = ''; |
|
| 485 | + if ( ! isset( $defaults[$var] ) ) { |
|
| 486 | + $defaults[$var] = ''; |
|
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | $prepared_value = ''; |
@@ -544,7 +544,7 @@ discard block |
||
| 544 | 544 | return false; |
| 545 | 545 | } |
| 546 | 546 | |
| 547 | - if ( $defaults && $defaults[ $var ] === $prepared_value ) { |
|
| 547 | + if ( $defaults && $defaults[$var] === $prepared_value ) { |
|
| 548 | 548 | return false; |
| 549 | 549 | } |
| 550 | 550 | |
@@ -623,7 +623,7 @@ discard block |
||
| 623 | 623 | * @return string |
| 624 | 624 | */ |
| 625 | 625 | private static function css_var_prepare_value( $settings, $key ) { |
| 626 | - $value = $settings[ $key ]; |
|
| 626 | + $value = $settings[$key]; |
|
| 627 | 627 | |
| 628 | 628 | if ( ! is_string( $value ) && ! is_numeric( $value ) ) { |
| 629 | 629 | return ''; |
@@ -713,8 +713,8 @@ discard block |
||
| 713 | 713 | $checkbox_opts = array( 'important_style', 'auto_width', 'submit_style', 'collapse_icon', 'center_form' ); |
| 714 | 714 | |
| 715 | 715 | foreach ( $checkbox_opts as $opt ) { |
| 716 | - if ( ! isset( $settings[ $opt ] ) ) { |
|
| 717 | - $settings[ $opt ] = 0; |
|
| 716 | + if ( ! isset( $settings[$opt] ) ) { |
|
| 717 | + $settings[$opt] = 0; |
|
| 718 | 718 | } |
| 719 | 719 | } |
| 720 | 720 | |
@@ -764,9 +764,9 @@ discard block |
||
| 764 | 764 | ); |
| 765 | 765 | |
| 766 | 766 | array_map( |
| 767 | - function ( $key ) use ( $defaults, $font_size, $base_font_size, &$settings ) { |
|
| 768 | - if ( isset( $settings[ $key ] ) ) { |
|
| 769 | - $settings[ $key ] = round( self::get_base_font_size_scale( $key, $font_size, $defaults ) * $base_font_size ) . 'px'; |
|
| 767 | + function( $key ) use ( $defaults, $font_size, $base_font_size, &$settings ) { |
|
| 768 | + if ( isset( $settings[$key] ) ) { |
|
| 769 | + $settings[$key] = round( self::get_base_font_size_scale( $key, $font_size, $defaults ) * $base_font_size ) . 'px'; |
|
| 770 | 770 | } |
| 771 | 771 | }, |
| 772 | 772 | $font_sizes_to_update |
@@ -787,11 +787,11 @@ discard block |
||
| 787 | 787 | * @return float |
| 788 | 788 | */ |
| 789 | 789 | private static function get_base_font_size_scale( $key, $value, $defaults ) { |
| 790 | - if ( empty( $defaults[ $key ] ) || ! is_numeric( (int) $defaults[ $key ] ) || ! is_numeric( (int) $value ) || 0 === (int) $value ) { |
|
| 790 | + if ( empty( $defaults[$key] ) || ! is_numeric( (int) $defaults[$key] ) || ! is_numeric( (int) $value ) || 0 === (int) $value ) { |
|
| 791 | 791 | return 1; |
| 792 | 792 | } |
| 793 | 793 | |
| 794 | - return round( (int) $defaults[ $key ] / (int) $value, 2 ); |
|
| 794 | + return round( (int) $defaults[$key] / (int) $value, 2 ); |
|
| 795 | 795 | } |
| 796 | 796 | |
| 797 | 797 | /** |
@@ -811,7 +811,7 @@ discard block |
||
| 811 | 811 | } |
| 812 | 812 | |
| 813 | 813 | foreach ( $opts as $opt ) { |
| 814 | - self::get_color_output( $css, $settings[ $opt ] ); |
|
| 814 | + self::get_color_output( $css, $settings[$opt] ); |
|
| 815 | 815 | } |
| 816 | 816 | } |
| 817 | 817 | } |
@@ -1039,13 +1039,13 @@ discard block |
||
| 1039 | 1039 | */ |
| 1040 | 1040 | private static function get_default_style_count( $style_id, $conversational_style_id ) { |
| 1041 | 1041 | $substrings = array_map( |
| 1042 | - function ( $value ) { |
|
| 1042 | + function( $value ) { |
|
| 1043 | 1043 | $substring = serialize( array( 'custom_style' => $value ) ); |
| 1044 | 1044 | return substr( $substring, 5, -1 ); |
| 1045 | 1045 | }, |
| 1046 | 1046 | array( '1', 1 ) |
| 1047 | 1047 | ); |
| 1048 | - $where = array( |
|
| 1048 | + $where = array( |
|
| 1049 | 1049 | 'status' => 'published', |
| 1050 | 1050 | 0 => array( |
| 1051 | 1051 | 'options NOT LIKE' => 'custom_style', |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | // Remove 'Styling Template' from titles. |
| 51 | 51 | foreach ( $api_info as $id => $template ) { |
| 52 | 52 | if ( isset( $template['name'] ) ) { |
| 53 | - $api_info[ $id ]['name'] = preg_replace( '/(\sStyle|Styling)?(\sTemplate)?$/', '', $template['name'] ); |
|
| 53 | + $api_info[$id]['name'] = preg_replace( '/(\sStyle|Styling)?(\sTemplate)?$/', '', $template['name'] ); |
|
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | |
@@ -80,12 +80,12 @@ discard block |
||
| 80 | 80 | $show_intervals = array( 50, 200, 500 ); |
| 81 | 81 | $asked = $this->review_status['asked']; |
| 82 | 82 | |
| 83 | - if ( ! isset( $show_intervals[ $asked ] ) ) { |
|
| 83 | + if ( ! isset( $show_intervals[$asked] ) ) { |
|
| 84 | 84 | return; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | $entries = FrmEntry::getRecordCount(); |
| 88 | - $count = $show_intervals[ $asked ]; |
|
| 88 | + $count = $show_intervals[$asked]; |
|
| 89 | 89 | $user = wp_get_current_user(); |
| 90 | 90 | |
| 91 | 91 | // Only show review request if the site has collected enough entries |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | $requests = $message->get_messages(); |
| 135 | 135 | $key = $this->inbox_key . ( $asked ? $asked : '' ); |
| 136 | 136 | |
| 137 | - if ( isset( $requests[ $key ] ) ) { |
|
| 137 | + if ( isset( $requests[$key] ) ) { |
|
| 138 | 138 | return; |
| 139 | 139 | } |
| 140 | 140 | |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | * @return bool |
| 174 | 174 | */ |
| 175 | 175 | private function has_later_request( $requests, $asked ) { |
| 176 | - return isset( $requests[ $this->inbox_key . ( $asked + 1 ) ] ) || isset( $requests[ $this->inbox_key . ( $asked + 2 ) ] ); |
|
| 176 | + return isset( $requests[$this->inbox_key . ( $asked + 1 )] ) || isset( $requests[$this->inbox_key . ( $asked + 2 )] ); |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | /** |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | * @return void |
| 87 | 87 | */ |
| 88 | 88 | private function init_style_settings( $atts ) { |
| 89 | - $style_settings = array( |
|
| 89 | + $style_settings = array( |
|
| 90 | 90 | 'border_color' => 'dddddd', |
| 91 | 91 | 'bg_color' => 'f7f7f7', |
| 92 | 92 | 'text_color' => '444444', |
@@ -97,12 +97,12 @@ discard block |
||
| 97 | 97 | $this->style_settings = apply_filters( 'frm_show_entry_styles', $style_settings ); |
| 98 | 98 | |
| 99 | 99 | foreach ( $this->style_settings as $key => $setting ) { |
| 100 | - if ( isset( $atts[ $key ] ) && $atts[ $key ] !== '' ) { |
|
| 101 | - $this->style_settings[ $key ] = $atts[ $key ]; |
|
| 100 | + if ( isset( $atts[$key] ) && $atts[$key] !== '' ) { |
|
| 101 | + $this->style_settings[$key] = $atts[$key]; |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | if ( $this->is_color_setting( $key ) ) { |
| 105 | - $this->style_settings[ $key ] = $this->get_color_markup( $this->style_settings[ $key ] ); |
|
| 105 | + $this->style_settings[$key] = $this->get_color_markup( $this->style_settings[$key] ); |
|
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | |