PluginProbe
Easy Elements for Elementor – Addons & Website Templates / 1.2.1
Easy Elements for Elementor – Addons & Website Templates v1.2.1
1.5.3 1.5.2 1.5.1 1.5.0 1.4.9 1.4.6 1.4.7 1.4.8 1.4.5 1.4.4 1.4.3 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 All 47 releases
← All changes | base.php +452 -698 1.4.31.2.1 View file →
@@ -1,699 +1,453 @@
1 -<?php
2 -if ( ! defined( 'ABSPATH' ) ) {
3 - exit;
4 -}
5 -
6 -final class Easyel_Elements_Elementor_Extension {
7 -
8 - const VERSION = EASYELEMENTS_VER;
9 -
10 - private static $_instance = null;
11 -
12 - public static function instance() {
13 - if ( is_null( self::$_instance ) ) {
14 - self::$_instance = new self();
15 - }
16 - return self::$_instance;
17 - }
18 -
19 - public function __construct() {
20 -
21 - // Load AJAX handlers
22 - require_once EASYELEMENTS_DIR_PATH . 'widgets/login-register/class.login-register.php';
23 -
24 - // Mini Cart AJAX handlers are loaded from the main plugin file
25 - // (easy-elements.php) so wp_ajax_* actions are registered as early as
26 - // possible — required on WP 6.9+ where admin-ajax.php returns 400 for
27 - // unregistered actions instead of the previous silent 200 + "0".
28 -
29 - add_action( 'init', [ $this, 'init' ] );
30 - add_action( 'elementor/widgets/register', [ $this, 'init_widgets' ] );
31 - add_action( 'elementor/elements/categories_registered', [ $this, 'add_elementor_categories' ] );
32 -
33 - add_action( 'admin_notices', [ $this, 'easyel_admin_promo_notice' ] , 0 );
34 - add_action( 'admin_init', [ $this, 'easyel_admin_promo_notice_dismiss_handler' ] );
35 -
36 - add_filter( 'plugin_row_meta', [ $this, 'easyel_plugin_row_meta' ], 10, 2 );
37 -
38 - add_filter('plugin_action_links_'.EASYELEMENTS_PATH,[ $this,'easyel_setting_page_link' ] );
39 -
40 - add_action( 'plugins_loaded', [ $this, "easyel_plugin_loaded" ] );
41 -
42 - register_activation_hook( EASYELEMENTS_PATH, [ __CLASS__, 'easy_elements_activate' ] );
43 -
44 - add_action( 'admin_init', [ __CLASS__, 'easyel_maybe_upgrade' ] );
45 -
46 - add_action('elementor/controls/register', function( $controls_manager ) {
47 - $controls_manager->register(
48 - new \Easyel\EasyElements\Utils\SearchSelect2()
49 - );
50 - });
51 -
52 - \Easyel\EasyElements\Extensions\WrapperLink\EasyelWrapperLink::get_instance();
53 -
54 - }
55 -
56 - public static function easyel_maybe_upgrade() {
57 -
58 - $stored_version = get_option( 'easyel_plugin_version', '0' );
59 -
60 - if ( version_compare( $stored_version, '1.3.1', '<' ) ) {
61 -
62 - self::easyel_upgrade_130();
63 -
64 - update_option( 'easyel_plugin_version', '1.3.1' );
65 - }
66 - }
67 -
68 - private static function easyel_upgrade_130() {
69 -
70 - $option_key_extension = 'easy_element_extensions';
71 - $settings = get_option( $option_key_extension, [] );
72 -
73 - $new_defaults = [
74 - 'enable_wrapper_link' => 1,
75 - 'enable_post_duplicator' => 1,
76 - 'enable_dynamic_content' => 1,
77 - 'enable_megamenu_builder' => 1,
78 - ];
79 -
80 - foreach ( $new_defaults as $key => $default ) {
81 - if ( ! isset( $settings[ $key ] ) ) {
82 - $settings[ $key ] = $default;
83 - }
84 - }
85 -
86 - update_option( $option_key_extension, $settings );
87 - }
88 -
89 - public static function easy_elements_activate() {
90 -
91 - if ( class_exists( '\Easyel\EasyElements\Admin\Admin_Settings' ) ) {
92 -
93 - $option_key_extension = 'easy_element_extensions';
94 - $settings = get_option( $option_key_extension, [] );
95 -
96 - $include_extension = array(
97 - "enable_wrapper_link",
98 - "enable_post_duplicator",
99 - "enable_dynamic_content",
100 - "enable_megamenu_builder",
101 - );
102 -
103 - $fields2 = [];
104 -
105 - if ( function_exists('easyel_get_extension_fields') ) {
106 - $fields2 = easyel_get_extension_fields();
107 - }
108 -
109 - foreach ( $fields2 as $key => $data ) {
110 -
111 - if ( array_key_exists( $key, $settings ) ) {
112 - continue;
113 - }
114 -
115 - $settings[$key] = in_array( $key, $include_extension, true ) ? 1 : 0;
116 - }
117 -
118 - update_option( $option_key_extension, $settings );
119 -
120 - $include_widget = array(
121 - "easy_table",
122 - "bmi_calculator",
123 - "single_navigation_menu",
124 - );
125 -
126 - $available_elements = \Easyel\EasyElements\Admin\Admin_Settings::get_instance()->easyel_elements_get_available_widgets();
127 - $tab = 'widget';
128 -
129 - foreach ( $available_elements as $key => $widget ) {
130 -
131 - if ( isset( $widget['tab'] ) && $widget['tab'] === $tab ) {
132 -
133 - $option_name = 'easy_element_' . $tab . '_' . $key;
134 -
135 - $existing_value = get_option( $option_name, null );
136 -
137 - if ( $existing_value !== null ) {
138 - continue;
139 - }
140 -
141 - if ( in_array( $key, $include_widget, true ) ) {
142 - add_option( $option_name, '0' );
143 - }
144 - }
145 - }
146 - }
147 -
148 - flush_rewrite_rules();
149 - }
150 -
151 - public function easyel_admin_promo_notice() {
152 -
153 - // Already dismissed
154 - if ( get_option( 'easyel_admin_promo_notice_dismissed2' ) ) {
155 - return;
156 - }
157 -
158 - $dismiss_url = wp_nonce_url(
159 - add_query_arg(
160 - [ 'easyel_promo_notice_dismiss' => '1' ],
161 - admin_url()
162 - ),
163 - 'easyel_promo_notice_dismiss_nonce'
164 - );
165 - ?>
166 -
167 - <div class="notice notice-info easyel-promo-notice">
168 - <div class="easyel-promo-content">
169 - <div class="easyel-promo-left">
170 - <span class="orange">Exclusive Deals Available</span> • <span></span> Discount Up To
171 - <span style="color:#ff7dcb;">40%</span> OFF
172 - <a class="easyel-promo-btn" href="https://wpeasyelements.com/pricing/" target="_blank">
173 - Grab the Deal →
174 - </a>
175 -
176 - </div>
177 - <div class="easyel-promo-right">
178 - <a href="<?php echo esc_url( $dismiss_url ); ?>" style="text-decoration:none;">
179 - ✕ Dismiss
180 - </a>
181 - </div>
182 - </div>
183 - </div>
184 -
185 - <?php
186 - }
187 -
188 - function easyel_plugin_row_meta( $meta, $plugin_file ) {
189 - if ( basename( EASYELEMENTS_PATH) !== basename( $plugin_file ) ) {
190 - return $meta;
191 - }
192 -
193 - $meta[] = '<a href="https://wpeasyelements.com/docs/" target="_blank">' . esc_html__('Documentation', 'easy-elements' ) . '</a>';
194 - $meta[] = '<a href="https://themewant.com/support/" target="_blank">' . esc_html__('Support', 'easy-elements') . '</a>';
195 - if ( !file_exists( WP_PLUGIN_DIR . '/' . 'easy-elements-pro/easy-elements-pro.php' ) ) {
196 - $meta[] = '<a href="https://wpeasyelements.com/" style="color:#ff7a00; font-weight: bold;" target="_blank">' . esc_html__('Upgrade to Pro', 'easy-elements') . '</a>';
197 - }
198 - $meta[] = '<a href="https://wordpress.org/support/plugin/easy-elements/reviews/#new-post" target="_blank">' . esc_html__(' Rate the plugin ★★★★★', 'easy-elements' ) . '</a>';
199 - return $meta;
200 - }
201 -
202 - public function easyel_admin_promo_notice_dismiss_handler() {
203 -
204 - if ( ! is_admin() ) {
205 - return;
206 - }
207 -
208 - if ( empty( $_GET['easyel_promo_notice_dismiss'] ) ) {
209 - return;
210 - }
211 -
212 - $nonce = isset( $_GET['_wpnonce'] )
213 - ? sanitize_text_field( wp_unslash( $_GET['_wpnonce'] ) )
214 - : '';
215 -
216 - if ( ! wp_verify_nonce( $nonce, 'easyel_promo_notice_dismiss_nonce' ) ) {
217 - return;
218 - }
219 -
220 - update_option( 'easyel_admin_promo_notice_dismissed2', 1 );
221 -
222 - wp_safe_redirect(
223 - remove_query_arg( [ 'easyel_promo_notice_dismiss', '_wpnonce' ] )
224 - );
225 - exit;
226 - }
227 -
228 - public function init() {
229 - // Safety checks
230 -
231 - add_filter( 'body_class', [ $this, "easy_add_extra_body_class" ] );
232 - add_action( 'easy_header', [ $this, 'easyel_before_content_container_hfe'], 20 );
233 - add_action( 'easy_footer', [ $this, 'easyel_after_content_container_hfe' ], 5 );
234 -
235 - add_action( 'admin_notices', [ $this, 'easyelements_admin_notice_missing_elementor' ] );
236 - }
237 -
238 - public function easyel_plugin_loaded () {
239 -
240 - \Easyel\EasyElements\Utils\Enqueue::get_instance();
241 - \Easyel\EasyElements\Utils\QueryHelper::get_instance();
242 -
243 - if( is_admin() ) {
244 - \Easyel\EasyElements\Admin\Admin_Settings::get_instance();
245 - \Easyel\EasyElements\NoticeDashboard\NoticeDashboard::get_instance();
246 -
247 - }
248 -
249 - if ( did_action( 'elementor/loaded' ) ) {
250 - \Easyel\EasyElements\Template_Library\Easyel_Templates_Library::get_instance();
251 - \Easyel\EasyElements\Starter_Template\Easyel_Starter_Template::get_instance();
252 - \Easyel\EasyElements\Header_Footer_Builder\Classes\Easy_Header_Footer_Elementor::get_instance();
253 - }
254 -
255 - \Easyel\EasyElements\Theme_Builder\Easyel_Theme_Builder_CPT::get_instance();
256 -
257 - \Easyel\EasyElements\Theme_Builder\Easyel_Theme_Builder_Front::get_instance();
258 -
259 - \Easyel\EasyElements\PostType\OffcanvasPostType::get_instance();
260 - \Easyel\EasyElements\CustomCode\Easyel_Custom_Code::get_instance();
261 - \Easyel\EasyElements\Popup_Builder\Easyel_Popup_Builder::get_instance();
262 - \Easyel\EasyElements\Extensions\ExtensionHook\ExtensionModule::get_instance();
263 - \Easyel\EasyElements\Extensions\CustomCss\EasyelCustomCss::get_instance()->init();
264 - \Easyel\EasyElements\Extensions\Duplicator\EasyelDuplicator::get_instance();
265 - \Easyel\EasyElements\Extensions\SettingExport\EasyelExport::get_instance();
266 - \Easyel\EasyElements\Extensions\LiveCopy\CopyPaste::get_instance();
267 - \Easyel\EasyElements\Extensions\VisibilityControl\VisibilityModule::get_instance();
268 - \Easyel\EasyElements\Extensions\Jarallax\JaralaxControl::get_instance()->init();
269 - \Easyel\EasyElements\Extensions\Jarallax\GlobalJarallax::get_instance();
270 - \Easyel\EasyElements\Extensions\ProgressBar\ReadingProgressBar::get_instance();
271 - \Easyel\EasyElements\Extensions\ScrollTop\ScrollTop::get_instance();
272 -
273 - // Preloader extension — only load the class file when the extension is enabled
274 - // (avoids parsing/instantiation cost when user has it turned off).
275 - if ( function_exists( 'easy_element_is_enabled' ) && easy_element_is_enabled( 'enable_preloader' ) ) {
276 - require_once EASYELEMENTS_DIR_PATH . 'includes/Extensions/Preloader/preloader.php';
277 - \Easyel\EasyElements\Extensions\Preloader\EasyelPreloader::get_instance();
278 - }
279 -
280 -
281 - if ( ! class_exists( '\Appsero\Client' ) ) {
282 - return;
283 - }
284 -
285 - \Easyel\EasyElements\Tracking\Appsero_Tracker::instance();
286 - }
287 -
288 - public function easyelements_admin_notice_missing_elementor() {
289 -
290 - $elementor = 'elementor/elementor.php';
291 -
292 - if ( current_user_can( 'activate_plugins' ) && isset( $_GET['activate'], $_GET['_wpnonce'] ) ) {
293 -
294 - $nonce = isset( $_GET['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_GET['_wpnonce'] ) ) : '';
295 -
296 - if ( wp_verify_nonce( $nonce, 'activate-plugin_' . $elementor ) ) {
297 - unset( $_GET['activate'] );
298 - }
299 - }
300 -
301 - if ( ! current_user_can( 'install_plugins' ) ) {
302 - return;
303 - }
304 -
305 - $elementor = 'elementor/elementor.php';
306 - $elementor_path = WP_PLUGIN_DIR . '/' . $elementor;
307 -
308 - $is_installed = file_exists( $elementor_path );
309 - $is_active = function_exists( 'is_plugin_active' ) && is_plugin_active( $elementor );
310 -
311 - if ( $is_active ) {
312 - return;
313 - }
314 -
315 - if ( $is_installed ) {
316 - $action_url = wp_nonce_url(
317 - self_admin_url( 'plugins.php?action=activate&plugin=' . $elementor ),
318 - 'activate-plugin_' . $elementor
319 - );
320 -
321 - $button_label = esc_html__( 'Activate Elementor', 'easy-elements' );
322 - $notice_text = esc_html__( 'Easy Elements is not working because the Elementor plugin is inactive.', 'easy-elements' );
323 -
324 - } else {
325 - $action_url = wp_nonce_url(
326 - self_admin_url( 'update.php?action=install-plugin&plugin=elementor' ),
327 - 'install-plugin_elementor'
328 - );
329 -
330 - $button_label = esc_html__( 'Install Elementor', 'easy-elements' );
331 - $notice_text = esc_html__( 'Easy Elements requires the Elementor plugin to be installed.', 'easy-elements' );
332 - }
333 -
334 - $message = '<p>' . $notice_text . '</p>';
335 - $message .= '<p><a href="' . esc_url( $action_url ) . '" class="button-primary">' . $button_label . '</a></p>';
336 -
337 - printf(
338 - '<div class="notice notice-error is-dismissible">%s</div>',
339 - wp_kses_post( $message )
340 - );
341 - }
342 -
343 - // Container Full site
344 - public function easyel_before_content_container_hfe() {
345 - if ( is_admin() ) return;
346 - if ( function_exists( 'elementor_theme_do_location' ) && \Elementor\Plugin::$instance->preview->is_preview() ) {
347 - return;
348 - }
349 - echo '<div class="easyel-content-container">';
350 - }
351 -
352 - /**
353 - * Close container before HFE Footer
354 - */
355 - function easyel_after_content_container_hfe() {
356 - if ( is_admin() ) return;
357 - if ( function_exists( 'elementor_theme_do_location' ) && \Elementor\Plugin::$instance->preview->is_preview() ) {
358 - return;
359 - }
360 - echo '</div>';
361 - }
362 -
363 - public function easy_add_extra_body_class( $classes ) {
364 - if ( is_plugin_active( 'easy-elements/easy-elements.php' ) ) {
365 - $classes[] = 'eel-easy-elements';
366 - }
367 -
368 - return $classes;
369 - }
370 -
371 - public function add_elementor_categories( $elements_manager ) {
372 -
373 - $new_categories = [
374 - 'easyelements_category' => [
375 - 'title' => __( 'Easy Elements', 'easy-elements' ),
376 - 'icon' => 'fa fa-plug',
377 - ],
378 - 'easyelements_post_category' => [
379 - 'title' => __( 'Easy Post Type Elements', 'easy-elements' ),
380 - 'icon' => 'fa fa-file-alt',
381 - ],
382 - 'easyelements_header_footer_category' => [
383 - 'title' => __( 'Easy Header Footer Elements', 'easy-elements' ),
384 - 'icon' => 'fa fa-header',
385 - ],
386 - 'easyelements_category_form' => [
387 - 'title' => __( 'Easy Elements Form', 'easy-elements' ),
388 - 'icon' => 'fa fa-plug',
389 - ],
390 - 'easyelements_category_pro' => [
391 - 'title' => __( 'Easy Elements Pro', 'easy-elements' ),
392 - 'icon' => 'fa fa-plug',
393 - ],
394 - ];
395 -
396 - $existing = $elements_manager->get_categories();
397 - $final_list = [];
398 -
399 - foreach ( $existing as $key => $cat ) {
400 - $final_list[ $key ] = $cat;
401 -
402 - if ( $key === 'layout' ) {
403 - foreach ( $new_categories as $new_key => $new_cat ) {
404 - $final_list[ $new_key ] = $new_cat;
405 - }
406 - }
407 - }
408 -
409 - $apply_categories = function( $cats ) {
410 - $this->categories = $cats;
411 - };
412 -
413 - $apply_categories->call( $elements_manager, $final_list );
414 - }
415 -
416 - public function init_widgets() {
417 - $widgets_manager = \Elementor\Plugin::instance()->widgets_manager;
418 -
419 - $widgets = [
420 - 'site_logo' => [
421 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Site_Logo_Widget',
422 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/site-logo/site-logo.php',
423 - 'tab' => 'widget'
424 - ],
425 - 'heading' => [
426 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Heading_Widget',
427 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/heading/heading.php',
428 - 'tab' => 'widget'
429 - ],
430 - 'clients_logo' => [
431 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Clients_Logo__Widget',
432 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/clients-logo-grid/logo.php',
433 - 'tab' => 'widget'
434 - ],
435 - 'icon_box' => [
436 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Icon_Box__Widget',
437 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/icon-box/icon.php',
438 - 'tab' => 'widget'
439 - ],
440 - 'simple_tab' => [
441 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Tab_Widget',
442 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/tab/tab.php',
443 - 'tab' => 'widget'
444 - ],
445 - 'testimonials' => [
446 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Testimonials__Widget',
447 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/testimonials-grid/testimonials.php',
448 - 'tab' => 'widget'
449 - ],
450 - 'team_grid' => [
451 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Team_Grid__Widget',
452 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/team-grid/team-grid.php',
453 - 'tab' => 'widget'
454 - ],
455 - 'search' => [
456 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Search_Widget',
457 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/search/search.php',
458 - 'tab' => 'widget'
459 - ],
460 - 'contact_box' => [
461 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Contact_Box__Widget',
462 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/contact-box/contact.php',
463 - 'tab' => 'widget'
464 - ],
465 - 'faq' => [
466 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_FAQ_Accordion_Widget',
467 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/faq/faq.php',
468 - 'tab' => 'widget'
469 - ],
470 - 'blog_grid' => [
471 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Blog_Grid__Widget',
472 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/blog-grid/blog-grid.php',
473 - 'tab' => 'widget'
474 - ],
475 - 'video' => [
476 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Video_Popup_Widget',
477 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/video/video.php',
478 - 'tab' => 'widget'
479 - ],
480 - 'pricing_table' => [
481 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Pricing_Table_Widget',
482 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/pricing-table/pricing.php',
483 - 'tab' => 'widget'
484 - ],
485 - 'service_list' => [
486 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Service_List_Widget',
487 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/service-list/service-list.php',
488 - 'tab' => 'widget'
489 - ],
490 - 'navigation_menu' => [
491 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Navigation_Menu_Widget',
492 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/navigation-menu/navigation-menu.php',
493 - 'tab' => 'widget'
494 - ],
495 - 'page_title' => [
496 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Page_Title_Widget',
497 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/page-title/page-title.php',
498 - 'tab' => 'widget'
499 - ],
500 - 'button' => [
501 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Button_Widget',
502 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/button/button.php',
503 - 'tab' => 'widget'
504 - ],
505 - 'process_grid' => [
506 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Process_Grid_Widget',
507 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/process-grid/process-grid.php',
508 - 'tab' => 'widget'
509 - ],
510 - 'process_list' => [
511 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Process_lists_Widget',
512 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/process-list/process-list.php',
513 - 'tab' => 'widget'
514 - ],
515 - 'social_share' => [
516 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Social_Share_Widget',
517 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/social-share/social-share.php',
518 - 'tab' => 'widget'
519 - ],
520 - 'social_icon' => [
521 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Social_Icon_Widget',
522 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/social-icon/social.php',
523 - 'tab' => 'widget'
524 - ],
525 - 'breadcrumb' => [
526 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Breadcrumb_Widget',
527 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/breadcrumb/breadcrumb.php',
528 - 'tab' => 'widget'
529 - ],
530 - 'domain_search' => [
531 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Domain_Search_Widget',
532 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/domain-search/domain-search.php',
533 - 'tab' => 'widget'
534 - ],
535 - 'image_comparison' => [
536 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Before_After_Widget',
537 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/image-comparison/img-before-after.php',
538 - 'tab' => 'widget'
539 - ],
540 - 'easy_offcanvas' => [
541 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Offcanvas_Widget',
542 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/offcanvas/offcanvas.php',
543 - 'tab' => 'widget'
544 - ],
545 - 'easy_table' => [
546 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Table_Elementor_Widget',
547 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/table/table-normal.php',
548 - 'tab' => 'widget'
549 - ],
550 - 'easy_scroll_to_top' => [
551 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Scroll_To_Top_Widget',
552 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/scroll-to-top/scroll.php',
553 - 'tab' => 'widget'
554 - ],
555 - 'easy_cf7' => [
556 - 'class' => '\Easyel\EasyElements\Widgets\easyel__CF7_Widget',
557 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/cf7/contact-cf7.php',
558 - 'tab' => 'widget'
559 - ],
560 - 'easy_gallery' => [
561 - 'class' => '\Easyel\EasyElements\Widgets\Easyel__Gallery_Widget',
562 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/gallery/gallery.php',
563 - 'tab' => 'widget'
564 - ],
565 - 'easy_progress' => [
566 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Progress_Widget',
567 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/progress/progress.php',
568 - 'tab' => 'widget'
569 - ],
570 - 'counter' => [
571 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Counter_Widget',
572 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/counter/counter.php',
573 - 'tab' => 'widget'
574 - ],
575 - 'countdown' => [
576 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Count_Down_Widget',
577 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/countdown/countdown.php',
578 - 'tab' => 'widget'
579 - ],
580 - 'excerpt' => [
581 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Free_Excerpt_Widget',
582 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/excerpt/excerpt.php',
583 - 'tab' => 'widget'
584 - ],
585 - 'post_title' => [
586 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Free_Post_Title_Widget',
587 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/post-title/post-title.php',
588 - 'tab' => 'widget'
589 - ],
590 - 'post_content' => [
591 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Free_Post_content_Widget',
592 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/post-content/post-content.php',
593 - 'tab' => 'widget'
594 - ],
595 - 'featured_image' => [
596 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_free_Featured_Image_Widget',
597 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/featured-image/featured-image.php',
598 - 'tab' => 'widget'
599 - ],
600 - 'post_meta' => [
601 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Free_Post_Meta_Widget',
602 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/post-meta/post-meta.php',
603 - 'tab' => 'widget'
604 - ],
605 - 'post_pagination' => [
606 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Free_Post_Pagination_Widget',
607 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/post-pagination/post-pagination.php',
608 - 'tab' => 'widget'
609 - ],
610 - 'post_comments' => [
611 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Free_Post_Comments_Widget',
612 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/post-comments/post-comments.php',
613 - 'tab' => 'widget'
614 - ],
615 - 'post_tags' => [
616 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Free_Post_Tags_Widget',
617 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/post-tag/post-tag.php',
618 - 'tab' => 'widget'
619 - ],
620 - 'post_author' => [
621 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Free_Post_Author_Info_Widget',
622 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/post-author/post-author.php',
623 - 'tab' => 'widget'
624 - ],
625 - 'archive_post' => [
626 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Free_Archive_Post__Widget',
627 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/archive-post/archive-post.php',
628 - 'tab' => 'widget',
629 - ],
630 - 'login_register' => [
631 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Login_Register_Widget',
632 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/login-register/login-register.php',
633 - 'tab' => 'widget',
634 - ],
635 - 'feature_list' => [
636 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Feature_List__Widget',
637 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/feature-list/feature-list.php',
638 - 'tab' => 'widget',
639 - ],
640 - 'single_navigation_menu' => [
641 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Single_Nav_Widget',
642 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/single-nav/single-nav.php',
643 - 'tab' => 'widget',
644 - ],
645 - 'vertical_navigation_menu' => [
646 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_vertical_Menu_Widget',
647 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/vertical-menu/vertical-menu-widget.php',
648 - 'tab' => 'widget',
649 - ]
650 - ];
651 -
652 - // WooCommerce-dependent widgets — only register when WooCommerce is active.
653 - if ( class_exists( 'WooCommerce' ) ) {
654 - $widgets['product_grid_lite'] = [
655 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Product_Grid_Lite_Widget',
656 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/product-grid-lite/product-grid-lite.php',
657 - 'tab' => 'widget',
658 - ];
659 -
660 - // Skip if an older version of Easy Elements Pro still bundles the Mini Cart widget.
661 - $legacy_pro_mini_cart = defined( 'EASYELEMENTS_PRO_PATH' )
662 - && file_exists( rtrim( EASYELEMENTS_PRO_PATH, '/\\' ) . '/widgets/mini-cart/mini-cart.php' );
663 -
664 - if ( ! $legacy_pro_mini_cart ) {
665 - $widgets['mini_cart'] = [
666 - 'class' => '\Easyel\EasyElements\Widgets\Easyel_Free_Mini_Cart_Widget',
667 - 'file' => EASYELEMENTS_DIR_PATH . '/widgets/mini-cart/mini-cart.php',
668 - 'tab' => 'widget',
669 - ];
670 - }
671 - }
672 -
673 - foreach ( $widgets as $key => $data ) {
674 - $option_name = 'easy_element_' . $data['tab'] . '_' . $key;
675 - $enabled = get_option( $option_name, '1' );
676 -
677 - if ( 1 !== ( int ) $enabled ) {
678 - continue; // Skip disabled widgets
679 - }
680 -
681 - if ( file_exists( $data['file'] ) ) {
682 - require_once $data['file'];
683 -
684 - if ( class_exists( $data['class'] ) ) {
685 - $widgets_manager->register( new $data['class']() );
686 - }
687 - }
688 - }
689 - }
690 -
691 - public function easyel_setting_page_link( $links ) {
692 - $action_link = sprintf("<a href='%s'>%s</a>",admin_url('admin.php?page=easy-elements-dashboard'),__('Settings','easy-elements'));
693 - array_push( $links,$action_link );
694 - return $links;
695 - }
696 -
697 -}
698 -
1 +<?php
2 +if ( ! defined( 'ABSPATH' ) ) {
3 + exit;
4 +}
5 +
6 +final class Easyel_Elements_Elementor_Extension {
7 +
8 + const VERSION = EASYELEMENTS_VER;
9 +
10 + private static $_instance = null;
11 +
12 + public static function instance() {
13 + if ( is_null( self::$_instance ) ) {
14 + self::$_instance = new self();
15 + }
16 + return self::$_instance;
17 + }
18 +
19 + public function __construct() {
20 +
21 + add_action( 'init', [ $this, 'init' ] );
22 + add_action( 'elementor/widgets/register', [ $this, 'init_widgets' ] );
23 + add_action( 'elementor/elements/categories_registered', [ $this, 'add_elementor_categories' ] );
24 +
25 + add_action( 'admin_notices', [ $this, 'easyel_admin_promo_notice' ] , 0 );
26 + add_action( 'admin_init', [ $this, 'easyel_admin_promo_notice_dismiss_handler' ] );
27 +
28 + }
29 +
30 + function easyel_admin_promo_notice() {
31 +
32 + // Check if dismissed
33 + if ( get_option( 'easyel_admin_promo_notice_dismissed1' ) ) {
34 + return;
35 + }
36 +
37 + $dismiss_url = wp_nonce_url(
38 + add_query_arg( 'easyel_promo_notice_dismiss1', '1' ),
39 + 'easyel_promo_notice_dismiss_nonce'
40 + );
41 + ?>
42 +
43 + <div class="notice easyel-promo-notice is-dismissible">
44 + <div class="easyel-promo-content">
45 + <div class="easyel-promo-left">
46 + <span class="orange">Easy Elements Black Friday Sale</span> • <span>Early Bird Sale</span> Discount Up To
47 + <span style="color:#ff7dcb;">65%</span> OFF
48 + <a class="easyel-promo-btn" href="https://wpeasyelements.com/pricing/" target="_blank">
49 + Grab the Deal →
50 + </a>
51 + </div>
52 + </div>
53 + </div>
54 +
55 + <?php
56 + }
57 +
58 + function easyel_admin_promo_notice_dismiss_handler() {
59 + if ( isset( $_GET['easyel_promo_notice_dismiss1'] ) ) {
60 +
61 + // Safely get the nonce
62 + $nonce = isset( $_GET['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_GET['_wpnonce'] ) ) : '';
63 +
64 + // Verify nonce
65 + if ( ! wp_verify_nonce( $nonce, 'easyel_promo_notice_dismiss_nonce' ) ) {
66 + return;
67 + }
68 +
69 + update_option( 'easyel_admin_promo_notice_dismissed1', 1 );
70 +
71 + wp_redirect( remove_query_arg( [ 'easyel_promo_notice_dismiss1', '_wpnonce' ] ) );
72 + exit;
73 + }
74 + }
75 +
76 +
77 +
78 + public function init() {
79 + // Safety checks
80 +
81 + add_filter( 'body_class', [ $this, "easy_add_extra_body_class" ] );
82 + add_action( 'easy_header', [ $this, 'easyel_before_content_container_hfe'], 20 );
83 + add_action( 'easy_footer', [ $this, 'easyel_after_content_container_hfe' ], 5 );
84 +
85 + add_action( 'admin_notices', [ $this, 'easyelements_admin_notice_missing_elementor' ] );
86 +
87 + }
88 +
89 + public function easyelements_admin_notice_missing_elementor() {
90 +
91 + $elementor = 'elementor/elementor.php';
92 +
93 + if ( current_user_can( 'activate_plugins' ) && isset( $_GET['activate'], $_GET['_wpnonce'] ) ) {
94 +
95 + $nonce = isset( $_GET['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_GET['_wpnonce'] ) ) : '';
96 +
97 + if ( wp_verify_nonce( $nonce, 'activate-plugin_' . $elementor ) ) {
98 + unset( $_GET['activate'] );
99 + }
100 + }
101 +
102 + if ( ! current_user_can( 'install_plugins' ) ) {
103 + return;
104 + }
105 +
106 + $elementor = 'elementor/elementor.php';
107 + $elementor_path = WP_PLUGIN_DIR . '/' . $elementor;
108 +
109 + $is_installed = file_exists( $elementor_path );
110 + $is_active = function_exists( 'is_plugin_active' ) && is_plugin_active( $elementor );
111 +
112 + if ( $is_active ) {
113 + return;
114 + }
115 +
116 + if ( $is_installed ) {
117 + $action_url = wp_nonce_url(
118 + self_admin_url( 'plugins.php?action=activate&plugin=' . $elementor ),
119 + 'activate-plugin_' . $elementor
120 + );
121 +
122 + $button_label = esc_html__( 'Activate Elementor', 'easy-elements' );
123 + $notice_text = esc_html__( 'Easy Elements is not working because the Elementor plugin is inactive.', 'easy-elements' );
124 +
125 + } else {
126 + $action_url = wp_nonce_url(
127 + self_admin_url( 'update.php?action=install-plugin&plugin=elementor' ),
128 + 'install-plugin_elementor'
129 + );
130 +
131 + $button_label = esc_html__( 'Install Elementor', 'easy-elements' );
132 + $notice_text = esc_html__( 'Easy Elements requires the Elementor plugin to be installed.', 'easy-elements' );
133 + }
134 +
135 + $message = '<p>' . $notice_text . '</p>';
136 + $message .= '<p><a href="' . esc_url( $action_url ) . '" class="button-primary">' . $button_label . '</a></p>';
137 +
138 + printf(
139 + '<div class="notice notice-error is-dismissible">%s</div>',
140 + wp_kses_post( $message )
141 + );
142 + }
143 +
144 + // Container Full site
145 + public function easyel_before_content_container_hfe() {
146 + if ( is_admin() ) return;
147 + if ( function_exists( 'elementor_theme_do_location' ) && \Elementor\Plugin::$instance->preview->is_preview() ) {
148 + return;
149 + }
150 + echo '<div class="easyel-content-container">';
151 + }
152 +
153 + /**
154 + * Close container before HFE Footer
155 + */
156 + function easyel_after_content_container_hfe() {
157 + if ( is_admin() ) return;
158 + if ( function_exists( 'elementor_theme_do_location' ) && \Elementor\Plugin::$instance->preview->is_preview() ) {
159 + return;
160 + }
161 + echo '</div>';
162 + }
163 +
164 + public function easy_add_extra_body_class( $classes ) {
165 + if ( is_plugin_active( 'easy-elements/easy-elements.php' ) ) {
166 + $classes[] = 'eel-easy-elements';
167 + }
168 +
169 + return $classes;
170 + }
171 +
172 + public function add_elementor_categories( $elements_manager ) {
173 +
174 + $new_categories = [
175 + 'easyelements_category' => [
176 + 'title' => __( 'Easy Elements', 'easy-elements' ),
177 + 'icon' => 'fa fa-plug',
178 + ],
179 + 'easyelements_post_category' => [
180 + 'title' => __( 'Easy Post Type Elements', 'easy-elements' ),
181 + 'icon' => 'fa fa-file-alt',
182 + ],
183 + 'easyelements_header_footer_category' => [
184 + 'title' => __( 'Easy Header Footer Elements', 'easy-elements' ),
185 + 'icon' => 'fa fa-header',
186 + ],
187 + 'easyelements_category_form' => [
188 + 'title' => __( 'Easy Elements Form', 'easy-elements' ),
189 + 'icon' => 'fa fa-plug',
190 + ],
191 + 'easyelements_category_pro' => [
192 + 'title' => __( 'Easy Elements Pro', 'easy-elements' ),
193 + 'icon' => 'fa fa-plug',
194 + ],
195 + ];
196 +
197 + $existing = $elements_manager->get_categories();
198 + $final_list = [];
199 +
200 + foreach ( $existing as $key => $cat ) {
201 + $final_list[ $key ] = $cat;
202 +
203 + if ( $key === 'layout' ) {
204 + foreach ( $new_categories as $new_key => $new_cat ) {
205 + $final_list[ $new_key ] = $new_cat;
206 + }
207 + }
208 + }
209 +
210 + $apply_categories = function( $cats ) {
211 + $this->categories = $cats;
212 + };
213 +
214 + $apply_categories->call( $elements_manager, $final_list );
215 + }
216 +
217 + public function init_widgets() {
218 + $widgets_manager = \Elementor\Plugin::instance()->widgets_manager;
219 +
220 + $widgets = [
221 + 'site_logo' => [
222 + 'class' => '\Easyel_Site_Logo_Widget',
223 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/site-logo/site-logo.php',
224 + 'tab' => 'widget'
225 + ],
226 + 'heading' => [
227 + 'class' => '\Easyel_Heading_Widget',
228 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/heading/heading.php',
229 + 'tab' => 'widget'
230 + ],
231 + 'clients_logo' => [
232 + 'class' => '\Easyel_Clients_Logo__Widget',
233 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/clients-logo-grid/logo.php',
234 + 'tab' => 'widget'
235 + ],
236 + 'icon_box' => [
237 + 'class' => '\Easyel_Icon_Box__Widget',
238 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/icon-box/icon.php',
239 + 'tab' => 'widget'
240 + ],
241 + 'simple_tab' => [
242 + 'class' => '\Easyel_Tab_Widget',
243 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/tab/tab.php',
244 + 'tab' => 'widget'
245 + ],
246 + 'testimonials' => [
247 + 'class' => '\Easyel_Testimonials__Widget',
248 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/testimonials-grid/testimonials.php',
249 + 'tab' => 'widget'
250 + ],
251 + 'team_grid' => [
252 + 'class' => '\Easyel_Team_Grid__Widget',
253 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/team-grid/team-grid.php',
254 + 'tab' => 'widget'
255 + ],
256 + 'search' => [
257 + 'class' => '\Easyel_Search_Widget',
258 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/search/search.php',
259 + 'tab' => 'widget'
260 + ],
261 + 'contact_box' => [
262 + 'class' => '\Easyel_Contact_Box__Widget',
263 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/contact-box/contact.php',
264 + 'tab' => 'widget'
265 + ],
266 + 'faq' => [
267 + 'class' => '\Easyel_FAQ_Accordion_Widget',
268 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/faq/faq.php',
269 + 'tab' => 'widget'
270 + ],
271 + 'blog_grid' => [
272 + 'class' => '\Easyel_Blog_Grid__Widget',
273 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/blog-grid/blog-grid.php',
274 + 'tab' => 'widget'
275 + ],
276 + 'video' => [
277 + 'class' => '\Easyel_Video_Popup_Widget',
278 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/video/video.php',
279 + 'tab' => 'widget'
280 + ],
281 + 'pricing_table' => [
282 + 'class' => '\Easyel_Pricing_Table_Widget',
283 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/pricing-table/pricing.php',
284 + 'tab' => 'widget'
285 + ],
286 + 'service_list' => [
287 + 'class' => '\Easyel_Service_List_Widget',
288 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/service-list/service-list.php',
289 + 'tab' => 'widget'
290 + ],
291 + 'navigation_menu' => [
292 + 'class' => '\Easyel_Navigation_Menu_Widget',
293 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/navigation-menu/navigation-menu.php',
294 + 'tab' => 'widget'
295 + ],
296 + 'page_title' => [
297 + 'class' => '\Easyel_Page_Title_Widget',
298 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/page-title/page-title.php',
299 + 'tab' => 'widget'
300 + ],
301 + 'button' => [
302 + 'class' => '\Easyel_Button_Widget',
303 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/button/button.php',
304 + 'tab' => 'widget'
305 + ],
306 + 'process_grid' => [
307 + 'class' => '\Easyel_Process_Widget',
308 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/process-grid/process-grid.php',
309 + 'tab' => 'widget'
310 + ],
311 + 'process_list' => [
312 + 'class' => '\Easyel_Process_list_Widget',
313 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/process-list/process-list.php',
314 + 'tab' => 'widget'
315 + ],
316 + 'social_share' => [
317 + 'class' => '\Easyel_Social_Share_Widget',
318 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/social-share/social-share.php',
319 + 'tab' => 'widget'
320 + ],
321 + 'social_icon' => [
322 + 'class' => '\Easyel_Social_Icon_Widget',
323 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/social-icon/social.php',
324 + 'tab' => 'widget'
325 + ],
326 + 'breadcrumb' => [
327 + 'class' => '\Easyel_Breadcrumb_Widget',
328 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/breadcrumb/breadcrumb.php',
329 + 'tab' => 'widget'
330 + ],
331 + 'domain_search' => [
332 + 'class' => '\Easyel_Domain_Search_Widget',
333 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/domain-search/domain-search.php',
334 + 'tab' => 'widget'
335 + ],
336 + 'easy_offcanvas' => [
337 + 'class' => '\Easyel_Offcanvas_Widget',
338 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/offcanvas/offcanvas.php',
339 + 'tab' => 'widget'
340 + ],
341 + 'easy_table' => [
342 + 'class' => '\Easyel_Table_Elementor_Widget',
343 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/table/table-normal.php',
344 + 'tab' => 'widget'
345 + ],
346 + 'easy_scroll_to_top' => [
347 + 'class' => '\Easyel_Scroll_To_Top_Widget',
348 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/scroll-to-top/scroll.php',
349 + 'tab' => 'widget'
350 + ],
351 + 'easy_cf7' => [
352 + 'class' => '\easyel__CF7_Widget',
353 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/cf7/contact-cf7.php',
354 + 'tab' => 'widget'
355 + ],
356 + 'easy_gallery' => [
357 + 'class' => '\Easyel__Gallery_Widget',
358 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/gallery/gallery.php',
359 + 'tab' => 'widget'
360 + ],
361 + 'easy_progress' => [
362 + 'class' => '\Easyel_Progress_Widget',
363 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/progress/progress.php',
364 + 'tab' => 'widget'
365 + ],
366 + 'counter' => [
367 + 'class' => '\Easyel_Counter_Widget',
368 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/counter/counter.php',
369 + 'tab' => 'widget'
370 + ],
371 + 'countdown' => [
372 + 'class' => '\Easyel_Count_Down_Widget',
373 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/countdown/countdown.php',
374 + 'tab' => 'widget'
375 + ],
376 + 'excerpt' => [
377 + 'class' => '\Easyel_Free_Excerpt_Widget',
378 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/excerpt/excerpt.php',
379 + 'tab' => 'widget'
380 + ],
381 + 'post_title' => [
382 + 'class' => '\Easyel_Free_Post_Title_Widget',
383 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/post-title/post-title.php',
384 + 'tab' => 'widget'
385 + ],
386 + 'post_content' => [
387 + 'class' => '\Easyel_Free_Post_content_Widget',
388 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/post-content/post-content.php',
389 + 'tab' => 'widget'
390 + ],
391 + 'featured_image' => [
392 + 'class' => '\Easyel_free_Featured_Image_Widget',
393 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/featured-image/featured-image.php',
394 + 'tab' => 'widget'
395 + ],
396 + 'post_meta' => [
397 + 'class' => '\Easyel_Free_Post_Meta_Widget',
398 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/post-meta/post-meta.php',
399 + 'tab' => 'widget'
400 + ],
401 + 'post_pagination' => [
402 + 'class' => '\Easyel_Free_Post_Pagination_Widget',
403 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/post-pagination/post-pagination.php',
404 + 'tab' => 'widget'
405 + ],
406 + 'post_comments' => [
407 + 'class' => '\Easyel_Free_Post_Comments_Widget',
408 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/post-comments/post-comments.php',
409 + 'tab' => 'widget'
410 + ],
411 + 'post_tags' => [
412 + 'class' => '\Easyel_Free_Post_Tags_Widget',
413 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/post-tag/post-tag.php',
414 + 'tab' => 'widget'
415 + ],
416 + 'post_author' => [
417 + 'class' => '\Easyel_Free_Post_Author_Info_Widget',
418 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/post-author/post-author.php',
419 + 'tab' => 'widget'
420 + ],
421 + 'archive_post' => [
422 + 'class' => '\Easyel_Free_Archive_Post__Widget',
423 + 'file' => EASYELEMENTS_DIR_PATH . '/widgets/archive-post/archive-post.php',
424 + 'tab' => 'widget',
425 + ],
426 + 'login_register' => [
427 + 'class' => '\Easyel_Login_Register_Widget',
428 + 'file' => __DIR__ . '/widgets/login-register/login-register.php',
429 + 'tab' => 'widget',
430 + ],
431 + ];
432 +
433 + foreach ( $widgets as $key => $data ) {
434 + $option_name = 'easy_element_' . $data['tab'] . '_' . $key;
435 + $enabled = get_option( $option_name, '1' );
436 +
437 + if ( 1 !== ( int ) $enabled ) {
438 + continue; // Skip disabled widgets
439 + }
440 +
441 + if ( file_exists( $data['file'] ) ) {
442 + require_once $data['file'];
443 +
444 + if ( class_exists( $data['class'] ) ) {
445 + $widgets_manager->register( new $data['class']() );
446 + }
447 + }
448 + }
449 + }
450 +
451 +}
452 +
699 453 Easyel_Elements_Elementor_Extension::instance();