PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 1.2.1
JetFormBuilder — Dynamic Blocks Form Builder v1.2.1
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
174 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 *
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
49 public static $instance;
50
51 /**
52 * Instance.
53 *
54 * Ensures only one instance of the plugin class is loaded or can be loaded.
55 *
56 * @since 1.0.0
57 * @access public
58 * @static
59 */
60 public static function instance() {
61
62 if ( is_null( self::$instance ) ) {
63 self::$instance = new self();
64 }
65
66 return self::$instance;
67 }
68
69 public static function clear() {
70 self::$instance = null;
71 }
72
73 /**
74 * Register autoloader.
75 */
76 private function register_autoloader() {
77 require JET_FORM_BUILDER_PATH . 'includes' . DIRECTORY_SEPARATOR . 'autoloader.php';
78 Autoloader::run();
79 }
80
81 /**
82 * Initialize plugin parts
83 *
84 * @return void
85 */
86 public function init_components() {
87 $this->allow_gateways = apply_filters( 'jet-form-builder/allow-gateways', false );
88 $this->maybe_enable_gateways();
89
90 $this->post_type = new Post_Type();
91 $this->blocks = new Blocks\Manager();
92 $this->actions = new Actions\Manager();
93 $this->form = new Form_Manager();
94 $this->form_handler = new Form_Handler();
95 $this->captcha = new Forms_Captcha();
96 //$this->license_manager = new LicenseManager();
97
98 Dev_Mode\Manager::instance();
99 File_Upload::instance();
100 new Elementor_Controller();
101
102
103 if ( is_admin() ) {
104 $this->editor = new Admin\Editor();
105 new Form_Actions_Manager();
106 new Pages_Manager( array(
107 new Settings_Page(),
108 //new Addons_Page()
109 ) );
110 }
111 }
112
113 public function init_framework() {
114 require $this->plugin_dir( 'framework/loader.php' );
115
116 $this->framework = new CX_Loader( array(
117 $this->plugin_dir( 'framework/vue-ui/cherry-x-vue-ui.php' ),
118 ) );
119 }
120
121 public function maybe_enable_gateways() {
122 Tab_Handler_Manager::instance()->tab( 'payments-gateways' )->save_global_options();
123 $gateways = Tab_Handler_Manager::instance()->tab( 'payments-gateways' )->get_global_options();
124
125 if ( isset( $gateways['enable_test_mode'] ) ) {
126 add_filter( 'jet-form-builder/gateways/paypal/sandbox-mode', function () use ( $gateways ) {
127 return $gateways['enable_test_mode'];
128 } );
129 }
130
131 if ( isset( $gateways['use_gateways'] ) ) {
132 $this->allow_gateways = $gateways['use_gateways'];
133 }
134 }
135
136
137 /**
138 * Returns url to file or dir inside plugin folder
139 *
140 * @param string $path Path inside plugin dir.
141 *
142 * @return string
143 */
144 public function plugin_url( $path = null ) {
145 return JET_FORM_BUILDER_URL . $path;
146 }
147
148 public function plugin_dir( $path = '' ) {
149 return JET_FORM_BUILDER_PATH . $path;
150 }
151
152 /**
153 * Returns plugin version
154 */
155 public function get_version() {
156 return JET_FORM_BUILDER_VERSION;
157 }
158
159 /**
160 * Plugin constructor.
161 */
162 private function __construct() {
163
164 $this->register_autoloader();
165
166 add_action( 'after_setup_theme', array( $this, 'init_components' ), 0 );
167
168 $this->init_framework();
169 }
170
171 }
172
173 Plugin::instance();
174