PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 1.2.2
JetFormBuilder — Dynamic Blocks Form Builder v1.2.2
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 5 years ago admin 5 years ago blocks 5 years ago classes 5 years ago compatibility 5 years ago dev-mode 5 years ago exceptions 5 years ago form-actions 5 years ago form-messages 5 years ago form-patterns 5 years ago form-response 5 years ago gateways 5 years ago generators 5 years ago integrations 5 years ago license 5 years ago presets 5 years ago request 5 years ago shortcodes 5 years ago widgets 5 years ago autoloader.php 5 years ago file-upload.php 5 years ago form-handler.php 5 years ago form-manager.php 5 years ago live-form.php 5 years ago plugin.php 5 years ago post-type.php 5 years ago
plugin.php
175 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\Pages_Manager;
8 use Jet_Form_Builder\Admin\Pages\Settings_Page;
9 use Jet_Form_Builder\Admin\Pages\Addons_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\Framework\CX_Loader;
14 use Jet_Form_Builder\Integrations\Forms_Captcha;
15 use Jet_Form_Builder\Widgets\Elementor_Controller;
16 use Jet_Form_Builder\License\Manager as LicenseManager;
17
18 if ( ! defined( 'WPINC' ) ) {
19 die;
20 }
21
22 /**
23 * @property Post_Type $post_type
24 * @property BlocksManager $blocks
25 * @property ActionsManager $actions
26 * @property Form_Manager $form
27 * @property Form_Handler $form_handler
28 * @property Forms_Captcha $captcha
29 * @property Admin\Editor $editor
30 * @property LicenseManager $license_manager
31 * Class Plugin
32 * @package Jet_Form_Builder
33 */
34 class Plugin {
35
36 public $post_type;
37 public $blocks;
38 public $actions;
39 public $form;
40 public $form_handler;
41 public $editor;
42 public $captcha;
43 public $dev_manager;
44
45 public $is_activated_jet_sm;
46 public $allow_gateways;
47 public $framework;
48 public $license_manager;
49
50 public static $instance;
51
52 /**
53 * Instance.
54 *
55 * Ensures only one instance of the plugin class is loaded or can be loaded.
56 *
57 * @since 1.0.0
58 * @access public
59 * @static
60 */
61 public static function instance() {
62
63 if ( is_null( self::$instance ) ) {
64 self::$instance = new self();
65 }
66
67 return self::$instance;
68 }
69
70 public static function clear() {
71 self::$instance = null;
72 }
73
74 /**
75 * Register autoloader.
76 */
77 private function register_autoloader() {
78 require JET_FORM_BUILDER_PATH . 'includes' . DIRECTORY_SEPARATOR . 'autoloader.php';
79 Autoloader::run();
80 }
81
82 /**
83 * Initialize plugin parts
84 *
85 * @return void
86 */
87 public function init_components() {
88 $this->allow_gateways = apply_filters( 'jet-form-builder/allow-gateways', false );
89 $this->maybe_enable_gateways();
90
91 $this->post_type = new Post_Type();
92 $this->blocks = new Blocks\Manager();
93 $this->actions = new Actions\Manager();
94 $this->form = new Form_Manager();
95 $this->form_handler = new Form_Handler();
96 $this->captcha = new Forms_Captcha();
97 $this->license_manager = new LicenseManager();
98
99 Dev_Mode\Manager::instance();
100 File_Upload::instance();
101 new Elementor_Controller();
102
103
104 if ( is_admin() ) {
105 $this->editor = new Admin\Editor();
106 new Form_Actions_Manager();
107 new Pages_Manager( array(
108 new Settings_Page(),
109 new Addons_Page()
110 ) );
111 }
112 }
113
114 public function init_framework() {
115 require $this->plugin_dir( 'framework/loader.php' );
116
117 $this->framework = new CX_Loader( array(
118 $this->plugin_dir( 'framework/vue-ui/cherry-x-vue-ui.php' ),
119 ) );
120 }
121
122 public function maybe_enable_gateways() {
123 Tab_Handler_Manager::instance()->tab( 'payments-gateways' )->save_global_options();
124 $gateways = Tab_Handler_Manager::instance()->tab( 'payments-gateways' )->get_global_options();
125
126 if ( isset( $gateways['enable_test_mode'] ) ) {
127 add_filter( 'jet-form-builder/gateways/paypal/sandbox-mode', function () use ( $gateways ) {
128 return $gateways['enable_test_mode'];
129 } );
130 }
131
132 if ( isset( $gateways['use_gateways'] ) ) {
133 $this->allow_gateways = $gateways['use_gateways'];
134 }
135 }
136
137
138 /**
139 * Returns url to file or dir inside plugin folder
140 *
141 * @param string $path Path inside plugin dir.
142 *
143 * @return string
144 */
145 public function plugin_url( $path = null ) {
146 return JET_FORM_BUILDER_URL . $path;
147 }
148
149 public function plugin_dir( $path = '' ) {
150 return JET_FORM_BUILDER_PATH . $path;
151 }
152
153 /**
154 * Returns plugin version
155 */
156 public function get_version() {
157 return JET_FORM_BUILDER_VERSION;
158 }
159
160 /**
161 * Plugin constructor.
162 */
163 private function __construct() {
164
165 $this->register_autoloader();
166
167 add_action( 'after_setup_theme', array( $this, 'init_components' ), 0 );
168
169 $this->init_framework();
170 }
171
172 }
173
174 Plugin::instance();
175