PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 1.3.0
JetFormBuilder — Dynamic Blocks Form Builder v1.3.0
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / includes / plugin.php
jetformbuilder / includes Last commit date
actions 4 years ago admin 4 years ago blocks 4 years ago classes 4 years ago compatibility 4 years ago dev-mode 4 years ago exceptions 4 years ago form-actions 4 years ago form-messages 4 years ago form-patterns 4 years ago form-response 4 years ago gateways 4 years ago generators 4 years ago integrations 4 years ago license 4 years ago presets 4 years ago request 4 years ago shortcodes 4 years ago widgets 4 years ago autoloader.php 4 years ago file-upload.php 4 years ago form-handler.php 4 years ago form-manager.php 4 years ago live-form.php 4 years ago plugin.php 4 years ago post-type.php 4 years ago
plugin.php
187 lines
1 <?php
2
3 namespace Jet_Form_Builder;
4
5 // If this file is called directly, abort.
6 use Jet_Form_Builder\Actions\Manager as ActionsManager;
7 use Jet_Form_Builder\Admin\Pages\Addons_Page;
8 use Jet_Form_Builder\Admin\Pages\Pages_Manager;
9 use Jet_Form_Builder\Admin\Pages\Settings_Page;
10 use Jet_Form_Builder\Admin\Tabs_Handlers\Tab_Handler_Manager;
11 use Jet_Form_Builder\Blocks\Manager as BlocksManager;
12 use Jet_Form_Builder\Form_Actions\Form_Actions_Manager;
13 use Jet_Form_Builder\Form_Patterns\Manager as PatternsManager;
14 use Jet_Form_Builder\Framework\CX_Loader;
15 use Jet_Form_Builder\Integrations\Forms_Captcha;
16 use Jet_Form_Builder\License\Manager as LicenseManager;
17 use Jet_Form_Builder\Widgets\Elementor_Controller;
18
19 if ( ! defined( 'WPINC' ) ) {
20 die;
21 }
22
23 /**
24 * @property Post_Type $post_type
25 * @property BlocksManager $blocks
26 * @property ActionsManager $actions
27 * @property Form_Manager $form
28 * @property Form_Handler $form_handler
29 * @property Forms_Captcha $captcha
30 * @property Admin\Editor $editor
31 * @property LicenseManager $license_manager
32 * @property \Jet_Admin_Bar $admin_bar
33 * Class Plugin
34 * @package Jet_Form_Builder
35 */
36 class Plugin {
37
38 public $post_type;
39 public $blocks;
40 public $actions;
41 public $form;
42 public $form_handler;
43 public $editor;
44 public $captcha;
45 public $dev_manager;
46
47 public $is_activated_jet_sm;
48 public $allow_gateways;
49 public $framework;
50 public $license_manager;
51 public $admin_bar;
52
53 public static $instance;
54
55 /**
56 * Instance.
57 *
58 * Ensures only one instance of the plugin class is loaded or can be loaded.
59 *
60 * @since 1.0.0
61 * @access public
62 * @static
63 */
64 public static function instance() {
65
66 if ( is_null( self::$instance ) ) {
67 self::$instance = new self();
68 }
69
70 return self::$instance;
71 }
72
73 public static function clear() {
74 self::$instance = null;
75 }
76
77 /**
78 * Register autoloader.
79 */
80 private function register_autoloader() {
81 require JET_FORM_BUILDER_PATH . 'includes' . DIRECTORY_SEPARATOR . 'autoloader.php';
82 Autoloader::run();
83 }
84
85 /**
86 * Initialize plugin parts
87 *
88 * @return void
89 */
90 public function init_components() {
91 $this->allow_gateways = apply_filters( 'jet-form-builder/allow-gateways', false );
92 $this->maybe_enable_gateways();
93
94 $this->admin_bar = \Jet_Admin_Bar::get_instance();
95 $this->post_type = new Post_Type();
96 $this->blocks = new Blocks\Manager();
97 $this->actions = new Actions\Manager();
98 $this->form = new Form_Manager();
99 $this->form_handler = new Form_Handler();
100 $this->captcha = new Forms_Captcha();
101 $this->license_manager = new LicenseManager();
102
103 Dev_Mode\Manager::instance();
104 File_Upload::instance();
105 new Elementor_Controller();
106
107 if ( is_admin() ) {
108 $this->editor = new Admin\Editor();
109 new Form_Actions_Manager();
110 new Pages_Manager( array(
111 new Settings_Page(),
112 new Addons_Page()
113 ) );
114
115 new PatternsManager();
116 }
117 }
118
119 public function init_framework() {
120 require $this->plugin_dir( 'framework/loader.php' );
121
122 $this->framework = new CX_Loader( array(
123 $this->plugin_dir( 'framework/vue-ui/cherry-x-vue-ui.php' ),
124 $this->plugin_dir( 'framework/admin-bar/jet-admin-bar.php' ),
125 ) );
126 }
127
128 public function maybe_enable_gateways() {
129 Tab_Handler_Manager::instance()->tab( 'payments-gateways' )->save_global_options();
130 $gateways = Tab_Handler_Manager::instance()->tab( 'payments-gateways' )->get_global_options();
131
132 if ( isset( $gateways['enable_test_mode'] ) ) {
133 add_filter( 'jet-form-builder/gateways/paypal/sandbox-mode', function () use ( $gateways ) {
134 return $gateways['enable_test_mode'];
135 } );
136 }
137
138 if ( isset( $gateways['use_gateways'] ) ) {
139 $this->allow_gateways = $gateways['use_gateways'];
140 }
141 }
142
143
144 /**
145 * Returns url to file or dir inside plugin folder
146 *
147 * @param string $path Path inside plugin dir.
148 *
149 * @return string
150 */
151 public function plugin_url( $path = null ) {
152 return JET_FORM_BUILDER_URL . $path;
153 }
154
155 public function plugin_dir( $path = '' ) {
156 return JET_FORM_BUILDER_PATH . $path;
157 }
158
159 /**
160 * Returns plugin version
161 */
162 public function get_version() {
163 return JET_FORM_BUILDER_VERSION;
164 }
165
166 /**
167 * Plugin constructor.
168 */
169 private function __construct() {
170
171 $this->register_autoloader();
172
173 add_action( 'after_setup_theme', function () {
174 do_action( 'jet-form-builder/before-init' );
175
176 $this->init_components();
177
178 do_action( 'jet-form-builder/after-init' );
179 }, 0 );
180
181 $this->init_framework();
182 }
183
184 }
185
186 Plugin::instance();
187