| @@ -2,13 +2,13 @@ | ||
| 2 | 2 | |
| 3 | 3 | /** |
| 4 | 4 | * Plugin Name: Bit Form |
| 5 | 5 | * Plugin URI: https://www.bitapps.pro/bit-form |
| 6 | - * Description: Wordpress form builder plugin | |
| 7 | - * Version: 1.4.17 | |
| 8 | - * Author: Bit Apps | |
| 6 | + * Description: Contact Form Builder: Multi Step Contact form, Payment form, WPForm Calculator form, Registration Form & WP Forms with form integrations | |
| 7 | + * Version: 2.7.0 | |
| 8 | + * Author: Contact Form Builder Plugin - WPForm by Bit Form | |
| 9 | 9 | * Author URI: https://www.bitapps.pro |
| 10 | - * Text Domain: bitform | |
| 10 | + * Text Domain: bit-form | |
| 11 | 11 | * Requires PHP: 5.6 |
| 12 | 12 | * Domain Path: /languages |
| 13 | 13 | * License: GPLv2 or later |
| 14 | 14 | */ |
| @@ -16,22 +16,38 @@ | ||
| 16 | 16 | /*** |
| 17 | 17 | * If try to direct access plugin folder it will Exit |
| 18 | 18 | **/ |
| 19 | 19 | if (!defined('ABSPATH')) { |
| 20 | - exit; | |
| 20 | + exit; | |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - | |
| 24 | 23 | // Define most essential constants. |
| 25 | -define('BITFORMS_VERSION', '1.4.17'); | |
| 24 | +define('BITFORMS_VERSION', '2.7.0'); | |
| 26 | 25 | define('BITFORMS_PLUGIN_MAIN_FILE', __FILE__); |
| 27 | 26 | |
| 28 | 27 | global $bitforms_db_version; |
| 29 | -$bitforms_db_version = '1.2'; | |
| 28 | +$bitforms_db_version = '2.2'; | |
| 30 | 29 | |
| 30 | +if (version_compare(PHP_VERSION, '5.6.0', '>=')) { | |
| 31 | + $rootVersionFolder = ''; | |
| 32 | + $olderVersion = get_option('bitforms_version'); | |
| 33 | + if ('2.0-beta.1' === $olderVersion) { | |
| 34 | + update_option('bitforms_migrated_to_v2', true); | |
| 35 | + update_option('bitforms_migrating_to_v2', false); | |
| 36 | + } | |
| 37 | + $isMigratedToV2 = get_option('bitforms_migrated_to_v2'); | |
| 38 | + $isMigratingToV2 = get_option('bitforms_migrating_to_v2'); | |
| 31 | 39 | |
| 32 | -if (version_compare(PHP_VERSION, '5.6.0', '>=')) { | |
| 33 | - require_once plugin_dir_path(__FILE__) . 'includes/loader.php'; | |
| 40 | + if (!$isMigratingToV2 && !$isMigratedToV2) { | |
| 41 | + global $wpdb; | |
| 42 | + $oldForms = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}bitforms_form"); | |
| 43 | + if (count($oldForms) > 0) { | |
| 44 | + $rootVersionFolder = 'v1/'; | |
| 45 | + } else { | |
| 46 | + update_option('bitforms_migrated_to_v2', true); | |
| 47 | + } | |
| 48 | + } | |
| 49 | + require_once plugin_dir_path(__FILE__) . $rootVersionFolder . 'includes/loader.php'; | |
| 34 | 50 | } |
| 35 | 51 | /** |
| 36 | 52 | * Handles plugin activation. |
| 37 | 53 | * |
| @@ -38,16 +54,16 @@ | ||
| 38 | 54 | * Throws an error if the plugin is activated on an older version than PHP 5.6. |
| 39 | 55 | */ |
| 40 | 56 | function bitforms_activate_plugin($network_wide) |
| 41 | 57 | { |
| 42 | - if (version_compare(PHP_VERSION, '5.6.0', '<')) { | |
| 43 | - wp_die( | |
| 44 | - esc_html__('bitforms requires PHP version 5.6.', 'bitform'), | |
| 45 | - esc_html__('Error Activating', 'bitform') | |
| 46 | - ); | |
| 47 | - } | |
| 58 | + if (version_compare(PHP_VERSION, '5.6.0', '<')) { | |
| 59 | + wp_die( | |
| 60 | + esc_html__('bitforms requires PHP version 5.6.', 'bit-form'), | |
| 61 | + esc_html__('Error Activating', 'bit-form') | |
| 62 | + ); | |
| 63 | + } | |
| 48 | 64 | |
| 49 | - do_action('bitforms_activation', $network_wide); | |
| 65 | + do_action('bitforms_activation', $network_wide); | |
| 50 | 66 | } |
| 51 | 67 | |
| 52 | 68 | register_activation_hook(__FILE__, 'bitforms_activate_plugin'); |
| 53 | 69 | |
| @@ -55,13 +71,13 @@ | ||
| 55 | 71 | * Handles plugin deactivation. |
| 56 | 72 | */ |
| 57 | 73 | function bitforms_deactivate_plugin($network_wide) |
| 58 | 74 | { |
| 59 | - if (version_compare(PHP_VERSION, '5.6.0', '<')) { | |
| 60 | - return; | |
| 61 | - } | |
| 75 | + if (version_compare(PHP_VERSION, '5.6.0', '<')) { | |
| 76 | + return; | |
| 77 | + } | |
| 62 | 78 | |
| 63 | - do_action('bitforms_deactivation', $network_wide); | |
| 79 | + do_action('bitforms_deactivation', $network_wide); | |
| 64 | 80 | } |
| 65 | 81 | |
| 66 | 82 | register_deactivation_hook(__FILE__, 'bitforms_deactivate_plugin'); |
| 67 | 83 | |
| @@ -71,11 +87,11 @@ | ||
| 71 | 87 | * @access private |
| 72 | 88 | */ |
| 73 | 89 | function bitforms_uninstall_plugin() |
| 74 | 90 | { |
| 75 | - if (version_compare(PHP_VERSION, '5.6.0', '<')) { | |
| 76 | - return; | |
| 77 | - } | |
| 91 | + if (version_compare(PHP_VERSION, '5.6.0', '<')) { | |
| 92 | + return; | |
| 93 | + } | |
| 78 | 94 | |
| 79 | - do_action('bitforms_uninstall'); | |
| 95 | + do_action('bitforms_uninstall'); | |
| 80 | 96 | } |
| 81 | 97 | register_uninstall_hook(__FILE__, 'bitforms_uninstall_plugin'); |