Contact Form by BestWebSoft - Version 3.79

Version Description

  • 06.06.2014 =
  • Bugfix : We fixed the bug with getting default settings.
  • Bugfix : We fixed the bug with plugin Contact Form Multi.
Download this release

Release Info

Developer bestwebsoft
Plugin Icon 128x128 Contact Form by BestWebSoft
Version 3.79
Comparing to
See all releases

Code changes from version 3.78 to 3.79

contact_form.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Contact Form
4
  Plugin URI: http://bestwebsoft.com/plugin/
5
  Description: Plugin for Contact Form.
6
  Author: BestWebSoft
7
- Version: 3.78
8
  Author URI: http://bestwebsoft.com/
9
  License: GPLv2 or later
10
  */
@@ -214,15 +214,43 @@ if ( ! function_exists( 'cntctfrm_settings' ) ) {
214
 
215
  /* Get options from the database */
216
  if ( 1 == $wpmu ) {
217
- if ( get_site_option( 'cntctfrmmlt_options_'. $_SESSION['cntctfrmmlt_id_form'] ) )
218
- $cntctfrm_options = get_site_option( 'cntctfrmmlt_options_'. $_SESSION['cntctfrmmlt_id_form'] );
219
- else
220
- $cntctfrm_options = get_site_option( 'cntctfrmmlt_options' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  } else {
222
- if ( get_option( 'cntctfrmmlt_options_' . $_SESSION['cntctfrmmlt_id_form'] ) )
223
- $cntctfrm_options = get_option( 'cntctfrmmlt_options_'. $_SESSION['cntctfrmmlt_id_form'] );
224
- else
 
 
 
 
 
 
 
 
 
 
 
 
 
225
  $cntctfrm_options = get_option( 'cntctfrmmlt_options' );
 
226
  }
227
  } else {
228
  /* Get options from the database */
@@ -290,34 +318,41 @@ if ( ! function_exists ( 'cntctfrm_db_create' ) ) {
290
  function cntctfrm_db_create() {
291
  global $wpdb;
292
  $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "cntctfrm_field" );
293
- $sql = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "cntctfrm_field` (
294
- id int NOT NULL AUTO_INCREMENT,
295
- name CHAR(100) NOT NULL,
296
- UNIQUE KEY id (id)
297
- );";
298
- require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
299
- dbDelta( $sql );
300
- $fields = array(
301
- 'name',
302
- 'email',
303
- 'subject',
304
- 'message',
305
- 'address',
306
- 'phone',
307
- 'attachment',
308
- 'attachment_explanations',
309
- 'send_copy',
310
- 'sent_from',
311
- 'date_time',
312
- 'coming_from',
313
- 'user_agent'
314
- );
315
- foreach ( $fields as $key => $value ) {
316
- $db_row = $wpdb->get_row( "SELECT * FROM " . $wpdb->prefix . "cntctfrm_field WHERE `name` = '" . $value . "'", ARRAY_A );
317
- if ( !isset( $db_row ) || empty( $db_row ) ) {
318
- $wpdb->insert( $wpdb->prefix . "cntctfrm_field", array( 'name' => $value ), array( '%s' ) );
319
- }
320
  }
 
 
 
 
 
 
 
 
321
  }
322
  }
323
 
@@ -1620,18 +1655,13 @@ if ( ! function_exists( 'cntctfrm_display_form' ) ) {
1620
  if ( is_plugin_active( 'contact-form-multi/contact-form-multi.php' ) || is_plugin_active_for_network( 'contact-form-multi/contact-form-multi.php' ) ||
1621
  is_plugin_active( 'contact-form-multi-pro/contact-form-multi-pro.php' ) || is_plugin_active_for_network( 'contact-form-multi-pro/contact-form-multi-pro.php' ) ) {
1622
 
1623
- $_SESSION['cntctfrmmlt_mailto'] = '';
1624
  extract( shortcode_atts( array( 'id' => $cntctfrmmlt_ide ), $atts ) );
1625
 
1626
- if ( ! isset( $atts['id'] ) ) {
1627
- $cntctfrm_options = get_option( 'cntctfrmmlt_options' );
1628
- $_SESSION['cntctfrmmlt_mailto'] = $cntctfrm_options['cntctfrm_user_email'];
1629
- } else {
1630
  $cntctfrm_options = get_option( 'cntctfrmmlt_options_' . $atts['id'] );
1631
- $_SESSION['cntctfrmmlt_mailto'] = $cntctfrm_options['cntctfrm_user_email'];
1632
- }
1633
- if ( ! $cntctfrm_options )
1634
  $cntctfrm_options = get_option( 'cntctfrmmlt_options' );
 
1635
  } else {
1636
  $cntctfrm_options = get_option( 'cntctfrm_options' );
1637
  }
@@ -1908,9 +1938,9 @@ if ( ! function_exists( 'cntctfrm_check_form' ) ) {
1908
  if ( ! apply_filters( 'cntctfrm_check_form', $_POST ) )
1909
  $error_message['error_captcha'] = $cntctfrm_options['cntctfrm_captcha_error'][ $language ];
1910
  if ( isset( $_FILES["cntctfrm_contact_attachment"]["tmp_name"] ) && "" != $_FILES["cntctfrm_contact_attachment"]["tmp_name"] ) {
1911
- if( is_multisite() ){
1912
  if ( defined('UPLOADS') ) {
1913
- if( ! is_dir( ABSPATH . UPLOADS ) ) {
1914
  wp_mkdir_p( ABSPATH . UPLOADS );
1915
  }
1916
  $path_of_uploaded_file = ABSPATH . UPLOADS . $_FILES["cntctfrm_contact_attachment"]["name"];
@@ -1985,7 +2015,7 @@ if ( ! function_exists( 'cntctfrm_check_form' ) ) {
1985
  /* Send mail function */
1986
  if( ! function_exists( 'cntctfrm_send_mail' ) ) {
1987
  function cntctfrm_send_mail() {
1988
- global $cntctfrm_options, $path_of_uploaded_file, $wp_version, $wpdb, $cntctfrmmlt_maito, $wpdb;
1989
  $to = $headers = "";
1990
 
1991
  $name = isset( $_POST['cntctfrm_contact_name'] ) ? $_POST['cntctfrm_contact_name'] : "";
@@ -2006,20 +2036,13 @@ if( ! function_exists( 'cntctfrm_send_mail' ) ) {
2006
  if ( isset( $_SESSION['cntctfrm_send_mail'] ) && true == $_SESSION['cntctfrm_send_mail'] )
2007
  return true;
2008
 
2009
- require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
2010
- if ( is_plugin_active( 'contact-form-multi/contact-form-multi.php' ) || is_plugin_active_for_network( 'contact-form-multi/contact-form-multi.php' ) ||
2011
- is_plugin_active( 'contact-form-multi-pro/contact-form-multi-pro.php' ) || is_plugin_active_for_network( 'contact-form-multi-pro/contact-form-multi-pro.php' ) ) {
2012
- $cntctfrmmlt_maito = $_SESSION['cntctfrmmlt_mailto'];
2013
- $to = $wpdb->get_col( "SELECT `user_email` FROM " . $wpdb->prefix . "users WHERE `user_login` = '$cntctfrmmlt_maito'" );
2014
- } else {
2015
- if ( 'user' == $cntctfrm_options['cntctfrm_select_email'] ) {
2016
- if ( '3.3' > $wp_version && function_exists('get_userdatabylogin') && false !== $user = get_userdatabylogin( $cntctfrm_options['cntctfrm_user_email'] ) ) {
2017
- $to = $user->user_email;
2018
- } elseif ( false !== $user = get_user_by( 'login', $cntctfrm_options['cntctfrm_user_email'] ) )
2019
- $to = $user->user_email;
2020
- } else {
2021
- $to = $cntctfrm_options['cntctfrm_custom_email'];
2022
- }
2023
  }
2024
 
2025
  if ( "" == $to ) {
@@ -2553,7 +2576,7 @@ if ( ! function_exists ( 'cntctfrm_delete_options' ) ) {
2553
  }
2554
  }
2555
 
2556
- register_activation_hook( __FILE__, 'cntctfrm_db_create' );
2557
 
2558
  add_action( 'admin_menu', 'cntctfrm_admin_menu' );
2559
 
4
  Plugin URI: http://bestwebsoft.com/plugin/
5
  Description: Plugin for Contact Form.
6
  Author: BestWebSoft
7
+ Version: 3.79
8
  Author URI: http://bestwebsoft.com/
9
  License: GPLv2 or later
10
  */
214
 
215
  /* Get options from the database */
216
  if ( 1 == $wpmu ) {
217
+ if ( isset( $_SESSION['cntctfrmmlt_id_form'] ) ) {
218
+ if ( get_site_option( 'cntctfrmmlt_options_'. $_SESSION['cntctfrmmlt_id_form'] ) )
219
+ $cntctfrm_options = get_site_option( 'cntctfrmmlt_options_'. $_SESSION['cntctfrmmlt_id_form'] );
220
+ else {
221
+ if ( isset( $contact_form_multi_pro_active ) )
222
+ $cntctfrmmlt_options_main = get_site_option( 'cntctfrmmltpr_options_main' );
223
+ elseif ( isset( $contact_form_multi_active ) )
224
+ $cntctfrmmlt_options_main = get_site_option( 'cntctfrmmlt_options_main' );
225
+
226
+ if ( 1 == $_SESSION['cntctfrmmlt_id_form'] && 1 == count( $cntctfrmmlt_options_main['name_id_form'] ) ) {
227
+ add_option( 'cntctfrmmlt_options_1' , get_site_option( 'cntctfrm_options' ), '', 'yes' );
228
+ $cntctfrm_options = get_site_option( 'cntctfrmmlt_options_1' );
229
+ } else
230
+ $cntctfrm_options = get_site_option( 'cntctfrmmlt_options' );
231
+ }
232
+ } else {
233
+ $cntctfrm_options = get_option( 'cntctfrmmlt_options' );
234
+ }
235
  } else {
236
+ if ( isset( $_SESSION['cntctfrmmlt_id_form'] ) ) {
237
+ if ( get_option( 'cntctfrmmlt_options_' . $_SESSION['cntctfrmmlt_id_form'] ) )
238
+ $cntctfrm_options = get_option( 'cntctfrmmlt_options_'. $_SESSION['cntctfrmmlt_id_form'] );
239
+ else {
240
+ if ( isset( $contact_form_multi_pro_active ) )
241
+ $cntctfrmmlt_options_main = get_site_option( 'cntctfrmmltpr_options_main' );
242
+ elseif ( isset( $contact_form_multi_active ) )
243
+ $cntctfrmmlt_options_main = get_site_option( 'cntctfrmmlt_options_main' );
244
+
245
+ if ( 1 == $_SESSION['cntctfrmmlt_id_form'] && 1 == count( $cntctfrmmlt_options_main['name_id_form'] ) ) {
246
+ add_option( 'cntctfrmmlt_options_1' , get_option( 'cntctfrm_options' ), '', 'yes' );
247
+ $cntctfrm_options = get_option( 'cntctfrmmlt_options_1' );
248
+ } else
249
+ $cntctfrm_options = get_option( 'cntctfrmmlt_options' );
250
+ }
251
+ } else {
252
  $cntctfrm_options = get_option( 'cntctfrmmlt_options' );
253
+ }
254
  }
255
  } else {
256
  /* Get options from the database */
318
  function cntctfrm_db_create() {
319
  global $wpdb;
320
  $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "cntctfrm_field" );
321
+ $sql = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "cntctfrm_field` (
322
+ id int NOT NULL AUTO_INCREMENT,
323
+ name CHAR(100) NOT NULL,
324
+ UNIQUE KEY id (id)
325
+ );";
326
+ require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
327
+ dbDelta( $sql );
328
+ $fields = array(
329
+ 'name',
330
+ 'email',
331
+ 'subject',
332
+ 'message',
333
+ 'address',
334
+ 'phone',
335
+ 'attachment',
336
+ 'attachment_explanations',
337
+ 'send_copy',
338
+ 'sent_from',
339
+ 'date_time',
340
+ 'coming_from',
341
+ 'user_agent'
342
+ );
343
+ foreach ( $fields as $key => $value ) {
344
+ $db_row = $wpdb->get_row( "SELECT * FROM " . $wpdb->prefix . "cntctfrm_field WHERE `name` = '" . $value . "'", ARRAY_A );
345
+ if ( !isset( $db_row ) || empty( $db_row ) ) {
346
+ $wpdb->insert( $wpdb->prefix . "cntctfrm_field", array( 'name' => $value ), array( '%s' ) );
 
347
  }
348
+ }
349
+ }
350
+ }
351
+
352
+ if ( ! function_exists ( 'cntctfrm_activation' ) ) {
353
+ function cntctfrm_activation() {
354
+ cntctfrm_settings();
355
+ cntctfrm_db_create();
356
  }
357
  }
358
 
1655
  if ( is_plugin_active( 'contact-form-multi/contact-form-multi.php' ) || is_plugin_active_for_network( 'contact-form-multi/contact-form-multi.php' ) ||
1656
  is_plugin_active( 'contact-form-multi-pro/contact-form-multi-pro.php' ) || is_plugin_active_for_network( 'contact-form-multi-pro/contact-form-multi-pro.php' ) ) {
1657
 
 
1658
  extract( shortcode_atts( array( 'id' => $cntctfrmmlt_ide ), $atts ) );
1659
 
1660
+ if ( isset( $atts['id'] ) )
 
 
 
1661
  $cntctfrm_options = get_option( 'cntctfrmmlt_options_' . $atts['id'] );
1662
+ else
 
 
1663
  $cntctfrm_options = get_option( 'cntctfrmmlt_options' );
1664
+
1665
  } else {
1666
  $cntctfrm_options = get_option( 'cntctfrm_options' );
1667
  }
1938
  if ( ! apply_filters( 'cntctfrm_check_form', $_POST ) )
1939
  $error_message['error_captcha'] = $cntctfrm_options['cntctfrm_captcha_error'][ $language ];
1940
  if ( isset( $_FILES["cntctfrm_contact_attachment"]["tmp_name"] ) && "" != $_FILES["cntctfrm_contact_attachment"]["tmp_name"] ) {
1941
+ if ( is_multisite() ) {
1942
  if ( defined('UPLOADS') ) {
1943
+ if ( ! is_dir( ABSPATH . UPLOADS ) ) {
1944
  wp_mkdir_p( ABSPATH . UPLOADS );
1945
  }
1946
  $path_of_uploaded_file = ABSPATH . UPLOADS . $_FILES["cntctfrm_contact_attachment"]["name"];
2015
  /* Send mail function */
2016
  if( ! function_exists( 'cntctfrm_send_mail' ) ) {
2017
  function cntctfrm_send_mail() {
2018
+ global $cntctfrm_options, $path_of_uploaded_file, $wp_version, $wpdb;
2019
  $to = $headers = "";
2020
 
2021
  $name = isset( $_POST['cntctfrm_contact_name'] ) ? $_POST['cntctfrm_contact_name'] : "";
2036
  if ( isset( $_SESSION['cntctfrm_send_mail'] ) && true == $_SESSION['cntctfrm_send_mail'] )
2037
  return true;
2038
 
2039
+ if ( 'user' == $cntctfrm_options['cntctfrm_select_email'] ) {
2040
+ if ( '3.3' > $wp_version && function_exists('get_userdatabylogin') && false !== $user = get_userdatabylogin( $cntctfrm_options['cntctfrm_user_email'] ) ) {
2041
+ $to = $user->user_email;
2042
+ } elseif ( false !== $user = get_user_by( 'login', $cntctfrm_options['cntctfrm_user_email'] ) )
2043
+ $to = $user->user_email;
2044
+ } else {
2045
+ $to = $cntctfrm_options['cntctfrm_custom_email'];
 
 
 
 
 
 
 
2046
  }
2047
 
2048
  if ( "" == $to ) {
2576
  }
2577
  }
2578
 
2579
+ register_activation_hook( __FILE__, 'cntctfrm_activation' );
2580
 
2581
  add_action( 'admin_menu', 'cntctfrm_admin_menu' );
2582
 
css/style.css CHANGED
File without changes
languages/contact_form-af_ZA.mo CHANGED
File without changes
languages/contact_form-af_ZA.po CHANGED
File without changes
languages/contact_form-es_ES.mo CHANGED
File without changes
languages/contact_form-es_ES.po CHANGED
File without changes
languages/contact_form-fr_FR.po CHANGED
File without changes
languages/contact_form-uk.mo CHANGED
File without changes
languages/contact_form-uk.po CHANGED
File without changes
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.2checkout.com/checkout/purchase?sid=1430388&quantity=1&
4
  Tags: attachment, contact, contatc, conact, cnotact, contact button, contact form, contact form plugin, contact me, contacts, contacts form plugin, copy, feedback, feedback form, form, insert the shortcode, post feedback, request, send, send copy, send messages, shortcode, text, web-page feedback
5
  Requires at least: 3.1
6
  Tested up to: 3.9.1
7
- Stable tag: 3.78
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -156,6 +156,10 @@ Please make sure that the problem hasn't been discussed yet on our forum (<a hre
156
 
157
  == Changelog ==
158
 
 
 
 
 
159
  = V3.78 - 20.05.2014 =
160
  * Update : We updated all functionality for wordpress 3.9.1.
161
  * Update : The French language file is updated.
@@ -507,6 +511,9 @@ Please make sure that the problem hasn't been discussed yet on our forum (<a hre
507
 
508
  == Upgrade Notice ==
509
 
 
 
 
510
  = V3.78 =
511
  We updated all functionality for wordpress 3.9.1. The French language file is updated. The Spanish language file is added. We fixed the bug of loading the user's list ( We have limited the list "The user's email address" on the settings page to the lowest role - author ).
512
 
4
  Tags: attachment, contact, contatc, conact, cnotact, contact button, contact form, contact form plugin, contact me, contacts, contacts form plugin, copy, feedback, feedback form, form, insert the shortcode, post feedback, request, send, send copy, send messages, shortcode, text, web-page feedback
5
  Requires at least: 3.1
6
  Tested up to: 3.9.1
7
+ Stable tag: 3.79
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
156
 
157
  == Changelog ==
158
 
159
+ = V3.79 - 06.06.2014 =
160
+ * Bugfix : We fixed the bug with getting default settings.
161
+ * Bugfix : We fixed the bug with plugin Contact Form Multi.
162
+
163
  = V3.78 - 20.05.2014 =
164
  * Update : We updated all functionality for wordpress 3.9.1.
165
  * Update : The French language file is updated.
511
 
512
  == Upgrade Notice ==
513
 
514
+ = V3.79 =
515
+ We fixed the bug with getting default settings. We fixed the bug with plugin Contact Form Multi.
516
+
517
  = V3.78 =
518
  We updated all functionality for wordpress 3.9.1. The French language file is updated. The Spanish language file is added. We fixed the bug of loading the user's list ( We have limited the list "The user's email address" on the settings page to the lowest role - author ).
519
 
screenshot-2.png CHANGED
File without changes
screenshot-4.png CHANGED
File without changes
screenshot-5.png CHANGED
File without changes
screenshot-6.png CHANGED
File without changes