PluginProbe ʕ •ᴥ•ʔ
Essential Addons for Elementor – Popular Elementor Templates & Widgets / 6.6.9
Essential Addons for Elementor – Popular Elementor Templates & Widgets v6.6.9
6.6.9 6.6.8 6.6.7 6.6.6 6.6.5 6.6.4 6.6.3 5.7.3 5.7.4 5.8.0 5.8.1 5.8.10 5.8.11 5.8.12 5.8.13 5.8.14 5.8.15 5.8.16 5.8.18 5.8.2 5.8.3 5.8.4 5.8.5 5.8.6 5.8.7 5.8.8 5.8.9 5.9.0 5.9.1 5.9.10 5.9.11 5.9.12 5.9.13 5.9.14 5.9.15 5.9.16 5.9.17 5.9.18 5.9.19 5.9.2 5.9.20 5.9.21 5.9.22 5.9.23 5.9.24 5.9.25 5.9.26 5.9.27 5.9.3 5.9.4 5.9.5 5.9.6 5.9.7 5.9.8 5.9.9 6.0.0 6.0.1 6.0.10 6.0.11 6.0.12 6.0.13 6.0.14 6.0.15 6.0.2 6.0.3 6.0.4 6.0.5 6.0.6 6.0.7 6.0.8 6.0.9 6.1.0 6.1.1 6.1.10 6.1.11 trunk 6.1.12 1.0.0 6.1.13 1.0.1 6.1.14 1.1.0 6.1.15 2.0 6.1.17 2.1 6.1.18 2.10.0 6.1.19 2.10.1 6.1.2 2.10.2 6.1.20 2.10.3 6.1.3 2.10.4 6.1.4 2.10.5 6.1.5 2.2.0 6.1.6 2.2.1 6.1.7 2.2.2 6.1.8 2.2.3 6.1.9 2.2.4 6.2.0 2.2.5 6.2.1 2.3.0 6.2.2 2.3.1 6.2.3 2.4.0 6.2.4 2.4.1 6.3.0 2.4.2 6.3.1 2.4.3 6.3.2 2.5.0 6.3.3 2.6.0 6.4.0 2.7.0 6.5.0 2.7.1 6.5.1 2.7.10 6.5.10 2.7.11 6.5.11 2.7.2 6.5.12 2.7.3 6.5.13 2.7.4 6.5.2 2.7.5 6.5.3 2.7.6 6.5.4 2.7.7 6.5.5 2.7.8 6.5.6 2.7.9 6.5.7 2.8.0 6.5.8 2.8.1 6.5.9 2.8.2 6.6.0 2.8.3 6.6.1 2.8.4 6.6.2 2.8.5 2.8.6 2.8.7 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8 2.9.9 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.4.1 3.1.5 3.2.0 3.3.0 3.3.1 3.3.2 3.3.3 3.4.0 3.5.0 3.5.1 3.5.2 3.6.0 3.6.1 3.6.2 3.7.0 3.7.1 3.7.2 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.2 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.3.0 4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6 4.3.7 4.3.8 4.3.9 4.4.0 4.4.1 4.5.0 4.5.1 4.5.2 4.5.3 4.5.4 4.5.5 4.6.0 4.6.1 4.6.2 4.6.3 4.6.4 4.6.5 4.6.6 4.7.0 4.7.1 4.7.2 4.7.3 4.7.4 4.7.5 4.8.0 4.8.1 4.8.2 4.8.3 4.8.4 4.9.0 4.9.1 4.9.2 4.9.3 4.9.4 4.9.5 4.9.6 4.9.7 5.0.0 5.0.1 5.0.10 5.0.11 5.0.12 5.0.13 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.0.9 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.1.8 5.1.9 5.2.0 5.2.1 5.2.2 5.2.3 5.2.4 5.3.0 5.3.1 5.3.2 5.4.6 5.5.5 5.6.5 5.7.2
essential-addons-for-elementor-lite / includes / Classes / Bootstrap.php
essential-addons-for-elementor-lite / includes / Classes Last commit date
AllTraits.php 1 year ago Asset_Builder.php 9 months ago Bootstrap.php 2 weeks ago Compatibility_Support.php 2 months ago Elements_Manager.php 7 months ago Helper.php 1 month ago Migration.php 5 months ago Plugin_Usage_Tracker.php 5 months ago WPDeveloper_Core_Installer.php 5 months ago WPDeveloper_Notice.php 2 months ago WPDeveloper_Plugin_Installer.php 5 months ago WPDeveloper_Setup_Wizard.php 2 months ago index.php 3 years ago
Bootstrap.php
398 lines
1 <?php
2
3 namespace Essential_Addons_Elementor\Classes;
4
5 if (!defined('ABSPATH')) {
6 exit;
7 } // Exit if accessed directly
8
9 use Elementor\Plugin;
10 use Essential_Addons_Elementor\Traits\Admin;
11 use Essential_Addons_Elementor\Traits\Core;
12 use Essential_Addons_Elementor\Traits\Elements;
13 use Essential_Addons_Elementor\Traits\Enqueue;
14 use Essential_Addons_Elementor\Traits\Helper;
15 use Essential_Addons_Elementor\Traits\Library;
16 use Essential_Addons_Elementor\Traits\Login_Registration;
17 use Essential_Addons_Elementor\Traits\Woo_Product_Comparable;
18 use Essential_Addons_Elementor\Traits\Controls;
19 use Essential_Addons_Elementor\Traits\Facebook_Feed;
20 use Essential_Addons_Elementor\Classes\Asset_Builder;
21 use Essential_Addons_Elementor\Traits\Ajax_Handler;
22 use Essential_Addons_Elementor\Pro\Classes\License\LicenseManager;
23
24 class Bootstrap
25 {
26 use Library;
27 use Core;
28 use Helper;
29 use Enqueue;
30 use Admin;
31 use Elements;
32 use Login_Registration;
33 use Woo_Product_Comparable;
34 use Controls;
35 use Facebook_Feed;
36 use Ajax_Handler;
37
38 // instance container
39 private static $instance = null;
40
41 // request unique id container
42 protected $uid = null;
43
44 // registered elements container
45 protected $registered_elements;
46
47 // registered extensions container
48 protected $registered_extensions;
49
50 // identify whether pro is enabled
51 protected $pro_enabled;
52
53 // localize objects
54 public $localize_objects = [];
55
56 // request data container
57 protected $request_requires_update;
58
59 // loaded templates in a request
60 protected $loaded_templates = [];
61
62 // loaded elements in a request
63 protected $loaded_elements = [];
64
65 // used for internal css
66 protected $css_strings;
67
68 // used for internal js
69 protected $js_strings;
70
71 // used to store custom js
72 protected $custom_js_strings;
73
74 // modules
75 protected $installer;
76
77
78 const EAEL_PROMOTION_FLAG = 21;
79 const EAEL_ADMIN_MENU_FLAG = 21;
80 /**
81 * Singleton instance
82 *
83 * @since 3.0.0
84 */
85 public static function instance()
86 {
87 if (self::$instance == null) {
88 self::$instance = new self;
89 }
90
91 return self::$instance;
92 }
93
94 /**
95 * Constructor of plugin class
96 *
97 * @since 3.0.0
98 */
99 private function __construct()
100 {
101 // init modules
102 $this->installer = new WPDeveloper_Plugin_Installer();
103
104 // before init hook
105 do_action('eael/before_init');
106
107 // search for pro version
108 $this->pro_enabled = apply_filters('eael/pro_enabled', false);
109
110 // elements classmap
111 $this->registered_elements = apply_filters('eael/registered_elements', $GLOBALS['eael_config']['elements']);
112
113 // extensions classmap
114 $this->registered_extensions = apply_filters('eael/registered_extensions', $GLOBALS['eael_config']['extensions']);
115
116 // start plugin tracking
117 if ( ! $this->pro_enabled ) {
118 add_action( 'init', [ $this, 'start_plugin_tracking' ] );
119 }
120
121 // register extensions
122 $this->register_extensions();
123
124 // register hooks
125 $this->register_hooks();
126
127 if ( $this->is_activate_elementor() ) {
128 new Asset_Builder( $this->registered_elements, $this->registered_extensions );
129 }
130
131 // Compatibility Support
132 new Compatibility_Support();
133
134 include_once(EAEL_PLUGIN_PATH . 'includes/bfcm-pointer.php');
135
136 }
137
138 protected function register_hooks() {
139 // Core
140 add_action('init', [$this, 'i18n']);
141 // TODO::RM
142 add_filter('eael/active_plugins', [$this, 'is_plugin_active'], 10, 1);
143
144 add_filter('eael/is_plugin_active', [$this, 'is_plugin_active'], 10, 1);
145 add_action('elementor/editor/after_save', array($this, 'save_global_values'), 10, 2);
146 add_action('trashed_post', array($this, 'save_global_values_trashed_post'), 10, 1);
147
148 // Enqueue
149 add_action('eael/before_enqueue_styles', [$this, 'before_enqueue_styles']);
150 add_action('elementor/editor/before_enqueue_scripts', [$this, 'editor_enqueue_scripts']);
151 add_action('elementor/frontend/before_register_scripts', [$this, 'frontend_enqueue_scripts']);
152
153 // Generator
154
155 $this->init_ajax_hooks();
156
157 // Ajax
158 add_action('wp_ajax_facebook_feed_load_more', [$this, 'facebook_feed_render_items']);
159 add_action('wp_ajax_nopriv_facebook_feed_load_more', [$this, 'facebook_feed_render_items']);
160
161 // Compare table
162 add_action( 'wp_ajax_nopriv_eael_product_grid', [$this, 'get_compare_table']);
163 add_action( 'wp_ajax_eael_product_grid', [$this, 'get_compare_table']);
164
165 add_action( 'wp_ajax_eael_clear_widget_cache_data', [ $this, 'eael_clear_widget_cache_data' ] );
166
167 if ( defined( 'ELEMENTOR_VERSION' ) ) {
168 if ( version_compare( ELEMENTOR_VERSION, '3.5.0', '>=' ) ) {
169 add_action( 'elementor/controls/register', array( $this, 'register_controls' ) );
170 add_action('elementor/widgets/register', array($this, 'register_elements'));
171 } else {
172 add_action( 'elementor/controls/controls_registered', array( $this, 'register_controls' ) );
173 add_action('elementor/widgets/widgets_registered', array($this, 'register_elements'));
174 }
175 }
176
177 // Elements
178 add_action('elementor/elements/categories_registered', array($this, 'register_widget_categories'));
179 add_filter('elementor/editor/localize_settings', [$this, 'promote_pro_elements']);
180 add_action('wp_footer', [$this, 'render_global_html']);
181 add_action('wp_footer', [$this, 'render_advanced_accordion_global_faq']);
182
183 // Controls
184 add_action('eael/controls/query', [$this, 'query'], 10, 1);
185 add_action('eael/controls/betterdocs/query', [$this, 'betterdocs_query'], 10, 1);
186 add_action('eael/controls/layout', [$this, 'layout'], 10, 1);
187 add_action('eael/controls/terms_style', [$this, 'terms_style'], 10, 1);
188 add_action('eael/controls/read_more_button_style', [$this, 'read_more_button_style'], 10, 1);
189 add_action('eael/controls/load_more_button_style', [$this, 'load_more_button_style'], 10, 1);
190 add_action('eael/controls/custom_positioning', [$this, 'custom_positioning'], 10, 5);
191 add_action('eael/controls/nothing_found_style', [$this, 'nothing_found_style'], 10, 1);
192
193 add_filter('eael/controls/event-calendar/source', [$this, 'event_calendar_source']);
194 add_action('eael/controls/advanced-data-table/source', [$this, 'advanced_data_table_source']);
195
196 // Login | Register
197 add_action('init', [$this, 'login_or_register_user']);
198 add_filter('wp_new_user_notification_email', array($this, 'new_user_notification_email'), 10, 3);
199 add_filter('wp_new_user_notification_email_admin', array($this, 'new_user_notification_email_admin'), 10, 3);
200
201 // Email OTP Verification (Login | Register)
202 add_action('wp_ajax_eael_lr_send_otp', [$this, 'eael_ajax_send_otp']);
203 add_action('wp_ajax_nopriv_eael_lr_send_otp', [$this, 'eael_ajax_send_otp']);
204 add_action('wp_ajax_eael_lr_verify_otp', [$this, 'eael_ajax_verify_otp']);
205 add_action('wp_ajax_nopriv_eael_lr_verify_otp', [$this, 'eael_ajax_verify_otp']);
206
207 // Flag unverified OTP register users in wp-admin → Users.
208 add_action('admin_footer-users.php', [$this, 'eael_lr_otp_pending_user_flag']);
209 add_action( 'init', [$this, 'eael_redirect_to_reset_password'] );
210
211 if( 'on' === get_option( 'eael_custom_profile_fields' ) ){
212 add_action( 'show_user_profile', [ $this, 'eael_extra_user_profile_fields' ] );
213 add_action( 'edit_user_profile', [ $this, 'eael_extra_user_profile_fields' ] );
214
215 add_action( 'personal_options_update', [ $this, 'eael_save_extra_user_profile_fields' ] );
216 add_action( 'edit_user_profile_update', [ $this, 'eael_save_extra_user_profile_fields' ] );
217 }
218
219 //rank math support
220 add_filter('rank_math/researches/toc_plugins', [$this, 'toc_rank_math_support']);
221
222 // if(defined('WPML_TM_VERSION')){
223 // add_filter( 'elementor/documents/get/post_id',[$this, 'eael_wpml_template_translation']);
224 // }
225
226 //templately plugin support
227 if( !class_exists('Templately\Plugin') && !get_option('eael_templately_promo_hide') ) {
228 add_action( 'elementor/editor/before_enqueue_scripts', [$this, 'templately_promo_enqueue_scripts'] );
229 add_action( 'eael/before_enqueue_styles', [$this, 'templately_promo_enqueue_style'] );
230 add_action( 'elementor/editor/footer', [ $this, 'print_template_views' ] );
231 add_action( 'wp_ajax_templately_promo_status', array($this, 'templately_promo_status'));
232 }
233
234 if( class_exists( 'woocommerce' ) ) {
235 // Login|Register custom fields on WooCommerce My Account edit-account page
236 add_action( 'woocommerce_edit_account_form_fields', [ $this, 'eael_wc_account_form_fields' ] );
237 add_action( 'woocommerce_save_account_details', [ $this, 'eael_wc_save_account_fields' ] );
238
239 // quick view
240 add_action( 'eael_woo_single_product_image', 'woocommerce_show_product_images', 20 );
241 add_action( 'eael_woo_single_product_summary', 'woocommerce_template_single_title', 5 );
242 add_action( 'eael_woo_single_product_summary', 'woocommerce_template_single_rating', 10 );
243 add_action( 'eael_woo_single_product_summary', 'woocommerce_template_single_price', 15 );
244 add_action( 'eael_woo_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
245 add_action( 'eael_woo_single_product_summary', 'woocommerce_template_single_add_to_cart', 25 );
246 add_action( 'eael_woo_single_product_summary', 'woocommerce_template_single_meta', 30 );
247
248 add_filter( 'eael_product_wrapper_class', [ $this, 'eael_product_wrapper_class' ], 10, 3 );
249
250 add_action('wp_ajax_eael_checkout_cart_qty_update', [$this, 'eael_checkout_cart_qty_update'] );
251 add_action('wp_ajax_nopriv_eael_checkout_cart_qty_update', [$this, 'eael_checkout_cart_qty_update'] );
252
253 add_action( 'wp_loaded', [ $this, 'eael_woo_cart_empty_action' ], 20 );
254 add_filter( 'woocommerce_checkout_fields', [ $this, 'eael_customize_woo_checkout_fields' ] );
255
256 add_action( 'eael_woo_before_product_loop', function ( $layout ) {
257 if ( $layout === 'eael-product-default' ) {
258 return;
259 }
260
261 remove_action( 'woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open' );
262 remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close' );
263 remove_action( 'woocommerce_after_shop_loop_item', 'astra_woo_woocommerce_shop_product_content' );
264 remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart' );
265 } );
266
267 add_action( 'eael_woo_after_product_loop', function ( $layout ) {
268 if ( $layout === 'eael-product-default' ) {
269 return;
270 }
271
272 add_action( 'woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open' );
273 add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close' );
274 //Get current active theme
275 $theme = wp_get_theme();
276 $theme = $theme->parent() ? $theme->parent() : $theme;
277 //Astra Theme
278 if( function_exists( 'astra_woo_woocommerce_shop_product_content' ) ){
279 add_action( 'woocommerce_after_shop_loop_item', 'astra_woo_woocommerce_shop_product_content' );
280 } else {
281 add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart' );
282 }
283 //Theme Support
284 $theme_to_check = ['OceanWP', 'Blocksy', 'Travel Ocean'];
285 if( in_array( $theme->name, $theme_to_check, true ) ) {
286 remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart' );
287 }
288 } );
289
290 add_filter( 'wcml_multi_currency_ajax_actions', function ( $ajax_actions ) {
291 $ajax_actions[] = 'load_more';
292
293 return $ajax_actions;
294 } );
295 }
296
297 // Admin
298 if ( is_admin() ) {
299 // Admin
300 if (!$this->pro_enabled) {
301 add_action( 'admin_init', [ $this, 'admin_notice' ] );
302 } else {
303 new WPDeveloper_Core_Installer( basename( EAEL_PLUGIN_BASENAME, '.php' ) );
304 }
305
306 add_action( 'admin_menu', array( $this, 'admin_menu' ) );
307 add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
308 add_action( 'admin_enqueue_scripts', array( $this, 'admin_dequeue_scripts' ), 100 );
309
310 // Core
311 add_filter('plugin_action_links_' . EAEL_PLUGIN_BASENAME, array($this, 'insert_plugin_links'));
312 add_filter('plugin_row_meta', array($this, 'insert_plugin_row_meta'), 10, 2);
313
314 // removed activation redirection temporarily
315 // add_action('admin_init', array($this, 'redirect_on_activation'));
316
317 if ( ! did_action( 'elementor/loaded' ) ) {
318 add_action( 'admin_notices', array( $this, 'elementor_not_loaded' ) );
319 add_action( 'eael_admin_notices', array( $this, 'elementor_not_loaded' ) );
320 }
321
322 add_action( 'in_admin_header', [ $this, 'remove_admin_notice' ], 99 );
323
324 //handle typeform auth token
325 add_action('admin_init', [$this, 'typeform_auth_handle']);
326
327
328 // On Editor - Register WooCommerce frontend hooks before the Editor init.
329 // Priority = 5, in order to allow plugins remove/add their wc hooks on init.
330 if ( ! empty( $_REQUEST['action'] ) && 'elementor' === $_REQUEST['action'] ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended
331 add_action( 'init', [ $this, 'register_wc_hooks' ], 5 );
332 }
333
334 // update admin menu notice flag once visit EA settings page
335 add_action( 'eael_admin_page_setting', [ $this, 'eael_show_admin_menu_notice' ] );
336
337 if ( ! current_user_can( 'administrator' ) ) {
338 add_filter( 'elementor/document/save/data', function ( $data ) {
339 if ( isset( $data['settings']['eael_custom_js'] ) ) {
340 $data['settings']['eael_custom_js'] = get_post_meta( get_the_ID(), '_eael_custom_js', true );
341 }
342
343 if ( empty( $data['elements'] ) ) {
344 return $data;
345 }
346
347 $data['elements'] = Plugin::$instance->db->iterate_data( $data['elements'], function ( $element ) {
348 if ( isset( $element['widgetType'] ) && $element['widgetType'] === 'eael-login-register' ) {
349 if ( ! empty( $element['settings']['register_user_role'] ) ) {
350 $element['settings']['register_user_role'] = '';
351 }
352 }
353
354 if ( isset( $element['widgetType'] ) && $element['widgetType'] === 'eicon-woocommerce' ) {
355 if ( ! empty( $element['settings']['eael_product_grid_products_status'] ) ) {
356 $element['settings']['eael_product_grid_products_status'] = [ 'publish' ];
357 }
358 }
359
360 if ( ! current_user_can( 'install_plugins' ) && isset( $element['widgetType'] ) && $element['widgetType'] === 'eaicon-advanced-data-table' ) {
361 if ( ! empty( $element['settings']['ea_adv_data_table_source'] ) ) {
362 $element['settings']['ea_adv_data_table_source'] = 'static';
363 }
364 }
365
366 return $element;
367 } );
368
369 return $data;
370 } );
371 }
372 } else {
373 add_action( 'wp', [ $this, 'eael_post_view_count' ] );
374 }
375
376 // beehive theme compatibility
377 add_filter( 'beehive_scripts', array( $this, 'beehive_theme_swiper_slider_compatibility' ), 999 );
378
379
380 // init plugin updater with version check
381 if ( defined( 'EAEL_PRO_PLUGIN_VERSION' ) && version_compare( EAEL_PRO_PLUGIN_VERSION, '6.2.2', '>=' ) && version_compare( EAEL_PRO_PLUGIN_VERSION, '6.2.3', '<=' ) ) {
382 add_action( 'init', [ $this, 'eael_init_plugin_updater' ], 99 );
383 }
384 }
385
386 /**
387 * Initialize plugin updater
388 *
389 * @since 6.1.14
390 */
391 function eael_init_plugin_updater() {
392 if ( is_admin() ) {
393 $license_manager = LicenseManager::get_instance( [] );
394 $license_manager->plugin_updater();
395 }
396 }
397 }
398