Formidable Forms – Form Builder for WordPress - Version 1.07.06

Version Description

  • Return graceful error message if no DOMDocument enabled
  • Allow fields to be updated via XML import by field key for non-templates
  • Added minimize=1 option to the [formidable] short code to minimize the form HTML to prevent wpautop interference
  • Correctly return fallbacks on a couple deprecated functions
  • PRO: Allow field keys in the frm-stats shortcode for fieldid=value
  • PRO: Fixed attaching file upload to entries when using single files
Download this release

Release Info

Developer sswells
Plugin Icon 128x128 Formidable Forms – Form Builder for WordPress
Version 1.07.06
Comparing to
See all releases

Code changes from version 1.07.05 to 1.07.06

classes/controllers/FrmEntriesController.php CHANGED
@@ -44,12 +44,12 @@ class FrmEntriesController{
44
 
45
  public static function show_form($id='', $key='', $title=false, $description=false){
46
  _deprecated_function( __FUNCTION__, '1.07.05', 'FrmFormsController::show_form()' );
47
- FrmFormsController::show_form($id, $key, $title, $description);
48
  }
49
 
50
  public static function get_form($filename, $form, $title, $description) {
51
  _deprecated_function( __FUNCTION__, '1.07.05', 'FrmFormsController::get_form()' );
52
- FrmFormsController::get_form($form, $title, $description);
53
  }
54
 
55
  public static function process_entry($errors='', $ajax=false){
44
 
45
  public static function show_form($id='', $key='', $title=false, $description=false){
46
  _deprecated_function( __FUNCTION__, '1.07.05', 'FrmFormsController::show_form()' );
47
+ return FrmFormsController::show_form($id, $key, $title, $description);
48
  }
49
 
50
  public static function get_form($filename, $form, $title, $description) {
51
  _deprecated_function( __FUNCTION__, '1.07.05', 'FrmFormsController::get_form()' );
52
+ return FrmFormsController::get_form($form, $title, $description);
53
  }
54
 
55
  public static function process_entry($errors='', $ajax=false){
classes/controllers/FrmFormsController.php CHANGED
@@ -66,7 +66,7 @@ class FrmFormsController{
66
  }
67
 
68
  public static function register_widgets(){
69
- require(FrmAppHelper::plugin_path() . '/classes/widgets/FrmShowForm.php');
70
  register_widget('FrmShowForm');
71
  }
72
 
@@ -678,10 +678,14 @@ class FrmFormsController{
678
  return $sc .']';
679
  }
680
 
681
- $shortcode_atts = shortcode_atts(array('id' => '', 'key' => '', 'title' => false, 'description' => false, 'readonly' => false, 'entry_id' => false, 'fields' => array(), 'exclude_fields' => array()), $atts);
 
 
 
 
682
  do_action('formidable_shortcode_atts', $shortcode_atts, $atts);
683
  extract($shortcode_atts);
684
- return self::show_form($id, $key, $title, $description);
685
  }
686
 
687
  //filter form shortcode in text widgets
@@ -690,7 +694,7 @@ class FrmFormsController{
690
  return preg_replace_callback( $regex, 'FrmAppController::widget_text_filter_callback', $content );
691
  }
692
 
693
- public static function show_form($id = '', $key = '', $title = false, $description = false) {
694
  global $frm_settings, $post;
695
 
696
  $frm_form = new FrmForm();
@@ -724,7 +728,7 @@ class FrmFormsController{
724
  return do_shortcode($frm_settings->login_msg);
725
  }
726
 
727
- $form = self::get_form($form, $title, $description);
728
 
729
  // check for external shortcodes
730
  $form = do_shortcode($form);
@@ -732,7 +736,7 @@ class FrmFormsController{
732
  return $form;
733
  }
734
 
735
- public static function get_form($form, $title, $description) {
736
  global $frm_field, $frm_entry, $frm_entry_meta, $frm_settings, $frm_vars;
737
  $form_name = $form->name;
738
 
@@ -761,8 +765,10 @@ class FrmFormsController{
761
  include $filename;
762
  $contents = ob_get_contents();
763
  ob_end_clean();
764
- // TODO: check if minimizing is turned on
765
- //$contents = preg_replace('(\r|\n|\t)', '', $contents);
 
 
766
  return $contents;
767
  }
768
  return false;
66
  }
67
 
68
  public static function register_widgets(){
69
+ require_once(FrmAppHelper::plugin_path() . '/classes/widgets/FrmShowForm.php');
70
  register_widget('FrmShowForm');
71
  }
72
 
678
  return $sc .']';
679
  }
680
 
681
+ $shortcode_atts = shortcode_atts(array(
682
+ 'id' => '', 'key' => '', 'title' => false, 'description' => false,
683
+ 'readonly' => false, 'entry_id' => false, 'fields' => array(),
684
+ 'exclude_fields' => array(), 'minimize' => false,
685
+ ), $atts);
686
  do_action('formidable_shortcode_atts', $shortcode_atts, $atts);
687
  extract($shortcode_atts);
688
+ return self::show_form($id, $key, $title, $description, $atts);
689
  }
690
 
691
  //filter form shortcode in text widgets
694
  return preg_replace_callback( $regex, 'FrmAppController::widget_text_filter_callback', $content );
695
  }
696
 
697
+ public static function show_form($id = '', $key = '', $title = false, $description = false, $atts = array()) {
698
  global $frm_settings, $post;
699
 
700
  $frm_form = new FrmForm();
728
  return do_shortcode($frm_settings->login_msg);
729
  }
730
 
731
+ $form = self::get_form($form, $title, $description, $atts);
732
 
733
  // check for external shortcodes
734
  $form = do_shortcode($form);
736
  return $form;
737
  }
738
 
739
+ public static function get_form($form, $title, $description, $atts = array()) {
740
  global $frm_field, $frm_entry, $frm_entry_meta, $frm_settings, $frm_vars;
741
  $form_name = $form->name;
742
 
765
  include $filename;
766
  $contents = ob_get_contents();
767
  ob_end_clean();
768
+ // check if minimizing is turned on
769
+ if ( isset($atts['minimize']) && !empty($atts['minimize']) ) {
770
+ $contents = str_replace(array("\r\n", "\r", "\n", "\t", " "), '', $contents);
771
+ }
772
  return $contents;
773
  }
774
  return false;
classes/helpers/FrmXMLHelper.php CHANGED
@@ -34,6 +34,10 @@ class FrmXMLHelper{
34
  define('WP_IMPORTING', true);
35
  }
36
 
 
 
 
 
37
  $dom = new DOMDocument;
38
  $success = $dom->loadXML( file_get_contents( $file ) );
39
  if ( !$success ) {
@@ -131,9 +135,7 @@ class FrmXMLHelper{
131
  $old_fields = array();
132
  foreach ( $form_fields as $f ) {
133
  $old_fields[$f->id] = $f;
134
- if ( $form['is_template'] ) {
135
- $old_fields[$f->field_key] = $f->id;
136
- }
137
  unset($f);
138
  }
139
  $form_fields = $old_fields;
34
  define('WP_IMPORTING', true);
35
  }
36
 
37
+ if ( !class_exists('DOMDocument') ) {
38
+ return new WP_Error( 'SimpleXML_parse_error', __( 'Your server does not have XML enabled', 'formidable' ), libxml_get_errors() );
39
+ }
40
+
41
  $dom = new DOMDocument;
42
  $success = $dom->loadXML( file_get_contents( $file ) );
43
  if ( !$success ) {
135
  $old_fields = array();
136
  foreach ( $form_fields as $f ) {
137
  $old_fields[$f->id] = $f;
138
+ $old_fields[$f->field_key] = $f->id;
 
 
139
  unset($f);
140
  }
141
  $form_fields = $old_fields;
classes/models/FrmForm.php CHANGED
@@ -98,7 +98,9 @@ class FrmForm{
98
  function after_duplicate($form_id, $values) {
99
  $new_opts = $values['options'] = maybe_unserialize($values['options']);
100
 
101
- $new_opts['success_msg'] = FrmFieldsHelper::switch_field_ids($new_opts['success_msg']);
 
 
102
 
103
  $new_opts = apply_filters('frm_after_duplicate_form_values', $new_opts, $form_id);
104
 
98
  function after_duplicate($form_id, $values) {
99
  $new_opts = $values['options'] = maybe_unserialize($values['options']);
100
 
101
+ if ( isset($new_opts['success_msg']) ) {
102
+ $new_opts['success_msg'] = FrmFieldsHelper::switch_field_ids($new_opts['success_msg']);
103
+ }
104
 
105
  $new_opts = apply_filters('frm_after_duplicate_form_values', $new_opts, $form_id);
106
 
classes/views/frm-fields/input.php CHANGED
@@ -73,4 +73,3 @@ if (FrmAppHelper::check_selected($field['value'], $field_val)) echo ' selected="
73
  if (!empty($frm_settings->pubkey))
74
  FrmFieldsHelper::display_recaptcha($field, $error_msg);
75
  }else do_action('frm_form_fields', $field, $field_name);
76
- ?>
73
  if (!empty($frm_settings->pubkey))
74
  FrmFieldsHelper::display_recaptcha($field, $error_msg);
75
  }else do_action('frm_form_fields', $field, $field_name);
 
classes/widgets/FrmShowForm.php CHANGED
@@ -60,5 +60,3 @@ class FrmShowForm extends WP_Widget {
60
  <?php
61
  }
62
  }
63
-
64
- ?>
60
  <?php
61
  }
62
  }
 
 
formidable.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Formidable
4
  Description: Quickly and easily create drag-and-drop forms
5
- Version: 1.07.05
6
  Plugin URI: http://formidablepro.com/
7
  Author URI: http://strategy11.com
8
  Author: Strategy11
@@ -21,7 +21,7 @@ Text Domain: formidable
21
  GNU General Public License for more details.
22
  */
23
 
24
- require(dirname( __FILE__ ) .'/classes/models/FrmSettings.php');
25
 
26
  global $frm_vars;
27
  $frm_vars = array(
@@ -29,7 +29,7 @@ $frm_vars = array(
29
  'created_entries' => array(), 'pro_is_installed' => false
30
  );
31
 
32
- require(dirname( __FILE__ ) .'/classes/helpers/FrmAppHelper.php');
33
  $obj = new FrmAppHelper();
34
 
35
  /***** SETUP SETTINGS OBJECT *****/
@@ -58,12 +58,12 @@ $frm_settings->set_default_options(); // Sets defaults for unset options
58
  $frm_path = FrmAppHelper::plugin_path();
59
 
60
  // Instansiate Models
61
- require($frm_path .'/classes/models/FrmDb.php');
62
- require($frm_path .'/classes/models/FrmField.php');
63
- require($frm_path .'/classes/models/FrmForm.php');
64
- require($frm_path .'/classes/models/FrmEntry.php');
65
- require($frm_path .'/classes/models/FrmEntryMeta.php');
66
- require($frm_path .'/classes/models/FrmNotification.php');
67
 
68
  global $frmdb;
69
  global $frm_field;
@@ -80,10 +80,10 @@ $obj = new FrmNotification();
80
 
81
 
82
  // Instansiate Controllers
83
- require($frm_path .'/classes/controllers/FrmAppController.php');
84
- require($frm_path .'/classes/controllers/FrmFieldsController.php');
85
- require($frm_path .'/classes/controllers/FrmFormsController.php');
86
- require($frm_path .'/classes/controllers/FrmEntriesController.php');
87
 
88
  FrmAppController::load_hooks();
89
  FrmEntriesController::load_hooks();
@@ -91,24 +91,24 @@ FrmFieldsController::load_hooks();
91
  FrmFormsController::load_hooks();
92
 
93
  if(is_admin()){
94
- require($frm_path .'/classes/controllers/FrmSettingsController.php');
95
  FrmSettingsController::load_hooks();
96
 
97
- require($frm_path .'/classes/controllers/FrmStatisticsController.php');
98
  FrmStatisticsController::load_hooks();
99
 
100
- require($frm_path .'/classes/controllers/FrmXMLController.php');
101
  FrmXMLController::load_hooks();
102
  }
103
 
104
  // Instansiate Helpers
105
- require($frm_path .'/classes/helpers/FrmEntriesHelper.php');
106
- require($frm_path .'/classes/helpers/FrmFieldsHelper.php');
107
- require($frm_path .'/classes/helpers/FrmFormsHelper.php');
108
 
109
  if ( file_exists($frm_path . '/pro/formidable-pro.php') ) {
110
- require($frm_path .'/pro/formidable-pro.php');
111
  }
112
 
113
- include($frm_path .'/deprecated.php');
114
  unset($frm_path);
2
  /*
3
  Plugin Name: Formidable
4
  Description: Quickly and easily create drag-and-drop forms
5
+ Version: 1.07.06
6
  Plugin URI: http://formidablepro.com/
7
  Author URI: http://strategy11.com
8
  Author: Strategy11
21
  GNU General Public License for more details.
22
  */
23
 
24
+ require_once(dirname( __FILE__ ) .'/classes/models/FrmSettings.php');
25
 
26
  global $frm_vars;
27
  $frm_vars = array(
29
  'created_entries' => array(), 'pro_is_installed' => false
30
  );
31
 
32
+ require_once(dirname( __FILE__ ) .'/classes/helpers/FrmAppHelper.php');
33
  $obj = new FrmAppHelper();
34
 
35
  /***** SETUP SETTINGS OBJECT *****/
58
  $frm_path = FrmAppHelper::plugin_path();
59
 
60
  // Instansiate Models
61
+ require_once($frm_path .'/classes/models/FrmDb.php');
62
+ require_once($frm_path .'/classes/models/FrmField.php');
63
+ require_once($frm_path .'/classes/models/FrmForm.php');
64
+ require_once($frm_path .'/classes/models/FrmEntry.php');
65
+ require_once($frm_path .'/classes/models/FrmEntryMeta.php');
66
+ require_once($frm_path .'/classes/models/FrmNotification.php');
67
 
68
  global $frmdb;
69
  global $frm_field;
80
 
81
 
82
  // Instansiate Controllers
83
+ require_once($frm_path .'/classes/controllers/FrmAppController.php');
84
+ require_once($frm_path .'/classes/controllers/FrmFieldsController.php');
85
+ require_once($frm_path .'/classes/controllers/FrmFormsController.php');
86
+ require_once($frm_path .'/classes/controllers/FrmEntriesController.php');
87
 
88
  FrmAppController::load_hooks();
89
  FrmEntriesController::load_hooks();
91
  FrmFormsController::load_hooks();
92
 
93
  if(is_admin()){
94
+ require_once($frm_path .'/classes/controllers/FrmSettingsController.php');
95
  FrmSettingsController::load_hooks();
96
 
97
+ require_once($frm_path .'/classes/controllers/FrmStatisticsController.php');
98
  FrmStatisticsController::load_hooks();
99
 
100
+ require_once($frm_path .'/classes/controllers/FrmXMLController.php');
101
  FrmXMLController::load_hooks();
102
  }
103
 
104
  // Instansiate Helpers
105
+ require_once($frm_path .'/classes/helpers/FrmEntriesHelper.php');
106
+ require_once($frm_path .'/classes/helpers/FrmFieldsHelper.php');
107
+ require_once($frm_path .'/classes/helpers/FrmFormsHelper.php');
108
 
109
  if ( file_exists($frm_path . '/pro/formidable-pro.php') ) {
110
+ require_once($frm_path .'/pro/formidable-pro.php');
111
  }
112
 
113
+ include_once($frm_path .'/deprecated.php');
114
  unset($frm_path);
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://formidablepro.com/donate
4
  Tags: admin, AJAX, captcha, contact, contact form, database, email, feedback, form, forms, javascript, jquery, page, plugin, poll, Post, spam, survey, template, widget, wpmu, form builder
5
  Requires at least: 3.3
6
  Tested up to: 3.8
7
- Stable tag: 1.07.05
8
 
9
  Quickly and easily build forms with a simple drag-and-drop interface and in-place editing.
10
 
@@ -64,6 +64,14 @@ A. Try clearing your browser cache. As plugin modifications are made, frequent j
64
  [See more FAQs](http://formidablepro.com/formidable-faqs/ "Formidable Pro FAQs")
65
 
66
  == Changelog ==
 
 
 
 
 
 
 
 
67
  = 1.07.05 =
68
  * Added XML import/export
69
  * Moved more email settings and bulk form delete to free version
4
  Tags: admin, AJAX, captcha, contact, contact form, database, email, feedback, form, forms, javascript, jquery, page, plugin, poll, Post, spam, survey, template, widget, wpmu, form builder
5
  Requires at least: 3.3
6
  Tested up to: 3.8
7
+ Stable tag: 1.07.06
8
 
9
  Quickly and easily build forms with a simple drag-and-drop interface and in-place editing.
10
 
64
  [See more FAQs](http://formidablepro.com/formidable-faqs/ "Formidable Pro FAQs")
65
 
66
  == Changelog ==
67
+ = 1.07.06 =
68
+ * Return graceful error message if no DOMDocument enabled
69
+ * Allow fields to be updated via XML import by field key for non-templates
70
+ * Added minimize=1 option to the [formidable] short code to minimize the form HTML to prevent wpautop interference
71
+ * Correctly return fallbacks on a couple deprecated functions
72
+ * PRO: Allow field keys in the frm-stats shortcode for fieldid=value
73
+ * PRO: Fixed attaching file upload to entries when using single files
74
+
75
  = 1.07.05 =
76
  * Added XML import/export
77
  * Moved more email settings and bulk form delete to free version