Visual Form Builder - Version 2.9.4

Version Description

Download this release

Release Info

Developer mmuro
Plugin Icon 128x128 Visual Form Builder
Version 2.9.4
Comparing to
See all releases

Code changes from version 2.9.3 to 2.9.4

Files changed (3) hide show
  1. includes/email.php +7 -4
  2. readme.txt +5 -1
  3. visual-form-builder.php +35 -27
includes/email.php CHANGED
@@ -8,12 +8,15 @@ $referrer = ( isset( $_POST['_wp_http_referer'] ) ) ? esc_html( $_POST['_wp_ht
8
  $wp_get_referer = wp_get_referer();
9
 
10
  // If the verification is set to required, run validation check
11
- if ( true == $required && !empty( $secret_field ) ) :
12
- if ( !empty( $honeypot ) )
13
  wp_die( __( 'Security check: hidden spam field should be blank.' , 'visual-form-builder'), '', array( 'back_link' => true ) );
14
- if ( !is_numeric( $_POST[ $secret_field ] ) || strlen( $_POST[ $secret_field ] ) !== 2 )
 
 
15
  wp_die( __( 'Security check: failed secret question. Please try again!' , 'visual-form-builder'), '', array( 'back_link' => true ) );
16
- endif;
 
17
 
18
  // Basic security check before moving any further
19
  if ( !isset( $_POST['vfb-submit'] ) )
8
  $wp_get_referer = wp_get_referer();
9
 
10
  // If the verification is set to required, run validation check
11
+ if ( true == $required && !empty( $secret_field ) ) {
12
+ if ( !empty( $honeypot ) ) {
13
  wp_die( __( 'Security check: hidden spam field should be blank.' , 'visual-form-builder'), '', array( 'back_link' => true ) );
14
+ }
15
+
16
+ if ( !is_numeric( $_POST[ $secret_field ] ) || strlen( $_POST[ $secret_field ] ) !== 2 ) {
17
  wp_die( __( 'Security check: failed secret question. Please try again!' , 'visual-form-builder'), '', array( 'back_link' => true ) );
18
+ }
19
+ }
20
 
21
  // Basic security check before moving any further
22
  if ( !isset( $_POST['vfb-submit'] ) )
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=G87A9
4
  Tags: form, forms, contact form, contact forms, form, forms, form to email, email form, email, input, validation, jquery, shortcode, form builder, contact form builder, form manager, form creator
5
  Requires at least: 4.3
6
  Tested up to: 4.8.2
7
- Stable tag: 2.9.3
8
  License: GPLv2 or later
9
 
10
  Build beautiful, fully functional contact forms in only a few minutes without writing PHP, CSS, or HTML.
@@ -237,6 +237,10 @@ function my_scripts_method() {
237
 
238
  == Changelog ==
239
 
 
 
 
 
240
  **Version 2.9.3 - Jul 10, 2017**
241
 
242
  * Update list of Countries to add a few new ones
4
  Tags: form, forms, contact form, contact forms, form, forms, form to email, email form, email, input, validation, jquery, shortcode, form builder, contact form builder, form manager, form creator
5
  Requires at least: 4.3
6
  Tested up to: 4.8.2
7
+ Stable tag: 2.9.4
8
  License: GPLv2 or later
9
 
10
  Build beautiful, fully functional contact forms in only a few minutes without writing PHP, CSS, or HTML.
237
 
238
  == Changelog ==
239
 
240
+ **Version 2.9.4 - Oct 01, 2017**
241
+
242
+ * Minor code updates
243
+
244
  **Version 2.9.3 - Jul 10, 2017**
245
 
246
  * Update list of Countries to add a few new ones
visual-form-builder.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Visual Form Builder
4
  Plugin URI: https://wordpress.org/plugins/visual-form-builder/
5
  Description: Dynamically build forms using a simple interface. Forms include jQuery validation, a basic logic-based verification system, and entry tracking.
6
- Version: 2.9.3
7
  Author: Matthew Muro
8
  Author URI: http://matthewmuro.com
9
  Text Domain: visual-form-builder
@@ -11,7 +11,7 @@ Domain Path: /languages/
11
  */
12
 
13
  // Version number to output as meta tag
14
- define( 'VFB_VERSION', '2.9.3' );
15
 
16
  /*
17
  This program is free software; you can redistribute it and/or modify
@@ -203,7 +203,6 @@ class Visual_Form_Builder{
203
  );
204
  update_option( 'vfb_dashboard_widget_options', $widget_options );
205
  }
206
-
207
  }
208
 
209
  /**
@@ -261,6 +260,13 @@ class Visual_Form_Builder{
261
  $entries_detail = new VisualFormBuilder_Entries_Detail();
262
  }
263
 
 
 
 
 
 
 
 
264
  public function include_forms_list() {
265
  global $forms_list;
266
 
@@ -324,7 +330,7 @@ class Visual_Form_Builder{
324
 
325
  $forms = $wpdb->get_var( "SELECT COUNT(*) FROM {$this->form_table_name}" );
326
 
327
- if ( !$forms ) :
328
  echo sprintf(
329
  '<p>%1$s <a href="%2$s">%3$s</a></p>',
330
  __( 'You currently do not have any forms.', 'visual-form-builder' ),
@@ -333,18 +339,18 @@ class Visual_Form_Builder{
333
  );
334
 
335
  return;
336
- endif;
337
 
338
  $entries = $wpdb->get_results( $wpdb->prepare( "SELECT forms.form_title, entries.entries_id, entries.form_id, entries.sender_name, entries.sender_email, entries.date_submitted FROM $this->form_table_name AS forms INNER JOIN $this->entries_table_name AS entries ON entries.form_id = forms.form_id ORDER BY entries.date_submitted DESC LIMIT %d", $total_items ) );
339
 
340
- if ( !$entries ) :
341
  echo sprintf( '<p>%1$s</p>', __( 'You currently do not have any entries.', 'visual-form-builder' ) );
342
- else :
 
343
 
344
  $content = '';
345
 
346
- foreach ( $entries as $entry ) :
347
-
348
  $content .= sprintf(
349
  '<li><a href="%1$s">%4$s</a> via <a href="%2$s">%5$s</a> <span class="rss-date">%6$s</span><cite>%3$s</cite></li>',
350
  esc_url( add_query_arg( array( 'action' => 'view', 'entry' => absint( $entry->entries_id ) ), admin_url( 'admin.php?page=vfb-entries' ) ) ),
@@ -354,12 +360,10 @@ class Visual_Form_Builder{
354
  esc_html( $entry->form_title ),
355
  date( "$date_format $time_format", strtotime( $entry->date_submitted ) )
356
  );
357
-
358
- endforeach;
359
 
360
  echo "<div class='rss-widget'><ul>$content</ul></div>";
361
-
362
- endif;
363
  }
364
 
365
  /**
@@ -397,7 +401,7 @@ class Visual_Form_Builder{
397
  *
398
  * @since 1.0
399
  */
400
- public function help(){
401
  $screen = get_current_screen();
402
 
403
  $screen->add_help_tab( array(
@@ -484,7 +488,7 @@ class Visual_Form_Builder{
484
  *
485
  * @since 1.0
486
  */
487
- public function screen_options(){
488
  $screen = get_current_screen();
489
 
490
  $page_main = $this->_admin_pages[ 'vfb' ];
@@ -525,7 +529,7 @@ class Visual_Form_Builder{
525
  *
526
  * @since 1.0
527
  */
528
- public function save_screen_options( $status, $option, $value ){
529
 
530
  if ( $option == 'vfb_entries_per_page' )
531
  return $value;
@@ -1195,17 +1199,22 @@ class Visual_Form_Builder{
1195
  $wpdb->insert( $this->field_table_name, $data );
1196
 
1197
  // If a parent field, save the old ID and the new ID to update new parent ID
1198
- if ( in_array( $field->field_type, array( 'fieldset', 'section', 'verification' ) ) )
1199
  $parents[ $field->field_id ] = $wpdb->insert_id;
 
1200
 
1201
- if ( $override == $field->field_id )
1202
  $wpdb->update( $this->form_table_name, array( 'form_email_from_override' => $wpdb->insert_id ), array( 'form_id' => $new_form_selected ) );
 
 
1203
 
1204
- if ( $from_name == $field->field_id )
1205
  $wpdb->update( $this->form_table_name, array( 'form_email_from_name_override' => $wpdb->insert_id ), array( 'form_id' => $new_form_selected ) );
 
1206
 
1207
- if ( $notify == $field->field_id )
1208
  $wpdb->update( $this->form_table_name, array( 'form_notification_email' => $wpdb->insert_id ), array( 'form_id' => $new_form_selected ) );
 
1209
  }
1210
 
1211
  // Loop through our parents and update them to their new IDs
@@ -1226,7 +1235,6 @@ class Visual_Form_Builder{
1226
  * @return void
1227
  */
1228
  public function save_settings() {
1229
-
1230
  if ( !isset( $_POST['action'] ) || !isset( $_GET['page'] ) )
1231
  return;
1232
 
@@ -1257,16 +1265,16 @@ class Visual_Form_Builder{
1257
 
1258
  $data = array();
1259
 
1260
- foreach ( $_POST['order'] as $k ) :
1261
- if ( 'root' !== $k['item_id'] && !empty( $k['item_id'] ) ) :
1262
  $data[] = array(
1263
  'field_id' => $k['item_id'],
1264
  'parent' => $k['parent_id']
1265
  );
1266
- endif;
1267
- endforeach;
1268
 
1269
- foreach ( $data as $k => $v ) :
1270
  // Update each field with it's new sequence and parent ID
1271
  $wpdb->update( $this->field_table_name, array(
1272
  'field_sequence' => $k,
@@ -1274,7 +1282,7 @@ class Visual_Form_Builder{
1274
  array( 'field_id' => $v['field_id'] ),
1275
  '%d'
1276
  );
1277
- endforeach;
1278
 
1279
  die(1);
1280
  }
3
  Plugin Name: Visual Form Builder
4
  Plugin URI: https://wordpress.org/plugins/visual-form-builder/
5
  Description: Dynamically build forms using a simple interface. Forms include jQuery validation, a basic logic-based verification system, and entry tracking.
6
+ Version: 2.9.4
7
  Author: Matthew Muro
8
  Author URI: http://matthewmuro.com
9
  Text Domain: visual-form-builder
11
  */
12
 
13
  // Version number to output as meta tag
14
+ define( 'VFB_VERSION', '2.9.4' );
15
 
16
  /*
17
  This program is free software; you can redistribute it and/or modify
203
  );
204
  update_option( 'vfb_dashboard_widget_options', $widget_options );
205
  }
 
206
  }
207
 
208
  /**
260
  $entries_detail = new VisualFormBuilder_Entries_Detail();
261
  }
262
 
263
+
264
+ /**
265
+ * include_forms_list function.
266
+ *
267
+ * @access public
268
+ * @return void
269
+ */
270
  public function include_forms_list() {
271
  global $forms_list;
272
 
330
 
331
  $forms = $wpdb->get_var( "SELECT COUNT(*) FROM {$this->form_table_name}" );
332
 
333
+ if ( !$forms ) {
334
  echo sprintf(
335
  '<p>%1$s <a href="%2$s">%3$s</a></p>',
336
  __( 'You currently do not have any forms.', 'visual-form-builder' ),
339
  );
340
 
341
  return;
342
+ }
343
 
344
  $entries = $wpdb->get_results( $wpdb->prepare( "SELECT forms.form_title, entries.entries_id, entries.form_id, entries.sender_name, entries.sender_email, entries.date_submitted FROM $this->form_table_name AS forms INNER JOIN $this->entries_table_name AS entries ON entries.form_id = forms.form_id ORDER BY entries.date_submitted DESC LIMIT %d", $total_items ) );
345
 
346
+ if ( !$entries ) {
347
  echo sprintf( '<p>%1$s</p>', __( 'You currently do not have any entries.', 'visual-form-builder' ) );
348
+ }
349
+ else {
350
 
351
  $content = '';
352
 
353
+ foreach ( $entries as $entry ) {
 
354
  $content .= sprintf(
355
  '<li><a href="%1$s">%4$s</a> via <a href="%2$s">%5$s</a> <span class="rss-date">%6$s</span><cite>%3$s</cite></li>',
356
  esc_url( add_query_arg( array( 'action' => 'view', 'entry' => absint( $entry->entries_id ) ), admin_url( 'admin.php?page=vfb-entries' ) ) ),
360
  esc_html( $entry->form_title ),
361
  date( "$date_format $time_format", strtotime( $entry->date_submitted ) )
362
  );
363
+ }
 
364
 
365
  echo "<div class='rss-widget'><ul>$content</ul></div>";
366
+ }
 
367
  }
368
 
369
  /**
401
  *
402
  * @since 1.0
403
  */
404
+ public function help() {
405
  $screen = get_current_screen();
406
 
407
  $screen->add_help_tab( array(
488
  *
489
  * @since 1.0
490
  */
491
+ public function screen_options() {
492
  $screen = get_current_screen();
493
 
494
  $page_main = $this->_admin_pages[ 'vfb' ];
529
  *
530
  * @since 1.0
531
  */
532
+ public function save_screen_options( $status, $option, $value ) {
533
 
534
  if ( $option == 'vfb_entries_per_page' )
535
  return $value;
1199
  $wpdb->insert( $this->field_table_name, $data );
1200
 
1201
  // If a parent field, save the old ID and the new ID to update new parent ID
1202
+ if ( in_array( $field->field_type, array( 'fieldset', 'section', 'verification' ) ) ) {
1203
  $parents[ $field->field_id ] = $wpdb->insert_id;
1204
+ }
1205
 
1206
+ if ( $override == $field->field_id ) {
1207
  $wpdb->update( $this->form_table_name, array( 'form_email_from_override' => $wpdb->insert_id ), array( 'form_id' => $new_form_selected ) );
1208
+ }
1209
+
1210
 
1211
+ if ( $from_name == $field->field_id ) {
1212
  $wpdb->update( $this->form_table_name, array( 'form_email_from_name_override' => $wpdb->insert_id ), array( 'form_id' => $new_form_selected ) );
1213
+ }
1214
 
1215
+ if ( $notify == $field->field_id ) {
1216
  $wpdb->update( $this->form_table_name, array( 'form_notification_email' => $wpdb->insert_id ), array( 'form_id' => $new_form_selected ) );
1217
+ }
1218
  }
1219
 
1220
  // Loop through our parents and update them to their new IDs
1235
  * @return void
1236
  */
1237
  public function save_settings() {
 
1238
  if ( !isset( $_POST['action'] ) || !isset( $_GET['page'] ) )
1239
  return;
1240
 
1265
 
1266
  $data = array();
1267
 
1268
+ foreach ( $_POST['order'] as $k ) {
1269
+ if ( 'root' !== $k['item_id'] && !empty( $k['item_id'] ) ) {
1270
  $data[] = array(
1271
  'field_id' => $k['item_id'],
1272
  'parent' => $k['parent_id']
1273
  );
1274
+ }
1275
+ }
1276
 
1277
+ foreach ( $data as $k => $v ) {
1278
  // Update each field with it's new sequence and parent ID
1279
  $wpdb->update( $this->field_table_name, array(
1280
  'field_sequence' => $k,
1282
  array( 'field_id' => $v['field_id'] ),
1283
  '%d'
1284
  );
1285
+ }
1286
 
1287
  die(1);
1288
  }