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

Version Description

  • Fixed: UTF-8 text for Email subject and Email from name.
Download this release

Release Info

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

Code changes from version 1.12.16 to 1.12.17

admin/controllers/Themes_fm.php CHANGED
@@ -2976,7 +2976,7 @@ class FMControllerThemes_fmc {
2976
  }
2977
  if ( $save !== FALSE ) {
2978
  require_once WDCFM()->plugin_dir . "/frontend/models/form_maker.php";
2979
- $model_frontend = new FMModelForm_maker();
2980
  $form_theme = json_decode(html_entity_decode($params), TRUE);
2981
  $model_frontend->create_css($id, $form_theme, $version == 1, TRUE);
2982
  $msg = 1;
2976
  }
2977
  if ( $save !== FALSE ) {
2978
  require_once WDCFM()->plugin_dir . "/frontend/models/form_maker.php";
2979
+ $model_frontend = new FMModelForm_maker_fmc();
2980
  $form_theme = json_decode(html_entity_decode($params), TRUE);
2981
  $model_frontend->create_css($id, $form_theme, $version == 1, TRUE);
2982
  $msg = 1;
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.16
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
@@ -89,8 +89,8 @@ final class WDCFM {
89
  $this->plugin_dir = WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__));
90
  $this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
91
  $this->main_file = plugin_basename(__FILE__);
92
- $this->plugin_version = '1.12.16';
93
- $this->db_version = '2.12.16';
94
  $this->menu_slug = 'manage_fmc';
95
  $this->prefix = 'form_maker_fmc';
96
  $this->css_prefix = 'fmc_';
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.17
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
89
  $this->plugin_dir = WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__));
90
  $this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
91
  $this->main_file = plugin_basename(__FILE__);
92
+ $this->plugin_version = '1.12.17';
93
+ $this->db_version = '2.12.17';
94
  $this->menu_slug = 'manage_fmc';
95
  $this->prefix = 'form_maker_fmc';
96
  $this->css_prefix = 'fmc_';
framework/WDW_FM_Library.php CHANGED
@@ -127,7 +127,7 @@ class WDW_FMC_Library {
127
  break;
128
  default: {
129
  $message = '';
130
- break;
131
  }
132
  }
133
  }
@@ -143,7 +143,7 @@ class WDW_FMC_Library {
143
  }
144
 
145
  return $message;
146
- }
147
 
148
  /**
149
  * Generate message.
@@ -161,7 +161,7 @@ class WDW_FMC_Library {
161
  }
162
  return $message;
163
  }
164
-
165
  public static function fm_container($theme_id, $form_body) {
166
  return '<div class="fm-form-container fm-theme' . $theme_id . '">' . $form_body . '</div>';
167
  }
@@ -179,7 +179,7 @@ class WDW_FMC_Library {
179
  * @return string
180
  */
181
  public static function ordering($id, $orderby, $order, $text, $page_url, $additional_class = '') {
182
- $class = array(
183
  ($orderby == $id ? 'sorted': 'sortable'),
184
  $order,
185
  $additional_class,
@@ -202,31 +202,31 @@ class WDW_FMC_Library {
202
  public static function search($search_by, $search_value, $form_id) {
203
  ?>
204
  <div class="alignleft actions" style="clear:both;">
205
- <script>
206
- function fm_search() {
207
- document.getElementById("page_number").value = "1";
208
- document.getElementById("search_or_not").value = "search";
209
- document.getElementById("<?php echo $form_id; ?>").submit();
210
- }
211
- function fm_reset() {
212
- if (document.getElementById("search_value")) {
213
- document.getElementById("search_value").value = "";
214
- }
215
- if (document.getElementById("search_select_value")) {
216
- document.getElementById("search_select_value").value = 0;
217
- }
218
- document.getElementById("<?php echo $form_id; ?>").submit();
219
- }
220
- </script>
221
- <div class="fm-search">
222
- <label for="search_value"><?php echo $search_by; ?>:</label>
223
- <input type="text" id="search_value" name="search_value" value="<?php echo esc_html($search_value); ?>"/>
224
- <button class="fm-icon search-icon" onclick="fm_search()">
225
- </button>
226
- <button class="fm-icon reset-icon" onclick="fm_reset()">
227
- </button>
228
- </div>
229
- </div>
230
  <?php
231
  }
232
 
@@ -243,13 +243,13 @@ class WDW_FMC_Library {
243
  <div class="alignleft actions" >
244
  <label for="search_select_value" style="font-size:14px; width:50px; display:inline-block;"><?php echo $search_by; ?>:</label>
245
  <select id="search_select_value" name="search_select_value" onchange="fm_search_select();" style="float: none; width: 150px;">
246
- <?php
247
  foreach ($playlists as $id => $playlist) {
248
  ?>
249
  <option value="<?php echo $id; ?>" <?php echo (($search_select_value == $id) ? 'selected="selected"' : ''); ?>><?php echo $playlist; ?></option>
250
  <?php
251
  }
252
- ?>
253
  </select>
254
  </div>
255
  </div>
@@ -273,7 +273,7 @@ class WDW_FMC_Library {
273
  ?>
274
  <script type="text/javascript">
275
  var items_county = <?php echo $items_county; ?>;
276
- function fm_page(x, y) {
277
  switch (y) {
278
  case 1:
279
  if (x >= items_county) {
@@ -300,8 +300,8 @@ class WDW_FMC_Library {
300
  default:
301
  document.getElementById('page_number').value = 1;
302
  }
303
-
304
- jQuery('#pagination_clicked').val('1');
305
  document.getElementById('<?php echo $form_id; ?>').submit();
306
  }
307
 
@@ -309,12 +309,12 @@ class WDW_FMC_Library {
309
  var key_code = (e.keyCode ? e.keyCode : e.which);
310
  if (key_code == 13) { /*Enter keycode*/
311
  if (jQuery('#current_page').val() >= items_county) {
312
- document.getElementById('page_number').value = items_county;
313
  }
314
  else {
315
- document.getElementById('page_number').value = jQuery('#current_page').val();
316
  }
317
- jQuery('#pagination_clicked').val('1');
318
  document.getElementById('<?php echo $form_id; ?>').submit();
319
  }
320
  return true;
@@ -330,22 +330,22 @@ class WDW_FMC_Library {
330
  </span>
331
  <?php
332
  if ($count_items > $items_per_page) {
333
- $first_page = "first-page";
334
- $prev_page = "prev-page";
 
 
 
 
 
335
  $next_page = "next-page";
336
  $last_page = "last-page";
337
- if ($page_number == 1) {
338
- $first_page = "first-page disabled";
339
- $prev_page = "prev-page disabled";
340
- $next_page = "next-page";
341
- $last_page = "last-page";
342
- }
343
- if ($page_number >= $items_county) {
344
- $first_page = "first-page ";
345
- $prev_page = "prev-page";
346
- $next_page = "next-page disabled";
347
- $last_page = "last-page disabled";
348
- }
349
  ?>
350
  <span class="pagination-links">
351
  <a class="<?php echo $first_page; ?>" title="Go to the first page" href="javascript:fm_page(<?php echo $page_number; ?>,-2);">«</a>
@@ -353,7 +353,7 @@ class WDW_FMC_Library {
353
  <span class="paging-input">
354
  <span class="total-pages">
355
  <input class="current_page" id="current_page" name="current_page" value="<?php echo $page_number; ?>" onkeypress="return check_enter_key(event)" title="Go to the page" type="text" size="1" />
356
- </span> of
357
  <span class="total-pages">
358
  <?php echo $items_county; ?>
359
  </span>
@@ -361,8 +361,8 @@ class WDW_FMC_Library {
361
  <a class="<?php echo $next_page ?>" title="Go to the next page" href="javascript:fm_page(<?php echo $page_number; ?>,1);">›</a>
362
  <a class="<?php echo $last_page ?>" title="Go to the last page" href="javascript:fm_page(<?php echo $page_number; ?>,2);">»</a>
363
  <?php
364
- }
365
- ?>
366
  </span>
367
  </div>
368
  <input type="hidden" id="page_number" name="page_number" value="<?php echo ((isset($_POST['page_number'])) ? (int) $_POST['page_number'] : 1); ?>" />
@@ -443,20 +443,20 @@ class WDW_FMC_Library {
443
  }
444
  fm_ajax_save('<?php echo $form_id; ?>');
445
  }
446
- function check_enter_key(e) {
447
  var key_code = (e.keyCode ? e.keyCode : e.which);
448
  if (key_code == 13) { /*Enter keycode*/
449
  if (jQuery('#current_page').val() >= items_county) {
450
- document.getElementById('page_number').value = items_county;
451
  }
452
  else {
453
- document.getElementById('page_number').value = jQuery('#current_page').val();
454
  }
455
-
456
  fm_ajax_save('<?php echo $form_id; ?>');
457
  return false;
458
  }
459
- return true;
460
  }
461
  </script>
462
  <div id="tablenav-pages" class="tablenav-pages">
@@ -469,22 +469,22 @@ class WDW_FMC_Library {
469
  </span>
470
  <?php
471
  if ($count_items > $limit) {
472
- $first_page = "first-page";
473
- $prev_page = "prev-page";
 
 
 
 
 
474
  $next_page = "next-page";
475
  $last_page = "last-page";
476
- if ($page_number == 1) {
477
- $first_page = "first-page disabled";
478
- $prev_page = "prev-page disabled";
479
- $next_page = "next-page";
480
- $last_page = "last-page";
481
- }
482
- if ($page_number >= $items_county) {
483
- $first_page = "first-page ";
484
- $prev_page = "prev-page";
485
- $next_page = "next-page disabled";
486
- $last_page = "last-page disabled";
487
- }
488
  ?>
489
  <span class="pagination-links">
490
  <a class="<?php echo $first_page; ?>" title="Go to the first page" onclick="fm_page(<?php echo $page_number; ?>,-2)">«</a>
@@ -492,7 +492,7 @@ class WDW_FMC_Library {
492
  <span class="paging-input">
493
  <span class="total-pages">
494
  <input class="current_page" id="current_page" name="current_page" value="<?php echo $page_number; ?>" onkeypress="return check_enter_key(event)" title="Go to the page" type="text" size="1" />
495
- </span> of
496
  <span class="total-pages">
497
  <?php echo $items_county; ?>
498
  </span>
@@ -500,8 +500,8 @@ class WDW_FMC_Library {
500
  <a class="<?php echo $next_page ?>" title="Go to the next page" onclick="fm_page(<?php echo $page_number; ?>,1)">›</a>
501
  <a class="<?php echo $last_page ?>" title="Go to the last page" onclick="fm_page(<?php echo $page_number; ?>,2)">»</a>
502
  <?php
503
- }
504
- ?>
505
  </span>
506
  </div>
507
  <input type="hidden" id="page_number" name="page_number" value="<?php echo ((isset($_POST['page_number'])) ? (int) $_POST['page_number'] : 1); ?>" />
@@ -520,9 +520,9 @@ class WDW_FMC_Library {
520
  }
521
 
522
  public static function get_google_fonts() {
523
- $google_fonts = array( 'Open Sans' => 'Open Sans', 'Oswald' => 'Oswald', 'Droid Sans' => 'Droid Sans', 'Lato' => 'Lato', 'Open Sans Condensed' => 'Open Sans Condensed', 'PT Sans' => 'PT Sans', 'Ubuntu' => 'Ubuntu', 'PT Sans Narrow' => 'PT Sans Narrow', 'Yanone Kaffeesatz' => 'Yanone Kaffeesatz', 'Roboto Condensed' => 'Roboto Condensed', 'Source Sans Pro' => 'Source Sans Pro', 'Nunito' => 'Nunito', 'Francois One' => 'Francois One', 'Roboto' => 'Roboto', 'Raleway' => 'Raleway', 'Arimo' => 'Arimo', 'Cuprum' => 'Cuprum', 'Play' => 'Play', 'Dosis' => 'Dosis', 'Abel' => 'Abel', 'Droid Serif' => 'Droid Serif', 'Arvo' => 'Arvo', 'Lora' => 'Lora', 'Rokkitt' => 'Rokkitt', 'PT Serif' => 'PT Serif', 'Bitter' => 'Bitter', 'Merriweather' => 'Merriweather', 'Vollkorn' => 'Vollkorn', 'Cantata One' => 'Cantata One', 'Kreon' => 'Kreon', 'Josefin Slab' => 'Josefin Slab', 'Playfair Display' => 'Playfair Display', 'Bree Serif' => 'Bree Serif', 'Crimson Text' => 'Crimson Text', 'Old Standard TT' => 'Old Standard TT', 'Sanchez' => 'Sanchez', 'Crete Round' => 'Crete Round', 'Cardo' => 'Cardo', 'Noticia Text' => 'Noticia Text', 'Judson' => 'Judson', 'Lobster' => 'Lobster', 'Unkempt' => 'Unkempt', 'Changa One' => 'Changa One', 'Special Elite' => 'Special Elite', 'Chewy' => 'Chewy', 'Comfortaa' => 'Comfortaa', 'Boogaloo' => 'Boogaloo', 'Fredoka One' => 'Fredoka One', 'Luckiest Guy' => 'Luckiest Guy', 'Cherry Cream Soda' => 'Cherry Cream Soda', 'Lobster Two' => 'Lobster Two', 'Righteous' => 'Righteous', 'Squada One' => 'Squada One', 'Black Ops One' => 'Black Ops One', 'Happy Monkey' => 'Happy Monkey', 'Passion One' => 'Passion One', 'Nova Square' => 'Nova Square', 'Metamorphous' => 'Metamorphous', 'Poiret One' => 'Poiret One', 'Bevan' => 'Bevan', 'Shadows Into Light' => 'Shadows Into Light', 'The Girl Next Door' => 'The Girl Next Door', 'Coming Soon' => 'Coming Soon', 'Dancing Script' => 'Dancing Script', 'Pacifico' => 'Pacifico', 'Crafty Girls' => 'Crafty Girls', 'Calligraffitti' => 'Calligraffitti', 'Rock Salt' => 'Rock Salt', 'Amatic SC' => 'Amatic SC', 'Leckerli One' => 'Leckerli One', 'Tangerine' => 'Tangerine', 'Reenie Beanie' => 'Reenie Beanie', 'Satisfy' => 'Satisfy', 'Gloria Hallelujah' => 'Gloria Hallelujah', 'Permanent Marker' => 'Permanent Marker', 'Covered By Your Grace' => 'Covered By Your Grace', 'Walter Turncoat' => 'Walter Turncoat', 'Patrick Hand' => 'Patrick Hand', 'Schoolbell' => 'Schoolbell', 'Indie Flower' => 'Indie Flower' );
524
- return $google_fonts;
525
- }
526
 
527
  public static function cleanData( &$str ) {
528
  $str = preg_replace("/\t/", "\\t", $str);
@@ -1389,7 +1389,7 @@ class WDW_FMC_Library {
1389
  }
1390
  if ( $blur ) {
1391
  $condition_js .= '
1392
- jQuery("' . substr($blur, 0, -2) . '").blur(function() {
1393
  if(' . $if . ')
1394
  jQuery("#form' . $form_id . ' div[wdid=' . $field_label[$k] . ']").' . $display . ';
1395
  else
@@ -1832,7 +1832,7 @@ class WDW_FMC_Library {
1832
  else {
1833
  if(jQuery("#wdform_' . $id1 . '_state' . $form_id . '").prop("tagName") == "SELECT") {
1834
  jQuery("#wdform_' . $id1 . '_state' . $form_id . '").parent().append("<input type=\"text\" id=\"wdform_' . $id1 . '_state' . $form_id . '\" name=\"wdform_' . ($id1 + 3) . '_state' . $form_id . '\" value=\"' . (isset($_POST['wdform_' . ($id1 + 3) . '_state' . $form_id]) ? esc_html(stripslashes($_POST['wdform_' . ($id1 + 3) . '_state' . $form_id])) : "") . '\" style=\"width: 100%;\" ' . $param['attributes'] . '><label class=\"mini_label\">' . $w_mini_labels[3] . '</label>");
1835
- jQuery("#wdform_' . $id1 . '_state' . $form_id . '").parent().children("select:first, label:first").remove();
1836
  }
1837
  }
1838
  });';
@@ -2257,7 +2257,7 @@ class WDW_FMC_Library {
2257
  }
2258
  $date_format= str_replace('%', '', $param['w_format']);
2259
 
2260
- $onsubmit_js .= '
2261
  jQuery("<input type=\"hidden\" name=\"wdform_' . $id1 . '_date_format' . $form_id . '\" value=\"' . $date_format . '\" />").appendTo("#form' . $form_id . '");';
2262
  break;
2263
  }
@@ -2371,8 +2371,8 @@ class WDW_FMC_Library {
2371
  return [ invalid_dates_finish.indexOf(string_days) == -1 ' . $w_hide_sunday . $w_hide_monday . $w_hide_tuesday . $w_hide_wednesday . $w_hide_thursday . $w_hide_friday . $w_hide_saturday . '];
2372
  }
2373
  });
2374
- var default_date;
2375
- var date_value = jQuery("#wdform_' . $id1 . '_element' . $form_id . '").val();
2376
  (date_value != "") ? default_date = date_value : default_date = "' . $default_date . '";
2377
  var format_date = "' . $param['w_format'] . '";
2378
  jQuery("#wdform_' . $id1 . '_element' . $form_id . '").datepicker("option", "dateFormat", format_date);
@@ -2383,7 +2383,6 @@ class WDW_FMC_Library {
2383
  jQuery("#wdform_' . $id1 . '_element' . $form_id . '").datepicker("setDate", default_date);
2384
  }
2385
  else {
2386
-
2387
  jQuery("#wdform_' . $id1 . '_element' . $form_id . '").datepicker("setDate", default_date);
2388
  }';
2389
  break;
@@ -2508,9 +2507,9 @@ class WDW_FMC_Library {
2508
  return [ invalid_dates_finish.indexOf(string_days) == -1 ' . $w_hide_sunday . $w_hide_monday . $w_hide_tuesday . $w_hide_wednesday . $w_hide_thursday . $w_hide_friday . $w_hide_saturday . '];
2509
  }
2510
  });
2511
- var default_date_start;
2512
- var date_start_value = jQuery("#wdform_' . $id1 . '_element' . $form_id . '0").val();
2513
- (date_start_value != "") ? default_date_start = date_start_value : default_date_start = "' . $param['w_default_date_start'] . '";
2514
  var format_date = "' . $param['w_format'] . '";
2515
  jQuery("#wdform_' . $id1 . '_element' . $form_id . '").datepicker("option", "dateFormat", format_date);
2516
  if(default_date_start =="today") {
@@ -2532,8 +2531,8 @@ class WDW_FMC_Library {
2532
  jQuery("#wdform_' . $id1 . '_element' . $form_id . '1").datepicker("option", "minDate", default_date_start);
2533
  }
2534
  var default_date_end;
2535
- var date_end_value = jQuery("#wdform_' . $id1 . '_element' . $form_id . '1").val();
2536
- (date_end_value != "") ? default_date_end = date_end_value : default_date_end = "' . $param['w_default_date_end'] . '";
2537
  var format_date = "' . $param['w_format'] . '";
2538
  jQuery("#wdform_' . $id1 . '_element' . $form_id . '0").datepicker("option", "dateFormat", format_date);
2539
  jQuery("#wdform_' . $id1 . '_element' . $form_id . '1").datepicker("option", "dateFormat", format_date);
@@ -3338,7 +3337,7 @@ class WDW_FMC_Library {
3338
  jQuery("#form' . $form_id . ' #wdform_' . $id1 . '_element' . $form_id . '")[0].spin = null;
3339
  spinner = jQuery("#form' . $form_id . ' #wdform_' . $id1 . '_element' . $form_id . '").spinner();
3340
  if ("' . $param['w_field_value'] . '" == "null") { spinner.spinner("value", ""); }
3341
- jQuery("#form' . $form_id . ' #wdform_' . $id1 . '_element' . $form_id . '").spinner({ min: "' . $param['w_field_min_value'] . '"});
3342
  jQuery("#form' . $form_id . ' #wdform_' . $id1 . '_element' . $form_id . '").spinner({ max: "' . $param['w_field_max_value'] . '"});
3343
  jQuery("#form' . $form_id . ' #wdform_' . $id1 . '_element' . $form_id . '").spinner({ step: "' . $param['w_field_step'] . '"});';
3344
  if ( $required ) {
@@ -3542,7 +3541,7 @@ class WDW_FMC_Library {
3542
  }
3543
  }
3544
  $onsubmit_js .= '
3545
- var disabled_fields = "";
3546
  jQuery("#form' . $form_id . ' div[wdid]").each(function() {
3547
  if(jQuery(this).css("display") == "none") {
3548
  disabled_fields += jQuery(this).attr("wdid");
@@ -3686,7 +3685,7 @@ class WDW_FMC_Library {
3686
  }
3687
  foreach ( $label_id as $key => $label ) {
3688
  if ( in_array($label, $labels) && $label_type[$key] != 'type_arithmetic_captcha'
3689
- && in_array($label, $labels) && $label_type[$key] != 'type_stripe' ) {
3690
  array_push($sorted_labels, $label_order[$key]);
3691
  array_push($sorted_labels_id, $label);
3692
  array_push($label_titles, stripslashes($label_order_original[$key]));
@@ -3891,7 +3890,7 @@ class WDW_FMC_Library {
3891
 
3892
  return $params;
3893
  }
3894
-
3895
  /**
3896
  * No items.
3897
  *
@@ -3903,58 +3902,58 @@ class WDW_FMC_Library {
3903
  $title = ($title != '') ? strtolower($title) : 'items';
3904
  ob_start();
3905
  ?><tr class="no-items">
3906
- <td class="colspanchange" colspan="0"><?php echo sprintf(__('No %s found.', WDCFM()->prefix), $title); ?></td>
3907
  </tr><?php
3908
  return ob_get_clean();
3909
  }
3910
 
3911
- /**
3912
  * Get current page url.
3913
  *
3914
  * @return string
3915
  */
3916
- public static function get_current_page_url() {
3917
- global $wp;
3918
- return add_query_arg( $_SERVER['QUERY_STRING'], '', home_url( $wp->request ) );
3919
- }
3920
-
3921
- /**
3922
  * Get all addons.
3923
  *
3924
  * @return array $addons
3925
  */
3926
- public static function get_all_addons_path() {
3927
- $addons = array(
3928
- 'form-maker-export-import/fm_exp_imp.php',
3929
- 'form-maker-save-progress/fm_save.php',
3930
- 'form-maker-conditional-emails/fm_conditional_emails.php',
3931
- 'form-maker-pushover/fm_pushover.php',
3932
- 'form-maker-mailchimp/fm_mailchimp.php',
3933
- 'form-maker-reg/fm_reg.php',
3934
- 'form-maker-post-generation/fm_post_generation.php',
3935
- 'form-maker-dropbox-integration/fm_dropbox_integration.php',
3936
- 'form-maker-gdrive-integration/fm_gdrive_integration.php',
3937
- 'form-maker-pdf-integration/fm_pdf_integration.php',
3938
- 'form-maker-stripe/fm_stripe.php',
3939
- 'form-maker-calculator/fm_calculator.php'
3940
- );
3941
- return $addons;
3942
- }
3943
 
3944
  /**
3945
  * Deactivate all addons.
3946
  *
3947
  * @return bool $addon
3948
  */
3949
- public static function deactivate_all_addons() {
3950
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
3951
- $addons = WDW_FMC_Library::get_all_addons_path();
3952
- foreach ( $addons as $addon ) {
3953
- if( is_plugin_active( $addon ) ) {
3954
- deactivate_plugins( $addon );
3955
- }
3956
- }
3957
- }
3958
 
3959
  /**
3960
  * Get countries list.
@@ -4251,13 +4250,13 @@ class WDW_FMC_Library {
4251
  })';
4252
  }
4253
 
4254
- /**
4255
  * Forbidden template.
4256
  *
4257
  * @return string
4258
  */
4259
- public static function forbidden_template() {
4260
- return '<!DOCTYPE html>
4261
  <html>
4262
  <head>
4263
  <title>403 Forbidden</title>
@@ -4266,7 +4265,7 @@ class WDW_FMC_Library {
4266
  <p>Directory access is forbidden.</p>
4267
  </body>
4268
  </html>';
4269
- }
4270
 
4271
  /**
4272
  * Sanitize parameters and send email.
@@ -4279,48 +4278,54 @@ class WDW_FMC_Library {
4279
  *
4280
  * @return bool
4281
  */
4282
- public static function mail($recipient, $subject, $message = '', $header_arr = array(), $attachment = array()) {
4283
- $recipient = trim($recipient, ',');
4284
  $recipient = explode(',', $recipient);
4285
  $recipient = array_map('trim', $recipient);
4286
  if ( empty($recipient) ) {
4287
  return FALSE;
4288
  }
4289
 
 
 
4290
  $subject = html_entity_decode($subject, ENT_QUOTES);
4291
  $subject = stripslashes($subject);
 
4292
 
4293
  $message = stripslashes($message);
4294
 
4295
  $headers = array();
4296
 
 
 
 
 
 
 
 
 
 
 
4297
  if ( isset($header_arr['from']) && $header_arr['from'] ) {
4298
  $from = $header_arr['from'];
4299
  $from = trim($from);
4300
  $from = trim($from, ',');
4301
- // $from_str = "From: ";
4302
- if ( isset($header_arr['from_name']) && $header_arr['from_name'] ) {
4303
- $from_name = $header_arr['from_name'];
4304
- $from_name = html_entity_decode($from_name, ENT_QUOTES);
4305
- $from_name = stripslashes($from_name);
4306
- // $from_str .= "'" . $from_name . "' ";
4307
- self::$email_from_name = $from_name;
4308
- add_filter('wp_mail_from_name', array('WDW_FMC_Library', 'mail_from_name'));
4309
- }
4310
- // $from_str .= "<" . $from . ">";
4311
- // $headers[] = $from_str;
4312
  self::$email_from = $from;
4313
  add_filter('wp_mail_from', array('WDW_FMC_Library', 'mail_from'));
4314
  }
4315
 
4316
  if ( isset($header_arr['content_type']) && $header_arr['content_type'] ) {
4317
- // $headers[] = "Content-Type: " . $header_arr['content_type'];
4318
  self::$email_content_type = $header_arr['content_type'];
4319
  add_filter('wp_mail_content_type', array('WDW_FMC_Library', 'mail_content_type'));
4320
  }
4321
 
4322
  if ( isset($header_arr['charset']) && $header_arr['charset'] ) {
4323
- // $headers[] = $header_arr['charset'];
4324
  self::$email_charset = $header_arr['charset'];
4325
  add_filter('wp_mail_charset', array('WDW_FMC_Library', 'mail_charset'));
4326
  }
@@ -4359,7 +4364,7 @@ class WDW_FMC_Library {
4359
  public static $email_charset;
4360
  public static $email_from;
4361
  public static $email_from_name;
4362
- public static function mail_content_type() {
4363
  return self::$email_content_type;
4364
  }
4365
  public static function mail_charset() {
@@ -4372,7 +4377,7 @@ class WDW_FMC_Library {
4372
  return self::$email_from_name;
4373
  }
4374
  }
4375
-
4376
  /*
4377
  * Rre.
4378
  *
@@ -4382,14 +4387,14 @@ class WDW_FMC_Library {
4382
  * @return string $data
4383
  */
4384
  if (!function_exists('pre')) {
4385
- function pre($data = false, $e = false)
4386
- {
4387
- $bt = debug_backtrace();
4388
- $caller = array_shift($bt);
4389
- print "<pre><xmp>";
4390
- print_r($data);
4391
- print "\r\n Called in : " . $caller['file'] . ", At line:" . $caller['line'];
4392
- echo "</xmp></pre>\n";
4393
- if ($e) { exit; }
4394
- }
4395
  }
127
  break;
128
  default: {
129
  $message = '';
130
+ break;
131
  }
132
  }
133
  }
143
  }
144
 
145
  return $message;
146
+ }
147
 
148
  /**
149
  * Generate message.
161
  }
162
  return $message;
163
  }
164
+
165
  public static function fm_container($theme_id, $form_body) {
166
  return '<div class="fm-form-container fm-theme' . $theme_id . '">' . $form_body . '</div>';
167
  }
179
  * @return string
180
  */
181
  public static function ordering($id, $orderby, $order, $text, $page_url, $additional_class = '') {
182
+ $class = array(
183
  ($orderby == $id ? 'sorted': 'sortable'),
184
  $order,
185
  $additional_class,
202
  public static function search($search_by, $search_value, $form_id) {
203
  ?>
204
  <div class="alignleft actions" style="clear:both;">
205
+ <script>
206
+ function fm_search() {
207
+ document.getElementById("page_number").value = "1";
208
+ document.getElementById("search_or_not").value = "search";
209
+ document.getElementById("<?php echo $form_id; ?>").submit();
210
+ }
211
+ function fm_reset() {
212
+ if (document.getElementById("search_value")) {
213
+ document.getElementById("search_value").value = "";
214
+ }
215
+ if (document.getElementById("search_select_value")) {
216
+ document.getElementById("search_select_value").value = 0;
217
+ }
218
+ document.getElementById("<?php echo $form_id; ?>").submit();
219
+ }
220
+ </script>
221
+ <div class="fm-search">
222
+ <label for="search_value"><?php echo $search_by; ?>:</label>
223
+ <input type="text" id="search_value" name="search_value" value="<?php echo esc_html($search_value); ?>"/>
224
+ <button class="fm-icon search-icon" onclick="fm_search()">
225
+ </button>
226
+ <button class="fm-icon reset-icon" onclick="fm_reset()">
227
+ </button>
228
+ </div>
229
+ </div>
230
  <?php
231
  }
232
 
243
  <div class="alignleft actions" >
244
  <label for="search_select_value" style="font-size:14px; width:50px; display:inline-block;"><?php echo $search_by; ?>:</label>
245
  <select id="search_select_value" name="search_select_value" onchange="fm_search_select();" style="float: none; width: 150px;">
246
+ <?php
247
  foreach ($playlists as $id => $playlist) {
248
  ?>
249
  <option value="<?php echo $id; ?>" <?php echo (($search_select_value == $id) ? 'selected="selected"' : ''); ?>><?php echo $playlist; ?></option>
250
  <?php
251
  }
252
+ ?>
253
  </select>
254
  </div>
255
  </div>
273
  ?>
274
  <script type="text/javascript">
275
  var items_county = <?php echo $items_county; ?>;
276
+ function fm_page(x, y) {
277
  switch (y) {
278
  case 1:
279
  if (x >= items_county) {
300
  default:
301
  document.getElementById('page_number').value = 1;
302
  }
303
+
304
+ jQuery('#pagination_clicked').val('1');
305
  document.getElementById('<?php echo $form_id; ?>').submit();
306
  }
307
 
309
  var key_code = (e.keyCode ? e.keyCode : e.which);
310
  if (key_code == 13) { /*Enter keycode*/
311
  if (jQuery('#current_page').val() >= items_county) {
312
+ document.getElementById('page_number').value = items_county;
313
  }
314
  else {
315
+ document.getElementById('page_number').value = jQuery('#current_page').val();
316
  }
317
+ jQuery('#pagination_clicked').val('1');
318
  document.getElementById('<?php echo $form_id; ?>').submit();
319
  }
320
  return true;
330
  </span>
331
  <?php
332
  if ($count_items > $items_per_page) {
333
+ $first_page = "first-page";
334
+ $prev_page = "prev-page";
335
+ $next_page = "next-page";
336
+ $last_page = "last-page";
337
+ if ($page_number == 1) {
338
+ $first_page = "first-page disabled";
339
+ $prev_page = "prev-page disabled";
340
  $next_page = "next-page";
341
  $last_page = "last-page";
342
+ }
343
+ if ($page_number >= $items_county) {
344
+ $first_page = "first-page ";
345
+ $prev_page = "prev-page";
346
+ $next_page = "next-page disabled";
347
+ $last_page = "last-page disabled";
348
+ }
 
 
 
 
 
349
  ?>
350
  <span class="pagination-links">
351
  <a class="<?php echo $first_page; ?>" title="Go to the first page" href="javascript:fm_page(<?php echo $page_number; ?>,-2);">«</a>
353
  <span class="paging-input">
354
  <span class="total-pages">
355
  <input class="current_page" id="current_page" name="current_page" value="<?php echo $page_number; ?>" onkeypress="return check_enter_key(event)" title="Go to the page" type="text" size="1" />
356
+ </span> of
357
  <span class="total-pages">
358
  <?php echo $items_county; ?>
359
  </span>
361
  <a class="<?php echo $next_page ?>" title="Go to the next page" href="javascript:fm_page(<?php echo $page_number; ?>,1);">›</a>
362
  <a class="<?php echo $last_page ?>" title="Go to the last page" href="javascript:fm_page(<?php echo $page_number; ?>,2);">»</a>
363
  <?php
364
+ }
365
+ ?>
366
  </span>
367
  </div>
368
  <input type="hidden" id="page_number" name="page_number" value="<?php echo ((isset($_POST['page_number'])) ? (int) $_POST['page_number'] : 1); ?>" />
443
  }
444
  fm_ajax_save('<?php echo $form_id; ?>');
445
  }
446
+ function check_enter_key(e) {
447
  var key_code = (e.keyCode ? e.keyCode : e.which);
448
  if (key_code == 13) { /*Enter keycode*/
449
  if (jQuery('#current_page').val() >= items_county) {
450
+ document.getElementById('page_number').value = items_county;
451
  }
452
  else {
453
+ document.getElementById('page_number').value = jQuery('#current_page').val();
454
  }
455
+
456
  fm_ajax_save('<?php echo $form_id; ?>');
457
  return false;
458
  }
459
+ return true;
460
  }
461
  </script>
462
  <div id="tablenav-pages" class="tablenav-pages">
469
  </span>
470
  <?php
471
  if ($count_items > $limit) {
472
+ $first_page = "first-page";
473
+ $prev_page = "prev-page";
474
+ $next_page = "next-page";
475
+ $last_page = "last-page";
476
+ if ($page_number == 1) {
477
+ $first_page = "first-page disabled";
478
+ $prev_page = "prev-page disabled";
479
  $next_page = "next-page";
480
  $last_page = "last-page";
481
+ }
482
+ if ($page_number >= $items_county) {
483
+ $first_page = "first-page ";
484
+ $prev_page = "prev-page";
485
+ $next_page = "next-page disabled";
486
+ $last_page = "last-page disabled";
487
+ }
 
 
 
 
 
488
  ?>
489
  <span class="pagination-links">
490
  <a class="<?php echo $first_page; ?>" title="Go to the first page" onclick="fm_page(<?php echo $page_number; ?>,-2)">«</a>
492
  <span class="paging-input">
493
  <span class="total-pages">
494
  <input class="current_page" id="current_page" name="current_page" value="<?php echo $page_number; ?>" onkeypress="return check_enter_key(event)" title="Go to the page" type="text" size="1" />
495
+ </span> of
496
  <span class="total-pages">
497
  <?php echo $items_county; ?>
498
  </span>
500
  <a class="<?php echo $next_page ?>" title="Go to the next page" onclick="fm_page(<?php echo $page_number; ?>,1)">›</a>
501
  <a class="<?php echo $last_page ?>" title="Go to the last page" onclick="fm_page(<?php echo $page_number; ?>,2)">»</a>
502
  <?php
503
+ }
504
+ ?>
505
  </span>
506
  </div>
507
  <input type="hidden" id="page_number" name="page_number" value="<?php echo ((isset($_POST['page_number'])) ? (int) $_POST['page_number'] : 1); ?>" />
520
  }
521
 
522
  public static function get_google_fonts() {
523
+ $google_fonts = array( 'Open Sans' => 'Open Sans', 'Oswald' => 'Oswald', 'Droid Sans' => 'Droid Sans', 'Lato' => 'Lato', 'Open Sans Condensed' => 'Open Sans Condensed', 'PT Sans' => 'PT Sans', 'Ubuntu' => 'Ubuntu', 'PT Sans Narrow' => 'PT Sans Narrow', 'Yanone Kaffeesatz' => 'Yanone Kaffeesatz', 'Roboto Condensed' => 'Roboto Condensed', 'Source Sans Pro' => 'Source Sans Pro', 'Nunito' => 'Nunito', 'Francois One' => 'Francois One', 'Roboto' => 'Roboto', 'Raleway' => 'Raleway', 'Arimo' => 'Arimo', 'Cuprum' => 'Cuprum', 'Play' => 'Play', 'Dosis' => 'Dosis', 'Abel' => 'Abel', 'Droid Serif' => 'Droid Serif', 'Arvo' => 'Arvo', 'Lora' => 'Lora', 'Rokkitt' => 'Rokkitt', 'PT Serif' => 'PT Serif', 'Bitter' => 'Bitter', 'Merriweather' => 'Merriweather', 'Vollkorn' => 'Vollkorn', 'Cantata One' => 'Cantata One', 'Kreon' => 'Kreon', 'Josefin Slab' => 'Josefin Slab', 'Playfair Display' => 'Playfair Display', 'Bree Serif' => 'Bree Serif', 'Crimson Text' => 'Crimson Text', 'Old Standard TT' => 'Old Standard TT', 'Sanchez' => 'Sanchez', 'Crete Round' => 'Crete Round', 'Cardo' => 'Cardo', 'Noticia Text' => 'Noticia Text', 'Judson' => 'Judson', 'Lobster' => 'Lobster', 'Unkempt' => 'Unkempt', 'Changa One' => 'Changa One', 'Special Elite' => 'Special Elite', 'Chewy' => 'Chewy', 'Comfortaa' => 'Comfortaa', 'Boogaloo' => 'Boogaloo', 'Fredoka One' => 'Fredoka One', 'Luckiest Guy' => 'Luckiest Guy', 'Cherry Cream Soda' => 'Cherry Cream Soda', 'Lobster Two' => 'Lobster Two', 'Righteous' => 'Righteous', 'Squada One' => 'Squada One', 'Black Ops One' => 'Black Ops One', 'Happy Monkey' => 'Happy Monkey', 'Passion One' => 'Passion One', 'Nova Square' => 'Nova Square', 'Metamorphous' => 'Metamorphous', 'Poiret One' => 'Poiret One', 'Bevan' => 'Bevan', 'Shadows Into Light' => 'Shadows Into Light', 'The Girl Next Door' => 'The Girl Next Door', 'Coming Soon' => 'Coming Soon', 'Dancing Script' => 'Dancing Script', 'Pacifico' => 'Pacifico', 'Crafty Girls' => 'Crafty Girls', 'Calligraffitti' => 'Calligraffitti', 'Rock Salt' => 'Rock Salt', 'Amatic SC' => 'Amatic SC', 'Leckerli One' => 'Leckerli One', 'Tangerine' => 'Tangerine', 'Reenie Beanie' => 'Reenie Beanie', 'Satisfy' => 'Satisfy', 'Gloria Hallelujah' => 'Gloria Hallelujah', 'Permanent Marker' => 'Permanent Marker', 'Covered By Your Grace' => 'Covered By Your Grace', 'Walter Turncoat' => 'Walter Turncoat', 'Patrick Hand' => 'Patrick Hand', 'Schoolbell' => 'Schoolbell', 'Indie Flower' => 'Indie Flower' );
524
+ return $google_fonts;
525
+ }
526
 
527
  public static function cleanData( &$str ) {
528
  $str = preg_replace("/\t/", "\\t", $str);
1389
  }
1390
  if ( $blur ) {
1391
  $condition_js .= '
1392
+ jQuery("' . substr($blur, 0, -2) . '").blur(function() {
1393
  if(' . $if . ')
1394
  jQuery("#form' . $form_id . ' div[wdid=' . $field_label[$k] . ']").' . $display . ';
1395
  else
1832
  else {
1833
  if(jQuery("#wdform_' . $id1 . '_state' . $form_id . '").prop("tagName") == "SELECT") {
1834
  jQuery("#wdform_' . $id1 . '_state' . $form_id . '").parent().append("<input type=\"text\" id=\"wdform_' . $id1 . '_state' . $form_id . '\" name=\"wdform_' . ($id1 + 3) . '_state' . $form_id . '\" value=\"' . (isset($_POST['wdform_' . ($id1 + 3) . '_state' . $form_id]) ? esc_html(stripslashes($_POST['wdform_' . ($id1 + 3) . '_state' . $form_id])) : "") . '\" style=\"width: 100%;\" ' . $param['attributes'] . '><label class=\"mini_label\">' . $w_mini_labels[3] . '</label>");
1835
+ jQuery("#wdform_' . $id1 . '_state' . $form_id . '").parent().children("select:first, label:first").remove();
1836
  }
1837
  }
1838
  });';
2257
  }
2258
  $date_format= str_replace('%', '', $param['w_format']);
2259
 
2260
+ $onsubmit_js .= '
2261
  jQuery("<input type=\"hidden\" name=\"wdform_' . $id1 . '_date_format' . $form_id . '\" value=\"' . $date_format . '\" />").appendTo("#form' . $form_id . '");';
2262
  break;
2263
  }
2371
  return [ invalid_dates_finish.indexOf(string_days) == -1 ' . $w_hide_sunday . $w_hide_monday . $w_hide_tuesday . $w_hide_wednesday . $w_hide_thursday . $w_hide_friday . $w_hide_saturday . '];
2372
  }
2373
  });
2374
+ var default_date;
2375
+ var date_value = jQuery("#wdform_' . $id1 . '_element' . $form_id . '").val();
2376
  (date_value != "") ? default_date = date_value : default_date = "' . $default_date . '";
2377
  var format_date = "' . $param['w_format'] . '";
2378
  jQuery("#wdform_' . $id1 . '_element' . $form_id . '").datepicker("option", "dateFormat", format_date);
2383
  jQuery("#wdform_' . $id1 . '_element' . $form_id . '").datepicker("setDate", default_date);
2384
  }
2385
  else {
 
2386
  jQuery("#wdform_' . $id1 . '_element' . $form_id . '").datepicker("setDate", default_date);
2387
  }';
2388
  break;
2507
  return [ invalid_dates_finish.indexOf(string_days) == -1 ' . $w_hide_sunday . $w_hide_monday . $w_hide_tuesday . $w_hide_wednesday . $w_hide_thursday . $w_hide_friday . $w_hide_saturday . '];
2508
  }
2509
  });
2510
+ var default_date_start;
2511
+ var date_start_value = jQuery("#wdform_' . $id1 . '_element' . $form_id . '0").val();
2512
+ (date_start_value != "") ? default_date_start = date_start_value : default_date_start = "' . $param['w_default_date_start'] . '";
2513
  var format_date = "' . $param['w_format'] . '";
2514
  jQuery("#wdform_' . $id1 . '_element' . $form_id . '").datepicker("option", "dateFormat", format_date);
2515
  if(default_date_start =="today") {
2531
  jQuery("#wdform_' . $id1 . '_element' . $form_id . '1").datepicker("option", "minDate", default_date_start);
2532
  }
2533
  var default_date_end;
2534
+ var date_end_value = jQuery("#wdform_' . $id1 . '_element' . $form_id . '1").val();
2535
+ (date_end_value != "") ? default_date_end = date_end_value : default_date_end = "' . $param['w_default_date_end'] . '";
2536
  var format_date = "' . $param['w_format'] . '";
2537
  jQuery("#wdform_' . $id1 . '_element' . $form_id . '0").datepicker("option", "dateFormat", format_date);
2538
  jQuery("#wdform_' . $id1 . '_element' . $form_id . '1").datepicker("option", "dateFormat", format_date);
3337
  jQuery("#form' . $form_id . ' #wdform_' . $id1 . '_element' . $form_id . '")[0].spin = null;
3338
  spinner = jQuery("#form' . $form_id . ' #wdform_' . $id1 . '_element' . $form_id . '").spinner();
3339
  if ("' . $param['w_field_value'] . '" == "null") { spinner.spinner("value", ""); }
3340
+ jQuery("#form' . $form_id . ' #wdform_' . $id1 . '_element' . $form_id . '").spinner({ min: "' . $param['w_field_min_value'] . '"});
3341
  jQuery("#form' . $form_id . ' #wdform_' . $id1 . '_element' . $form_id . '").spinner({ max: "' . $param['w_field_max_value'] . '"});
3342
  jQuery("#form' . $form_id . ' #wdform_' . $id1 . '_element' . $form_id . '").spinner({ step: "' . $param['w_field_step'] . '"});';
3343
  if ( $required ) {
3541
  }
3542
  }
3543
  $onsubmit_js .= '
3544
+ var disabled_fields = "";
3545
  jQuery("#form' . $form_id . ' div[wdid]").each(function() {
3546
  if(jQuery(this).css("display") == "none") {
3547
  disabled_fields += jQuery(this).attr("wdid");
3685
  }
3686
  foreach ( $label_id as $key => $label ) {
3687
  if ( in_array($label, $labels) && $label_type[$key] != 'type_arithmetic_captcha'
3688
+ && in_array($label, $labels) && $label_type[$key] != 'type_stripe' ) {
3689
  array_push($sorted_labels, $label_order[$key]);
3690
  array_push($sorted_labels_id, $label);
3691
  array_push($label_titles, stripslashes($label_order_original[$key]));
3890
 
3891
  return $params;
3892
  }
3893
+
3894
  /**
3895
  * No items.
3896
  *
3902
  $title = ($title != '') ? strtolower($title) : 'items';
3903
  ob_start();
3904
  ?><tr class="no-items">
3905
+ <td class="colspanchange" colspan="0"><?php echo sprintf(__('No %s found.', WDCFM()->prefix), $title); ?></td>
3906
  </tr><?php
3907
  return ob_get_clean();
3908
  }
3909
 
3910
+ /**
3911
  * Get current page url.
3912
  *
3913
  * @return string
3914
  */
3915
+ public static function get_current_page_url() {
3916
+ global $wp;
3917
+ return add_query_arg( $_SERVER['QUERY_STRING'], '', home_url( $wp->request ) );
3918
+ }
3919
+
3920
+ /**
3921
  * Get all addons.
3922
  *
3923
  * @return array $addons
3924
  */
3925
+ public static function get_all_addons_path() {
3926
+ $addons = array(
3927
+ 'form-maker-export-import/fm_exp_imp.php',
3928
+ 'form-maker-save-progress/fm_save.php',
3929
+ 'form-maker-conditional-emails/fm_conditional_emails.php',
3930
+ 'form-maker-pushover/fm_pushover.php',
3931
+ 'form-maker-mailchimp/fm_mailchimp.php',
3932
+ 'form-maker-reg/fm_reg.php',
3933
+ 'form-maker-post-generation/fm_post_generation.php',
3934
+ 'form-maker-dropbox-integration/fm_dropbox_integration.php',
3935
+ 'form-maker-gdrive-integration/fm_gdrive_integration.php',
3936
+ 'form-maker-pdf-integration/fm_pdf_integration.php',
3937
+ 'form-maker-stripe/fm_stripe.php',
3938
+ 'form-maker-calculator/fm_calculator.php'
3939
+ );
3940
+ return $addons;
3941
+ }
3942
 
3943
  /**
3944
  * Deactivate all addons.
3945
  *
3946
  * @return bool $addon
3947
  */
3948
+ public static function deactivate_all_addons() {
3949
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
3950
+ $addons = WDW_FMC_Library::get_all_addons_path();
3951
+ foreach ( $addons as $addon ) {
3952
+ if( is_plugin_active( $addon ) ) {
3953
+ deactivate_plugins( $addon );
3954
+ }
3955
+ }
3956
+ }
3957
 
3958
  /**
3959
  * Get countries list.
4250
  })';
4251
  }
4252
 
4253
+ /**
4254
  * Forbidden template.
4255
  *
4256
  * @return string
4257
  */
4258
+ public static function forbidden_template() {
4259
+ return '<!DOCTYPE html>
4260
  <html>
4261
  <head>
4262
  <title>403 Forbidden</title>
4265
  <p>Directory access is forbidden.</p>
4266
  </body>
4267
  </html>';
4268
+ }
4269
 
4270
  /**
4271
  * Sanitize parameters and send email.
4278
  *
4279
  * @return bool
4280
  */
4281
+ public static function mail($recipient, $subject, $message = '', $header_arr = array(), $attachment = array()) {
4282
+ $recipient = trim($recipient, ',');
4283
  $recipient = explode(',', $recipient);
4284
  $recipient = array_map('trim', $recipient);
4285
  if ( empty($recipient) ) {
4286
  return FALSE;
4287
  }
4288
 
4289
+ mb_internal_encoding('UTF-8');
4290
+
4291
  $subject = html_entity_decode($subject, ENT_QUOTES);
4292
  $subject = stripslashes($subject);
4293
+ $subject = mb_encode_mimeheader($subject, 'UTF-8', 'Q');
4294
 
4295
  $message = stripslashes($message);
4296
 
4297
  $headers = array();
4298
 
4299
+ if ( isset($header_arr['from_name']) && $header_arr['from_name'] ) {
4300
+ $from_name = $header_arr['from_name'];
4301
+ $from_name = html_entity_decode($from_name, ENT_QUOTES);
4302
+ $from_name = stripslashes($from_name);
4303
+ $from_name = mb_encode_mimeheader($from_name, 'UTF-8', 'Q');
4304
+ // $from_str .= "'" . $from_name . "' ";
4305
+ self::$email_from_name = $from_name;
4306
+ add_filter('wp_mail_from_name', array('WDW_FMC_Library', 'mail_from_name'));
4307
+ }
4308
+
4309
  if ( isset($header_arr['from']) && $header_arr['from'] ) {
4310
  $from = $header_arr['from'];
4311
  $from = trim($from);
4312
  $from = trim($from, ',');
4313
+ // $from_str = "From: ";
4314
+
4315
+ // $from_str .= "<" . $from . ">";
4316
+ // $headers[] = $from_str;
 
 
 
 
 
 
 
4317
  self::$email_from = $from;
4318
  add_filter('wp_mail_from', array('WDW_FMC_Library', 'mail_from'));
4319
  }
4320
 
4321
  if ( isset($header_arr['content_type']) && $header_arr['content_type'] ) {
4322
+ // $headers[] = "Content-Type: " . $header_arr['content_type'];
4323
  self::$email_content_type = $header_arr['content_type'];
4324
  add_filter('wp_mail_content_type', array('WDW_FMC_Library', 'mail_content_type'));
4325
  }
4326
 
4327
  if ( isset($header_arr['charset']) && $header_arr['charset'] ) {
4328
+ // $headers[] = $header_arr['charset'];
4329
  self::$email_charset = $header_arr['charset'];
4330
  add_filter('wp_mail_charset', array('WDW_FMC_Library', 'mail_charset'));
4331
  }
4364
  public static $email_charset;
4365
  public static $email_from;
4366
  public static $email_from_name;
4367
+ public static function mail_content_type() {
4368
  return self::$email_content_type;
4369
  }
4370
  public static function mail_charset() {
4377
  return self::$email_from_name;
4378
  }
4379
  }
4380
+
4381
  /*
4382
  * Rre.
4383
  *
4387
  * @return string $data
4388
  */
4389
  if (!function_exists('pre')) {
4390
+ function pre($data = false, $e = false)
4391
+ {
4392
+ $bt = debug_backtrace();
4393
+ $caller = array_shift($bt);
4394
+ print "<pre><xmp>";
4395
+ print_r($data);
4396
+ print "\r\n Called in : " . $caller['file'] . ", At line:" . $caller['line'];
4397
+ echo "</xmp></pre>\n";
4398
+ if ($e) { exit; }
4399
+ }
4400
  }
frontend/models/form_maker.php CHANGED
@@ -3061,8 +3061,8 @@ class FMModelForm_maker_fmc {
3061
 
3062
  if ( $row->mail_from_user != '' ) {
3063
  $header_arr['from'] = $row->mail_from_user;
3064
- $header_arr['from_name'] = $fromname;
3065
  }
 
3066
  $header_arr['content_type'] = $content_type;
3067
  $header_arr['charset'] = 'charset=UTF-8';
3068
  $header_arr['reply_to'] = $row->reply_to_user;
@@ -3200,8 +3200,8 @@ class FMModelForm_maker_fmc {
3200
  }
3201
  if ( $row->from_mail ) {
3202
  $header_arr['from'] = isset($_POST['wdform_' . $row->from_mail . "_element" . $id]) ? $_POST['wdform_' . $row->from_mail . "_element" . $id] : $row->from_mail;
3203
- $header_arr['from_name'] = $fromname;
3204
  }
 
3205
  $header_arr['content_type'] = $content_type;
3206
  $header_arr['charset'] = 'charset=UTF-8';
3207
  $header_arr['reply_to'] = isset($_POST['wdform_' . $row->reply_to . "_element" . $id]) ? $_POST['wdform_' . $row->reply_to . "_element" . $id] : $row->reply_to;
3061
 
3062
  if ( $row->mail_from_user != '' ) {
3063
  $header_arr['from'] = $row->mail_from_user;
 
3064
  }
3065
+ $header_arr['from_name'] = $fromname;
3066
  $header_arr['content_type'] = $content_type;
3067
  $header_arr['charset'] = 'charset=UTF-8';
3068
  $header_arr['reply_to'] = $row->reply_to_user;
3200
  }
3201
  if ( $row->from_mail ) {
3202
  $header_arr['from'] = isset($_POST['wdform_' . $row->from_mail . "_element" . $id]) ? $_POST['wdform_' . $row->from_mail . "_element" . $id] : $row->from_mail;
 
3203
  }
3204
+ $header_arr['from_name'] = $fromname;
3205
  $header_arr['content_type'] = $content_type;
3206
  $header_arr['charset'] = 'charset=UTF-8';
3207
  $header_arr['reply_to'] = isset($_POST['wdform_' . $row->reply_to . "_element" . $id]) ? $_POST['wdform_' . $row->reply_to . "_element" . $id] : $row->reply_to;
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: 3.4
5
  Tested up to: 4.9
6
- Stable tag: 1.12.16
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -39,7 +39,7 @@ This contact form builder will equally fit the needs of the novice and experienc
39
  * Data validation before the submission of the form.
40
  * Conditional logic
41
 
42
- Please note, that if youre looking to add more complex, custom online forms with more field types, File upload field, Stripe and PayPal integrations, and many other premium features, you can use the [Contact Form Maker premium plugin](https://web-dorado.com/products/wordpress-contact-form-maker-plugin.html), which is a more advanced form builder tool.
43
 
44
  Contact Form Maker WordPress plugin comes with pre-built templates, but in case you need custom forms, feel free to create your own advanced forms. The form creation process with the plugin is quick and easy.
45
 
@@ -72,6 +72,9 @@ After downloading the ZIP file,
72
 
73
  == Changelog ==
74
 
 
 
 
75
  = 1.12.16 =
76
  * Improved: Email functionality.
77
  * Fixed: Multiple choice and single choice with long labels.
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: 3.4
5
  Tested up to: 4.9
6
+ Stable tag: 1.12.17
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
39
  * Data validation before the submission of the form.
40
  * Conditional logic
41
 
42
+ Please note, that if you're looking to add more complex, custom online forms with more field types, File upload field, Stripe and PayPal integrations, and many other premium features, you can use the [Contact Form Maker premium plugin](https://web-dorado.com/products/wordpress-contact-form-maker-plugin.html), which is a more advanced form builder tool.
43
 
44
  Contact Form Maker WordPress plugin comes with pre-built templates, but in case you need custom forms, feel free to create your own advanced forms. The form creation process with the plugin is quick and easy.
45
 
72
 
73
  == Changelog ==
74
 
75
+ = 1.12.17 =
76
+ * Fixed: UTF-8 text for Email subject and Email from name.
77
+
78
  = 1.12.16 =
79
  * Improved: Email functionality.
80
  * Fixed: Multiple choice and single choice with long labels.