| @@ -3,13 +3,12 @@ | ||
| 3 | 3 | /** |
| 4 | 4 | * Plugin Name: Bit Form |
| 5 | 5 | * Plugin URI: https://www.bitapps.pro/bit-form |
| 6 | 6 | * Description: Contact Form Builder Plugin: Multi Step Contact Form, Payment Form, Custom Contact Form Plugin by Bit Form |
| 7 | - * Version: 3.1.2 | |
| 7 | + * Version: 2.17.6 | |
| 8 | 8 | * Author: Contact Form Builder - Bit Form |
| 9 | 9 | * Author URI: https://www.bitapps.pro |
| 10 | 10 | * Text Domain: bit-form |
| 11 | - * Requires at least: 6.4 | |
| 12 | 11 | * Requires PHP: 7.4 |
| 13 | 12 | * Domain Path: /languages |
| 14 | 13 | * License: GPLv2 or later |
| 15 | 14 | */ |
| @@ -21,14 +20,13 @@ | ||
| 21 | 20 | exit; |
| 22 | 21 | } |
| 23 | 22 | |
| 24 | 23 | // Define most essential constants. |
| 25 | -define('BITFORMS_VERSION', '3.1.2'); | |
| 24 | +define('BITFORMS_VERSION', '2.17.6'); | |
| 26 | 25 | define('BITFORMS_PLUGIN_MAIN_FILE', __FILE__); |
| 27 | -define('BITFORMS_REQUIRED_BITFORMPRO_VERSION', '3.1.0'); | |
| 28 | 26 | |
| 29 | 27 | global $bitforms_db_version; |
| 30 | -$bitforms_db_version = '3.0'; | |
| 28 | +$bitforms_db_version = '2.3'; | |
| 31 | 29 | define('BITFORMS_DB_VERSION', $bitforms_db_version); |
| 32 | 30 | define('BITFORMS_REQUIRED_WP_VERSION', '5.1'); |
| 33 | 31 | define('BITFORMS_REQUIRED_PHP_VERSION', '7.4'); |
| 34 | 32 | define('BITFORMS_API_VERSION', '1.0'); |
| @@ -45,10 +43,10 @@ | ||
| 45 | 43 | function bitforms_activate_plugin($network_wide) |
| 46 | 44 | { |
| 47 | 45 | if (version_compare(PHP_VERSION, '5.6.0', '<')) { |
| 48 | 46 | wp_die( |
| 49 | - 'Bit Form requires PHP version 5.6 or higher.', | |
| 50 | - 'Error Activating' | |
| 47 | + esc_html_e('bitforms requires PHP version 5.6.', 'bit-form'), | |
| 48 | + esc_html_e('Error Activating', 'bit-form') | |
| 51 | 49 | ); |
| 52 | 50 | } |
| 53 | 51 | |
| 54 | 52 | do_action('bitforms_activation', $network_wide); |
| @@ -83,73 +81,4 @@ | ||
| 83 | 81 | |
| 84 | 82 | do_action('bitforms_uninstall'); |
| 85 | 83 | } |
| 86 | 84 | register_uninstall_hook(__FILE__, 'bitforms_uninstall_plugin'); |
| 87 | - | |
| 88 | -add_action('plugins_loaded', 'bitforms_check_pro_version'); | |
| 89 | - | |
| 90 | -function bitforms_check_pro_version() | |
| 91 | -{ | |
| 92 | - if (!defined('BITFORMPRO_VERSION')) { | |
| 93 | - return; | |
| 94 | - } | |
| 95 | - if (!version_compare(BITFORMPRO_VERSION, BITFORMS_REQUIRED_BITFORMPRO_VERSION, '>=')) { | |
| 96 | - add_action('admin_notices', 'bitformsProUpgradeNotice'); | |
| 97 | - } | |
| 98 | -} | |
| 99 | - | |
| 100 | -function bitformsProUpgradeNotice() | |
| 101 | -{ | |
| 102 | - // user meta calls safe here — admin_notices fires well after user initialisation | |
| 103 | - $dismissed_for = get_user_meta(get_current_user_id(), 'bitforms_dismiss_pro_upgrade_notice', true); | |
| 104 | - if (BITFORMS_REQUIRED_BITFORMPRO_VERSION === $dismissed_for) { | |
| 105 | - return; | |
| 106 | - } | |
| 107 | - | |
| 108 | - $update_url = esc_url(admin_url('plugins.php?plugin_status=upgrade')); | |
| 109 | - $required = esc_html(BITFORMS_REQUIRED_BITFORMPRO_VERSION); | |
| 110 | - | |
| 111 | - // Keep HTML out of translatable strings to prevent translator HTML injection | |
| 112 | - $message = '<strong>' . esc_html__('Bit Form Pro', 'bit-form') . '</strong> ' | |
| 113 | - . sprintf( | |
| 114 | - /* translators: %s: minimum required version number */ | |
| 115 | - esc_html__('requires an update to version %s or higher for full compatibility.', 'bit-form'), | |
| 116 | - '<strong>' . $required . '</strong>' | |
| 117 | - ) | |
| 118 | - . ' <a href="' . $update_url . '">' . esc_html__('Update now', 'bit-form') . '</a>'; | |
| 119 | - | |
| 120 | - wp_admin_notice( | |
| 121 | - $message, | |
| 122 | - [ | |
| 123 | - 'type' => 'error', | |
| 124 | - 'dismissible' => true, | |
| 125 | - 'additional_classes' => ['bitforms-pro-upgrade-notice'], | |
| 126 | - 'attributes' => [ | |
| 127 | - 'data-nonce' => wp_create_nonce('bitforms_dismiss_pro_notice'), | |
| 128 | - 'data-ajax-url' => esc_url(admin_url('admin-ajax.php')), | |
| 129 | - ], | |
| 130 | - 'paragraph_wrap' => true, | |
| 131 | - ] | |
| 132 | - ); | |
| 133 | - | |
| 134 | - // Script at footer — avoids mid-page inline script | |
| 135 | - add_action('admin_footer', 'bitformsProUpgradeNoticeScript'); | |
| 136 | -} | |
| 137 | - | |
| 138 | -function bitformsProUpgradeNoticeScript() | |
| 139 | -{ | |
| 140 | - ?> | |
| 141 | - <script> | |
| 142 | - (function () { | |
| 143 | - var notice = document.querySelector('.bitforms-pro-upgrade-notice'); | |
| 144 | - if (!notice) return; | |
| 145 | - notice.addEventListener('click', function (e) { | |
| 146 | - if (!e.target.classList.contains('notice-dismiss')) return; | |
| 147 | - var fd = new FormData(); | |
| 148 | - fd.append('action', 'bitforms_dismiss_pro_notice'); | |
| 149 | - fd.append('nonce', notice.dataset.nonce); | |
| 150 | - fetch(notice.dataset.ajaxUrl, { method: 'POST', credentials: 'same-origin', body: fd }); | |
| 151 | - }); | |
| 152 | - }()); | |
| 153 | - </script> | |
| 154 | - <?php | |
| 155 | -} | |