Contact Form by WD – responsive drag & drop contact form builder tool - Version 1.12.33

Version Description

  • Added: Option to enable/disable WP Editor.
  • Added: Additional security checks against bots.
  • Changed: Field validation on form options page.
  • Fixed: Error on deactivation.
  • Fixed: Port for connecting to a remote Database with SQL mapping.
  • Fixed: Displaying Form on all posts instead of the selected.
  • Fixed: Payment fields filled values should not be lost on an error.
  • Fixed: Form is not saved if you click Publish before the page is loaded.
  • Fixed: Table of fields validation.
  • Fixed: Add shortcode functionality on Beaver, Elementor, SiteOrigin and Visual Composer builders.
  • Fixed: If you Sort/Filter the data via some column, then hit next page button, the sort reverts to the default sort order.
  • Fixed: Select all in Submissions should apply to the current page only.
  • Fixed: Do not change the page after IP block in submissions page.
  • Fixed: Do not change the page after deleting submission in submissions page.
Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 Contact Form by WD – responsive drag & drop contact form builder tool
Version 1.12.33
Comparing to
See all releases

Code changes from version 1.12.32 to 1.12.33

admin/controllers/FormMakerSQLMapping.php CHANGED
@@ -81,6 +81,9 @@ class FMControllerFormMakerSQLMapping_fmc extends CFMAdminController {
81
  $host = $temp[0];
82
  $temp = explode('***wdfportwdf***', $temp[1]);
83
  $port = $temp[0];
 
 
 
84
  $temp = explode('***wdfusernamewdf***', $temp[1]);
85
  $username = $temp[0];
86
  $temp = explode('***wdfpasswordwdf***', $temp[1]);
81
  $host = $temp[0];
82
  $temp = explode('***wdfportwdf***', $temp[1]);
83
  $port = $temp[0];
84
+ if ($port) {
85
+ $host .= ':' . $port;
86
+ }
87
  $temp = explode('***wdfusernamewdf***', $temp[1]);
88
  $username = $temp[0];
89
  $temp = explode('***wdfpasswordwdf***', $temp[1]);
admin/controllers/Manage_fm.php CHANGED
@@ -309,6 +309,9 @@ class FMControllerManage_fmc extends CFMAdminController {
309
  public function add() {
310
  $backup_id = 0;
311
  $params = array();
 
 
 
312
  $params['id'] = $backup_id;
313
  $params['row'] = $this->model->get_row_data_new($backup_id);
314
  $params['page_url'] = $this->page_url;
@@ -359,6 +362,7 @@ class FMControllerManage_fmc extends CFMAdminController {
359
  public function edit( $id = 0, $backup_id = 0 ) {
360
  $fm_settings = get_option(WDFMInstance(self::PLUGIN)->is_free == 2 ? 'fmc_settings' : 'fm_settings');
361
  $fm_advanced_layout = isset($fm_settings['fm_advanced_layout']) && $fm_settings['fm_advanced_layout'] == '1' ? 1 : 0;
 
362
  if ( $id && !$fm_advanced_layout ) {
363
  $fm_advanced_layout = !$this->model->get_autogen_layout($id);
364
  }
@@ -400,6 +404,7 @@ class FMControllerManage_fmc extends CFMAdminController {
400
  $params['default_theme'] = $this->model->get_default_theme_id();
401
 
402
  $params['form_preview_link'] = $this->model->get_form_preview_post();
 
403
 
404
  if ( $id ) {
405
  $params['form_options_url'] = add_query_arg( array( 'page' => $this->page , 'task' => 'form_options', 'current_id' => $id ), $this->page_url );
@@ -881,10 +886,10 @@ function after_submit() {
881
  WDW_FM_Library(self::PLUGIN)->fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'display'), admin_url('admin.php') ) );
882
  }
883
  $params['row'] = $this->model->get_display_options($id);
884
- $params['page_title'] = '"'. $params['row_form']->title . '" ' . __('display options', WDFMInstance(self::PLUGIN)->prefix);
885
  $params['animation_effects'] = $this->animation_effects;
886
- $params['posts_and_pages'] = $this->model->fm_posts_query();
887
- $params['all_display_posts'] = $this->model->get_all_display_posts();
888
  $params['categories'] = $this->model->fm_categories_query();
889
  $params['selected_categories'] = explode(',', $params['row']->display_on_categories);
890
  $params['current_categories_array'] = explode(',', $params['row']->current_categories);
@@ -1339,9 +1344,9 @@ function after_submit() {
1339
  }
1340
 
1341
  public function fm_live_search() {
1342
- $search_string = !empty($_POST['pp_live_search']) ? sanitize_text_field($_POST['pp_live_search']) : '';
1343
- $post_type = !empty($_POST['pp_post_type']) ? sanitize_text_field($_POST['pp_post_type']) : 'any';
1344
- $full_content = !empty($_POST['pp_full_content']) ? sanitize_text_field($_POST['pp_full_content']) : 'true';
1345
  $args['s'] = $search_string;
1346
  $results = $this->fm_posts_query($args, $post_type);
1347
  $output = '<ul class="pp_search_results">';
@@ -1364,25 +1369,16 @@ function after_submit() {
1364
  */
1365
  public function fm_posts_query( $args = array(), $include_post_type = '' ) {
1366
  if ( 'only_pages' === $include_post_type ) {
1367
- $pt_names = array( 'page' );
1368
  }
1369
  elseif ( 'any' === $include_post_type || 'only_posts' === $include_post_type ) {
1370
- $default_post_types = array( 'post', 'page' );
1371
- $custom_post_types = get_post_types(array(
1372
- 'public' => TRUE,
1373
- '_builtin' => FALSE,
1374
- ));
1375
- $post_types = array_merge($default_post_types, $custom_post_types);
1376
- $pt_names = array_values($post_types);
1377
- if ( 'only_posts' === $include_post_type ) {
1378
- unset($pt_names[1]);
1379
- }
1380
  }
1381
  else {
1382
- $pt_names = $include_post_type;
1383
  }
1384
  $query = array(
1385
- 'post_type' => $pt_names,
1386
  'suppress_filters' => TRUE,
1387
  'update_post_term_cache' => FALSE,
1388
  'update_post_meta_cache' => FALSE,
309
  public function add() {
310
  $backup_id = 0;
311
  $params = array();
312
+ $fm_settings = get_option(WDFMInstance(self::PLUGIN)->is_free == 2 ? 'fmc_settings' : 'fm_settings');
313
+ $fm_enable_wp_editor = !isset( $fm_settings['fm_enable_wp_editor'] ) ? 1 : $fm_settings['fm_enable_wp_editor'];
314
+ $params['fm_enable_wp_editor'] = $fm_enable_wp_editor;
315
  $params['id'] = $backup_id;
316
  $params['row'] = $this->model->get_row_data_new($backup_id);
317
  $params['page_url'] = $this->page_url;
362
  public function edit( $id = 0, $backup_id = 0 ) {
363
  $fm_settings = get_option(WDFMInstance(self::PLUGIN)->is_free == 2 ? 'fmc_settings' : 'fm_settings');
364
  $fm_advanced_layout = isset($fm_settings['fm_advanced_layout']) && $fm_settings['fm_advanced_layout'] == '1' ? 1 : 0;
365
+ $fm_enable_wp_editor = !isset( $fm_settings['fm_enable_wp_editor'] ) ? 1 : $fm_settings['fm_enable_wp_editor'];
366
  if ( $id && !$fm_advanced_layout ) {
367
  $fm_advanced_layout = !$this->model->get_autogen_layout($id);
368
  }
404
  $params['default_theme'] = $this->model->get_default_theme_id();
405
 
406
  $params['form_preview_link'] = $this->model->get_form_preview_post();
407
+ $params['fm_enable_wp_editor'] = $fm_enable_wp_editor;
408
 
409
  if ( $id ) {
410
  $params['form_options_url'] = add_query_arg( array( 'page' => $this->page , 'task' => 'form_options', 'current_id' => $id ), $this->page_url );
886
  WDW_FM_Library(self::PLUGIN)->fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'display'), admin_url('admin.php') ) );
887
  }
888
  $params['row'] = $this->model->get_display_options($id);
889
+ $params['page_title'] = '"'. $params['row_form']->title . '" ' . __('display options', WDFMInstance(self::PLUGIN)->prefix);
890
  $params['animation_effects'] = $this->animation_effects;
891
+ $params['display_on_list'] = array('everything' => 'All', 'home' => 'Homepage', 'archive' => 'Archives', 'post' => 'Post', 'page' => 'Page');
892
+ $params['posts_and_pages'] = $this->model->fm_posts_query();
893
  $params['categories'] = $this->model->fm_categories_query();
894
  $params['selected_categories'] = explode(',', $params['row']->display_on_categories);
895
  $params['current_categories_array'] = explode(',', $params['row']->current_categories);
1344
  }
1345
 
1346
  public function fm_live_search() {
1347
+ $search_string = !empty($_POST['pp_live_search']) ? sanitize_text_field($_POST['pp_live_search']) : '';
1348
+ $post_type = !empty($_POST['pp_post_type']) ? sanitize_text_field($_POST['pp_post_type']) : 'any';
1349
+ $full_content = !empty($_POST['pp_full_content']) ? sanitize_text_field($_POST['pp_full_content']) : 'true';
1350
  $args['s'] = $search_string;
1351
  $results = $this->fm_posts_query($args, $post_type);
1352
  $output = '<ul class="pp_search_results">';
1369
  */
1370
  public function fm_posts_query( $args = array(), $include_post_type = '' ) {
1371
  if ( 'only_pages' === $include_post_type ) {
1372
+ $post_type = array('page');
1373
  }
1374
  elseif ( 'any' === $include_post_type || 'only_posts' === $include_post_type ) {
1375
+ $post_type = array('post');
 
 
 
 
 
 
 
 
 
1376
  }
1377
  else {
1378
+ $post_type = $include_post_type;
1379
  }
1380
  $query = array(
1381
+ 'post_type' => $post_type,
1382
  'suppress_filters' => TRUE,
1383
  'update_post_term_cache' => FALSE,
1384
  'update_post_meta_cache' => FALSE,
admin/controllers/Submissions_fm.php CHANGED
@@ -104,6 +104,7 @@ class FMControllerSubmissions_fmc extends CFMAdminController {
104
  * @param string $task
105
  */
106
  public function bulk_action( $task = '' ) {
 
107
  $form_id = WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
108
  $check = WDW_FM_Library(self::PLUGIN)->get('check', '');
109
 
@@ -125,7 +126,20 @@ class FMControllerSubmissions_fmc extends CFMAdminController {
125
  $message = sprintf(_n('%s item successfully %s.', '%s items successfully %s.', $successfully_updated, WDFMInstance(self::PLUGIN)->prefix), $successfully_updated, $this->actions[$task][$block_action]);
126
  }
127
  }
128
- WDW_FM_Library(self::PLUGIN)->fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'display', 'current_id' => $form_id, ($message === 2 ? 'message' : 'msg') => $message), admin_url('admin.php') ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  }
130
 
131
  /**
@@ -140,6 +154,8 @@ class FMControllerSubmissions_fmc extends CFMAdminController {
140
  $params['page_url'] = $this->page_url;
141
  $params['page_title'] = __('Submissions', WDFMInstance(self::PLUGIN)->prefix);
142
  $params['forms'] = $this->model->get_forms();
 
 
143
 
144
  $this->view->forms($params);
145
  }
@@ -157,11 +173,11 @@ class FMControllerSubmissions_fmc extends CFMAdminController {
157
  $params['page_title'] = __('Submissions', WDFMInstance(self::PLUGIN)->prefix);
158
  $params['actions'] = $this->actions;
159
 
160
- // Set pagination params.
161
- $params['pagination_url'] = add_query_arg( array( 'task' => 'display', 'current_id' => $id ), $this->page_url );
162
- $params['page_per_num'] = $this->page_per_num;
163
- $page = (int) WDW_FM_Library(self::PLUGIN)->get('paged', 1);
164
- $page_num = $page ? ($page - 1) * $params['page_per_num'] : 0;
165
 
166
  $params['forms'] = $this->model->get_forms();
167
  $params['statistics'] = $this->model->get_statistics( $id );
@@ -183,8 +199,9 @@ class FMControllerSubmissions_fmc extends CFMAdminController {
183
  $params['where_choices'] = $labels_parameters[7];
184
  $params['searched_ids'] = $labels_parameters[8] ? implode(',', $labels_parameters[8]) : '';
185
  $params['groupids'] = $labels_parameters[8] ? array_reverse($labels_parameters[8]) : array();
186
- $params['order_by'] = (isset($_POST['order_by']) ? esc_html(stripslashes($_POST['order_by'])) : 'group_id');
187
- $params['asc_or_desc'] = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'asc') ? 'asc' : 'desc');
 
188
 
189
  $lists = $labels_parameters[2];
190
  $params['lists'] = $lists;
@@ -198,19 +215,67 @@ class FMControllerSubmissions_fmc extends CFMAdminController {
198
  $params['oder_class_default'] = "manage-column column-autor sortable desc";
199
  $params['oder_class'] = "manage-column column-autor column-title sorted " . $params['asc_or_desc'];
200
  $params['m'] = count($params['sorted_label_names']);
201
-
 
202
  $is_search = false;
203
- foreach($lists as $list_key => $list_val){
204
- if(!empty($_POST[$list_key])) {
 
205
  $is_search = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  }
 
 
 
 
 
 
207
  }
208
- $params['is_search'] = $is_search; // (($lists['ip_search'] || $lists['startdate'] || $lists['enddate'] || $lists['username_search'] || $lists['useremail_search'] || $lists['id_search']) ? true : false );
209
- $params['is_stats'] = FALSE;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
 
211
  $params['rows_data'] = $lists;
212
  $params['rows'] = $labels_parameters[5];
213
  $params['subs_count'] = $labels_parameters[2]['total'];
 
 
 
 
 
214
 
215
  $option_key = (WDFMInstance(self::PLUGIN)->is_free == 2 ? 'fmc_settings' : 'fm_settings');
216
  $params['fm_settings'] = get_option($option_key);
@@ -465,6 +530,7 @@ class FMControllerSubmissions_fmc extends CFMAdminController {
465
  * @return int
466
  */
467
  public function delete( $id = 0, $bulk = FALSE ) {
 
468
  $form_id = (int) WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
469
  $delete = $this->model->delete_row($id);
470
  $message = 2;
@@ -475,13 +541,18 @@ class FMControllerSubmissions_fmc extends CFMAdminController {
475
  if ( $bulk ) {
476
  return $message;
477
  }
478
-
479
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
480
- 'page' => $this->page,
481
- 'task' => 'display',
482
- 'current_id'=> $form_id,
483
- 'message' => $message,
484
- ), admin_url('admin.php')));
 
 
 
 
 
485
  }
486
 
487
  /**
@@ -495,6 +566,7 @@ class FMControllerSubmissions_fmc extends CFMAdminController {
495
  public function block_ip( $id = 0, $bulk = FALSE ) {
496
  global $wpdb;
497
 
 
498
  $form_id = (int) WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
499
  $q = $wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id ="%d"', $id);
500
  $row = $wpdb->get_row($q);
@@ -513,12 +585,17 @@ class FMControllerSubmissions_fmc extends CFMAdminController {
513
  return $message;
514
  }
515
 
516
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg( array(
517
- 'page' => $this->page,
518
- 'task' => 'display',
519
- 'current_id'=> $form_id,
520
- 'message' => $message,
521
- ), admin_url('admin.php')) );
 
 
 
 
 
522
  }
523
 
524
  /**
@@ -532,6 +609,7 @@ class FMControllerSubmissions_fmc extends CFMAdminController {
532
  public function unblock_ip( $id = 0, $bulk = FALSE ) {
533
  global $wpdb;
534
 
 
535
  $form_id = (int) WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
536
  $q = $wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id ="%d"', $id);
537
  $row = $wpdb->get_row($q);
@@ -550,11 +628,16 @@ class FMControllerSubmissions_fmc extends CFMAdminController {
550
  return $message;
551
  }
552
 
553
- WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg( array(
554
- 'page' => $this->page,
555
- 'task' => 'display',
556
- 'current_id'=> $form_id,
557
- 'message' => $message,
558
- ), admin_url('admin.php')) );
 
 
 
 
 
559
  }
560
  }
104
  * @param string $task
105
  */
106
  public function bulk_action( $task = '' ) {
107
+ $paged = (int) WDW_FM_Library(self::PLUGIN)->get('current_page', 1);
108
  $form_id = WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
109
  $check = WDW_FM_Library(self::PLUGIN)->get('check', '');
110
 
126
  $message = sprintf(_n('%s item successfully %s.', '%s items successfully %s.', $successfully_updated, WDFMInstance(self::PLUGIN)->prefix), $successfully_updated, $this->actions[$task][$block_action]);
127
  }
128
  }
129
+
130
+ $url_args = array(
131
+ 'page' => $this->page,
132
+ 'task' => 'display',
133
+ 'current_id' => $form_id,
134
+ 'paged' => $paged,
135
+ ($message === 2 ? 'message' : 'msg') => $message);
136
+
137
+ $delete_keys = array_merge($url_args, array('form_id' => '', WDFMInstance(self::PLUGIN)->nonce => ''));
138
+ $new_url_args = WDW_FM_Library(self::PLUGIN)->array_remove_keys($_GET, $delete_keys);
139
+ $redirect = add_query_arg( array_merge($url_args, $new_url_args), admin_url('admin.php') );
140
+
141
+ WDW_FM_Library(self::PLUGIN)->fm_redirect( $redirect, false );
142
+
143
  }
144
 
145
  /**
154
  $params['page_url'] = $this->page_url;
155
  $params['page_title'] = __('Submissions', WDFMInstance(self::PLUGIN)->prefix);
156
  $params['forms'] = $this->model->get_forms();
157
+ $params['order_by'] = 'group_id';
158
+ $params['asc_or_desc'] = 'desc';
159
 
160
  $this->view->forms($params);
161
  }
173
  $params['page_title'] = __('Submissions', WDFMInstance(self::PLUGIN)->prefix);
174
  $params['actions'] = $this->actions;
175
 
176
+ // Set pagination params.
177
+ $paged = (int) WDW_FM_Library(self::PLUGIN)->get('paged', 1);
178
+ $params['page_per_num'] = $this->page_per_num;
179
+ $params['page_number'] = $paged;
180
+ $page_num = $paged ? ($paged - 1) * $params['page_per_num'] : 0;
181
 
182
  $params['forms'] = $this->model->get_forms();
183
  $params['statistics'] = $this->model->get_statistics( $id );
199
  $params['where_choices'] = $labels_parameters[7];
200
  $params['searched_ids'] = $labels_parameters[8] ? implode(',', $labels_parameters[8]) : '';
201
  $params['groupids'] = $labels_parameters[8] ? array_reverse($labels_parameters[8]) : array();
202
+
203
+ $params['order_by'] = $order_by = WDW_FM_Library(self::PLUGIN)->get('order_by', 'group_id');
204
+ $params['asc_or_desc'] = $asc_or_desc = WDW_FM_Library(self::PLUGIN)->get('asc_or_desc', 'desc');
205
 
206
  $lists = $labels_parameters[2];
207
  $params['lists'] = $lists;
215
  $params['oder_class_default'] = "manage-column column-autor sortable desc";
216
  $params['oder_class'] = "manage-column column-autor column-title sorted " . $params['asc_or_desc'];
217
  $params['m'] = count($params['sorted_label_names']);
218
+ /* sort/filter logics */
219
+ $is_sort = false;
220
  $is_search = false;
221
+ $post_url_args = array();
222
+ foreach ( $lists as $list_key => $list_val ) {
223
+ if ( !empty($_POST[$list_key]) ) {
224
  $is_search = true;
225
+ $post_url_args[$list_key] = urlencode($_POST[$list_key]);
226
+ $post_url_args['is_search'] = 1;
227
+ }
228
+ }
229
+ /* Get sorting value on $_POST for redirect */
230
+ if ( !empty($_POST['order_by']) || !empty($_POST['asc_or_desc']) ) {
231
+ $is_sort = true;
232
+ $order_by = $_POST['order_by'];
233
+ $asc_or_desc = $_POST['asc_or_desc'];
234
+ }
235
+ if ( !empty($is_search) || $is_sort || isset($_POST['current_page']) ) {
236
+ if ( !empty($_POST['fm_is_search']) ) {
237
+ $post_url_args['paged'] = 1;
238
+ } else {
239
+ $post_url_args['paged'] = WDW_FM_Library(self::PLUGIN)->get('current_page', 1);
240
+ if ( isset($_POST['current_page']) ) {
241
+ $post_url_args['paged'] = $_POST['current_page'];
242
+ }
243
  }
244
+ $url_args = array_merge(
245
+ array('page' => $this->page, 'task' => 'display', 'current_id' => $id, 'order_by' => $order_by, 'asc_or_desc' => $asc_or_desc),
246
+ $post_url_args
247
+ );
248
+ $redirect = add_query_arg( $url_args, admin_url('admin.php') );
249
+ WDW_FM_Library(self::PLUGIN)->fm_redirect( $redirect, false );
250
  }
251
+
252
+ $pagination_url_args = array();
253
+ foreach ( $lists as $list_key => $list_val ) {
254
+ if ( !empty($_GET[$list_key]) ) {
255
+ $lists[$list_key] = urlencode(WDW_FM_Library(self::PLUGIN)->get($list_key));
256
+ $pagination_url_args[$list_key] = WDW_FM_Library(self::PLUGIN)->get($list_key);
257
+ $pagination_url_args['is_search'] = 1;
258
+ }
259
+ }
260
+ $pagination_url = array_merge(
261
+ array('page' => $this->page, 'task' => 'display', 'current_id' => $id, 'order_by' => $order_by, 'asc_or_desc' => $asc_or_desc),
262
+ $pagination_url_args
263
+ );
264
+ $params['pagination_url'] = add_query_arg( $pagination_url , admin_url('admin.php') );
265
+ $params['pagination_url_args'] = $pagination_url_args;
266
+
267
+ $params['lists'] = $lists;
268
+ $params['is_search'] = WDW_FM_Library(self::PLUGIN)->get('is_search', 0);
269
+ $params['is_stats'] = FALSE;
270
 
271
  $params['rows_data'] = $lists;
272
  $params['rows'] = $labels_parameters[5];
273
  $params['subs_count'] = $labels_parameters[2]['total'];
274
+ /* If not result redirect to first page */
275
+ if ( empty($params['group_id_s']) && $paged > 1 ) {
276
+ $redirect = add_query_arg( array_merge( $pagination_url, array('paged' => 1) ), admin_url('admin.php') );
277
+ WDW_FM_Library(self::PLUGIN)->fm_redirect( $redirect );
278
+ }
279
 
280
  $option_key = (WDFMInstance(self::PLUGIN)->is_free == 2 ? 'fmc_settings' : 'fm_settings');
281
  $params['fm_settings'] = get_option($option_key);
530
  * @return int
531
  */
532
  public function delete( $id = 0, $bulk = FALSE ) {
533
+ $paged = (int) WDW_FM_Library(self::PLUGIN)->get('paged', 1);
534
  $form_id = (int) WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
535
  $delete = $this->model->delete_row($id);
536
  $message = 2;
541
  if ( $bulk ) {
542
  return $message;
543
  }
544
+
545
+ $url_args = array(
546
+ 'page' => $this->page,
547
+ 'task' => 'display',
548
+ 'current_id' => $form_id,
549
+ 'paged' => $paged,
550
+ 'message' => $message);
551
+ $delete_keys = array_merge($url_args, array('form_id' => '', WDFMInstance(self::PLUGIN)->nonce => ''));
552
+ $new_url_args = WDW_FM_Library(self::PLUGIN)->array_remove_keys($_GET, $delete_keys);
553
+
554
+ $redirect = add_query_arg( array_merge($url_args, $new_url_args), admin_url('admin.php') );
555
+ WDW_FM_Library(self::PLUGIN)->fm_redirect( $redirect );
556
  }
557
 
558
  /**
566
  public function block_ip( $id = 0, $bulk = FALSE ) {
567
  global $wpdb;
568
 
569
+ $paged = (int) WDW_FM_Library(self::PLUGIN)->get('paged', 1);
570
  $form_id = (int) WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
571
  $q = $wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id ="%d"', $id);
572
  $row = $wpdb->get_row($q);
585
  return $message;
586
  }
587
 
588
+ $url_args = array(
589
+ 'page' => $this->page,
590
+ 'task' => 'display',
591
+ 'current_id' => $form_id,
592
+ 'paged' => $paged,
593
+ 'message' => $message);
594
+ $delete_keys = array_merge($url_args, array('form_id' => '', WDFMInstance(self::PLUGIN)->nonce => ''));
595
+ $new_url_args = WDW_FM_Library(self::PLUGIN)->array_remove_keys($_GET, $delete_keys);
596
+
597
+ $redirect = add_query_arg( array_merge($url_args, $new_url_args), admin_url('admin.php') );
598
+ WDW_FM_Library(self::PLUGIN)->fm_redirect( $redirect );
599
  }
600
 
601
  /**
609
  public function unblock_ip( $id = 0, $bulk = FALSE ) {
610
  global $wpdb;
611
 
612
+ $paged = (int) WDW_FM_Library(self::PLUGIN)->get('paged', 1);
613
  $form_id = (int) WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
614
  $q = $wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id ="%d"', $id);
615
  $row = $wpdb->get_row($q);
628
  return $message;
629
  }
630
 
631
+ $url_args = array(
632
+ 'page' => $this->page,
633
+ 'task' => 'display',
634
+ 'current_id' => $form_id,
635
+ 'paged' => $paged,
636
+ 'message' => $message);
637
+ $delete_keys = array_merge($url_args, array('form_id' => '', WDFMInstance(self::PLUGIN)->nonce => ''));
638
+ $new_url_args = WDW_FM_Library(self::PLUGIN)->array_remove_keys($_GET, $delete_keys);
639
+
640
+ $redirect = add_query_arg( array_merge($url_args, $new_url_args), admin_url('admin.php') );
641
+ WDW_FM_Library(self::PLUGIN)->fm_redirect( $redirect );
642
  }
643
  }
admin/models/FMSelectDataFromDb.php CHANGED
@@ -36,6 +36,10 @@ class FMModelSelect_data_from_db_fmc extends CFMAdminModel {
36
  $password = WDW_FM_Library(self::PLUGIN)->get('password', '');
37
  $database = WDW_FM_Library(self::PLUGIN)->get('database', '');
38
  $host = WDW_FM_Library(self::PLUGIN)->get('host', '');
 
 
 
 
39
  $wpdb_temp = new wpdb($username, $password, $database, $host);
40
  $query = "SHOW TABLES";
41
  $tables = $wpdb_temp->get_col($query);
@@ -92,6 +96,10 @@ class FMModelSelect_data_from_db_fmc extends CFMAdminModel {
92
  $password = WDW_FM_Library(self::PLUGIN)->get('password', '');
93
  $database = WDW_FM_Library(self::PLUGIN)->get('database', '');
94
  $host = WDW_FM_Library(self::PLUGIN)->get('host', '');
 
 
 
 
95
  $wpdb_temp = new wpdb($username, $password, $database, $host);
96
  $table_struct = $wpdb_temp->get_results($query);
97
  }
36
  $password = WDW_FM_Library(self::PLUGIN)->get('password', '');
37
  $database = WDW_FM_Library(self::PLUGIN)->get('database', '');
38
  $host = WDW_FM_Library(self::PLUGIN)->get('host', '');
39
+ $port = WDW_FM_Library(self::PLUGIN)->get('port', '');
40
+ if ($port) {
41
+ $host .= ':' . $port;
42
+ }
43
  $wpdb_temp = new wpdb($username, $password, $database, $host);
44
  $query = "SHOW TABLES";
45
  $tables = $wpdb_temp->get_col($query);
96
  $password = WDW_FM_Library(self::PLUGIN)->get('password', '');
97
  $database = WDW_FM_Library(self::PLUGIN)->get('database', '');
98
  $host = WDW_FM_Library(self::PLUGIN)->get('host', '');
99
+ $port = WDW_FM_Library(self::PLUGIN)->get('port', '');
100
+ if ($port) {
101
+ $host .= ':' . $port;
102
+ }
103
  $wpdb_temp = new wpdb($username, $password, $database, $host);
104
  $table_struct = $wpdb_temp->get_results($query);
105
  }
admin/models/FMSqlMapping.php CHANGED
@@ -48,6 +48,10 @@ class FMModelFormMakerSQLMapping_fmc extends CFMAdminModel {
48
  $password = WDW_FM_Library(self::PLUGIN)->get('password', '');
49
  $database = WDW_FM_Library(self::PLUGIN)->get('database', '');
50
  $host = WDW_FM_Library(self::PLUGIN)->get('host', '');
 
 
 
 
51
  $wpdb_temp = new wpdb($username, $password, $database, $host);
52
  $query = "SHOW TABLES";
53
  $tables = $wpdb_temp->get_col($query);
@@ -88,6 +92,10 @@ class FMModelFormMakerSQLMapping_fmc extends CFMAdminModel {
88
  $password = WDW_FM_Library(self::PLUGIN)->get('password', '');
89
  $database = WDW_FM_Library(self::PLUGIN)->get('database', '');
90
  $host = WDW_FM_Library(self::PLUGIN)->get('host', '');
 
 
 
 
91
  $wpdb_temp = new wpdb($username, $password, $database, $host);
92
  $table_struct = $wpdb_temp->get_results($query);
93
  }
48
  $password = WDW_FM_Library(self::PLUGIN)->get('password', '');
49
  $database = WDW_FM_Library(self::PLUGIN)->get('database', '');
50
  $host = WDW_FM_Library(self::PLUGIN)->get('host', '');
51
+ $port = WDW_FM_Library(self::PLUGIN)->get('port', '');
52
+ if ($port) {
53
+ $host .= ':' . $port;
54
+ }
55
  $wpdb_temp = new wpdb($username, $password, $database, $host);
56
  $query = "SHOW TABLES";
57
  $tables = $wpdb_temp->get_col($query);
92
  $password = WDW_FM_Library(self::PLUGIN)->get('password', '');
93
  $database = WDW_FM_Library(self::PLUGIN)->get('database', '');
94
  $host = WDW_FM_Library(self::PLUGIN)->get('host', '');
95
+ $port = WDW_FM_Library(self::PLUGIN)->get('port', '');
96
+ if ($port) {
97
+ $host .= ':' . $port;
98
+ }
99
  $wpdb_temp = new wpdb($username, $password, $database, $host);
100
  $table_struct = $wpdb_temp->get_results($query);
101
  }
admin/models/Manage_fm.php CHANGED
@@ -3523,39 +3523,10 @@ class FMModelManage_fmc extends CFMAdminModel {
3523
  return $row;
3524
  }
3525
 
3526
- /**
3527
- * Get all display posts.
3528
- *
3529
- * @return $post_types array
3530
- */
3531
- public function get_all_display_posts() {
3532
- $def_post_types = array('everything' => 'All', 'home' => 'Homepage', 'archive' => 'Archives', 'post' => 'Post', 'page' => 'Page');
3533
- $custom_post_types = get_post_types( array(
3534
- 'public' => true,
3535
- '_builtin' => false,
3536
- ) );
3537
-
3538
- if ( !empty($custom_post_types) ) {
3539
- foreach ( WDW_FM_Library(self::PLUGIN)->not_display_posts() as $key ) {
3540
- if ( isset($custom_post_types[$key]) ) {
3541
- unset($custom_post_types[$key]);
3542
- }
3543
- }
3544
- }
3545
- $post_types = array_merge($def_post_types, $custom_post_types);
3546
- return $post_types;
3547
- }
3548
-
3549
  public function fm_posts_query() {
3550
  $default_post_types = array( 'post', 'page' );
3551
- $custom_post_types = get_post_types(array(
3552
- 'public' => TRUE,
3553
- '_builtin' => FALSE,
3554
- ));
3555
- $post_types = array_merge($default_post_types, $custom_post_types);
3556
- $pt_names = array_values($post_types);
3557
  $query = array(
3558
- 'post_type' => $pt_names,
3559
  'suppress_filters' => TRUE,
3560
  'update_post_term_cache' => FALSE,
3561
  'update_post_meta_cache' => FALSE,
@@ -3570,8 +3541,8 @@ class FMModelManage_fmc extends CFMAdminModel {
3570
  $results = array();
3571
  foreach ( $posts as $post ) {
3572
  $post_id = (int) $post->ID;
3573
- $post_type = $post->post_type;
3574
- $post_title = trim(esc_html(strip_tags(get_the_title($post))));
3575
  $results[$post_id] = array(
3576
  'title' => $post_title,
3577
  'post_type' => $post->post_type,
3523
  return $row;
3524
  }
3525
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3526
  public function fm_posts_query() {
3527
  $default_post_types = array( 'post', 'page' );
 
 
 
 
 
 
3528
  $query = array(
3529
+ 'post_type' => $default_post_types,
3530
  'suppress_filters' => TRUE,
3531
  'update_post_term_cache' => FALSE,
3532
  'update_post_meta_cache' => FALSE,
3541
  $results = array();
3542
  foreach ( $posts as $post ) {
3543
  $post_id = (int) $post->ID;
3544
+ $post_type = $post->post_type;
3545
+ $post_title = trim(esc_html(strip_tags(get_the_title($post))));
3546
  $results[$post_id] = array(
3547
  'title' => $post_title,
3548
  'post_type' => $post->post_type,
admin/models/Options_fm.php CHANGED
@@ -15,6 +15,7 @@ class FMModelOptions_fmc extends CFMAdminModel {
15
  $csv_delimiter = (isset($_POST['csv_delimiter']) && $_POST['csv_delimiter'] != '' ? esc_html(stripslashes($_POST['csv_delimiter'])) : ',');
16
  $fm_shortcode = (isset($_POST['fm_shortcode']) ? "old" : '');
17
  $fm_advanced_layout = WDW_FM_Library(self::PLUGIN)->get('fm_advanced_layout', '0');
 
18
  $map_key = WDW_FM_Library(self::PLUGIN)->get('map_key', '');
19
  update_option( $option_key, array(
20
  'public_key' => $public_key,
@@ -23,6 +24,7 @@ class FMModelOptions_fmc extends CFMAdminModel {
23
  'map_key' => $map_key,
24
  'fm_shortcode' => $fm_shortcode,
25
  'fm_advanced_layout' => $fm_advanced_layout,
 
26
  'ajax_export_per_page' => !empty($fm_settings['ajax_export_per_page']) ? $fm_settings['export_per_page'] : 1000
27
  ));
28
  return 8;
15
  $csv_delimiter = (isset($_POST['csv_delimiter']) && $_POST['csv_delimiter'] != '' ? esc_html(stripslashes($_POST['csv_delimiter'])) : ',');
16
  $fm_shortcode = (isset($_POST['fm_shortcode']) ? "old" : '');
17
  $fm_advanced_layout = WDW_FM_Library(self::PLUGIN)->get('fm_advanced_layout', '0');
18
+ $fm_enable_wp_editor = WDW_FM_Library(self::PLUGIN)->get('fm_enable_wp_editor', '1');
19
  $map_key = WDW_FM_Library(self::PLUGIN)->get('map_key', '');
20
  update_option( $option_key, array(
21
  'public_key' => $public_key,
24
  'map_key' => $map_key,
25
  'fm_shortcode' => $fm_shortcode,
26
  'fm_advanced_layout' => $fm_advanced_layout,
27
+ 'fm_enable_wp_editor' => $fm_enable_wp_editor,
28
  'ajax_export_per_page' => !empty($fm_settings['ajax_export_per_page']) ? $fm_settings['export_per_page'] : 1000
29
  ));
30
  return 8;
admin/models/Submissions_fm.php CHANGED
@@ -127,16 +127,16 @@ class FMModelSubmissions_fmc extends CFMAdminModel {
127
  $sorted_label_names_original = array();
128
  $where_labels = array();
129
  $where2 = array();
130
- $order_by = ((isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) != '') ? esc_html(stripslashes($_POST['order_by'])) : 'group_id');
131
- $asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'asc') ? 'asc' : 'desc');
132
 
133
- $lists['hide_label_list'] = ((isset($_POST['hide_label_list'])) ? esc_html(stripslashes($_POST['hide_label_list'])) : '');
134
- $lists['startdate'] = ((isset($_POST['startdate'])) ? esc_html(stripslashes($_POST['startdate'])) : '');
135
- $lists['enddate'] = ((isset($_POST['enddate'])) ? esc_html(stripslashes($_POST['enddate'])) : '');
136
- $lists['ip_search'] = ((isset($_POST['ip_search'])) ? esc_html(stripslashes($_POST['ip_search'])) : '');
137
- $lists['username_search'] = ((isset($_POST['username_search'])) ? esc_html(stripslashes($_POST['username_search'])) : '');
138
- $lists['useremail_search'] = ((isset($_POST['useremail_search'])) ? esc_html(stripslashes($_POST['useremail_search'])) : '');
139
- $lists['id_search'] = ((isset($_POST['id_search'])) ? esc_html(stripslashes($_POST['id_search'])) : '');
 
 
140
  if ( $lists['ip_search'] ) {
141
  $where[] = 'ip LIKE "%' . $lists['ip_search'] . '%"';
142
  }
@@ -202,25 +202,26 @@ class FMModelSubmissions_fmc extends CFMAdminModel {
202
  array_push($sorted_label_names, $label_names[$key]);
203
  array_push($sorted_label_types, $label_types[$key]);
204
  array_push($sorted_label_names_original, $label_names_original[$key]);
205
- if ( isset($_POST[$form_id . '_' . $label_id . '_search']) ) {
206
- $search_temp = esc_html($_POST[$form_id . '_' . $label_id . '_search']);
 
 
207
  }
208
- else {
209
- $search_temp = '';
210
- }
211
- $search_temp = strtolower($search_temp);
 
212
  $lists[$form_id . '_' . $label_id . '_search'] = $search_temp;
213
  if ( $search_temp ) {
214
  $join_query[] = 'search';
215
  $join_where[] = array( 'label' => $label_id, 'search' => $search_temp );
216
  }
 
217
  if ( isset($_POST[$form_id . '_' . $label_id . '_search_verified']) ) {
218
  $search_verified = $_POST[$form_id . '_' . $label_id . '_search_verified'];
219
  $lists[$form_id . '_' . $label_id . '_search_verified'] = $search_verified;
220
  }
221
- else {
222
- $search_verified = '';
223
- }
224
  if ( $search_verified && isset($ver_emails_array[$label_id]) ) {
225
  $join_query[] = 'search';
226
  $join_where[] = NULL;
@@ -305,8 +306,8 @@ class FMModelSubmissions_fmc extends CFMAdminModel {
305
  }
306
  $total = $wpdb->get_var($query);
307
  $query_sub_count = "SELECT count(distinct group_id) from " . $wpdb->prefix . "formmaker_submits";
308
- $sub_count = (int) $wpdb->get_var($query_sub_count);
309
- $query = $join . ' ' . $orderby . ' LIMIT ' . $page_num . ', '. $per_num;
310
  $results = $wpdb->get_results($query);
311
  for ( $i = 0; $i < count($results); $i++ ) {
312
  array_push($rows_ord, $results[$i]->group_id);
@@ -323,7 +324,7 @@ class FMModelSubmissions_fmc extends CFMAdminModel {
323
  $where2[] = "group_id='" . $rows_ordd . "'";
324
  }
325
  $where2 = (count($where2) ? ' WHERE ' . implode(' OR ', $where2) . '' : '');
326
- $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits ' . $where2;
327
  $rows = $wpdb->get_results($query);
328
  $group_ids = $rows_ord;
329
  $lists['total'] = $total;
@@ -882,6 +883,9 @@ class FMModelSubmissions_fmc extends CFMAdminModel {
882
  $host = $temp[0];
883
  $temp = explode('@@@wdfportwdf@@@', $temp[1]);
884
  $port = $temp[0];
 
 
 
885
  $temp = explode('@@@wdfusernamewdf@@@', $temp[1]);
886
  $username = $temp[0];
887
  $temp = explode('@@@wdfpasswordwdf@@@', $temp[1]);
@@ -917,6 +921,9 @@ class FMModelSubmissions_fmc extends CFMAdminModel {
917
  $host = $temp[0];
918
  $temp = explode('@@@wdfportwdf@@@', $temp[1]);
919
  $port = $temp[0];
 
 
 
920
  $temp = explode('@@@wdfusernamewdf@@@', $temp[1]);
921
  $username = $temp[0];
922
  $temp = explode('@@@wdfpasswordwdf@@@', $temp[1]);
127
  $sorted_label_names_original = array();
128
  $where_labels = array();
129
  $where2 = array();
 
 
130
 
131
+ $order_by = WDW_FM_Library(self::PLUGIN)->get('order_by', 'group_id');
132
+ $asc_or_desc = WDW_FM_Library(self::PLUGIN)->get('asc_or_desc', 'desc');
133
+ $lists['hide_label_list'] = WDW_FM_Library(self::PLUGIN)->get('hide_label_list', '');
134
+ $lists['startdate'] = WDW_FM_Library(self::PLUGIN)->get('startdate', '');
135
+ $lists['enddate'] = WDW_FM_Library(self::PLUGIN)->get('enddate', '');
136
+ $lists['ip_search'] = WDW_FM_Library(self::PLUGIN)->get('ip_search', '');
137
+ $lists['username_search'] = WDW_FM_Library(self::PLUGIN)->get('username_search', '');
138
+ $lists['useremail_search'] = WDW_FM_Library(self::PLUGIN)->get('useremail_search', '');
139
+ $lists['id_search'] = WDW_FM_Library(self::PLUGIN)->get('id_search', '');
140
  if ( $lists['ip_search'] ) {
141
  $where[] = 'ip LIKE "%' . $lists['ip_search'] . '%"';
142
  }
202
  array_push($sorted_label_names, $label_names[$key]);
203
  array_push($sorted_label_types, $label_types[$key]);
204
  array_push($sorted_label_names_original, $label_names_original[$key]);
205
+ $search_temp = '';
206
+ $_search_key = $form_id . '_' . $label_id . '_search';
207
+ if ( WDW_FM_Library(self::PLUGIN)->get($_search_key, '') ) {
208
+ $search_temp = WDW_FM_Library(self::PLUGIN)->get($_search_key, '');
209
  }
210
+ $search_temp = urldecode($search_temp);
211
+ /* TODO conflict other DB version
212
+ $search_temp = html_entity_decode($search_temp, ENT_QUOTES);
213
+ */
214
+
215
  $lists[$form_id . '_' . $label_id . '_search'] = $search_temp;
216
  if ( $search_temp ) {
217
  $join_query[] = 'search';
218
  $join_where[] = array( 'label' => $label_id, 'search' => $search_temp );
219
  }
220
+ $search_verified = '';
221
  if ( isset($_POST[$form_id . '_' . $label_id . '_search_verified']) ) {
222
  $search_verified = $_POST[$form_id . '_' . $label_id . '_search_verified'];
223
  $lists[$form_id . '_' . $label_id . '_search_verified'] = $search_verified;
224
  }
 
 
 
225
  if ( $search_verified && isset($ver_emails_array[$label_id]) ) {
226
  $join_query[] = 'search';
227
  $join_where[] = NULL;
306
  }
307
  $total = $wpdb->get_var($query);
308
  $query_sub_count = "SELECT count(distinct group_id) from " . $wpdb->prefix . "formmaker_submits";
309
+ $sub_count = (int) $wpdb->get_var($query_sub_count);
310
+ $query = $join . ' ' . $orderby . ' LIMIT ' . $page_num . ', '. $per_num;
311
  $results = $wpdb->get_results($query);
312
  for ( $i = 0; $i < count($results); $i++ ) {
313
  array_push($rows_ord, $results[$i]->group_id);
324
  $where2[] = "group_id='" . $rows_ordd . "'";
325
  }
326
  $where2 = (count($where2) ? ' WHERE ' . implode(' OR ', $where2) . '' : '');
327
+ $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits ' . $where2;
328
  $rows = $wpdb->get_results($query);
329
  $group_ids = $rows_ord;
330
  $lists['total'] = $total;
883
  $host = $temp[0];
884
  $temp = explode('@@@wdfportwdf@@@', $temp[1]);
885
  $port = $temp[0];
886
+ if ($port) {
887
+ $host .= ':' . $port;
888
+ }
889
  $temp = explode('@@@wdfusernamewdf@@@', $temp[1]);
890
  $username = $temp[0];
891
  $temp = explode('@@@wdfpasswordwdf@@@', $temp[1]);
921
  $host = $temp[0];
922
  $temp = explode('@@@wdfportwdf@@@', $temp[1]);
923
  $port = $temp[0];
924
+ if ($port) {
925
+ $host .= ':' . $port;
926
+ }
927
  $temp = explode('@@@wdfusernamewdf@@@', $temp[1]);
928
  $username = $temp[0];
929
  $temp = explode('@@@wdfpasswordwdf@@@', $temp[1]);
admin/views/FMSqlMapping.php CHANGED
@@ -31,6 +31,9 @@ class FMViewFormMakerSQLMapping_fmc extends FMAdminView_fmc {
31
  $host = $temp[0];
32
  $temp = explode('***wdfportwdf***', $temp[1]);
33
  $port = $temp[0];
 
 
 
34
  $temp = explode('***wdfusernamewdf***', $temp[1]);
35
  $username = $temp[0];
36
  $temp = explode('***wdfpasswordwdf***', $temp[1]);
31
  $host = $temp[0];
32
  $temp = explode('***wdfportwdf***', $temp[1]);
33
  $port = $temp[0];
34
+ if ($port) {
35
+ $host .= ':' . $port;
36
+ }
37
  $temp = explode('***wdfusernamewdf***', $temp[1]);
38
  $username = $temp[0];
39
  $temp = explode('***wdfpasswordwdf***', $temp[1]);
admin/views/Manage_fm.php CHANGED
@@ -189,7 +189,7 @@ class FMViewManage_fmc extends FMAdminView_fmc {
189
  ?>
190
  </td>
191
  <td data-colname="<?php _e('Shortcode', WDFMInstance(self::PLUGIN)->prefix); ?>">
192
- <input type="text" value='<?php echo (WDFMInstance(self::PLUGIN)->is_free == 2 ? '[wd_contact_form id="' . $row_data->id . '"]' : '[Form id="' . $row_data->id . '"]'); ?>' onclick="fm_select_value(this)" size="12" readonly="readonly" class="fm_shortcode" />
193
  </td>
194
  <td data-colname="<?php _e('PHP function', WDFMInstance(self::PLUGIN)->prefix); ?>">
195
  <input type="text" value='<?php echo (WDFMInstance(self::PLUGIN)->is_free == 2 ? '&#60;?php wd_contact_form_maker(' . $row_data->id . ', "' . $row_data->type . '"); ?&#62;' : '&#60;?php wd_form_maker(' . $row_data->id . ', "' . $row_data->type . '"); ?&#62;'); ?>' onclick="fm_select_value(this)" readonly="readonly" class="fm_php_function" />
@@ -338,7 +338,7 @@ class FMViewManage_fmc extends FMAdminView_fmc {
338
  }
339
  }
340
  ?>
341
- <button class="button button-primary button-large" onclick="if (fm_check_required('title', '<?php _e('Form Title', WDFMInstance(self::PLUGIN)->prefix); ?>') || !FormManageSubmitButton()) {return false;}; fm_set_input_value('task', 'apply');">
342
  <?php
343
  if ($row->title) {
344
  _e('Update', WDFMInstance(self::PLUGIN)->prefix);
@@ -417,13 +417,13 @@ class FMViewManage_fmc extends FMAdminView_fmc {
417
  </div>
418
  <div class="fm-row">
419
  <label><?php _e('Description:', WDFMInstance(self::PLUGIN)->prefix); ?></label>
420
- <div id="description_editor" style="display: inline-block; vertical-align: middle;">
421
  <input type="hidden" id="header_description_initial_value" value="<?php echo rawurlencode($row->header_description); ?>" />
422
- <?php if (user_can_richedit()) {
423
  wp_editor($row->header_description, 'header_description', array('teeny' => TRUE, 'textarea_name' => 'header_description', 'media_buttons' => FALSE, 'textarea_rows' => 5));
424
  }
425
  else { ?>
426
- <textarea name="header_description" id="header_description" cols="40" rows="5" style="height: 350px;" class="mce_editable fm-check-change" aria-hidden="true" data-initial-value="<?php echo $row->header_description; ?>"><?php echo $row->header_description; ?></textarea>
427
  <?php
428
  }
429
  ?>
@@ -489,7 +489,7 @@ class FMViewManage_fmc extends FMAdminView_fmc {
489
  </div>
490
 
491
  <div type="type_text" class="wdform_field">
492
- <div class="add-new-button button-primary" onclick="popup_ready(); Enable(); return false;">
493
  <span class="dashicons dashicons-move"></span>
494
  <?php _e('New Field', WDFMInstance(self::PLUGIN)->prefix); ?>
495
  </div>
@@ -678,7 +678,7 @@ class FMViewManage_fmc extends FMAdminView_fmc {
678
  <input type="hidden" id="editing_id" />
679
  <input type="hidden" value="<?php echo WDFMInstance(self::PLUGIN)->plugin_url; ?>" id="form_plugins_url" />
680
  <div id="main_editor" style="position: fixed; display: none; z-index: 140;">
681
- <?php if ( user_can_richedit() ) {
682
  wp_editor('', 'form_maker_editor', array(
683
  'teeny' => TRUE,
684
  'textarea_name' => 'form_maker_editor',
@@ -687,7 +687,7 @@ class FMViewManage_fmc extends FMAdminView_fmc {
687
  ));
688
  }
689
  else { ?>
690
- <textarea name="form_maker_editor" id="form_maker_editor" cols="40" rows="5" style="width: 440px; height: 350px;" class="mce_editable" aria-hidden="true"></textarea>
691
  <?php
692
  }
693
  ?>
@@ -1017,7 +1017,7 @@ class FMViewManage_fmc extends FMAdminView_fmc {
1017
  <div class="wd-box-content">
1018
  <div class="wd-group wd-has-placeholder">
1019
  <label class="wd-label" for="mail"><?php _e('Email to send submissions to', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1020
- <input type="text" id="mail" name="mail" value="<?php echo $row->mail; ?>" />
1021
  <span class="dashicons dashicons-list-view" data-id="mail"></span>
1022
  <p class="description"><?php _e('Specify the email address(es), to which submitted form information will be sent. For multiple email addresses separate with commas.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
1023
  </div>
@@ -1082,7 +1082,7 @@ class FMViewManage_fmc extends FMAdminView_fmc {
1082
  <input style="<?php echo ($fields_count == 1) ? 'display:none;' : ''; ?>" class="wd-radio" type="radio" id="other" name="from_mail" value="other" <?php echo ($is_other) ? 'checked="checked"' : ''; ?> onclick="wdshow('mail_from_other_wrap')" />
1083
  <label style="<?php echo ($fields_count == 1) ? 'display:none;' : ''; ?>" class="wd-label-radio" for="other"><?php _e('Other', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1084
  <p style="display: <?php echo ($is_other) ? 'block;' : 'none;'; ?>" id="mail_from_other_wrap">
1085
- <input type="text" name="mail_from_other" id="mail_from_other" value="<?php echo ($is_other) ? $row->from_mail : ''; ?>" />
1086
  </p>
1087
  <p class="description"><?php _e('Specify the email address from which the administrator will receive the email.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
1088
  </div>
@@ -1116,18 +1116,18 @@ class FMViewManage_fmc extends FMAdminView_fmc {
1116
  <input style="<?php echo ($fields_count == 1) ? 'display: none;' : ''; ?>" class="wd-radio" type="radio" id="other1" name="reply_to" value="other" <?php echo ($is_other) ? 'checked="checked"' : ''; ?> onclick="wdshow('reply_to_other_wrap')" />
1117
  <label style="<?php echo ($fields_count == 1) ? 'display: none;' : ''; ?>" class="wd-label-radio" for="other1"><?php _e('Other', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1118
  <p style="display: <?php echo ($is_other) ? 'block;' : 'none;'; ?>" id="reply_to_other_wrap">
1119
- <input type="text" name="reply_to_other" value="<?php echo ($is_other && $row->reply_to) ? $row->reply_to : ''; ?>" id="reply_to_other" />
1120
  </p>
1121
  <p class="description"><?php _e('Specify an alternative email address, to which the administrator will be able to reply upon receiving the message.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
1122
  </div>
1123
  <div class="wd-group">
1124
  <label class="wd-label" for="mail_cc"><?php _e('CC', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1125
- <input type="text" id="mail_cc" name="mail_cc" value="<?php echo $row->mail_cc ?>" />
1126
  <p class="description"><?php _e('Provide additional email addresses to send the submission or confirmation email to. The receiver will be able to view all other recipients.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
1127
  </div>
1128
  <div class="wd-group">
1129
  <label class="wd-label" for="mail_bcc"><?php _e('BCC', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1130
- <input type="text" id="mail_bcc" name="mail_bcc" value="<?php echo $row->mail_bcc ?>" />
1131
  <p class="description"><?php _e('Write additional email addresses to send the submission or confirmation email to. The receiver will not be able to view other recipients.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
1132
  </div>
1133
  <div class="wd-group">
@@ -1225,7 +1225,7 @@ class FMViewManage_fmc extends FMAdminView_fmc {
1225
  <div class="inside">
1226
  <div class="wd-group">
1227
  <label class="wd-label" for="mail_from_user"><?php _e('Email From', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1228
- <input type="text" id="mail_from_user" name="mail_from_user" value="<?php echo $row->mail_from_user; ?>" />
1229
  <p class="description"><?php _e('Specify the email address from which the submitter will receive the email.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
1230
  </div>
1231
  <div class="wd-group wd-has-placeholder">
@@ -1236,17 +1236,17 @@ class FMViewManage_fmc extends FMAdminView_fmc {
1236
  </div>
1237
  <div class="wd-group">
1238
  <label class="wd-label" for="reply_to_user"><?php _e('Reply to (if different from "Email From")', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1239
- <input type="text" name="reply_to_user" value="<?php echo $row->reply_to_user; ?>" id="reply_to_user" />
1240
  <p class="description"><?php _e('Specify an alternative email address, to which the submitter will be able to reply upon receiving the message.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
1241
  </div>
1242
  <div class="wd-group">
1243
  <label class="wd-label" for="mail_cc_user"><?php _e('CC', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1244
- <input type="text" name="mail_cc_user" value="<?php echo $row->mail_cc_user ?>" id="mail_cc_user" />
1245
  <p class="description"><?php _e('Provide additional email addresses to send the submission or confirmation email to. The receiver will be able to view all other recipients.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
1246
  </div>
1247
  <div class="wd-group">
1248
  <label class="wd-label" for="mail_bcc_user"><?php _e('BCC', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1249
- <input type="text" name="mail_bcc_user" value="<?php echo $row->mail_bcc_user ?>" id="mail_bcc_user" />
1250
  <p class="description"><?php _e('Write additional email addresses to send the submission or confirmation email to. The receiver will not be able to view other recipients.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
1251
  </div>
1252
  <div class="wd-group">
@@ -1295,85 +1295,85 @@ class FMViewManage_fmc extends FMAdminView_fmc {
1295
  <div class="wd-table-col-70">
1296
  <div class="wd-box-section">
1297
  <div class="wd-box-content">
1298
- <span class="wd-group">
1299
- <label class="wd-label"><?php _e('Action type', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1300
- <input type="radio" name="submit_text_type" id="text_type_none" onclick="set_type('none')" value="1" <?php echo ($row->submit_text_type != 2 && $row->submit_text_type != 3 && $row->submit_text_type != 4 && $row->submit_text_type != 5) ? "checked" : ""; ?> />
1301
- <label for="text_type_none"><?php _e('Stay on Form', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1302
- <br>
1303
- <input type="radio" name="submit_text_type" id="text_type_post" onclick="set_type('post')" value="2" <?php echo ($row->submit_text_type == 2) ? "checked" : ""; ?> />
1304
- <label for="text_type_post"><?php _e('Post', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1305
- <br>
1306
- <input type="radio" name="submit_text_type" id="text_type_page" onclick="set_type('page')" value="5" <?php echo ($row->submit_text_type == 5) ? "checked" : ""; ?> />
1307
- <label for="text_type_page"><?php _e('Page', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1308
- <br>
1309
- <input type="radio" name="submit_text_type" id="text_type_custom_text" onclick="set_type('custom_text')" value="3" <?php echo ($row->submit_text_type == 3) ? "checked" : ""; ?> />
1310
- <label for="text_type_custom_text"><?php _e('Custom Text', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1311
- <br>
1312
- <input type="radio" name="submit_text_type" id="text_type_url" onclick="set_type('url')" value="4" <?php echo ($row->submit_text_type == 4) ? "checked" : ""; ?> />
1313
- <label for="text_type_url"><?php _e('URL', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1314
- </span>
1315
- <span class="wd-group">
1316
- <div id="post" <?php echo(($row->submit_text_type != 2) ? 'style="display:none"' : ''); ?>>
1317
- <label class="wd-label"><?php _e('Post', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1318
- <select id="post_name" name="post_name">
1319
- <option value="0">- Select Post -</option>
1320
- <?php
1321
- $args = array( 'posts_per_page' => 10000 );
1322
- query_posts($args);
1323
- while ( have_posts() ) : the_post();
1324
- ?>
1325
- <option value="<?php $x = get_permalink(get_the_ID());
1326
- echo $x; ?>" <?php echo(($row->article_id == $x) ? 'selected="selected"' : ''); ?>><?php the_title(); ?></option>
1327
- <?php
1328
- endwhile;
1329
- wp_reset_query();
1330
- ?>
1331
- </select>
1332
- </div>
1333
- <div id="page" <?php echo(($row->submit_text_type != 5) ? 'style="display:none"' : ''); ?>>
1334
- <label class="wd-label"><?php _e('Page', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1335
- <select id="page_name" name="page_name">
1336
- <option value="0">- Select Page -</option>
1337
- <?php
1338
- $pages = get_pages();
1339
- foreach ( $pages as $page ) {
1340
- $page_id = get_page_link($page->ID);
1341
- ?>
1342
- <option value="<?php echo $page_id; ?>" <?php echo(($row->article_id == $page_id) ? 'selected="selected"' : ''); ?>><?php echo $page->post_title; ?></option>
1343
- <?php
1344
- }
1345
- wp_reset_query();
1346
- ?>
1347
- </select>
1348
- </div>
1349
- <div id="custom_text" <?php echo(($row->submit_text_type != 3) ? 'style="display: none;"' : ''); ?>>
1350
- <label class="wd-label"><?php _e('Text', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1351
- <div class="wd-editor-placeholder">
1352
- <span class="dashicons dashicons-list-view" data-id="submit_text"></span>
1353
- </div>
1354
- <?php
1355
- if ( user_can_richedit() ) {
1356
- wp_editor($row->submit_text, 'submit_text', array(
1357
- 'teeny' => TRUE,
1358
- 'textarea_name' => 'submit_text',
1359
- 'media_buttons' => FALSE,
1360
- 'textarea_rows' => 5
1361
- ));
1362
- }
1363
- else {
1364
- ?>
1365
- <textarea cols="36" rows="5" id="submit_text" name="submit_text" style="resize: vertical; width:100%">
1366
- <?php echo $row->submit_text; ?>
1367
- </textarea>
1368
- <?php
1369
- }
1370
- ?>
1371
- </div>
1372
- <div id="url" <?php echo(($row->submit_text_type != 4) ? 'style="display:none"' : ''); ?>>
1373
- <label class="wd-label"><?php _e('URL', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1374
- <input type="text" id="url" name="url" value="<?php echo $row->url; ?>" />
1375
- </div>
1376
- </span>
1377
  </div>
1378
  </div>
1379
  </div>
@@ -1442,7 +1442,7 @@ class FMViewManage_fmc extends FMAdminView_fmc {
1442
  </div>
1443
  <div class="wd-group <?php if(WDFMInstance(self::PLUGIN)->is_free) { echo 'fm-free-option'; } ?>">
1444
  <label class="wd-label" for="paypal_email"><?php _e('Paypal email', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1445
- <input type="text" name="paypal_email" id="paypal_email" value="<?php echo $row->paypal_email; ?>" class="text_area" <?php disabled(WDFMInstance(self::PLUGIN)->is_free, true) ?> />
1446
  <p class="description"><?php _e('Provide the email address of a valid PayPal account. It will receive the payments made through your form.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
1447
  </div>
1448
  </div>
@@ -1477,9 +1477,9 @@ class FMViewManage_fmc extends FMAdminView_fmc {
1477
  <div class="wd-table-col-100">
1478
  <div class="wd-box-section">
1479
  <div class="wd-box-content">
1480
- <span class="wd-group">
1481
- <textarea cols="60" rows="30" name="javascript" id="form_javascript"><?php echo $row->javascript; ?></textarea>
1482
- </span>
1483
  </div>
1484
  </div>
1485
  </div>
@@ -2137,7 +2137,7 @@ class FMViewManage_fmc extends FMAdminView_fmc {
2137
  $row = $params['row'];
2138
  $page_title = $params['page_title'];
2139
  $posts_and_pages = $params['posts_and_pages'];
2140
- $all_display_posts = $params['all_display_posts'];
2141
  $animation_effects = $params['animation_effects'];
2142
  $back_url = $params['back_url'];
2143
 
@@ -2348,7 +2348,7 @@ class FMViewManage_fmc extends FMAdminView_fmc {
2348
  $selected_types = explode(',', $row->display_on);
2349
  $show_cats = in_array('post', $selected_types);
2350
  $m = 0;
2351
- foreach($all_display_posts as $post_key => $post_type){
2352
  $checked = in_array('everything', $selected_types) || in_array($post_key, $selected_types) ? 'checked="checked"' : '';
2353
  $postclass = $post_key != 'page' && in_array($post_key, array_keys($def_post_types)) ? 'class="catpost"' : '';
2354
  echo '<li><input id="pt' . $m . '" type="checkbox" name="display_on[]" value="' . $post_key . '" ' . $checked . ' ' . $postclass . '/><label for="pt'.$m.'">'.$post_type.'</label></li>';
@@ -2363,14 +2363,21 @@ class FMViewManage_fmc extends FMAdminView_fmc {
2363
  $categories = $params['categories'];
2364
  $selected_categories = $params['selected_categories'];
2365
  $current_categories_array = $params['current_categories_array'];
 
2366
  $m = 0;
2367
- foreach($categories as $cat_key => $category){
2368
- $checked = ((!$row->current_categories && !$row->display_on_categories) || in_array($cat_key, $selected_categories) || (in_array('auto_check_new', $selected_categories) && !in_array($cat_key, $current_categories_array))) ? 'checked="checked"' : '';
2369
- echo '<li><input id="cat'.$m.'" type="checkbox" name="display_on_categories[]" value="'.$cat_key.'" '.$checked.'/><label for="cat'.$m.'">'.$category.'</label></li>';
 
 
 
2370
  $m++;
 
 
 
 
 
2371
  }
2372
- $auto_check = (!$row->current_categories && !$row->display_on_categories) || in_array('auto_check_new', $selected_categories) ? 'checked="checked"' : '';
2373
- echo '<li><br/><input id="cat'.$m.'" type="checkbox" name="display_on_categories[]" value="auto_check_new" '.$auto_check.'/><label for="cat'.$m.'">Automatically check new categories</label></li>';
2374
  $current_categories = !$row->current_categories && !$row->display_on_categories ? implode(',', array_keys($categories)) : $row->current_categories;
2375
  ?>
2376
  </ul>
@@ -2379,20 +2386,19 @@ class FMViewManage_fmc extends FMAdminView_fmc {
2379
  <span class="wd-group fm-popover fm-topbar fm-scrollbox fm-posts-show <?php echo (in_array('everything', $selected_types) || in_array('post', $selected_types)) && $row->type != 'embedded' ? 'fm-show' : 'fm-hide' ?>">
2380
  <label class="wd-label"><?php _e('Display on these posts', WDFMInstance(self::PLUGIN)->prefix); ?></label>
2381
  <div class="fm-mini-heading">
2382
- <?php _e('Click on input area to view the list of posts.', WDFMInstance(self::PLUGIN)->prefix); ?>
2383
- <?php _e('If left empty the form will appear on all posts.', WDFMInstance(self::PLUGIN)->prefix); ?>
2384
  </div>
2385
- <p><?php _e('Posts defined below will override all settings above.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
2386
  <ul class="fm-pp">
2387
  <li class="pp_selected">
2388
  <?php
2389
- if($row->posts_include){
2390
  $posts_include = explode(',', $row->posts_include);
2391
  foreach($posts_include as $post_exclude){
2392
  if(isset($posts_and_pages[$post_exclude])){
2393
  $ptitle = $posts_and_pages[$post_exclude]['title'];
2394
  $ptype = $posts_and_pages[$post_exclude]['post_type'];
2395
- echo '<span data-post_id="'.$post_exclude.'">['.$ptype.'] - '.$ptitle.'<span class="pp_selected_remove">x</span></span>';
2396
  }
2397
  }
2398
  } ?></li>
@@ -2402,19 +2408,16 @@ class FMViewManage_fmc extends FMAdminView_fmc {
2402
  <span class="fm-loading"></span>
2403
  </li>
2404
  <li class="pp_live_search fm-hide">
2405
- <ul class="pp_search_results">
2406
-
2407
- </ul>
2408
  </li>
2409
  </ul>
2410
  </span>
2411
  <span class="wd-group fm-popover fm-topbar fm-scrollbox fm-pages-show <?php echo (in_array('everything', $selected_types) || in_array('page', $selected_types)) && $row->type != 'embedded' ? 'fm-show' : 'fm-hide' ?>">
2412
  <label class="wd-label"><?php _e('Display on these pages', WDFMInstance(self::PLUGIN)->prefix); ?></label>
2413
  <div class="fm-mini-heading">
2414
- <?php _e('Click on input area to view the list of pages. ', WDFMInstance(self::PLUGIN)->prefix); ?>
2415
- <?php _e('If left empty the form will appear on all pages.', WDFMInstance(self::PLUGIN)->prefix); ?>
2416
  </div>
2417
- <p><?php _e('Pages defined below will override all settings above.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
2418
  <ul class="fm-pp">
2419
  <li class="pp_selected"><?php if($row->pages_include){
2420
  $pages_include = explode(',', $row->pages_include);
@@ -2432,8 +2435,7 @@ class FMViewManage_fmc extends FMAdminView_fmc {
2432
  <span class="fm-loading"></span>
2433
  </li>
2434
  <li class="pp_live_search fm-hide">
2435
- <ul class="pp_search_results">
2436
- </ul>
2437
  </li>
2438
  </ul>
2439
  </span>
189
  ?>
190
  </td>
191
  <td data-colname="<?php _e('Shortcode', WDFMInstance(self::PLUGIN)->prefix); ?>">
192
+ <input type="text" value='<?php echo (WDFMInstance(self::PLUGIN)->is_free == 2 ? '[wd_contact_form id="' . $row_data->id . '"]' : '[Form id="' . $row_data->id . '"]'); ?>' onclick="fm_select_value(this)" size="12" readonly="readonly" class="fm_shortcode" />
193
  </td>
194
  <td data-colname="<?php _e('PHP function', WDFMInstance(self::PLUGIN)->prefix); ?>">
195
  <input type="text" value='<?php echo (WDFMInstance(self::PLUGIN)->is_free == 2 ? '&#60;?php wd_contact_form_maker(' . $row_data->id . ', "' . $row_data->type . '"); ?&#62;' : '&#60;?php wd_form_maker(' . $row_data->id . ', "' . $row_data->type . '"); ?&#62;'); ?>' onclick="fm_select_value(this)" readonly="readonly" class="fm_php_function" />
338
  }
339
  }
340
  ?>
341
+ <button class="button button-primary button-large" onclick="if (fm_check_required('title', '<?php _e('Form Title', WDFMInstance(self::PLUGIN)->prefix); ?>') || (jQuery('#form_id_tempform_view_img'+form_view_max).length <= 0) || !FormManageSubmitButton()) {return false;}; fm_set_input_value('task', 'apply');">
342
  <?php
343
  if ($row->title) {
344
  _e('Update', WDFMInstance(self::PLUGIN)->prefix);
417
  </div>
418
  <div class="fm-row">
419
  <label><?php _e('Description:', WDFMInstance(self::PLUGIN)->prefix); ?></label>
420
+ <div id="description_editor">
421
  <input type="hidden" id="header_description_initial_value" value="<?php echo rawurlencode($row->header_description); ?>" />
422
+ <?php if (user_can_richedit() && $params['fm_enable_wp_editor']) {
423
  wp_editor($row->header_description, 'header_description', array('teeny' => TRUE, 'textarea_name' => 'header_description', 'media_buttons' => FALSE, 'textarea_rows' => 5));
424
  }
425
  else { ?>
426
+ <textarea name="header_description" id="header_description" class="mce_editable fm-check-change" aria-hidden="true" data-initial-value="<?php echo $row->header_description; ?>"><?php echo $row->header_description; ?></textarea>
427
  <?php
428
  }
429
  ?>
489
  </div>
490
 
491
  <div type="type_text" class="wdform_field">
492
+ <div class="add-new-button button-primary" onclick="popup_ready(); Enable(); return false;">
493
  <span class="dashicons dashicons-move"></span>
494
  <?php _e('New Field', WDFMInstance(self::PLUGIN)->prefix); ?>
495
  </div>
678
  <input type="hidden" id="editing_id" />
679
  <input type="hidden" value="<?php echo WDFMInstance(self::PLUGIN)->plugin_url; ?>" id="form_plugins_url" />
680
  <div id="main_editor" style="position: fixed; display: none; z-index: 140;">
681
+ <?php if ( user_can_richedit() && $params['fm_enable_wp_editor']) {
682
  wp_editor('', 'form_maker_editor', array(
683
  'teeny' => TRUE,
684
  'textarea_name' => 'form_maker_editor',
687
  ));
688
  }
689
  else { ?>
690
+ <textarea name="form_maker_editor" id="form_maker_editor" class="mce_editable" aria-hidden="true"></textarea>
691
  <?php
692
  }
693
  ?>
1017
  <div class="wd-box-content">
1018
  <div class="wd-group wd-has-placeholder">
1019
  <label class="wd-label" for="mail"><?php _e('Email to send submissions to', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1020
+ <input class="fm-validate" data-type="email" data-callback="fm_validate_email" data-callback-parameter="" data-tab-id="emailTab" data-content-id="emailTab_fieldset" type="text" id="mail" name="mail" value="<?php echo $row->mail; ?>" />
1021
  <span class="dashicons dashicons-list-view" data-id="mail"></span>
1022
  <p class="description"><?php _e('Specify the email address(es), to which submitted form information will be sent. For multiple email addresses separate with commas.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
1023
  </div>
1082
  <input style="<?php echo ($fields_count == 1) ? 'display:none;' : ''; ?>" class="wd-radio" type="radio" id="other" name="from_mail" value="other" <?php echo ($is_other) ? 'checked="checked"' : ''; ?> onclick="wdshow('mail_from_other_wrap')" />
1083
  <label style="<?php echo ($fields_count == 1) ? 'display:none;' : ''; ?>" class="wd-label-radio" for="other"><?php _e('Other', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1084
  <p style="display: <?php echo ($is_other) ? 'block;' : 'none;'; ?>" id="mail_from_other_wrap">
1085
+ <input class="fm-validate" data-type="email" data-callback="fm_validate_email" data-callback-parameter="" data-tab-id="emailTab" data-content-id="emailTab_fieldset" type="text" name="mail_from_other" id="mail_from_other" value="<?php echo ($is_other) ? $row->from_mail : ''; ?>" />
1086
  </p>
1087
  <p class="description"><?php _e('Specify the email address from which the administrator will receive the email.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
1088
  </div>
1116
  <input style="<?php echo ($fields_count == 1) ? 'display: none;' : ''; ?>" class="wd-radio" type="radio" id="other1" name="reply_to" value="other" <?php echo ($is_other) ? 'checked="checked"' : ''; ?> onclick="wdshow('reply_to_other_wrap')" />
1117
  <label style="<?php echo ($fields_count == 1) ? 'display: none;' : ''; ?>" class="wd-label-radio" for="other1"><?php _e('Other', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1118
  <p style="display: <?php echo ($is_other) ? 'block;' : 'none;'; ?>" id="reply_to_other_wrap">
1119
+ <input class="fm-validate" data-type="email" data-callback="fm_validate_email" data-callback-parameter="" data-tab-id="emailTab" data-content-id="emailTab_fieldset" type="text" name="reply_to_other" value="<?php echo ($is_other && $row->reply_to) ? $row->reply_to : ''; ?>" id="reply_to_other" />
1120
  </p>
1121
  <p class="description"><?php _e('Specify an alternative email address, to which the administrator will be able to reply upon receiving the message.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
1122
  </div>
1123
  <div class="wd-group">
1124
  <label class="wd-label" for="mail_cc"><?php _e('CC', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1125
+ <input class="fm-validate" data-type="email" data-callback="fm_validate_email" data-callback-parameter="" data-tab-id="emailTab" data-content-id="emailTab_fieldset" type="text" id="mail_cc" name="mail_cc" value="<?php echo $row->mail_cc ?>" />
1126
  <p class="description"><?php _e('Provide additional email addresses to send the submission or confirmation email to. The receiver will be able to view all other recipients.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
1127
  </div>
1128
  <div class="wd-group">
1129
  <label class="wd-label" for="mail_bcc"><?php _e('BCC', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1130
+ <input class="fm-validate" data-type="email" data-callback="fm_validate_email" data-callback-parameter="" data-tab-id="emailTab" data-content-id="emailTab_fieldset" type="text" id="mail_bcc" name="mail_bcc" value="<?php echo $row->mail_bcc ?>" />
1131
  <p class="description"><?php _e('Write additional email addresses to send the submission or confirmation email to. The receiver will not be able to view other recipients.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
1132
  </div>
1133
  <div class="wd-group">
1225
  <div class="inside">
1226
  <div class="wd-group">
1227
  <label class="wd-label" for="mail_from_user"><?php _e('Email From', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1228
+ <input class="fm-validate" data-type="email" data-callback="fm_validate_email" data-callback-parameter="" data-tab-id="emailTab" data-content-id="emailTab_fieldset" type="text" id="mail_from_user" name="mail_from_user" value="<?php echo $row->mail_from_user; ?>" />
1229
  <p class="description"><?php _e('Specify the email address from which the submitter will receive the email.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
1230
  </div>
1231
  <div class="wd-group wd-has-placeholder">
1236
  </div>
1237
  <div class="wd-group">
1238
  <label class="wd-label" for="reply_to_user"><?php _e('Reply to (if different from "Email From")', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1239
+ <input class="fm-validate" data-type="email" data-callback="fm_validate_email" data-callback-parameter="" data-tab-id="emailTab" data-content-id="emailTab_fieldset" type="text" name="reply_to_user" value="<?php echo $row->reply_to_user; ?>" id="reply_to_user" />
1240
  <p class="description"><?php _e('Specify an alternative email address, to which the submitter will be able to reply upon receiving the message.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
1241
  </div>
1242
  <div class="wd-group">
1243
  <label class="wd-label" for="mail_cc_user"><?php _e('CC', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1244
+ <input class="fm-validate" data-type="email" data-callback="fm_validate_email" data-callback-parameter="" data-tab-id="emailTab" data-content-id="emailTab_fieldset" type="text" name="mail_cc_user" value="<?php echo $row->mail_cc_user ?>" id="mail_cc_user" />
1245
  <p class="description"><?php _e('Provide additional email addresses to send the submission or confirmation email to. The receiver will be able to view all other recipients.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
1246
  </div>
1247
  <div class="wd-group">
1248
  <label class="wd-label" for="mail_bcc_user"><?php _e('BCC', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1249
+ <input class="fm-validate" data-type="email" data-callback="fm_validate_email" data-callback-parameter="" data-tab-id="emailTab" data-content-id="emailTab_fieldset" type="text" name="mail_bcc_user" value="<?php echo $row->mail_bcc_user ?>" id="mail_bcc_user" />
1250
  <p class="description"><?php _e('Write additional email addresses to send the submission or confirmation email to. The receiver will not be able to view other recipients.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
1251
  </div>
1252
  <div class="wd-group">
1295
  <div class="wd-table-col-70">
1296
  <div class="wd-box-section">
1297
  <div class="wd-box-content">
1298
+ <span class="wd-group">
1299
+ <label class="wd-label"><?php _e('Action type', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1300
+ <input type="radio" name="submit_text_type" id="text_type_none" onclick="set_type('none')" value="1" <?php echo ($row->submit_text_type != 2 && $row->submit_text_type != 3 && $row->submit_text_type != 4 && $row->submit_text_type != 5) ? "checked" : ""; ?> />
1301
+ <label for="text_type_none"><?php _e('Stay on Form', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1302
+ <br>
1303
+ <input type="radio" name="submit_text_type" id="text_type_post" onclick="set_type('post')" value="2" <?php echo ($row->submit_text_type == 2) ? "checked" : ""; ?> />
1304
+ <label for="text_type_post"><?php _e('Post', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1305
+ <br>
1306
+ <input type="radio" name="submit_text_type" id="text_type_page" onclick="set_type('page')" value="5" <?php echo ($row->submit_text_type == 5) ? "checked" : ""; ?> />
1307
+ <label for="text_type_page"><?php _e('Page', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1308
+ <br>
1309
+ <input type="radio" name="submit_text_type" id="text_type_custom_text" onclick="set_type('custom_text')" value="3" <?php echo ($row->submit_text_type == 3) ? "checked" : ""; ?> />
1310
+ <label for="text_type_custom_text"><?php _e('Custom Text', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1311
+ <br>
1312
+ <input type="radio" name="submit_text_type" id="text_type_url" onclick="set_type('url')" value="4" <?php echo ($row->submit_text_type == 4) ? "checked" : ""; ?> />
1313
+ <label for="text_type_url"><?php _e('URL', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1314
+ </span>
1315
+ <span class="wd-group">
1316
+ <div id="post" <?php echo(($row->submit_text_type != 2) ? 'style="display:none"' : ''); ?>>
1317
+ <label class="wd-label"><?php _e('Post', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1318
+ <select id="post_name" name="post_name">
1319
+ <option value="0">- Select Post -</option>
1320
+ <?php
1321
+ $args = array( 'posts_per_page' => 10000 );
1322
+ query_posts($args);
1323
+ while ( have_posts() ) : the_post();
1324
+ ?>
1325
+ <option value="<?php $x = get_permalink(get_the_ID());
1326
+ echo $x; ?>" <?php echo(($row->article_id == $x) ? 'selected="selected"' : ''); ?>><?php the_title(); ?></option>
1327
+ <?php
1328
+ endwhile;
1329
+ wp_reset_query();
1330
+ ?>
1331
+ </select>
1332
+ </div>
1333
+ <div id="page" <?php echo(($row->submit_text_type != 5) ? 'style="display:none"' : ''); ?>>
1334
+ <label class="wd-label"><?php _e('Page', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1335
+ <select id="page_name" name="page_name">
1336
+ <option value="0">- Select Page -</option>
1337
+ <?php
1338
+ $pages = get_pages();
1339
+ foreach ( $pages as $page ) {
1340
+ $page_id = get_page_link($page->ID);
1341
+ ?>
1342
+ <option value="<?php echo $page_id; ?>" <?php echo(($row->article_id == $page_id) ? 'selected="selected"' : ''); ?>><?php echo $page->post_title; ?></option>
1343
+ <?php
1344
+ }
1345
+ wp_reset_query();
1346
+ ?>
1347
+ </select>
1348
+ </div>
1349
+ <div id="custom_text" <?php echo(($row->submit_text_type != 3) ? 'style="display: none;"' : ''); ?>>
1350
+ <label class="wd-label"><?php _e('Text', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1351
+ <div class="wd-editor-placeholder">
1352
+ <span class="dashicons dashicons-list-view" data-id="submit_text"></span>
1353
+ </div>
1354
+ <?php
1355
+ if ( user_can_richedit() ) {
1356
+ wp_editor($row->submit_text, 'submit_text', array(
1357
+ 'teeny' => TRUE,
1358
+ 'textarea_name' => 'submit_text',
1359
+ 'media_buttons' => FALSE,
1360
+ 'textarea_rows' => 5
1361
+ ));
1362
+ }
1363
+ else {
1364
+ ?>
1365
+ <textarea cols="36" rows="5" id="submit_text" name="submit_text" style="resize: vertical; width:100%">
1366
+ <?php echo $row->submit_text; ?>
1367
+ </textarea>
1368
+ <?php
1369
+ }
1370
+ ?>
1371
+ </div>
1372
+ <div id="url" <?php echo(($row->submit_text_type != 4) ? 'style="display:none"' : ''); ?>>
1373
+ <label class="wd-label"><?php _e('URL', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1374
+ <input type="text" id="url" name="url" value="<?php echo $row->url; ?>" />
1375
+ </div>
1376
+ </span>
1377
  </div>
1378
  </div>
1379
  </div>
1442
  </div>
1443
  <div class="wd-group <?php if(WDFMInstance(self::PLUGIN)->is_free) { echo 'fm-free-option'; } ?>">
1444
  <label class="wd-label" for="paypal_email"><?php _e('Paypal email', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1445
+ <input class="fm-validate" data-type="email" data-callback="fm_validate_email" data-callback-parameter="#paypal_mode1" data-tab-id="payment" data-content-id="payment_fieldset" type="text" name="paypal_email" id="paypal_email" value="<?php echo $row->paypal_email; ?>" class="text_area" <?php disabled(WDFMInstance(self::PLUGIN)->is_free, true) ?> />
1446
  <p class="description"><?php _e('Provide the email address of a valid PayPal account. It will receive the payments made through your form.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
1447
  </div>
1448
  </div>
1477
  <div class="wd-table-col-100">
1478
  <div class="wd-box-section">
1479
  <div class="wd-box-content">
1480
+ <span class="wd-group">
1481
+ <textarea cols="60" rows="30" name="javascript" id="form_javascript"><?php echo $row->javascript; ?></textarea>
1482
+ </span>
1483
  </div>
1484
  </div>
1485
  </div>
2137
  $row = $params['row'];
2138
  $page_title = $params['page_title'];
2139
  $posts_and_pages = $params['posts_and_pages'];
2140
+ $display_on_list = $params['display_on_list'];
2141
  $animation_effects = $params['animation_effects'];
2142
  $back_url = $params['back_url'];
2143
 
2348
  $selected_types = explode(',', $row->display_on);
2349
  $show_cats = in_array('post', $selected_types);
2350
  $m = 0;
2351
+ foreach ( $display_on_list as $post_key => $post_type ) {
2352
  $checked = in_array('everything', $selected_types) || in_array($post_key, $selected_types) ? 'checked="checked"' : '';
2353
  $postclass = $post_key != 'page' && in_array($post_key, array_keys($def_post_types)) ? 'class="catpost"' : '';
2354
  echo '<li><input id="pt' . $m . '" type="checkbox" name="display_on[]" value="' . $post_key . '" ' . $checked . ' ' . $postclass . '/><label for="pt'.$m.'">'.$post_type.'</label></li>';
2363
  $categories = $params['categories'];
2364
  $selected_categories = $params['selected_categories'];
2365
  $current_categories_array = $params['current_categories_array'];
2366
+ $auto_check = ( in_array('select_all_categories', $selected_categories) && count($categories) == count($selected_categories) - 1 ) ? 'checked="checked"' : '';
2367
  $m = 0;
2368
+ echo '<li>
2369
+ <br/>
2370
+ <input id="cat'.$m.'" class="fm-display-all-categories" data-categories-count="' . count($categories) . '" type="checkbox" name="display_on_categories[]" value="select_all_categories" '. $auto_check .' />
2371
+ <label for="cat'.$m.'">' . __('All categories', WDFMInstance(self::PLUGIN)->prefix) .' </label>
2372
+ </li>';
2373
+ foreach ( $categories as $cat_key => $category ) {
2374
  $m++;
2375
+ $checked = ( in_array($cat_key, $selected_categories) ) ? 'checked="checked"' : '';
2376
+ echo '<li>
2377
+ <input id="cat'.$m.'" type="checkbox" name="display_on_categories[]" value="'.$cat_key.'" '.$checked.'/>
2378
+ <label for="cat'.$m.'">'.$category.'</label>
2379
+ </li>';
2380
  }
 
 
2381
  $current_categories = !$row->current_categories && !$row->display_on_categories ? implode(',', array_keys($categories)) : $row->current_categories;
2382
  ?>
2383
  </ul>
2386
  <span class="wd-group fm-popover fm-topbar fm-scrollbox fm-posts-show <?php echo (in_array('everything', $selected_types) || in_array('post', $selected_types)) && $row->type != 'embedded' ? 'fm-show' : 'fm-hide' ?>">
2387
  <label class="wd-label"><?php _e('Display on these posts', WDFMInstance(self::PLUGIN)->prefix); ?></label>
2388
  <div class="fm-mini-heading">
2389
+ <?php _e('Click on input area to view the list of posts.', WDFMInstance(self::PLUGIN)->prefix); ?>
2390
+ <?php _e('If left empty the form will appear on all posts.', WDFMInstance(self::PLUGIN)->prefix); ?>
2391
  </div>
 
2392
  <ul class="fm-pp">
2393
  <li class="pp_selected">
2394
  <?php
2395
+ if ( $row->posts_include ) {
2396
  $posts_include = explode(',', $row->posts_include);
2397
  foreach($posts_include as $post_exclude){
2398
  if(isset($posts_and_pages[$post_exclude])){
2399
  $ptitle = $posts_and_pages[$post_exclude]['title'];
2400
  $ptype = $posts_and_pages[$post_exclude]['post_type'];
2401
+ echo '<span data-post_id="'.$post_exclude.'">['. $ptype .'] - '. $ptitle .'<span class="pp_selected_remove">x</span></span>';
2402
  }
2403
  }
2404
  } ?></li>
2408
  <span class="fm-loading"></span>
2409
  </li>
2410
  <li class="pp_live_search fm-hide">
2411
+ <ul class="pp_search_results"></ul>
 
 
2412
  </li>
2413
  </ul>
2414
  </span>
2415
  <span class="wd-group fm-popover fm-topbar fm-scrollbox fm-pages-show <?php echo (in_array('everything', $selected_types) || in_array('page', $selected_types)) && $row->type != 'embedded' ? 'fm-show' : 'fm-hide' ?>">
2416
  <label class="wd-label"><?php _e('Display on these pages', WDFMInstance(self::PLUGIN)->prefix); ?></label>
2417
  <div class="fm-mini-heading">
2418
+ <?php _e('Click on input area to view the list of pages. ', WDFMInstance(self::PLUGIN)->prefix); ?>
2419
+ <?php _e('If left empty the form will appear on all pages.', WDFMInstance(self::PLUGIN)->prefix); ?>
2420
  </div>
 
2421
  <ul class="fm-pp">
2422
  <li class="pp_selected"><?php if($row->pages_include){
2423
  $pages_include = explode(',', $row->pages_include);
2435
  <span class="fm-loading"></span>
2436
  </li>
2437
  <li class="pp_live_search fm-hide">
2438
+ <ul class="pp_search_results"></ul>
 
2439
  </li>
2440
  </ul>
2441
  </span>
admin/views/Options_fm.php CHANGED
@@ -55,6 +55,7 @@ class FMViewOptions_fmc extends FMAdminView_fmc {
55
  $private_key = isset($fm_settings['private_key']) ? $fm_settings['private_key'] : '';
56
  $csv_delimiter = isset($fm_settings['csv_delimiter']) ? $fm_settings['csv_delimiter'] : ',';
57
  $fm_advanced_layout = isset($fm_settings['fm_advanced_layout']) && $fm_settings['fm_advanced_layout'] == '1' ? '1' : '0';
 
58
  $map_key = isset($fm_settings['map_key']) ? $fm_settings['map_key'] : '';
59
  $uninstall_href = add_query_arg( array( 'page' => 'uninstall' . WDFMInstance(self::PLUGIN)->menu_postfix), admin_url('admin.php') );
60
  ?>
@@ -117,6 +118,15 @@ class FMViewOptions_fmc extends FMAdminView_fmc {
117
  <label class="wd-label-radio" for="fm_advanced_layout-0"><?php _e('No', WDFMInstance(self::PLUGIN)->prefix); ?></label>
118
  <p class="description"><?php _e('If you wish to build your form with HTML, instead of using Form Maker’s user-friendly interface, you can enable Advanced Layout. It can be accessed from the form editor.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
119
  </span>
 
 
 
 
 
 
 
 
 
120
  <span class="wd-group">
121
  <label class="wd-label"><?php echo sprintf(__('Uninstall %s', WDFMInstance(self::PLUGIN)->prefix), WDFMInstance(self::PLUGIN)->nicename); ?></label>
122
  <a class="button" href="<?php echo $uninstall_href ?>"><?php _e('Uninstall', WDFMInstance(self::PLUGIN)->prefix); ?></a>
55
  $private_key = isset($fm_settings['private_key']) ? $fm_settings['private_key'] : '';
56
  $csv_delimiter = isset($fm_settings['csv_delimiter']) ? $fm_settings['csv_delimiter'] : ',';
57
  $fm_advanced_layout = isset($fm_settings['fm_advanced_layout']) && $fm_settings['fm_advanced_layout'] == '1' ? '1' : '0';
58
+ $fm_enable_wp_editor = !isset($fm_settings['fm_enable_wp_editor']) ? '1' : $fm_settings['fm_enable_wp_editor'];
59
  $map_key = isset($fm_settings['map_key']) ? $fm_settings['map_key'] : '';
60
  $uninstall_href = add_query_arg( array( 'page' => 'uninstall' . WDFMInstance(self::PLUGIN)->menu_postfix), admin_url('admin.php') );
61
  ?>
118
  <label class="wd-label-radio" for="fm_advanced_layout-0"><?php _e('No', WDFMInstance(self::PLUGIN)->prefix); ?></label>
119
  <p class="description"><?php _e('If you wish to build your form with HTML, instead of using Form Maker’s user-friendly interface, you can enable Advanced Layout. It can be accessed from the form editor.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
120
  </span>
121
+ <span class="wd-group">
122
+ <label class="wd-label"><?php _e('Enable HTML editor', WDFMInstance(self::PLUGIN)->prefix); ?></label>
123
+ <input <?php echo checked($fm_enable_wp_editor, '1'); ?> id="fm_enable_wp_editor-1" class="wd-radio" value="1" name="fm_enable_wp_editor" type="radio"/>
124
+ <label class="wd-label-radio" for="fm_enable_wp_editor-1"><?php _e('Yes', WDFMInstance(self::PLUGIN)->prefix); ?></label>
125
+ <input <?php echo checked($fm_enable_wp_editor, '0'); ?> id="fm_enable_wp_editor-0" class="wd-radio" value="0" name="fm_enable_wp_editor" type="radio"/>
126
+ <label class="wd-label-radio" for="fm_enable_wp_editor-0"><?php _e('No', WDFMInstance(self::PLUGIN)->prefix); ?></label>
127
+ <p class="description"><?php _e('Form Header Description text and Layout fields boxes of Form Maker will use TinyMCE editor, in case this setting is enabled.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
128
+ </span>
129
+
130
  <span class="wd-group">
131
  <label class="wd-label"><?php echo sprintf(__('Uninstall %s', WDFMInstance(self::PLUGIN)->prefix), WDFMInstance(self::PLUGIN)->nicename); ?></label>
132
  <a class="button" href="<?php echo $uninstall_href ?>"><?php _e('Uninstall', WDFMInstance(self::PLUGIN)->prefix); ?></a>
admin/views/Submissions_fm.php CHANGED
@@ -44,11 +44,13 @@ class FMViewSubmissions_fmc extends FMAdminView_fmc {
44
  // TODO: Change this function to standard.
45
  echo $this->topbar();
46
 
47
- $id = $params['id'];
48
- $page = $params['page'];
49
  $page_title = $params['page_title'];
50
  $page_url = $params['page_url'];
51
  $forms = $params['forms'];
 
 
52
  echo '<div class="wrap">';
53
  echo $this->title(array(
54
  'title' => $page_title,
@@ -58,7 +60,7 @@ class FMViewSubmissions_fmc extends FMAdminView_fmc {
58
  <br>
59
  <div class="tablenav top">
60
  <div class="alignleft">
61
- <?php echo $this->saelect_form( array('id' => $id, 'forms' => $forms, 'page' => $page, 'page_url' => $page_url) ); ?>
62
  </div>
63
  <div class="fm-export-tools">
64
  <?php $blocked_ips_link = add_query_arg(array( 'page' => 'blocked_ips' . WDFMInstance(self::PLUGIN)->menu_postfix ), $page_url); ?>
@@ -86,18 +88,25 @@ class FMViewSubmissions_fmc extends FMAdminView_fmc {
86
  $id = $params['id'];
87
  $page = $params['page'];
88
  $page_url = $params['page_url'];
 
 
 
 
89
  ob_start();
90
  $unexpected_error_message = sprintf( __('An unexpected error occurred while exporting data. %s Please contact Web-Dorado (10Web) Customer Care. %s', WDFMInstance(self::PLUGIN)->prefix), '<a href="https://web-dorado.com/support/contact-us.html" target="_blank">','</a>');
91
  echo '<div class="fm-unexpected_error_message fm-hide">' . WDW_FM_Library(self::PLUGIN)->message_id('', $unexpected_error_message, 'error') . '</div>';
92
  echo $this->body($params);
93
-
94
  // Pass the content to form.
 
 
 
 
95
  $form_attr = array(
96
  // 'id' => WDFMInstance(self::PLUGIN)->prefix . '_submissions',
97
  'id' => 'admin_form',
98
  'name' => WDFMInstance(self::PLUGIN)->prefix . '_submissions',
99
  'class' => WDFMInstance(self::PLUGIN)->prefix . '_submissions fm-table-submissions wd-form',
100
- 'action' => add_query_arg( array('page' => $page, 'task' => 'display', 'current_id' => $id ), $page_url),
101
  );
102
  echo $this->form(ob_get_clean(), $form_attr);
103
  }
@@ -115,6 +124,7 @@ class FMViewSubmissions_fmc extends FMAdminView_fmc {
115
  $page_url = $params['page_url'];
116
  $page_title = $params['page_title'];
117
  $pagination_url = $params['pagination_url'];
 
118
  $page_per_num = $params['page_per_num'];
119
 
120
  $forms = $params['forms'];
@@ -158,9 +168,6 @@ class FMViewSubmissions_fmc extends FMAdminView_fmc {
158
  $subs_count = $params['subs_count'];
159
  $pdf_data = $params['pdf_data'];
160
 
161
- $is_search = $params['is_search'];
162
- $is_stats = $params['is_stats'];
163
-
164
  $verified_emails = array();
165
 
166
  echo $this->title(array(
@@ -170,7 +177,7 @@ class FMViewSubmissions_fmc extends FMAdminView_fmc {
170
  ?>
171
  <br>
172
  <div>
173
- <?php echo $this->saelect_form( array('id' => $form_id, 'forms' => $forms, 'page' => $page, 'page_url' => $page_url) ); ?>
174
  <div class="fm-reports">
175
  <div class="fm-tools-button">
176
  <div class="fm-total_entries"><?php echo $statistics["total_entries"]; ?></div>
@@ -337,6 +344,7 @@ class FMViewSubmissions_fmc extends FMAdminView_fmc {
337
  <th class="fm-column-not-hide"></th>
338
  <th class="submitid_fc" <?php echo $style_id; ?> >
339
  <input type="text" name="id_search" id="id_search" value="<?php echo $lists['id_search'] ?>" style="width:30px" />
 
340
  </th>
341
  <th class="submitdate_fc fm-column-not-hide" <?php echo $style_date; ?>>
342
  <table align="center" style="margin:auto" class="simple_table">
@@ -433,7 +441,7 @@ class FMViewSubmissions_fmc extends FMAdminView_fmc {
433
  break;
434
  default: ?>
435
  <th class="<?php echo $sorted_labels_id[$i]; ?>_fc" <?php echo $styleStr; ?>>
436
- <input name="<?php echo $form_id . '_' . $sorted_labels_id[$i] . '_search'; ?>" id="<?php echo $form_id . '_' . $sorted_labels_id[$i] . '_search'; ?>" type="text" value="<?php echo $lists[$form_id . '_' . $sorted_labels_id[$i] . '_search']; ?>">
437
  </th>
438
  <?php
439
  break;
@@ -474,10 +482,10 @@ class FMViewSubmissions_fmc extends FMAdminView_fmc {
474
  'TB_iframe' => '1',
475
  ), admin_url('admin-ajax.php'));
476
 
477
- $edit_url = add_query_arg( array( 'task' => 'edit', 'current_id' => $data->group_id, 'form_id' => $form_id ), $page_url );
478
- $delete_url = add_query_arg( array( 'task' => 'delete', 'current_id' => $data->group_id, 'form_id' => $form_id ), $page_url );
479
- $block_url = add_query_arg( array( 'task' => 'block_ip', 'current_id' => $data->group_id, 'form_id' => $form_id ), $page_url );
480
- $unblock_url = add_query_arg( array( 'task' => 'unblock_ip', 'current_id' => $data->group_id, 'form_id' => $form_id ), $page_url );
481
 
482
  $ip_infoin_popup_url = add_query_arg( array(
483
  'action' => 'FormMakerIpinfoinPopup' . WDFMInstance(self::PLUGIN)->plugin_postfix,
@@ -625,7 +633,7 @@ class FMViewSubmissions_fmc extends FMAdminView_fmc {
625
  ?>
626
  <td class="<?php echo $sorted_labels_id[$h]; ?>_fc sub-align" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?> data-colname="<?php echo !empty($label_name_ids[$sorted_labels_id[$h]]) ? $label_name_ids[$sorted_labels_id[$h]] : ''; ?>">
627
  <p><?php echo $temp[$g]->element_value; ?>
628
- <span style="color:#2DA068;">( Verified <img src="<?php echo WDFMInstance(self::PLUGIN)->plugin_url . '/images/verified.png'; ?>" /> )</span>
629
  </p>
630
  </td>
631
  <?php }
@@ -1348,20 +1356,22 @@ class FMViewSubmissions_fmc extends FMAdminView_fmc {
1348
 
1349
  /**
1350
  * Print saelect form.
1351
- *
1352
  * @param array $params
1353
  */
1354
  private function saelect_form( $params = array() ) {
1355
- if ( !empty($params['forms']) ) {
1356
  $page = $params['page'];
1357
  $page_url = $params['page_url'];
 
 
1358
  ?>
1359
  <select name="form_id" id="form_id">
1360
  <option value="0"><?php _e('- Select a form -', WDFMInstance(self::PLUGIN)->prefix); ?></option>
1361
  <?php
1362
  foreach ( $params['forms'] as $form ) {
1363
  $selected = ( $form->id == $params['id'] ) ? 'selected="selected"' : '';
1364
- $show_url = add_query_arg( array( 'page' => $page, 'task' => 'display', 'current_id' => $form->id ), admin_url('admin.php'));
1365
  echo '<option value="' . $form->id . '" ' . $selected . ' data-submission-href="' . $show_url . '">' . $form->title . '</option>';
1366
  }
1367
  ?>
44
  // TODO: Change this function to standard.
45
  echo $this->topbar();
46
 
47
+ $id = $params['id'];
48
+ $page = $params['page'];
49
  $page_title = $params['page_title'];
50
  $page_url = $params['page_url'];
51
  $forms = $params['forms'];
52
+ $order_by = $params['order_by'];
53
+ $asc_or_desc = $params['asc_or_desc'];
54
  echo '<div class="wrap">';
55
  echo $this->title(array(
56
  'title' => $page_title,
60
  <br>
61
  <div class="tablenav top">
62
  <div class="alignleft">
63
+ <?php echo $this->saelect_form( array('id' => $id, 'forms' => $forms, 'page' => $page, 'page_url' => $page_url, 'order_by' => $order_by, 'asc_or_desc' => $asc_or_desc) ); ?>
64
  </div>
65
  <div class="fm-export-tools">
66
  <?php $blocked_ips_link = add_query_arg(array( 'page' => 'blocked_ips' . WDFMInstance(self::PLUGIN)->menu_postfix ), $page_url); ?>
88
  $id = $params['id'];
89
  $page = $params['page'];
90
  $page_url = $params['page_url'];
91
+ $page_number = $params['page_number'];
92
+ $order_by = $params['order_by'];
93
+ $asc_or_desc = $params['asc_or_desc'];
94
+ $pagination_url_args = $params['pagination_url_args'];
95
  ob_start();
96
  $unexpected_error_message = sprintf( __('An unexpected error occurred while exporting data. %s Please contact Web-Dorado (10Web) Customer Care. %s', WDFMInstance(self::PLUGIN)->prefix), '<a href="https://web-dorado.com/support/contact-us.html" target="_blank">','</a>');
97
  echo '<div class="fm-unexpected_error_message fm-hide">' . WDW_FM_Library(self::PLUGIN)->message_id('', $unexpected_error_message, 'error') . '</div>';
98
  echo $this->body($params);
 
99
  // Pass the content to form.
100
+ $action = add_query_arg( array_merge(
101
+ array('page' => $page, 'task' => 'display', 'current_id' => $id, 'paged' => $page_number, 'order_by' => $order_by, 'asc_or_desc' => $asc_or_desc ),
102
+ $pagination_url_args
103
+ ), $page_url);
104
  $form_attr = array(
105
  // 'id' => WDFMInstance(self::PLUGIN)->prefix . '_submissions',
106
  'id' => 'admin_form',
107
  'name' => WDFMInstance(self::PLUGIN)->prefix . '_submissions',
108
  'class' => WDFMInstance(self::PLUGIN)->prefix . '_submissions fm-table-submissions wd-form',
109
+ 'action' => $action
110
  );
111
  echo $this->form(ob_get_clean(), $form_attr);
112
  }
124
  $page_url = $params['page_url'];
125
  $page_title = $params['page_title'];
126
  $pagination_url = $params['pagination_url'];
127
+ $page_number = $params['page_number'];
128
  $page_per_num = $params['page_per_num'];
129
 
130
  $forms = $params['forms'];
168
  $subs_count = $params['subs_count'];
169
  $pdf_data = $params['pdf_data'];
170
 
 
 
 
171
  $verified_emails = array();
172
 
173
  echo $this->title(array(
177
  ?>
178
  <br>
179
  <div>
180
+ <?php echo $this->saelect_form( array('id' => $form_id, 'forms' => $forms, 'page' => $page, 'page_url' => $page_url, 'order_by' => $order_by, 'asc_or_desc' => $asc_or_desc) ); ?>
181
  <div class="fm-reports">
182
  <div class="fm-tools-button">
183
  <div class="fm-total_entries"><?php echo $statistics["total_entries"]; ?></div>
344
  <th class="fm-column-not-hide"></th>
345
  <th class="submitid_fc" <?php echo $style_id; ?> >
346
  <input type="text" name="id_search" id="id_search" value="<?php echo $lists['id_search'] ?>" style="width:30px" />
347
+ <input type="hidden" name="fm_is_search" id="fm_is_search" value="0" />
348
  </th>
349
  <th class="submitdate_fc fm-column-not-hide" <?php echo $style_date; ?>>
350
  <table align="center" style="margin:auto" class="simple_table">
441
  break;
442
  default: ?>
443
  <th class="<?php echo $sorted_labels_id[$i]; ?>_fc" <?php echo $styleStr; ?>>
444
+ <input name="<?php echo $form_id . '_' . $sorted_labels_id[$i] . '_search'; ?>" id="<?php echo $form_id . '_' . $sorted_labels_id[$i] . '_search'; ?>" type="text" value="<?php echo stripslashes( urldecode($lists[$form_id . '_' . $sorted_labels_id[$i] . '_search'] ) ); ?>">
445
  </th>
446
  <?php
447
  break;
482
  'TB_iframe' => '1',
483
  ), admin_url('admin-ajax.php'));
484
 
485
+ $edit_url = add_query_arg( array( 'task' => 'edit', 'current_id' => $data->group_id, 'form_id' => $form_id, 'paged' => $page_number, WDFMInstance(self::PLUGIN)->nonce => wp_create_nonce(WDFMInstance(self::PLUGIN)->nonce) ), $pagination_url );
486
+ $delete_url = add_query_arg( array( 'task' => 'delete', 'current_id' => $data->group_id, 'form_id' => $form_id, 'paged' => $page_number, WDFMInstance(self::PLUGIN)->nonce => wp_create_nonce(WDFMInstance(self::PLUGIN)->nonce) ), $pagination_url );
487
+ $block_url = add_query_arg( array( 'task' => 'block_ip', 'current_id' => $data->group_id, 'form_id' => $form_id, 'paged' => $page_number, WDFMInstance(self::PLUGIN)->nonce => wp_create_nonce(WDFMInstance(self::PLUGIN)->nonce) ), $pagination_url );
488
+ $unblock_url = add_query_arg( array( 'task' => 'unblock_ip', 'current_id' => $data->group_id, 'form_id' => $form_id, 'paged' => $page_number, WDFMInstance(self::PLUGIN)->nonce => wp_create_nonce(WDFMInstance(self::PLUGIN)->nonce) ), $pagination_url );
489
 
490
  $ip_infoin_popup_url = add_query_arg( array(
491
  'action' => 'FormMakerIpinfoinPopup' . WDFMInstance(self::PLUGIN)->plugin_postfix,
633
  ?>
634
  <td class="<?php echo $sorted_labels_id[$h]; ?>_fc sub-align" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?> data-colname="<?php echo !empty($label_name_ids[$sorted_labels_id[$h]]) ? $label_name_ids[$sorted_labels_id[$h]] : ''; ?>">
635
  <p><?php echo $temp[$g]->element_value; ?>
636
+ <div style="color:#2DA068;">( <?php _e("Verified", WDFMInstance(self::PLUGIN)->prefix); ?> <img src="<?php echo WDFMInstance(self::PLUGIN)->plugin_url . '/images/verified.png'; ?>" /> )</div>
637
  </p>
638
  </td>
639
  <?php }
1356
 
1357
  /**
1358
  * Print saelect form.
1359
+ *
1360
  * @param array $params
1361
  */
1362
  private function saelect_form( $params = array() ) {
1363
+ if ( !empty($params['forms']) ) {
1364
  $page = $params['page'];
1365
  $page_url = $params['page_url'];
1366
+ $order_by = $params['order_by'];
1367
+ $asc_or_desc = $params['asc_or_desc'];
1368
  ?>
1369
  <select name="form_id" id="form_id">
1370
  <option value="0"><?php _e('- Select a form -', WDFMInstance(self::PLUGIN)->prefix); ?></option>
1371
  <?php
1372
  foreach ( $params['forms'] as $form ) {
1373
  $selected = ( $form->id == $params['id'] ) ? 'selected="selected"' : '';
1374
+ $show_url = add_query_arg( array( 'page' => $page, 'task' => 'display', 'current_id' => $form->id, 'order_by' => $order_by, 'asc_or_desc' => $asc_or_desc ), admin_url('admin.php'));
1375
  echo '<option value="' . $form->id . '" ' . $selected . ' data-submission-href="' . $show_url . '">' . $form->title . '</option>';
1376
  }
1377
  ?>
contact-form-maker.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Contact Form Maker
4
  * Plugin URI: https://web-dorado.com/products/form-maker-wordpress.html
5
  * Description: WordPress Contact Form Maker is a simple contact form builder, which allows the user with almost no knowledge of programming to create and edit different type of contact forms.
6
- * Version: 1.12.32
7
  * Author: WebDorado Form Builder Team
8
  * Author URI: https://web-dorado.com/wordpress-plugins-bundle.html
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -95,8 +95,8 @@ final class WDCFM {
95
  $this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
96
  $this->front_urls = $this->get_front_urls();
97
  $this->main_file = plugin_basename(__FILE__);
98
- $this->plugin_version = '1.12.32';
99
- $this->db_version = '2.12.32';
100
  $this->menu_postfix = ($this->is_free == 2 ? '_fmc' : '_fm');
101
  $this->plugin_postfix = ($this->is_free == 2 ? '_fmc' : '');
102
  $this->menu_slug = 'manage' . $this->menu_postfix;
@@ -198,7 +198,7 @@ final class WDCFM {
198
  add_filter('set-screen-option', array($this, 'set_option_submissions'), 10, 3);
199
 
200
  // Check add-ons versions.
201
- if ($this->is_free != 2) {
202
  add_action('admin_notices', array($this, 'fm_check_addons_compatibility'));
203
  }
204
 
@@ -364,6 +364,8 @@ final class WDCFM {
364
  if ($this->is_free != 2) {
365
  do_action('fm_init_addons');
366
  }
 
 
367
  }
368
 
369
  /**
@@ -525,6 +527,11 @@ final class WDCFM {
525
  wp_register_script($this->handle_prefix . '-manage-edit', $this->plugin_url . '/js/form_maker_manage_edit.js', array(), $this->plugin_version);
526
  wp_register_script($this->handle_prefix . '-formmaker_div', $this->plugin_url . '/js/formmaker_div.js', array(), $this->plugin_version);
527
  wp_register_script($this->handle_prefix . '-form-options', $this->plugin_url . '/js/form_maker_form_options.js', array(), $this->plugin_version);
 
 
 
 
 
528
  wp_register_script($this->handle_prefix . '-form-advanced-layout', $this->plugin_url . '/js/form_maker_form_advanced_layout.js', array(), $this->plugin_version);
529
  wp_register_script($this->handle_prefix . '-add-fields', $this->plugin_url . '/js/add_field.js', array($this->handle_prefix . '-formmaker_div'), $this->plugin_version);
530
  wp_localize_script($this->handle_prefix . '-add-fields', 'form_maker', array(
@@ -752,7 +759,6 @@ final class WDCFM {
752
  $id = WDW_FM_Library(self::PLUGIN)->get('wdform_id', 0);
753
  $display_options = WDW_FM_Library(self::PLUGIN)->display_options( $id );
754
  $type = $display_options->type;
755
-
756
  $attrs = array( 'id' => $id );
757
  if ($type == "embedded") {
758
  ob_start();
@@ -1008,10 +1014,13 @@ final class WDCFM {
1008
  update_option("wd_form_maker_version", $new_version);
1009
 
1010
  if ( FALSE === $fm_settings = get_option($option_key) ) {
1011
- $recaptcha_keys = $wpdb->get_row('SELECT `public_key`, `private_key` FROM ' . $wpdb->prefix . 'formmaker WHERE public_key!="" and private_key!=""', ARRAY_A);
1012
- $public_key = isset($recaptcha_keys['public_key']) ? $recaptcha_keys['public_key'] : '';
1013
- $private_key = isset($recaptcha_keys['private_key']) ? $recaptcha_keys['private_key'] : '';
1014
- add_option($option_key, array('public_key' => $public_key, 'private_key' => $private_key, 'csv_delimiter' => ',', 'map_key' => '', 'ajax_export_per_page' => 1000));
 
 
 
1015
  }
1016
  }
1017
  }
@@ -1160,15 +1169,15 @@ final class WDCFM {
1160
  $add_ons = array(
1161
  'form-maker-export-import' => array('version' => '2.0.7', 'file' => 'fm_exp_imp.php'),
1162
  'form-maker-save-progress' => array('version' => '1.0.1', 'file' => 'fm_save.php'),
1163
- 'form-maker-conditional-emails' => array('version' => '1.1.2', 'file' => 'fm_conditional_emails.php'),
1164
- 'form-maker-pushover' => array('version' => '1.0.1', 'file' => 'fm_pushover.php'),
1165
- 'form-maker-mailchimp' => array('version' => '1.0.1', 'file' => 'fm_mailchimp.php'),
1166
- 'form-maker-reg' => array('version' => '1.1.0', 'file' => 'fm_reg.php'),
1167
  'form-maker-post-generation' => array('version' => '1.0.2', 'file' => 'fm_post_generation.php'),
1168
  'form-maker-dropbox-integration' => array('version' => '1.1.1', 'file' => 'fm_dropbox_integration.php'),
1169
  'form-maker-gdrive-integration' => array('version' => '1.0.0', 'file' => 'fm_gdrive_integration.php'),
1170
  'form-maker-pdf-integration' => array('version' => '1.1.3', 'file' => 'fm_pdf_integration.php'),
1171
- 'form-maker-stripe' => array('version' => '1.0.1', 'file' => 'fm_stripe.php'),
1172
  'form-maker-calculator' => array('version' => '1.0.3', 'file' => 'fm_calculator.php'),
1173
  );
1174
 
@@ -1180,7 +1189,7 @@ final class WDCFM {
1180
  if (is_plugin_active($add_on_key . '/' . $add_on_value['file'])) {
1181
  $addon = get_plugin_data($addon_path); // array
1182
  if (version_compare($addon['Version'], $add_on_value['version'], '<=')) { //compare versions
1183
- deactivate_plugins($addon_path);
1184
  array_push($add_ons_notice, $addon['Name']);
1185
  }
1186
  }
@@ -1199,8 +1208,8 @@ final class WDCFM {
1199
  function fm_addons_compatibility_notice($add_ons_notice) {
1200
  $addon_names = implode($add_ons_notice, ', ');
1201
  $count = count($add_ons_notice);
1202
- $single = __('Please update the %s add-on to start using.', $this->prefix);
1203
- $plural = __('Please update the %s add-ons to start using.', $this->prefix);
1204
  echo '<div class="error"><p>' . sprintf( _n($single, $plural, $count, $this->prefix), $addon_names ) .'</p></div>';
1205
  }
1206
 
@@ -1208,6 +1217,18 @@ final class WDCFM {
1208
  $vars[] = 'form_id';
1209
  return $vars;
1210
  }
 
 
 
 
 
 
 
 
 
 
 
 
1211
  }
1212
 
1213
  /**
3
  * Plugin Name: Contact Form Maker
4
  * Plugin URI: https://web-dorado.com/products/form-maker-wordpress.html
5
  * Description: WordPress Contact Form Maker is a simple contact form builder, which allows the user with almost no knowledge of programming to create and edit different type of contact forms.
6
+ * Version: 1.12.33
7
  * Author: WebDorado Form Builder Team
8
  * Author URI: https://web-dorado.com/wordpress-plugins-bundle.html
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
95
  $this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
96
  $this->front_urls = $this->get_front_urls();
97
  $this->main_file = plugin_basename(__FILE__);
98
+ $this->plugin_version = '1.12.33';
99
+ $this->db_version = '2.12.33';
100
  $this->menu_postfix = ($this->is_free == 2 ? '_fmc' : '_fm');
101
  $this->plugin_postfix = ($this->is_free == 2 ? '_fmc' : '');
102
  $this->menu_slug = 'manage' . $this->menu_postfix;
198
  add_filter('set-screen-option', array($this, 'set_option_submissions'), 10, 3);
199
 
200
  // Check add-ons versions.
201
+ if ( $this->is_free != 2 && isset( $_GET[ 'page' ] ) && strpos( esc_html( $_GET[ 'page' ] ), '_' . $this->handle_prefix ) !== FALSE ) {
202
  add_action('admin_notices', array($this, 'fm_check_addons_compatibility'));
203
  }
204
 
364
  if ($this->is_free != 2) {
365
  do_action('fm_init_addons');
366
  }
367
+ // Prevent adding shortcode conflict with some builders.
368
+ $this->before_shortcode_add_builder_editor();
369
  }
370
 
371
  /**
527
  wp_register_script($this->handle_prefix . '-manage-edit', $this->plugin_url . '/js/form_maker_manage_edit.js', array(), $this->plugin_version);
528
  wp_register_script($this->handle_prefix . '-formmaker_div', $this->plugin_url . '/js/formmaker_div.js', array(), $this->plugin_version);
529
  wp_register_script($this->handle_prefix . '-form-options', $this->plugin_url . '/js/form_maker_form_options.js', array(), $this->plugin_version);
530
+ wp_localize_script($this->handle_prefix . '-form-options', 'form_maker', array(
531
+ 'not_valid_value' => __('Enter a valid value.', $this->prefix),
532
+ 'required_field' => __('Field is required.', $this->prefix),
533
+ 'not_valid_email' => __('Enter a valid email address.', $this->prefix),
534
+ ));
535
  wp_register_script($this->handle_prefix . '-form-advanced-layout', $this->plugin_url . '/js/form_maker_form_advanced_layout.js', array(), $this->plugin_version);
536
  wp_register_script($this->handle_prefix . '-add-fields', $this->plugin_url . '/js/add_field.js', array($this->handle_prefix . '-formmaker_div'), $this->plugin_version);
537
  wp_localize_script($this->handle_prefix . '-add-fields', 'form_maker', array(
759
  $id = WDW_FM_Library(self::PLUGIN)->get('wdform_id', 0);
760
  $display_options = WDW_FM_Library(self::PLUGIN)->display_options( $id );
761
  $type = $display_options->type;
 
762
  $attrs = array( 'id' => $id );
763
  if ($type == "embedded") {
764
  ob_start();
1014
  update_option("wd_form_maker_version", $new_version);
1015
 
1016
  if ( FALSE === $fm_settings = get_option($option_key) ) {
1017
+ $recaptcha_keys = $wpdb->get_row('SELECT `public_key`, `private_key` FROM ' . $wpdb->prefix . 'formmaker WHERE public_key!="" and private_key!=""', ARRAY_A);
1018
+ $public_key = isset($recaptcha_keys['public_key']) ? $recaptcha_keys['public_key'] : '';
1019
+ $private_key = isset($recaptcha_keys['private_key']) ? $recaptcha_keys['private_key'] : '';
1020
+ add_option($option_key, array('public_key' => $public_key, 'private_key' => $private_key, 'csv_delimiter' => ',', 'map_key' => '', 'ajax_export_per_page' => 1000));
1021
+ } elseif ( !isset($fm_settings['fm_enable_wp_editor']) ) {
1022
+ $fm_settings['fm_enable_wp_editor'] = 1;
1023
+ update_option( $option_key, $fm_settings );
1024
  }
1025
  }
1026
  }
1169
  $add_ons = array(
1170
  'form-maker-export-import' => array('version' => '2.0.7', 'file' => 'fm_exp_imp.php'),
1171
  'form-maker-save-progress' => array('version' => '1.0.1', 'file' => 'fm_save.php'),
1172
+ 'form-maker-conditional-emails' => array('version' => '1.1.4', 'file' => 'fm_conditional_emails.php'),
1173
+ 'form-maker-pushover' => array('version' => '1.0.2', 'file' => 'fm_pushover.php'),
1174
+ 'form-maker-mailchimp' => array('version' => '1.0.2', 'file' => 'fm_mailchimp.php'),
1175
+ 'form-maker-reg' => array('version' => '1.2.2', 'file' => 'fm_reg.php'),
1176
  'form-maker-post-generation' => array('version' => '1.0.2', 'file' => 'fm_post_generation.php'),
1177
  'form-maker-dropbox-integration' => array('version' => '1.1.1', 'file' => 'fm_dropbox_integration.php'),
1178
  'form-maker-gdrive-integration' => array('version' => '1.0.0', 'file' => 'fm_gdrive_integration.php'),
1179
  'form-maker-pdf-integration' => array('version' => '1.1.3', 'file' => 'fm_pdf_integration.php'),
1180
+ 'form-maker-stripe' => array('version' => '1.1.3', 'file' => 'fm_stripe.php'),
1181
  'form-maker-calculator' => array('version' => '1.0.3', 'file' => 'fm_calculator.php'),
1182
  );
1183
 
1189
  if (is_plugin_active($add_on_key . '/' . $add_on_value['file'])) {
1190
  $addon = get_plugin_data($addon_path); // array
1191
  if (version_compare($addon['Version'], $add_on_value['version'], '<=')) { //compare versions
1192
+ // deactivate_plugins($addon_path);
1193
  array_push($add_ons_notice, $addon['Name']);
1194
  }
1195
  }
1208
  function fm_addons_compatibility_notice($add_ons_notice) {
1209
  $addon_names = implode($add_ons_notice, ', ');
1210
  $count = count($add_ons_notice);
1211
+ $single = __('The current version of %s add-on is not compatible with Form Maker. Some functions may not work correctly. Please update the add-on to fully use its features.', $this->prefix);
1212
+ $plural = __('The current version of %s add-ons are not compatible with Form Maker. Some functions may not work correctly. Please update the add-ons to fully use its features.', $this->prefix);
1213
  echo '<div class="error"><p>' . sprintf( _n($single, $plural, $count, $this->prefix), $addon_names ) .'</p></div>';
1214
  }
1215
 
1217
  $vars[] = 'form_id';
1218
  return $vars;
1219
  }
1220
+
1221
+ /**
1222
+ * Prevent adding shortcode conflict with some builders.
1223
+ */
1224
+ private function before_shortcode_add_builder_editor() {
1225
+ if ( defined('ELEMENTOR_VERSION') ) {
1226
+ add_action('elementor/editor/before_enqueue_scripts', array( $this, 'form_maker_admin_ajax' ));
1227
+ }
1228
+ if ( class_exists('FLBuilder') ) {
1229
+ add_action('wp_enqueue_scripts', array( $this, 'form_maker_admin_ajax' ));
1230
+ }
1231
+ }
1232
  }
1233
 
1234
  /**
css/form_maker_tables.css CHANGED
@@ -2614,4 +2614,29 @@ button:focus {
2614
  }
2615
  .fm-opacity-40 {
2616
  opacity: 0.4;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2617
  }
2614
  }
2615
  .fm-opacity-40 {
2616
  opacity: 0.4;
2617
+ }
2618
+
2619
+ p.fm-validate-description {
2620
+ color: #FF0000;
2621
+ }
2622
+
2623
+ .fm-validate-field {
2624
+ border: 1px solid #FF0000 !important;
2625
+ }
2626
+
2627
+ #description_editor {
2628
+ display: inline-block;
2629
+ vertical-align: middle;
2630
+ width: 100%;
2631
+ max-width: 487px;
2632
+ }
2633
+ #header_description {
2634
+ width: 100%;
2635
+ height: 100px;
2636
+ }
2637
+
2638
+ #form_maker_editor {
2639
+ width: 100%;
2640
+ height: 100%;
2641
+ min-height: 150px;
2642
  }
framework/WDW_FM_Library.php CHANGED
@@ -861,8 +861,17 @@ class WDW_FMC_Library {
861
  <?php
862
  }
863
 
864
- public static function fm_redirect($url) {
865
- $url = html_entity_decode(wp_nonce_url($url, WDFMInstance(self::PLUGIN)->nonce, WDFMInstance(self::PLUGIN)->nonce));
 
 
 
 
 
 
 
 
 
866
  ?>
867
  <script>
868
  window.location = "<?php echo $url; ?>";
@@ -5085,10 +5094,6 @@ class WDW_FMC_Library {
5085
  }
5086
  }
5087
 
5088
- public static function not_display_posts() {
5089
- return array('fmemailverification','cfmemailverification','form-maker','form-maker_fmc');
5090
- }
5091
-
5092
  public static function get_user_submission_ids( $email_address ) {
5093
  global $wpdb;
5094
  $user = get_user_by( 'email', $email_address );
@@ -5200,6 +5205,24 @@ class WDW_FMC_Library {
5200
  'done' => true,
5201
  );
5202
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5203
  }
5204
 
5205
  /*
861
  <?php
862
  }
863
 
864
+ /**
865
+ * FM Redirect.
866
+ *
867
+ * @param $url
868
+ * @param bool $nonce
869
+ */
870
+ public static function fm_redirect( $url, $nonce = true ) {
871
+ $url = html_entity_decode($url);
872
+ if ( $nonce ) {
873
+ $url = html_entity_decode(wp_nonce_url($url, WDFMInstance(self::PLUGIN)->nonce, WDFMInstance(self::PLUGIN)->nonce));
874
+ }
875
  ?>
876
  <script>
877
  window.location = "<?php echo $url; ?>";
5094
  }
5095
  }
5096
 
 
 
 
 
5097
  public static function get_user_submission_ids( $email_address ) {
5098
  global $wpdb;
5099
  $user = get_user_by( 'email', $email_address );
5205
  'done' => true,
5206
  );
5207
  }
5208
+
5209
+ /**
5210
+ * Array remove keys.
5211
+ *
5212
+ * @param array $array
5213
+ * @param array $keys
5214
+ * @return array
5215
+ */
5216
+ public static function array_remove_keys( $array = array(), $keys = array() ) {
5217
+ if ( !empty($array) ) {
5218
+ foreach ( $array as $key => $val ) {
5219
+ if ( isset($keys[$key]) ) {
5220
+ unset($array[$key]);
5221
+ }
5222
+ }
5223
+ }
5224
+ return $array;
5225
+ }
5226
  }
5227
 
5228
  /*
frontend/controllers/form_maker.php CHANGED
@@ -57,17 +57,18 @@ class FMControllerForm_maker_fmc {
57
  if ( !$result ) {
58
  return;
59
  }
60
- $ok = $this->model->savedata($result[0], $id);
61
- if ( is_numeric($ok) ) {
62
- $this->model->remove($ok);
 
 
 
63
  }
64
- $this->model->increment_views_count($id);
65
  return $this->view->display($result, $fm_settings, $id, $type);
66
  }
67
  else {
68
- // Get all forms.
69
  $forms = $this->model->all_forms();
70
-
71
  return $this->autoload_form($forms, $fm_settings);
72
  }
73
  }
@@ -81,7 +82,6 @@ class FMControllerForm_maker_fmc {
81
  */
82
  public function autoload_form( $forms = array(), $fm_settings = array() ) {
83
  $fm_forms = array();
84
-
85
  foreach ($forms as $key => $form) {
86
  $display_on_this = FALSE;
87
  $error = 'success';
@@ -145,39 +145,29 @@ class FMControllerForm_maker_fmc {
145
  }
146
  break;
147
  case 'post':
148
- if (!$posts_include || in_array($page_id, $posts_include)) {
149
  $display_on_this = TRUE;
150
  }
151
  else {
152
  $categories = get_the_terms($page_id, 'category');
153
  $post_cats = array();
154
- if ($categories) {
155
- foreach ($categories as $category) {
156
  $post_cats[] = $category->term_id;
157
  }
158
  }
159
- foreach ($post_cats as $single_cat) {
160
- if (in_array($single_cat, $categories_display)) {
161
  $display_on_this = TRUE;
162
  }
163
  }
164
- if (FALSE === $display_on_this && !in_array('auto_select_new', $categories_display)) {
165
- foreach ($post_cats as $single_cat) {
166
- if (!in_array($single_cat, $current_categories)) {
167
- $display_on_this = TRUE;
168
- }
169
- }
170
- }
171
- else {
172
- $display_on_this = TRUE;
173
- }
174
  }
175
- break;
176
  default:
177
  if (in_array($current_post_type, $display_on)) {
178
  $display_on_this = TRUE;
179
  }
180
- break;
181
  }
182
  }
183
  }
@@ -193,24 +183,44 @@ class FMControllerForm_maker_fmc {
193
  if ( !$form_result ) {
194
  continue;
195
  }
196
- $ok = $this->model->savedata($form_result[0], $id);
197
- if ( is_numeric($ok) ) {
198
- $this->model->remove($ok);
 
 
 
199
  }
200
- $this->model->increment_views_count($id);
201
  $params = array();
202
- $params['id'] = $id;
203
- $params['type'] = $type;
204
- $params['form'] = $form;
205
- $params['display_on_this'] = $display_on_this;
206
- $params['show_for_admin'] = $show_for_admin;
207
- $params['form_result'] = $form_result;
208
- $params['fm_settings'] = $fm_settings;
209
- $params['error'] = $error;
210
- $params['message'] = $message;
211
- $fm_forms[$id] = $this->view->autoload_form( $params );
212
  }
213
 
214
  return implode($fm_forms);
215
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
216
  }
57
  if ( !$result ) {
58
  return;
59
  }
60
+ if( $this->fm_bot_validation( $id ) ){
61
+ $ok = $this->model->savedata($result[0], $id);
62
+ if ( is_numeric($ok) ) {
63
+ $this->model->remove($ok);
64
+ }
65
+ $this->model->increment_views_count($id);
66
  }
 
67
  return $this->view->display($result, $fm_settings, $id, $type);
68
  }
69
  else {
70
+ // Get all forms.
71
  $forms = $this->model->all_forms();
 
72
  return $this->autoload_form($forms, $fm_settings);
73
  }
74
  }
82
  */
83
  public function autoload_form( $forms = array(), $fm_settings = array() ) {
84
  $fm_forms = array();
 
85
  foreach ($forms as $key => $form) {
86
  $display_on_this = FALSE;
87
  $error = 'success';
145
  }
146
  break;
147
  case 'post':
148
+ if ( !empty($posts_include) && in_array($page_id, $posts_include) ) {
149
  $display_on_this = TRUE;
150
  }
151
  else {
152
  $categories = get_the_terms($page_id, 'category');
153
  $post_cats = array();
154
+ if ( $categories ) {
155
+ foreach ( $categories as $category ) {
156
  $post_cats[] = $category->term_id;
157
  }
158
  }
159
+ foreach ( $post_cats as $single_cat ) {
160
+ if ( in_array($single_cat, $categories_display) ) {
161
  $display_on_this = TRUE;
162
  }
163
  }
 
 
 
 
 
 
 
 
 
 
164
  }
165
+ break;
166
  default:
167
  if (in_array($current_post_type, $display_on)) {
168
  $display_on_this = TRUE;
169
  }
170
+ break;
171
  }
172
  }
173
  }
183
  if ( !$form_result ) {
184
  continue;
185
  }
186
+ if( $this->fm_bot_validation( $id ) ) {
187
+ $ok = $this->model->savedata($form_result[0], $id);
188
+ if ( is_numeric($ok) ) {
189
+ $this->model->remove($ok);
190
+ }
191
+ $this->model->increment_views_count($id);
192
  }
 
193
  $params = array();
194
+ $params['id'] = $id;
195
+ $params['type'] = $type;
196
+ $params['form'] = $form;
197
+ $params['display_on_this'] = $display_on_this;
198
+ $params['show_for_admin'] = $show_for_admin;
199
+ $params['form_result'] = $form_result;
200
+ $params['fm_settings'] = $fm_settings;
201
+ $params['error'] = $error;
202
+ $params['message'] = $message;
203
+ $fm_forms[$id] = $this->view->autoload_form( $params );
204
  }
205
 
206
  return implode($fm_forms);
207
  }
208
+
209
+ /**
210
+ * Bot validation.
211
+ *
212
+ * @param int $form_id
213
+ *
214
+ * @return bool
215
+ */
216
+ public function fm_bot_validation( $form_id ) {
217
+ if ( (isset( $_POST[ "fm_bot_validation" . $form_id ] ) && $_POST[ "fm_bot_validation" . $form_id ] != '') || (isset($_POST["counter" . $form_id]) && !isset($_POST[ "fm_bot_validation" . $form_id ])) ){
218
+ WDW_FM_Library(self::PLUGIN)->start_session();
219
+ $_SESSION['massage_after_submit' . $form_id] = addslashes(addslashes(__('Error, something went wrong.', WDFMInstance(self::PLUGIN)->prefix)));;
220
+ $_SESSION['error_or_no' . $form_id] = TRUE;
221
+ return false;
222
+ }
223
+ return true;
224
+ }
225
+
226
  }
frontend/models/form_maker.php CHANGED
@@ -1197,9 +1197,13 @@ class FMModelForm_maker_fmc {
1197
  }
1198
  else {
1199
  $result_temp = $this->save_db( $id_for_old );
 
 
 
 
 
1200
  if ( isset( $result_temp[ 'error' ] ) ) {
1201
  $this->remove( $result_temp['group_id'] );
1202
- $_SESSION[ 'massage_after_submit' . $id ] = $result_temp[ 'message' ];
1203
  $_SESSION[ 'error_or_no' . $id ] = 1;
1204
  }
1205
  else {
@@ -1233,6 +1237,10 @@ class FMModelForm_maker_fmc {
1233
  $temp = explode( '@@@wdfhostwdf@@@', $db_info );
1234
  $host = $temp[ 0 ];
1235
  $temp = explode( '@@@wdfportwdf@@@', $temp[ 1 ] );
 
 
 
 
1236
  $temp = explode( '@@@wdfusernamewdf@@@', $temp[ 1 ] );
1237
  $username = $temp[ 0 ];
1238
  $temp = explode( '@@@wdfpasswordwdf@@@', $temp[ 1 ] );
@@ -1267,6 +1275,10 @@ class FMModelForm_maker_fmc {
1267
  $temp = explode( '@@@wdfhostwdf@@@', $db_info );
1268
  $host = $temp[ 0 ];
1269
  $temp = explode( '@@@wdfportwdf@@@', $temp[ 1 ] );
 
 
 
 
1270
  $temp = explode( '@@@wdfusernamewdf@@@', $temp[ 1 ] );
1271
  $username = $temp[ 0 ];
1272
  $temp = explode( '@@@wdfpasswordwdf@@@', $temp[ 1 ] );
@@ -2148,6 +2160,10 @@ class FMModelForm_maker_fmc {
2148
  $temp = explode( '***wdfhostwdf***', $temp[ 1 ] );
2149
  $host = $temp[ 0 ];
2150
  $temp = explode( '***wdfportwdf***', $temp[ 1 ] );
 
 
 
 
2151
  $temp = explode( '***wdfusernamewdf***', $temp[ 1 ] );
2152
  $username = $temp[ 0 ];
2153
  $temp = explode( '***wdfpasswordwdf***', $temp[ 1 ] );
@@ -2337,9 +2353,26 @@ class FMModelForm_maker_fmc {
2337
  $frontend_parmas['custom_fields'] = $custom_fields;
2338
  $frontend_parmas['all_files'] = json_encode($all_files);
2339
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2340
  do_action( 'fm_addon_frontend_init', $frontend_parmas );
2341
  }
2342
  $return_value = array( 'group_id' => $group_id, 'all_files' => $all_files, 'redirect_url' => $str );
 
2343
  $return_value = apply_filters('fm_save_submission_return_value', $return_value);
2344
  return $return_value;
2345
  }
@@ -3163,7 +3196,8 @@ class FMModelForm_maker_fmc {
3163
 
3164
  foreach ( $send_tos as $index => $send_to ) {
3165
  $send_to = str_replace( '*', '', $send_to );
3166
- if ( $row->mail_verify && $verification_link !== NULL && (strpos( $new_script, "{verificationlink}" ) > -1 || strpos( $new_script, "%Verification link%" ) > -1) ) {
 
3167
  $ver_link = $row->mail_mode_user ? "<a href =" . add_query_arg( array(
3168
  'gid' => $_SESSION[ 'gid' ],
3169
  'h' => $_SESSION[ 'hash' ][ $index ] . '@' . $send_to,
@@ -3360,7 +3394,10 @@ class FMModelForm_maker_fmc {
3360
  }
3361
 
3362
  if ( $row->submit_text_type != 4 ) {
3363
- $_SESSION[ 'massage_after_submit' . $id ] = $msg;
 
 
 
3364
  if ( $row->type == 'popover' || $row->type == 'topbar' || $row->type == 'scrollbox' ) {
3365
  $_SESSION[ 'fm_hide_form_after_submit' . $id ] = 1;
3366
  }
1197
  }
1198
  else {
1199
  $result_temp = $this->save_db( $id_for_old );
1200
+ // Enqueue any message from an add-on to display.
1201
+ if ( isset( $result_temp[ 'message' ] ) ) {
1202
+ $_SESSION[ 'massage_after_submit' . $id ] = $result_temp[ 'message' ];
1203
+ $_SESSION[ 'error_or_no' . $id ] = 0;
1204
+ }
1205
  if ( isset( $result_temp[ 'error' ] ) ) {
1206
  $this->remove( $result_temp['group_id'] );
 
1207
  $_SESSION[ 'error_or_no' . $id ] = 1;
1208
  }
1209
  else {
1237
  $temp = explode( '@@@wdfhostwdf@@@', $db_info );
1238
  $host = $temp[ 0 ];
1239
  $temp = explode( '@@@wdfportwdf@@@', $temp[ 1 ] );
1240
+ $port = $temp[ 0 ];
1241
+ if ($port) {
1242
+ $host .= ':' . $port;
1243
+ }
1244
  $temp = explode( '@@@wdfusernamewdf@@@', $temp[ 1 ] );
1245
  $username = $temp[ 0 ];
1246
  $temp = explode( '@@@wdfpasswordwdf@@@', $temp[ 1 ] );
1275
  $temp = explode( '@@@wdfhostwdf@@@', $db_info );
1276
  $host = $temp[ 0 ];
1277
  $temp = explode( '@@@wdfportwdf@@@', $temp[ 1 ] );
1278
+ $port = $temp[0];
1279
+ if ($port) {
1280
+ $host .= ':' . $port;
1281
+ }
1282
  $temp = explode( '@@@wdfusernamewdf@@@', $temp[ 1 ] );
1283
  $username = $temp[ 0 ];
1284
  $temp = explode( '@@@wdfpasswordwdf@@@', $temp[ 1 ] );
2160
  $temp = explode( '***wdfhostwdf***', $temp[ 1 ] );
2161
  $host = $temp[ 0 ];
2162
  $temp = explode( '***wdfportwdf***', $temp[ 1 ] );
2163
+ $port = $temp[0];
2164
+ if ($port) {
2165
+ $host .= ':' . $port;
2166
+ }
2167
  $temp = explode( '***wdfusernamewdf***', $temp[ 1 ] );
2168
  $username = $temp[ 0 ];
2169
  $temp = explode( '***wdfpasswordwdf***', $temp[ 1 ] );
2353
  $frontend_parmas['custom_fields'] = $custom_fields;
2354
  $frontend_parmas['all_files'] = json_encode($all_files);
2355
 
2356
+ // Send stripe receipt to logged in user email or first email address in user emails list.
2357
+ $user_email = $wp_useremail;
2358
+ if ( !$user_email && $form->send_to ) {
2359
+ $send_tos = explode( '**', $form->send_to );
2360
+ foreach ( $send_tos as $index => $send_to ) {
2361
+ $send_to = str_replace( '*', '', $send_to );
2362
+
2363
+ $recipient = isset( $_POST[ 'wdform_' . str_replace( '*', '', $send_to ) . "_element" . $id ] ) ? $_POST[ 'wdform_' . $send_to . "_element" . $id ] : NULL;
2364
+ if ( $recipient ) {
2365
+ $user_email = $recipient;
2366
+ break;
2367
+ }
2368
+ }
2369
+ }
2370
+ $frontend_parmas['user_email'] = $user_email;
2371
+
2372
  do_action( 'fm_addon_frontend_init', $frontend_parmas );
2373
  }
2374
  $return_value = array( 'group_id' => $group_id, 'all_files' => $all_files, 'redirect_url' => $str );
2375
+ // Get output from add-ons.
2376
  $return_value = apply_filters('fm_save_submission_return_value', $return_value);
2377
  return $return_value;
2378
  }
3196
 
3197
  foreach ( $send_tos as $index => $send_to ) {
3198
  $send_to = str_replace( '*', '', $send_to );
3199
+ if ( $row->mail_verify && $verification_link !== NULL
3200
+ && (strpos( $new_script, "{verificationlink}" ) > -1 || strpos( $new_script, "%Verification link%" ) > -1) ) {
3201
  $ver_link = $row->mail_mode_user ? "<a href =" . add_query_arg( array(
3202
  'gid' => $_SESSION[ 'gid' ],
3203
  'h' => $_SESSION[ 'hash' ][ $index ] . '@' . $send_to,
3394
  }
3395
 
3396
  if ( $row->submit_text_type != 4 ) {
3397
+ // This ensures that no message is enqueued by an add-on.
3398
+ if ( !$_SESSION[ 'massage_after_submit' . $id ] ) {
3399
+ $_SESSION[ 'massage_after_submit' . $id ] = $msg;
3400
+ }
3401
  if ( $row->type == 'popover' || $row->type == 'topbar' || $row->type == 'scrollbox' ) {
3402
  $_SESSION[ 'fm_hide_form_after_submit' . $id ] = 1;
3403
  }
frontend/views/form_maker.php CHANGED
@@ -134,6 +134,7 @@ class FMViewForm_maker_fmc {
134
 
135
  $form_maker_front_end .= '<input type="hidden" id="counter' . $form_id . '" value="' . $row->counter . '" name="counter' . $form_id . '" />';
136
  $form_maker_front_end .= '<input type="hidden" id="Itemid' . $form_id . '" value="" name="Itemid' . $form_id . '" />';
 
137
 
138
  if ( !$fm_hide_form_after_submit ) {
139
  // Form header.
@@ -1906,7 +1907,7 @@ class FMViewForm_maker_fmc {
1906
  }
1907
  }
1908
  if ( $onload_js ) {
1909
- $onload_js = 'jQuery(document).ready(function () {' . $onload_js . '})';
1910
  }
1911
  if ( function_exists('wp_add_inline_script') ) { // Since Wordpress 4.5.0
1912
  wp_add_inline_script( WDFMInstance(self::PLUGIN)->handle_prefix . '-script-' . $id, $onload_js);
134
 
135
  $form_maker_front_end .= '<input type="hidden" id="counter' . $form_id . '" value="' . $row->counter . '" name="counter' . $form_id . '" />';
136
  $form_maker_front_end .= '<input type="hidden" id="Itemid' . $form_id . '" value="" name="Itemid' . $form_id . '" />';
137
+ $form_maker_front_end .= '<input type="hidden" value="" name="fm_bot_validation' . $form_id . '" />';
138
 
139
  if ( !$fm_hide_form_after_submit ) {
140
  // Form header.
1907
  }
1908
  }
1909
  if ( $onload_js ) {
1910
+ $onload_js = 'jQuery(document).ready( function () {' . $onload_js . '})';
1911
  }
1912
  if ( function_exists('wp_add_inline_script') ) { // Since Wordpress 4.5.0
1913
  wp_add_inline_script( WDFMInstance(self::PLUGIN)->handle_prefix . '-script-' . $id, $onload_js);
js/form_maker_admin.js CHANGED
@@ -61,10 +61,7 @@ function fm_toggle_postbox(that) {
61
  }
62
 
63
  function fm_option_tabs_mail_validation() {
64
- if (fm_check_email('email') || fm_check_email('fm_email_to') || fm_check_email('mail_bcc_user') || fm_check_email('mail_cc_user') || fm_check_email('reply_to_other') || fm_check_email('mail_cc') || fm_check_email('mail_bcc') || fm_check_email('mail') || fm_check_email('from_mail') || fm_check_email('reply_to') || fm_check_email('mail_from_user') || fm_check_email('reply_to_user') || fm_check_email('mail_from_other') || fm_check_email('reply_to_other') || fm_check_email('paypal_email')) {
65
- return false;
66
- }
67
- return true;
68
  }
69
  /**
70
  * Set null value no input.
@@ -118,15 +115,15 @@ function input_search(e, that) {
118
  function input_pagination(e, that) {
119
  var key_code = (e.keyCode ? e.keyCode : e.which);
120
  if (key_code == 13) { /*Enter keycode*/
 
121
  var to_page = jQuery(that).val();
122
  var pages_count = jQuery(that).parents(".pagination-links").data("pages-count");
123
- var form = jQuery(that).parents("form");
124
- if (to_page <= pages_count) {
125
- var search = jQuery("input[name='s']").val() ? ("&s=" + jQuery("input[name='s']").val()) : "";
126
-
127
- form.attr("action", window.location + "&paged=" + to_page + search);
128
  }
129
- form.submit();
130
  }
131
  return true;
132
  }
@@ -582,6 +579,29 @@ jQuery(document).ready(function () {
582
  this_item.remove();
583
  return false;
584
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
585
  });
586
 
587
  function fm_toggle_posts(that) {
61
  }
62
 
63
  function fm_option_tabs_mail_validation() {
64
+ return true;
 
 
 
65
  }
66
  /**
67
  * Set null value no input.
115
  function input_pagination(e, that) {
116
  var key_code = (e.keyCode ? e.keyCode : e.which);
117
  if (key_code == 13) { /*Enter keycode*/
118
+ var form = jQuery(that).parents("form");
119
  var to_page = jQuery(that).val();
120
  var pages_count = jQuery(that).parents(".pagination-links").data("pages-count");
121
+ if ( to_page <= pages_count && to_page > 0 ) {
122
+ var nonceRE = new RegExp("&nonce_fm="+ nonce_fm +"","g");
123
+ var action = form.attr("action").replace(nonceRE, '').replace(/&paged=(\d+)/, '') + '&paged=' + to_page;
124
+ form.attr("action", action);
125
+ location.href = action;
126
  }
 
127
  }
128
  return true;
129
  }
579
  this_item.remove();
580
  return false;
581
  });
582
+ jQuery('body').on('click', '.pp_display_on_categories input[name="display_on_categories[]"]', function () {
583
+ var all_checkbox = jQuery('.pp_display_on_categories input[name="display_on_categories[]"]');
584
+ var all_categories = jQuery('.fm-display-all-categories');
585
+ var val = jQuery(this).val();
586
+ if ( val == 'select_all_categories') {
587
+ if ( jQuery(this).is(':checked') ) {
588
+ all_checkbox.prop('checked', true);
589
+ } else {
590
+ all_checkbox.prop('checked', false);
591
+ }
592
+ }
593
+ else {
594
+ var checked_count = jQuery('input[name="display_on_categories[]"]:checked').length;
595
+ var all_categories_count = parseInt(all_categories.attr('data-categories-count'));
596
+ if ( !jQuery(this).prop('checked') ) {
597
+ checked_count = checked_count - 1;
598
+ }
599
+ all_categories.prop('checked', false);
600
+ if ( checked_count == all_categories_count) {
601
+ all_categories.prop('checked', true);
602
+ }
603
+ }
604
+ });
605
  });
606
 
607
  function fm_toggle_posts(that) {
js/form_maker_form_options.js CHANGED
@@ -41,12 +41,12 @@ jQuery(document).ready(function () {
41
  jQuery(window).on('load', function () {
42
  var fieldset_id = jQuery("#fieldset_id").val();
43
  form_maker_options_tabs(fieldset_id);
44
-
 
45
  if ( fieldset_id == 'javascript' ) {
46
  codemirror_for_javascript();
47
  }
48
-
49
- fm_change_payment_method(payment_method);
50
  fm_popup();
51
  function hide_email_labels(event) {
52
  var e = event.toElement || event.relatedTarget;
@@ -115,14 +115,107 @@ function filter_placeholders(that) {
115
  }
116
  }
117
 
118
- function wd_fm_apply_options(task) {
119
- var submit = fm_option_tabs_mail_validation();
120
- if(submit === true){
121
- set_condition();
122
- fm_set_input_value('task', task);
123
- return true;
124
- }
125
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  }
127
 
128
  function fm_placeholders_popup(input_id) {
41
  jQuery(window).on('load', function () {
42
  var fieldset_id = jQuery("#fieldset_id").val();
43
  form_maker_options_tabs(fieldset_id);
44
+ fm_change_payment_method(jQuery('input[name=paypal_mode]:checked').val());
45
+
46
  if ( fieldset_id == 'javascript' ) {
47
  codemirror_for_javascript();
48
  }
49
+
 
50
  fm_popup();
51
  function hide_email_labels(event) {
52
  var e = event.toElement || event.relatedTarget;
115
  }
116
  }
117
 
118
+ function wd_fm_apply_options(task) {
119
+ var success = true;
120
+ jQuery(".fm-validate").each(function() {
121
+ var type = jQuery(this).attr("data-type");
122
+ var message = form_maker.not_valid_value;
123
+ if ( type == 'required' ) {
124
+ message = form_maker.required_field;
125
+ }
126
+ else if ( type == 'email' ) {
127
+ message = form_maker.not_valid_email;
128
+ }
129
+ message = "<p class='description fm-validate-description'>" + message + "</p>";
130
+ var callback = jQuery(this).attr("data-callback");
131
+ var callbackParameter = jQuery(this).attr("data-callback-parameter");
132
+ var tabId = jQuery(this).attr("data-tab-id");
133
+ var contentId = jQuery(this).attr("data-content-id");
134
+ var value = jQuery(this).val();
135
+
136
+ if ( typeof window[callback] == "function" && !window[callback](value, callbackParameter ) ) { /* Check validation.*/
137
+ /* Remove active class from all tabs.*/
138
+ jQuery(".fm_fieldset_active").addClass("fm_fieldset_deactive").removeClass("fm_fieldset_active");
139
+ jQuery(".fm_fieldset_tab").removeClass("active");
140
+ /* Add active class to required tab.*/
141
+ jQuery("#" + contentId).removeClass("fm_fieldset_deactive").addClass("fm_fieldset_active");
142
+ jQuery("#" + tabId).addClass("active");
143
+ jQuery("#fieldset_id").val(tabId);
144
+ /* Add error message to the field.*/
145
+ if ( jQuery(this).parent().find(".fm-validate-description").length === 0 ) {
146
+ var description_container = jQuery(this).parent().find(".description");
147
+ if ( description_container.length ) {
148
+ /* Show error message before description, if description container exist.*/
149
+ description_container.before(message);
150
+ }
151
+ else {
152
+ jQuery(this).parent().append(message);
153
+ }
154
+
155
+ jQuery(this).addClass("fm-validate-field");
156
+ }
157
+ jQuery('html, body').animate({
158
+ scrollTop: jQuery(this).offset().top - 200
159
+ }, 500);
160
+ success = false;
161
+ return false; /* To break loop.*/
162
+ }
163
+ });
164
+
165
+ if ( success ) {
166
+ set_condition();
167
+ fm_set_input_value('task', task);
168
+ }
169
+
170
+ return success;
171
+ }
172
+
173
+ jQuery(document).ready(function () {
174
+ // Remove validation errors on key press.
175
+ jQuery(".fm-validate").each(function() {
176
+ jQuery(this).on("keypress", function () {
177
+ jQuery(this).parent().find(".fm-validate-description").remove();
178
+ jQuery(this).removeClass("fm-validate-field");
179
+ });
180
+ });
181
+ });
182
+
183
+ function fm_validate_email(value, obj) {
184
+ if ( obj != "" && !jQuery(obj).is(':checked') ) { /* No need to check, if option is disabled.*/
185
+ return true;
186
+ }
187
+
188
+ var emails = value.split(',');
189
+ var re = /^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,61}$/;
190
+ var rePlaceholder = /^({)[0-9]+(})$/;
191
+
192
+ var allowed_placeholders = ['{adminemail}', '{useremail}'];
193
+
194
+ for ( var i in emails ) {
195
+ var email = emails[i].replace(/^\s+|\s+$/g, '');
196
+ if ( !allowed_placeholders.includes(email) ) {
197
+ if ( email && !re.test(email) && !rePlaceholder.test(email) ) {
198
+ return false;
199
+ }
200
+ }
201
+ }
202
+
203
+ return true;
204
+ }
205
+
206
+ function fm_add_inline_email_validation_message(obj) {
207
+ var value = jQuery(obj).val();
208
+ if ( !fm_validate_email(value, '') ) {
209
+ jQuery(obj).after("<p class='description fm-validate-description'>" + form_maker.not_valid_value + "</p>");
210
+ jQuery(obj).addClass("fm-validate-field");
211
+ jQuery('html, body').animate({
212
+ scrollTop: jQuery(this).offset().top - 200
213
+ }, 500);
214
+
215
+ return false;
216
+ }
217
+
218
+ return true;
219
  }
220
 
221
  function fm_placeholders_popup(input_id) {
js/form_maker_manage.js CHANGED
@@ -159,14 +159,11 @@ function fm_delete_mail(img, value) {
159
  }
160
 
161
  function form_maker_options_tabs(id) {
162
- var tab = fm_option_tabs_mail_validation();
163
- if ( tab === true ) {
164
- jQuery("#fieldset_id").val(id);
165
- jQuery(".fm_fieldset_active").removeClass("fm_fieldset_active").addClass("fm_fieldset_deactive");
166
- jQuery("#" + id + "_fieldset").removeClass("fm_fieldset_deactive").addClass("fm_fieldset_active");
167
- jQuery(".fm_fieldset_tab").removeClass("active");
168
- jQuery("#" + id).addClass("active");
169
- }
170
 
171
  return false;
172
  }
@@ -230,33 +227,33 @@ function fm_check_email(id) {
230
 
231
  /* Do only if there is active class */
232
  if( jQuery('#submenu li a').hasClass('active') ) {
233
- var activeTabId = jQuery("#submenu .active").attr("id");
234
- var error_cont_id = jQuery('#' + id).closest(".fm_fieldset_deactive").attr("id");
235
-
236
- if(typeof error_cont_id != 'undefined') {
237
- var error_tab_id = error_cont_id.split("_fieldset");
238
- tab_id = error_tab_id[0];
239
-
240
- /* If current active and error active tabs are the same */
241
- if ( activeTabId != tab_id ) {
242
- var activeContentId = activeTabId +"_fieldset";
243
- jQuery("#"+activeContentId).removeClass("fm_fieldset_active");
244
- jQuery("#"+activeContentId).removeClass("fm_fieldset_deactive");
 
 
 
 
 
 
 
 
 
 
 
 
245
  jQuery("#" + error_cont_id).addClass("fm_fieldset_active");
246
- jQuery("#submenu .active").removeClass('active');
247
  jQuery("#" + tab_id).addClass("active");
248
  }
249
- }
250
- } else {
251
- var error_cont_id = jQuery('#' + id).closest(".fm_fieldset_deactive").attr("id");
252
- if(typeof error_cont_id != 'undefined') {
253
- var tab_id = error_cont_id.split("_fieldset");
254
- tab_id = tab_id[0];
255
-
256
- jQuery("#" + error_cont_id).removeClass("fm_fieldset_deactive");
257
- jQuery("#" + error_cont_id).addClass("fm_fieldset_active");
258
- jQuery("#" + tab_id).addClass("active");
259
- }
260
  }
261
 
262
  jQuery('#' + id).css('border', '1px solid #FF0000');
@@ -810,7 +807,6 @@ function check_stripe_required_fields() {
810
  }
811
  for (i=0; i < fields.length; i++) {
812
  if (!jQuery('#' + fields[i]).val()) {
813
- form_maker_options_tabs('payment');
814
  jQuery('#' + fields[i]).focus();
815
  alert(fields_titles[i] + ' is required.');
816
  return true;
159
  }
160
 
161
  function form_maker_options_tabs(id) {
162
+ jQuery("#fieldset_id").val(id);
163
+ jQuery(".fm_fieldset_active").removeClass("fm_fieldset_active").addClass("fm_fieldset_deactive");
164
+ jQuery("#" + id + "_fieldset").removeClass("fm_fieldset_deactive").addClass("fm_fieldset_active");
165
+ jQuery(".fm_fieldset_tab").removeClass("active");
166
+ jQuery("#" + id).addClass("active");
 
 
 
167
 
168
  return false;
169
  }
227
 
228
  /* Do only if there is active class */
229
  if( jQuery('#submenu li a').hasClass('active') ) {
230
+ var activeTabId = jQuery("#submenu .active").attr("id");
231
+ var error_cont_id = jQuery('#' + id).closest(".fm_fieldset_deactive").attr("id");
232
+
233
+ if(typeof error_cont_id != 'undefined') {
234
+ var error_tab_id = error_cont_id.split("_fieldset");
235
+ tab_id = error_tab_id[0];
236
+
237
+ /* If current active and error active tabs are the same */
238
+ if ( activeTabId != tab_id ) {
239
+ var activeContentId = activeTabId +"_fieldset";
240
+ jQuery("#"+activeContentId).removeClass("fm_fieldset_active");
241
+ jQuery("#"+activeContentId).removeClass("fm_fieldset_deactive");
242
+ jQuery("#" + error_cont_id).addClass("fm_fieldset_active");
243
+ jQuery("#submenu .active").removeClass('active');
244
+ jQuery("#" + tab_id).addClass("active");
245
+ }
246
+ }
247
+ } else {
248
+ var error_cont_id = jQuery('#' + id).closest(".fm_fieldset_deactive").attr("id");
249
+ if(typeof error_cont_id != 'undefined') {
250
+ var tab_id = error_cont_id.split("_fieldset");
251
+ tab_id = tab_id[0];
252
+
253
+ jQuery("#" + error_cont_id).removeClass("fm_fieldset_deactive");
254
  jQuery("#" + error_cont_id).addClass("fm_fieldset_active");
 
255
  jQuery("#" + tab_id).addClass("active");
256
  }
 
 
 
 
 
 
 
 
 
 
 
257
  }
258
 
259
  jQuery('#' + id).css('border', '1px solid #FF0000');
807
  }
808
  for (i=0; i < fields.length; i++) {
809
  if (!jQuery('#' + fields[i]).val()) {
 
810
  jQuery('#' + fields[i]).focus();
811
  alert(fields_titles[i] + ' is required.');
812
  return true;
js/form_maker_manage_edit.js CHANGED
@@ -234,7 +234,7 @@ function FormManageSubmitButton(check_for_changes) {
234
  form_changed = true;
235
  }
236
  });
237
- if (tinyMCE.get('header_description') != null) {
238
  if (tinyMCE.get('header_description').isDirty()) {
239
  form_changed = true;
240
  }
234
  form_changed = true;
235
  }
236
  });
237
+ if (typeof tinyMCE != 'undefined' && tinyMCE.get('header_description') != null) {
238
  if (tinyMCE.get('header_description').isDirty()) {
239
  form_changed = true;
240
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: webdorado,10web
3
  Tags: contact, contact form, email, forms, contact forms, custom form, feedback, form builder, form manager, form maker, forms builder, form builder wordpress
4
  Requires at least: 4.6
5
  Tested up to: 4.9
6
- Stable tag: 1.12.32
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -79,6 +79,22 @@ After downloading the ZIP file,
79
 
80
  == Changelog ==
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  = 1.12.32 =
83
  * Fixed: Include styles/scripts on form pages only.
84
 
3
  Tags: contact, contact form, email, forms, contact forms, custom form, feedback, form builder, form manager, form maker, forms builder, form builder wordpress
4
  Requires at least: 4.6
5
  Tested up to: 4.9
6
+ Stable tag: 1.12.33
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
79
 
80
  == Changelog ==
81
 
82
+ = 1.12.33 =
83
+ * Added: Option to enable/disable WP Editor.
84
+ * Added: Additional security checks against bots.
85
+ * Changed: Field validation on form options page.
86
+ * Fixed: Error on deactivation.
87
+ * Fixed: Port for connecting to a remote Database with SQL mapping.
88
+ * Fixed: Displaying Form on all posts instead of the selected.
89
+ * Fixed: Payment fields filled values should not be lost on an error.
90
+ * Fixed: Form is not saved if you click Publish before the page is loaded.
91
+ * Fixed: Table of fields validation.
92
+ * Fixed: Add shortcode functionality on Beaver, Elementor, SiteOrigin and Visual Composer builders.
93
+ * Fixed: If you Sort/Filter the data via some column, then hit next page button, the sort reverts to the default sort order.
94
+ * Fixed: Select all in Submissions should apply to the current page only.
95
+ * Fixed: Do not change the page after IP block in submissions page.
96
+ * Fixed: Do not change the page after deleting submission in submissions page.
97
+
98
  = 1.12.32 =
99
  * Fixed: Include styles/scripts on form pages only.
100