Contact Form by BestWebSoft - Version 3.99

Version Description

  • 27.04.2016 =
  • Bugfix : The bug with adding options to the database was fixed.
Download this release

Release Info

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

Code changes from version 3.98 to 3.99

Files changed (2) hide show
  1. contact_form.php +24 -18
  2. readme.txt +9 -3
contact_form.php CHANGED
@@ -6,7 +6,7 @@ Description: Plugin for Contact Form.
6
  Author: BestWebSoft
7
  Text Domain: contact-form-plugin
8
  Domain Path: /languages
9
- Version: 3.98
10
  Author URI: http://bestwebsoft.com/
11
  License: GPLv2 or later
12
  */
@@ -118,7 +118,7 @@ if ( ! function_exists ( 'cntctfrm_plugins_loaded' ) ) {
118
 
119
  /* Register settings for plugin */
120
  if ( ! function_exists( 'cntctfrm_settings' ) ) {
121
- function cntctfrm_settings() {
122
  global $cntctfrm_options, $cntctfrm_option_defaults, $cntctfrm_plugin_info;
123
  $cntctfrm_db_version = "1.0";
124
 
@@ -290,16 +290,17 @@ if ( ! function_exists( 'cntctfrm_settings' ) ) {
290
  }
291
 
292
  /* Get options from the database */
293
- if ( isset( $_SESSION['cntctfrmmlt_id_form'] ) ) {
294
- if ( get_option( 'cntctfrmmlt_options_' . $_SESSION['cntctfrmmlt_id_form'] ) ) {
295
- $cntctfrm_options = get_option( 'cntctfrmmlt_options_'. $_SESSION['cntctfrmmlt_id_form'] );
 
296
  } else {
297
  if ( isset( $contact_form_multi_pro_active ) )
298
  $cntctfrmmlt_options_main = get_option( 'cntctfrmmltpr_options_main' );
299
  elseif ( isset( $contact_form_multi_active ) )
300
  $cntctfrmmlt_options_main = get_option( 'cntctfrmmlt_options_main' );
301
 
302
- if ( 1 == $_SESSION['cntctfrmmlt_id_form'] && 1 == count( $cntctfrmmlt_options_main['name_id_form'] ) ) {
303
  add_option( 'cntctfrmmlt_options_1' , get_option( 'cntctfrm_options' ) );
304
  $cntctfrm_options = get_option( 'cntctfrmmlt_options_1' );
305
  } else {
@@ -403,8 +404,13 @@ if ( ! function_exists( 'cntctfrm_settings' ) ) {
403
  $cntctfrm_options['hide_premium_options'] = array();
404
 
405
  if ( isset( $contact_form_multi_active ) || isset( $contact_form_multi_pro_active ) ) {
406
- if ( isset( $_SESSION['cntctfrmmlt_id_form'] ) && get_option( 'cntctfrmmlt_options_' . $_SESSION['cntctfrmmlt_id_form'] ) ) {
407
- update_option( 'cntctfrmmlt_options_' . $_SESSION['cntctfrmmlt_id_form'] , $cntctfrm_options );
 
 
 
 
 
408
  } else {
409
  update_option( 'cntctfrmmlt_options', $cntctfrm_options );
410
  }
@@ -418,8 +424,13 @@ if ( ! function_exists( 'cntctfrm_settings' ) ) {
418
  cntctfrm_db_create();
419
  $cntctfrm_options['plugin_db_version'] = $cntctfrm_db_version;
420
  if ( isset( $contact_form_multi_active ) || isset( $contact_form_multi_pro_active ) ) {
421
- if ( isset( $_SESSION['cntctfrmmlt_id_form'] ) && get_option( 'cntctfrmmlt_options_' . $_SESSION['cntctfrmmlt_id_form'] ) ) {
422
- update_option( 'cntctfrmmlt_options_' . $_SESSION['cntctfrmmlt_id_form'] , $cntctfrm_options );
 
 
 
 
 
423
  } else {
424
  update_option( 'cntctfrmmlt_options', $cntctfrm_options );
425
  }
@@ -2219,31 +2230,26 @@ if ( ! function_exists( 'cntctfrm_settings_page' ) ) {
2219
  if ( ! function_exists( 'cntctfrm_display_form' ) ) {
2220
  function cntctfrm_display_form( $atts = array( 'lang' => 'default' ) ) {
2221
  global $cntctfrm_error_message, $cntctfrm_options, $cntctfrm_result, $cntctfrmmlt_ide, $cntctfrmmlt_active_plugin, $cntctfrm_form_count;
2222
-
2223
  $cntctfrm_form_count = empty( $cntctfrm_form_count ) ? 1 : ++$cntctfrm_form_count;
2224
  $cntctfrm_form_countid = ( $cntctfrm_form_count == 1 ? '' : '_' . $cntctfrm_form_count );
2225
-
2226
  $content = "";
2227
-
2228
  /* Get options for the form with a definite identifier */
2229
  require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
2230
  if ( is_plugin_active( 'contact-form-multi/contact-form-multi.php' ) || is_plugin_active( 'contact-form-multi-pro/contact-form-multi-pro.php' ) ) {
2231
-
2232
- if ( ! get_option( 'cntctfrmmlt_options' ) ) {
2233
- cntctfrm_settings();
2234
- }
2235
-
2236
  extract( shortcode_atts( array( 'id' => $cntctfrmmlt_ide, 'lang' => 'default' ), $atts ) );
2237
  if ( isset( $atts['id'] ) ) {
 
2238
  $cntctfrm_options = get_option( 'cntctfrmmlt_options_' . $atts['id'] );
2239
  /* if no options with the specified id */
2240
  if ( ! $cntctfrm_options ) {
2241
  $cntctfrm_options = get_option( 'cntctfrmmlt_options' );
2242
  }
2243
  } else {
 
2244
  $cntctfrm_options = get_option( 'cntctfrmmlt_options' );
2245
  }
2246
  } else {
 
2247
  $cntctfrm_options = get_option( 'cntctfrm_options' );
2248
  extract( shortcode_atts( array( 'lang' => 'default' ), $atts ) );
2249
  }
6
  Author: BestWebSoft
7
  Text Domain: contact-form-plugin
8
  Domain Path: /languages
9
+ Version: 3.99
10
  Author URI: http://bestwebsoft.com/
11
  License: GPLv2 or later
12
  */
118
 
119
  /* Register settings for plugin */
120
  if ( ! function_exists( 'cntctfrm_settings' ) ) {
121
+ function cntctfrm_settings( $form_id = false ) {
122
  global $cntctfrm_options, $cntctfrm_option_defaults, $cntctfrm_plugin_info;
123
  $cntctfrm_db_version = "1.0";
124
 
290
  }
291
 
292
  /* Get options from the database */
293
+ if ( isset( $_SESSION['cntctfrmmlt_id_form'] ) || $form_id ) {
294
+ $id = ( $form_id ) ? $form_id : $_SESSION['cntctfrmmlt_id_form'];
295
+ if ( get_option( 'cntctfrmmlt_options_' . $id ) ) {
296
+ $cntctfrm_options = get_option( 'cntctfrmmlt_options_'. $id );
297
  } else {
298
  if ( isset( $contact_form_multi_pro_active ) )
299
  $cntctfrmmlt_options_main = get_option( 'cntctfrmmltpr_options_main' );
300
  elseif ( isset( $contact_form_multi_active ) )
301
  $cntctfrmmlt_options_main = get_option( 'cntctfrmmlt_options_main' );
302
 
303
+ if ( 1 == $id && 1 == count( $cntctfrmmlt_options_main['name_id_form'] ) ) {
304
  add_option( 'cntctfrmmlt_options_1' , get_option( 'cntctfrm_options' ) );
305
  $cntctfrm_options = get_option( 'cntctfrmmlt_options_1' );
306
  } else {
404
  $cntctfrm_options['hide_premium_options'] = array();
405
 
406
  if ( isset( $contact_form_multi_active ) || isset( $contact_form_multi_pro_active ) ) {
407
+ if ( isset( $_SESSION['cntctfrmmlt_id_form'] ) || $form_id ) {
408
+ $id = ( $form_id ) ? $form_id : $_SESSION['cntctfrmmlt_id_form'];
409
+ if ( get_option( 'cntctfrmmlt_options_' . $id ) ) {
410
+ update_option( 'cntctfrmmlt_options_' . $id , $cntctfrm_options );
411
+ } else {
412
+ update_option( 'cntctfrmmlt_options', $cntctfrm_options );
413
+ }
414
  } else {
415
  update_option( 'cntctfrmmlt_options', $cntctfrm_options );
416
  }
424
  cntctfrm_db_create();
425
  $cntctfrm_options['plugin_db_version'] = $cntctfrm_db_version;
426
  if ( isset( $contact_form_multi_active ) || isset( $contact_form_multi_pro_active ) ) {
427
+ if ( isset( $_SESSION['cntctfrmmlt_id_form'] ) || $form_id ) {
428
+ $id = ( $form_id ) ? $form_id : $_SESSION['cntctfrmmlt_id_form'];
429
+ if ( get_option( 'cntctfrmmlt_options_' . $id ) ) {
430
+ update_option( 'cntctfrmmlt_options_' . $id , $cntctfrm_options );
431
+ } else {
432
+ update_option( 'cntctfrmmlt_options', $cntctfrm_options );
433
+ }
434
  } else {
435
  update_option( 'cntctfrmmlt_options', $cntctfrm_options );
436
  }
2230
  if ( ! function_exists( 'cntctfrm_display_form' ) ) {
2231
  function cntctfrm_display_form( $atts = array( 'lang' => 'default' ) ) {
2232
  global $cntctfrm_error_message, $cntctfrm_options, $cntctfrm_result, $cntctfrmmlt_ide, $cntctfrmmlt_active_plugin, $cntctfrm_form_count;
 
2233
  $cntctfrm_form_count = empty( $cntctfrm_form_count ) ? 1 : ++$cntctfrm_form_count;
2234
  $cntctfrm_form_countid = ( $cntctfrm_form_count == 1 ? '' : '_' . $cntctfrm_form_count );
 
2235
  $content = "";
 
2236
  /* Get options for the form with a definite identifier */
2237
  require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
2238
  if ( is_plugin_active( 'contact-form-multi/contact-form-multi.php' ) || is_plugin_active( 'contact-form-multi-pro/contact-form-multi-pro.php' ) ) {
 
 
 
 
 
2239
  extract( shortcode_atts( array( 'id' => $cntctfrmmlt_ide, 'lang' => 'default' ), $atts ) );
2240
  if ( isset( $atts['id'] ) ) {
2241
+ cntctfrm_settings( $atts['id'] );
2242
  $cntctfrm_options = get_option( 'cntctfrmmlt_options_' . $atts['id'] );
2243
  /* if no options with the specified id */
2244
  if ( ! $cntctfrm_options ) {
2245
  $cntctfrm_options = get_option( 'cntctfrmmlt_options' );
2246
  }
2247
  } else {
2248
+ cntctfrm_settings();
2249
  $cntctfrm_options = get_option( 'cntctfrmmlt_options' );
2250
  }
2251
  } else {
2252
+ cntctfrm_settings();
2253
  $cntctfrm_options = get_option( 'cntctfrm_options' );
2254
  extract( shortcode_atts( array( 'lang' => 'default' ), $atts ) );
2255
  }
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Contact Form by BestWebSoft ===
2
  Contributors: bestwebsoft
3
  Donate link: http://bestwebsoft.com/donate/
4
- Tags: Attachment, add contact form, add contact form add-on, add several contact forms, address form, best contact form, best cf, best contact form add-on, cnotact, conact, contact, contact button, contact form, contact form addon, contact form add-on, contact form parameters, contact form plugin, contact me, contacts, contacts form plugin, contcat, copy, request, send, send copy, several contact forms, contact us form, contactform, custom form, easy contact form, email, email form, file upload, form addons, form register, form registration, free feedback form, free form, free contact form, feedback, feedback form, form, free, forms plugin, forms, insert the shortcode, kontak form, online form, multi, multiple contact forms, multilingual, post feedback, request, send, simple contact form, send copy, send messages, shortcode, web-page feedback, web form, wordpress contact form, wp form, wordpress plugin, wp plugins
5
  Requires at least: 3.8
6
- Tested up to: 4.5
7
- Stable tag: 3.98
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -173,6 +173,9 @@ Please make sure that the problem hasn't been discussed yet on our forum (<a hre
173
 
174
  == Changelog ==
175
 
 
 
 
176
  = V3.98 - 25.04.2016 =
177
  * NEW : Compatibility with plugin Subscriber.
178
  * NEW : The Danish language file is added.
@@ -617,6 +620,9 @@ Please make sure that the problem hasn't been discussed yet on our forum (<a hre
617
 
618
  == Upgrade Notice ==
619
 
 
 
 
620
  = V3.98 =
621
  Compatibility with plugin Subscriber. The Danish language file is added.
622
 
1
  === Contact Form by BestWebSoft ===
2
  Contributors: bestwebsoft
3
  Donate link: http://bestwebsoft.com/donate/
4
+ Tags: contact, contact form, feedback form, contact us form, contact button, email form, contac, form, web-page feedback, cf, cf plugin, contact form plugin
5
  Requires at least: 3.8
6
+ Tested up to: 4.5.2
7
+ Stable tag: 3.99
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
173
 
174
  == Changelog ==
175
 
176
+ = V3.99 - 27.04.2016 =
177
+ * Bugfix : The bug with adding options to the database was fixed.
178
+
179
  = V3.98 - 25.04.2016 =
180
  * NEW : Compatibility with plugin Subscriber.
181
  * NEW : The Danish language file is added.
620
 
621
  == Upgrade Notice ==
622
 
623
+ = V3.99 =
624
+ The bug with adding options to the database was fixed.
625
+
626
  = V3.98 =
627
  Compatibility with plugin Subscriber. The Danish language file is added.
628