| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Plugin Name: Bit Form |
| 5 |
* Plugin URI: https://www.bitapps.pro/bit-form |
| 6 |
* Description: Easiest Contact Form Plugin with the fastest Drag & Drop form builder in WordPress to create modern & responsive contact, payment & registration forms with 100+ integrations |
| 7 |
* Version: 2.5.0 |
| 8 |
* Author: Contact Form Builder Plugin - Bit Form |
| 9 |
* Author URI: https://www.bitapps.pro |
| 10 |
* Text Domain: bit-form |
| 11 |
* Requires PHP: 5.6 |
| 12 |
* Domain Path: /languages |
| 13 |
* License: GPLv2 or later |
| 14 |
*/ |
| 15 |
|
| 16 |
/*** |
| 17 |
* If try to direct access plugin folder it will Exit |
| 18 |
**/ |
| 19 |
if (!defined('ABSPATH')) { |
| 20 |
exit; |
| 21 |
} |
| 22 |
|
| 23 |
// Define most essential constants. |
| 24 |
define('BITFORMS_VERSION', '2.5.0'); |
| 25 |
define('BITFORMS_PLUGIN_MAIN_FILE', __FILE__); |
| 26 |
|
| 27 |
global $bitforms_db_version; |
| 28 |
$bitforms_db_version = '2.2'; |
| 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'); |
| 39 |
|
| 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'; |
| 50 |
} |
| 51 |
/** |
| 52 |
* Handles plugin activation. |
| 53 |
* |
| 54 |
* Throws an error if the plugin is activated on an older version than PHP 5.6. |
| 55 |
*/ |
| 56 |
function bitforms_activate_plugin($network_wide) |
| 57 |
{ |
| 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 |
} |
| 64 |
|
| 65 |
do_action('bitforms_activation', $network_wide); |
| 66 |
} |
| 67 |
|
| 68 |
register_activation_hook(__FILE__, 'bitforms_activate_plugin'); |
| 69 |
|
| 70 |
/** |
| 71 |
* Handles plugin deactivation. |
| 72 |
*/ |
| 73 |
function bitforms_deactivate_plugin($network_wide) |
| 74 |
{ |
| 75 |
if (version_compare(PHP_VERSION, '5.6.0', '<')) { |
| 76 |
return; |
| 77 |
} |
| 78 |
|
| 79 |
do_action('bitforms_deactivation', $network_wide); |
| 80 |
} |
| 81 |
|
| 82 |
register_deactivation_hook(__FILE__, 'bitforms_deactivate_plugin'); |
| 83 |
|
| 84 |
/** |
| 85 |
* Handles plugin uninstall. |
| 86 |
* |
| 87 |
* @access private |
| 88 |
*/ |
| 89 |
function bitforms_uninstall_plugin() |
| 90 |
{ |
| 91 |
if (version_compare(PHP_VERSION, '5.6.0', '<')) { |
| 92 |
return; |
| 93 |
} |
| 94 |
|
| 95 |
do_action('bitforms_uninstall'); |
| 96 |
} |
| 97 |
register_uninstall_hook(__FILE__, 'bitforms_uninstall_plugin'); |
| 98 |
|