| @@ -1,12 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace BitCode\BitForm; |
| 4 | 4 | |
| 5 | -if (!defined('ABSPATH')) { | |
| 6 | - exit; | |
| 7 | -} | |
| 8 | - | |
| 9 | 5 | /** |
| 10 | 6 | * Main class for the plugin. |
| 11 | 7 | * |
| 12 | 8 | * @since 1.0.0-alpha |
| @@ -13,14 +9,13 @@ | ||
| 13 | 9 | */ |
| 14 | 10 | |
| 15 | 11 | use BitCode\BitForm\Core\Database\DB; |
| 16 | 12 | use BitCode\BitForm\Core\Database\FormModel; |
| 17 | -use BitCode\BitForm\Core\Fallback\FormFallback; | |
| 13 | +use BitCode\BitForm\Core\Fallback\Form as FormFallback; | |
| 18 | 14 | use BitCode\BitForm\Core\Hooks\Hooks; |
| 19 | 15 | use BitCode\BitForm\Core\Util\Activation; |
| 20 | 16 | use BitCode\BitForm\Core\Util\Deactivation; |
| 21 | 17 | use BitCode\BitForm\Core\Util\Uninstallation; |
| 22 | -use BitCode\BitForm\Widgets\RegisterBitFormElementorWidget; | |
| 23 | 18 | |
| 24 | 19 | final class Plugin |
| 25 | 20 | { |
| 26 | 21 | /** |
| @@ -38,9 +33,8 @@ | ||
| 38 | 33 | */ |
| 39 | 34 | public function register() |
| 40 | 35 | { |
| 41 | 36 | add_action('plugins_loaded', [$this, 'init_plugin']); |
| 42 | - // add_action('init', [$this, 'localization_setup']); | |
| 43 | 37 | (new Activation())->activate(); |
| 44 | 38 | (new Deactivation())->register(); |
| 45 | 39 | (new Uninstallation())->register(); |
| 46 | 40 | } |
| @@ -108,9 +102,9 @@ | ||
| 108 | 102 | return; |
| 109 | 103 | } |
| 110 | 104 | |
| 111 | 105 | global $bitforms_db_version; |
| 112 | - $installed_db_version = get_option('bitforms_db_version'); | |
| 106 | + $installed_db_version = get_site_option('bitforms_db_version'); | |
| 113 | 107 | if ($installed_db_version !== $bitforms_db_version) { |
| 114 | 108 | DB::migrate(); |
| 115 | 109 | } |
| 116 | 110 | } |
| @@ -123,9 +117,8 @@ | ||
| 123 | 117 | * @return array |
| 124 | 118 | */ |
| 125 | 119 | public function init_plugin() |
| 126 | 120 | { |
| 127 | - $this->update_tables(); | |
| 128 | 121 | $currentBitFormVersion = BITFORMS_VERSION; |
| 129 | 122 | $installedBitFormVersion = get_option('bitforms_version'); |
| 130 | 123 | if ($currentBitFormVersion !== $installedBitFormVersion) { |
| 131 | 124 | (new FormFallback())->resetJsGeneratedPageIds(); |
| @@ -130,9 +123,9 @@ | ||
| 130 | 123 | if ($currentBitFormVersion !== $installedBitFormVersion) { |
| 131 | 124 | (new FormFallback())->resetJsGeneratedPageIds(); |
| 132 | 125 | } |
| 133 | 126 | Hooks::init_hooks(); |
| 134 | - $this->initWidgets(); | |
| 127 | + $this->update_tables(); | |
| 135 | 128 | do_action('bitform_loaded'); |
| 136 | 129 | } |
| 137 | 130 | |
| 138 | 131 | /** |
| @@ -148,9 +141,9 @@ | ||
| 148 | 141 | } |
| 149 | 142 | |
| 150 | 143 | public function plugin_action_links($links) |
| 151 | 144 | { |
| 152 | - $links[] = '<a href="https://bitapps.pro/docs/bit-form/" target="_blank">' . __('Docs', 'bit-form') . '</a>'; | |
| 145 | + $links[] = '<a href="https://docs.form.bitapps.pro" target="_blank">' . __('Docs') . '</a>'; | |
| 153 | 146 | |
| 154 | 147 | return $links; |
| 155 | 148 | } |
| 156 | 149 | |
| @@ -170,17 +163,5 @@ | ||
| 170 | 163 | static::$instance = new static($main_file); |
| 171 | 164 | static::$instance->register(); |
| 172 | 165 | return true; |
| 173 | 166 | } |
| 174 | - | |
| 175 | - private function initWidgets() | |
| 176 | - { | |
| 177 | - if (defined('ELEMENTOR_VERSION')) { | |
| 178 | - new RegisterBitFormElementorWidget(); | |
| 179 | - } | |
| 180 | - } | |
| 181 | - | |
| 182 | - // public function localization_setup() | |
| 183 | - // { | |
| 184 | - // // load_plugin_textdomain('bit-form', false, dirname(BITFORMS_PLUGIN_BASENAME) . '/languages'); | |
| 185 | - // } | |
| 186 | 167 | } |