PluginProbe
Easy Elements for Elementor – Addons & Website Templates / 1.3.1
Easy Elements for Elementor – Addons & Website Templates v1.3.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
easy-elements / includes / Admin / Admin_Settings.php

Admin_Settings.php in Easy Elements for Elementor – Addons & Website Templates 1.3.1, at includes/Admin/Admin_Settings.php

1,629 lines 75.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Easyel\EasyElements\Admin;
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit;
5 }
6
7 class Admin_Settings {
8
9 // Singleton instance
10 private static $instance = null;
11
12 private function __construct() {
13 // Hooks
14
15 // Custom Font Load Free
16
17 add_action( 'admin_menu', array( $this, 'easyel_elements_settings_menu' ) );
18 add_action( 'admin_menu', array( $this, 'easyel_elements_settings_menu2' ) ,999 );
19 add_action( 'admin_init', array( $this, 'easyel_elements_register_settings' ) );
20
21 add_action( 'easyel_smooth_scroller_popup', array( $this, 'easyel_smooth_scroller_popup_callback' ), 5 );
22
23 add_action( "admin_footer", array( $this,"easyel_settings_toggle_popup_modal" ) );
24
25 $this->easyel_settings_ajax();
26
27 }
28
29 public function easyel_settings_ajax( ) {
30
31 // AJAX handler for saving minify js option
32
33 add_action('wp_ajax_easy_elements_save_widget_setting', array( $this, "easy_elements_save_widget_setting" ) );
34 add_action('wp_ajax_easy_elements_bulk_action', array( $this, 'easy_elements_bulk_action') );
35
36 add_action('wp_ajax_easy_elements_save_global_extensions', array( $this, 'easy_elements_save_global_extensions') ) ;
37 add_action('wp_ajax_easy_elements_save_global_extensions_bulk', array( $this, 'easy_elements_save_global_extensions_bulk') ) ;
38
39 add_action('wp_ajax_easy_elements_bulk_group_action', [$this, 'easy_elements_bulk_group_action']);
40
41 add_action('admin_enqueue_scripts', array( $this, 'easyel_elements_enqueue_admin_assets') );
42 add_action( 'admin_head', array( $this, 'easyel_hide_admin_notices' ) );
43
44 add_action('wp_ajax_easyel_save_user_data', array( $this, 'easyel_save_user_data_callback') );
45
46 add_action('wp_ajax_save_smooth_scroll_settings', array( $this, 'save_smooth_scroll_settings'));
47 add_action('wp_ajax_nopriv_save_smooth_scroll_settings', array( $this, 'save_smooth_scroll_settings') );
48
49 }
50
51 // Singleton get_instance
52 public static function get_instance() {
53 if (self::$instance === null) {
54 self::$instance = new self();
55 }
56 return self::$instance;
57 }
58
59 public function easyel_save_user_data_callback() {
60
61 check_ajax_referer('easy_elements_nonce', 'security');
62
63 // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
64 $posted = $_POST['settings'] ?? [];
65 $settings = map_deep( wp_unslash( $posted ), 'sanitize_text_field' );
66
67 update_option( 'easy_element_user_data', $settings );
68
69 wp_send_json_success(['message' => 'Saved successfully!']);
70 }
71
72 public function easyel_elements_settings_menu() {
73
74 // Main Menu
75 add_menu_page(
76 __('Easy Elements', 'easy-elements'),
77 __('Easy Elements', 'easy-elements'),
78 'manage_options',
79 'easy-elements-dashboard',
80 array( $this, 'easyel_elements_settings_callback' ),
81 'dashicons-admin-generic',
82 59
83 );
84
85 global $submenu;
86
87 // Main slug
88 $slug = 'easy-elements-dashboard';
89
90 $submenu[$slug][] = [ __('Overview', 'easy-elements'), 'manage_options', 'admin.php?page='.$slug.'#overview' ];
91 $submenu[$slug][] = [ __('Widgets', 'easy-elements'), 'manage_options', 'admin.php?page='.$slug.'#widget' ];
92 $submenu[$slug][] = [ __('All Extensions', 'easy-elements'), 'manage_options', 'admin.php?page='.$slug.'#extensions' ];
93
94 // Header & Footer Submenu
95 add_submenu_page(
96 'easy-elements-dashboard',
97 __('Header & Footer', 'easy-elements'),
98 __('Header & Footer', 'easy-elements'),
99 'manage_options',
100 'edit.php?post_type=ee-elementor-hf'
101 );
102
103 // Upload Custom Fonts Submenu
104 add_submenu_page(
105 'easy-elements-dashboard',
106 __('Upload Custom Fonts', 'easy-elements'),
107 __('Upload Custom Fonts', 'easy-elements'),
108 'manage_options',
109 'easyel-custom-fonts',
110 array( $this, 'easyel_custom_fonts_page_html' )
111 );
112
113 // Off Canvas Submenu
114 add_submenu_page(
115 'easy-elements-dashboard',
116 __('Off Canvas', 'easy-elements'),
117 __('Off Canvas', 'easy-elements'),
118 'manage_options',
119 'edit.php?post_type=easy-offcanvas'
120 );
121
122 $flush_needed = get_option( 'easyel_flush_rewrite_rules', true );
123
124 if ( $flush_needed ) {
125 flush_rewrite_rules(); // Flush permalink
126 update_option( 'easyel_flush_rewrite_rules', false ); // Mark as flushed
127 }
128
129
130 }
131
132 public function easyel_settings_toggle_popup_modal( ) { ?>
133
134 <div id="easyel-admin-toggle-pro-upgrade-modal" class="easyel-admin-toggle-pro-modal">
135 <div class="easyel-admin-toggle-pro-modal-overlay"></div>
136
137 <div class="easyel-admin-toggle-pro-modal-content">
138 <button class="easyel-admin-toggle-pro-modal-close">×</button>
139
140 <span class="easyel-admin-toggle-pro-badge">PRO</span>
141
142 <h2>Unlock the PRO Features 🚀</h2>
143
144 <p>
145 This widget is available in <strong>Easy Elements Pro</strong>.
146 Upgrade now to unlock advanced widgets, premium features, and priority support.
147 </p>
148
149 <ul class="easyel-admin-toggle-pro-feature-list">
150 <li> Advanced Elementor Widgets</li>
151 <li> Premium Effects & Controls</li>
152 <li> Faster Performance</li>
153 <li> Priority Support</li>
154 </ul>
155
156 <div class="easyel-admin-toggle-pro-actions">
157 <a href="https://wpeasyelements.com/pricing/"
158 target="_blank"
159 class="easyel-admin-toggle-pro-upgrade-btn">
160 Upgrade to Pro
161 </a>
162
163 <button class="easyel-admin-toggle-pro-modal-cancel">
164 Maybe Later
165 </button>
166 </div>
167 </div>
168 </div>
169
170
171 <?php }
172
173 public function easyel_elements_settings_menu2() {
174
175 global $submenu;
176
177 // Main slug
178 $slug = 'easy-elements-dashboard';
179 /**
180 * ----------------------------------------
181 * Activate License
182 * ----------------------------------------
183 */
184 if ( defined( 'EASY_ELEMENTS_PRO_ACTIVE' ) && EASY_ELEMENTS_PRO_ACTIVE ) {
185 $submenu[ $slug ][] = [
186 __( 'Activate License', 'easy-elements' ),
187 'manage_options',
188 'admin.php?page=' . $slug . '#activate_license',
189 ];
190 }
191
192 $license_status = 'invalid';
193
194 $pro_version = easyel_get_pro_clean_version();
195
196 if ( $pro_version && version_compare( $pro_version, '1.0.8', '>=' ) ) {
197
198 if ( did_action( 'plugins_loaded' ) && class_exists( '\EasyElements_Elementor\Pro\Licenses\EasyelLicense' ) ) {
199 $manager = \EasyElements_Elementor\Pro\Licenses\EasyelLicense::get_instance();
200 if ( method_exists( $manager, 'check_license_validity' ) ) {
201 $license_status = $manager->check_license_validity();
202 }
203 }
204
205 } else {
206
207 if ( did_action( 'plugins_loaded' ) && class_exists( '\Easyel_License_Manager' ) ) {
208 $license_manager = new \Easyel_License_Manager();
209 if ( $license_manager && method_exists( $license_manager, 'check_license_validity' ) ) {
210 $license_status = $license_manager->check_license_validity();
211 }
212 }
213
214 }
215
216 if ( 'valid' !== $license_status ) {
217
218 $submenu[ $slug ][] = [
219 __( 'Upgrade to Pro', 'easy-elements' ),
220 'manage_options',
221 'https://wpeasyelements.com/pricing/',
222 '',
223 '',
224 ];
225
226 // Hook CSS to highlight it
227 add_action('admin_head', function() use ($slug) {
228 ?>
229 <style>
230 #toplevel_page_<?php echo esc_attr($slug); ?> .wp-submenu li a[href="https://wpeasyelements.com/pricing/"] {
231 color: #fff !important;
232 background-color: #7455FF !important;
233 font-weight: bold;
234 border-radius: 4px;
235 }
236
237 #toplevel_page_<?php echo esc_attr($slug); ?> .wp-submenu li a[href="https://wpeasyelements.com/pricing/"]:hover {
238 background-color: #7455FF !important;
239 color: #fff !important;
240 }
241 </style>
242 <script>
243 jQuery(document).ready(function($){
244 $('#toplevel_page_<?php echo esc_js($slug); ?> .wp-submenu li a[href="https://wpeasyelements.com/pricing/"]').attr('target','_blank');
245 });
246 </script>
247 <?php
248 });
249 }
250 }
251
252 public function easyel_elements_register_settings() {
253 register_setting( 'easyel_elements_extensions_group', 'easyel_enable_js_animation', [
254 'sanitize_callback' => 'absint',
255 'default' => 0,
256 ] );
257
258 // Cursor setting register
259 register_setting( 'easyel_elements_extensions_group', 'easyel_enable_cursor', [
260 'sanitize_callback' => 'absint',
261 'default' => 0,
262 ] );
263 }
264
265 public function easy_elements_bulk_group_action() {
266
267 if (!current_user_can('manage_options')) {
268 wp_send_json_error(__('Unauthorized', 'easy-elements'));
269 }
270
271 check_ajax_referer('easy_elements_bulk_action_nonce', 'nonce');
272
273 $group = isset($_POST['group']) ? sanitize_text_field(wp_unslash($_POST['group'])) : '';
274 $tab = isset($_POST['tab']) ? sanitize_text_field(wp_unslash($_POST['tab'])) : 'widget';
275 $status = isset($_POST['status']) && $_POST['status'] == 1 ? '1' : '0';
276
277 $available_elements = $this->easyel_elements_get_available_widgets();
278 $updated_count = 0;
279
280 $is_pro_active = class_exists('Easy_Elements_Pro');
281
282 foreach ($available_elements as $key => $widget) {
283
284 if (!isset($widget['tab']) || $widget['tab'] !== $tab) {
285 continue;
286 }
287
288 $group_slug = strtolower(trim($group));
289
290 $widget_group = isset( $widget['group'] ) ? $widget['group'] : 'General Widgets';
291
292 $widget_group_slug = strtolower(trim(str_replace(' ', '-', $widget_group ) ) );
293
294 if ($widget_group_slug !== $group_slug) {
295 continue;
296 }
297
298 $option_name = 'easy_element_' . $tab . '_' . $key;
299
300 if (!$is_pro_active && isset($widget['is_pro']) && $widget['is_pro']) {
301 update_option($option_name, '0');
302 } else {
303 update_option($option_name, $status);
304 }
305
306 $updated_count++;
307 }
308
309 wp_send_json_success([
310 'message' => sprintf('%d widgets %s successfully', $updated_count, $status ? 'activated' : 'deactivated'),
311 'count' => $updated_count,
312 'is_pro_active' => $is_pro_active,
313 'status' => $status
314 ]);
315 }
316
317 public function easy_elements_save_global_extensions_bulk() {
318 if ( ! current_user_can( 'manage_options' ) ) {
319 wp_send_json_error( __( 'Unauthorized', 'easy-elements' ) );
320 }
321
322 check_ajax_referer( 'easy_elements_widget_settings_nonce', 'nonce' );
323
324 $tab = isset( $_POST['tab'] ) ? sanitize_text_field( wp_unslash( $_POST['tab'] ) ) : 'extensions';
325 $keys = isset( $_POST['keys'] ) ? array_map( 'sanitize_text_field', (array) wp_unslash( $_POST['keys'] ) ) : [];
326 $status = isset( $_POST['status'] ) ? intval( wp_unslash( $_POST['status'] ) ) : 0;
327 $group_slug = isset( $_POST['group'] ) ? sanitize_text_field( wp_unslash( $_POST['group'] ) ) : '';
328
329 if ( empty( $keys ) ) {
330 wp_send_json_error( [ 'message' => __( 'No keys provided', 'easy-elements' ) ] );
331 }
332
333 $settings = get_option( 'easy_element_' . $tab, [] );
334
335 foreach ( $keys as $key ) {
336 $key = sanitize_text_field( $key );
337 $settings[ $key ] = $status;
338 }
339
340 update_option( 'easy_element_' . $tab, $settings );
341
342 if ( $group_slug ) {
343 update_option( 'easy_element_group_' . $group_slug, $status );
344 }
345
346 wp_send_json_success( [ 'message' => __( 'Bulk settings updated', 'easy-elements' ) ] );
347 }
348
349 public function easy_elements_save_global_extensions() {
350 if (!current_user_can('manage_options')) {
351 wp_send_json_error(__('Unauthorized', 'easy-elements'));
352 }
353
354 check_ajax_referer('easy_elements_widget_settings_nonce', 'nonce');
355
356 $tab = isset( $_POST['tab'] ) ? sanitize_text_field( wp_unslash( $_POST['tab'] ) ) : 'extensions';
357 $key = isset($_POST['key']) ? sanitize_text_field( wp_unslash( $_POST['key'] )) : '';
358 $status = isset( $_POST['status'] ) ? intval( wp_unslash( $_POST['status'] ) ) : 0;
359
360 if (!$key) {
361 wp_send_json_error(['message' => __('Invalid key', 'easy-elements')]);
362 }
363
364 $settings = get_option('easy_element_' . $tab, []);
365 $settings[$key] = $status;
366
367 update_option('easy_element_' . $tab, $settings);
368
369 wp_send_json_success(['message' => __('Settings updated', 'easy-elements')]);
370 }
371
372
373 // AJAX handler for saving individual widget settings
374
375 public function easy_elements_save_widget_setting() {
376 if (!current_user_can('manage_options')) {
377 wp_send_json_error(__('Unauthorized', 'easy-elements'));
378 }
379 check_ajax_referer('easy_elements_widget_settings_nonce', 'nonce');
380
381 $widget_key = isset($_POST['widget_key']) ? sanitize_text_field( wp_unslash($_POST['widget_key'] ) ) : '';
382 $status = isset($_POST['status']) && $_POST['status'] === '1' ? '1' : '0';
383 $tab_slug = isset($_POST['tab']) ? sanitize_text_field( wp_unslash( $_POST['tab'] ) ) : 'widget';
384
385 if (!empty( $widget_key ) ) {
386 $option_name = 'easy_element_' . $tab_slug . '_' . $widget_key;
387
388 update_option($option_name, $status);
389
390 wp_send_json_success([
391 'message' => __('Widget setting updated successfully', 'easy-elements'),
392 'status' => $status,
393 ]);
394 } else {
395 wp_send_json_error(['message' => __('Invalid widget key', 'easy-elements')]);
396 }
397 }
398
399 // AJAX handler for bulk actions
400 public function easy_elements_bulk_action() {
401 if (!current_user_can('manage_options')) {
402 wp_send_json_error(__('Unauthorized', 'easy-elements'));
403 }
404 check_ajax_referer('easy_elements_bulk_action_nonce', 'nonce');
405
406 $bulk_action = isset($_POST['bulk_action']) ? sanitize_text_field(wp_unslash($_POST['bulk_action'])) : '';
407 $tab = isset($_POST['tab']) ? sanitize_text_field( wp_unslash( $_POST['tab'] ) ) : 'widget';
408 $status = $bulk_action === 'activate_all' ? '1' : '0';
409
410 $available_elements = $this->easyel_elements_get_available_widgets();
411 $updated_count = 0;
412
413 $is_pro_active = class_exists('Easy_Elements_Pro');
414
415 foreach ($available_elements as $key => $widget) {
416 if (isset($widget['tab']) && $widget['tab'] === $tab) {
417 $option_name = 'easy_element_' . $tab . '_' . $key;
418
419 if (!$is_pro_active && isset($widget['is_pro']) && $widget['is_pro']) {
420 update_option($option_name, '0');
421 } else {
422 $status = $bulk_action === 'activate_all' ? '1' : '0';
423 update_option($option_name, $status);
424 }
425 }
426 }
427
428 wp_send_json_success([
429 'message' => sprintf('%d widgets %s successfully', $updated_count, $status ? 'activated' : 'deactivated'),
430 'count' => $updated_count,
431 'is_pro_active' => $is_pro_active
432 ]);
433 }
434
435
436 function easyel_elements_settings_callback() {
437 $available_elements = $this->easyel_elements_get_available_widgets();
438
439 $easyel_tabs = [
440 'overview' => __('Overview', 'easy-elements'),
441 'widget' => __('All Widgets', 'easy-elements'),
442 'extensions' => __('All Extensions', 'easy-elements'),
443 'advsettings' => __('Advanced Settings', 'easy-elements'),
444 'userData' => __('API Settings', 'easy-elements'),
445
446 ];
447
448 if ( defined( 'EASY_ELEMENTS_PRO_ACTIVE' ) && EASY_ELEMENTS_PRO_ACTIVE ) {
449 $easyel_tabs['activate_license'] = __('Activate License', 'easy-elements');
450 }
451
452 $easyel_tab_list = apply_filters("easyel_all_tab_list", $easyel_tabs );
453
454 ?>
455 <div class="easyel-plugin-main-settings-page">
456 <div class="easyel-saving-indicator">
457 Saving...
458 </div>
459 <div class="easyel-overview-header">
460 <img src="<?php echo esc_url( EASYELEMENTS_DIR_URL . 'includes/Admin/img/easy-logo.png' ); ?>" alt="<?php echo esc_attr( 'logo' ); ?>">
461
462 </div>
463 <div class=" easyel-plugin-settings-wrapper">
464 <div class="easyel-nav-tab-item">
465 <div class="easyel-nav-tab-wrapper easyel-border-radius-20">
466 <a href="#overview" class="easyel-nav-tab easyel-nav-tab-active" data-tab="overview"><i class="easyelIcon-home"></i> <?php esc_html_e ('Overview','easy-elements'); ?></a>
467 <a href="#widget" class="easyel-nav-tab" data-tab="widget"><i class="easyelIcon-widgets"></i><?php esc_html_e('All Widgets','easy-elements'); ?></a>
468 <a href="#extensions" class="easyel-nav-tab" data-tab="extensions"><i class="easyelIcon-extension"></i><?php esc_html_e('All Extensions','easy-elements'); ?></a>
469 <a href="#userData" class="easyel-nav-tab" data-tab="userData"><i class="easyelIcon-setting"></i><?php esc_html_e('API Settings','easy-elements'); ?></a>
470 <?php if ( defined( 'EASY_ELEMENTS_PRO_ACTIVE' ) && EASY_ELEMENTS_PRO_ACTIVE ) : ?>
471 <a href="#activate_license" class="easyel-nav-tab" data-tab="activate_license"><i class="easyelIcon-license-pro"></i><?php esc_html_e('Activate License','easy-elements'); ?></a>
472 <?php endif; ?>
473 <div class="easyel-tab-pro-link">
474 <a href="https://wpeasyelements.com/pricing/" class="easyel-nav-tab-pro" target="_blank">
475 <i class="easyelIcon-crown"></i>
476 <?php esc_html_e('Go Premium','easy-elements'); ?>
477 </a>
478 </div>
479 </div>
480 </div>
481 <!-- Status Messages -->
482 <div id="bulk-action-message" class="notice" style="display: none;"></div>
483
484 <!-- Tab Content -->
485 <div id="easyel-tab-content">
486 <?php foreach ( $easyel_tabs as $tab_slug => $tab_label ) : ?>
487 <div id="tab-<?php echo esc_attr($tab_slug); ?>"
488 class="easyel-tab-panel easyel-border-radius-20 <?php echo esc_attr($tab_slug); ?>"
489 style="<?php echo $tab_slug === 'overview' ? '' : 'display:none;'; ?>">
490
491 <?php
492 if ( $tab_slug === 'widget' ) : ?>
493 <div class="easyel-addon-search easyel-dflex easyel-justify-between">
494 <div class="easyel-widget-filter">
495 <h1 class="easyel-dashboard-heading"><?php esc_html_e('Widgets','easy-elements');?></h1>
496 <div class="easyel-widget-filter-button">
497 <button type="button" id="easyel_all" class="easyel-action-btn active" data-filter="easyel_all"><?php esc_html_e('All', 'easy-elements'); ?></button>
498 <button type="button" id="easyel_free" class="easyel-action-btn" data-filter="easyel_free"><?php esc_html_e('Free', 'easy-elements'); ?></button>
499 <button type="button" id="easyel_pro" class="easyel-action-btn" data-filter="easyel_pro"><?php esc_html_e('Pro', 'easy-elements'); ?></button>
500 </div>
501 </div>
502 <div class="easyel-widget-search-enable">
503 <div class="easyel-widget-activeDeactivate-button">
504 <button type="button" id="activate-all-btn"><?php esc_html_e('Activate All', 'easy-elements'); ?></button>
505 <button type="button" id="deactivate-all-btn"><?php esc_html_e('Deactivate All', 'easy-elements'); ?></button>
506 </div>
507 <?php if ( $tab_slug === 'widget' ) { ?>
508 <input type="text" id="element-search" placeholder="<?php esc_attr_e('Search widgets...', 'easy-elements'); ?>">
509 <?php } ?>
510 </div>
511 </div>
512 <?php endif; ?>
513 <?php
514
515 $tab_file = EASYELEMENTS_DIR_PATH . 'includes/Admin/settingstab/tab-' . $tab_slug . '.php';
516
517 if ( file_exists( $tab_file ) ) {
518 include $tab_file;
519 }
520
521 $pro_version = easyel_get_pro_clean_version();
522
523 if (
524 $pro_version &&
525 version_compare( $pro_version, '1.0.8', '>=' )
526 ) {
527 if (
528 did_action( 'plugins_loaded' ) &&
529 class_exists( '\EasyElements_Elementor\Pro\Licenses\EasyelLicense' ) &&
530 $tab_slug === 'activate_license'
531 ) {
532 $manager = \EasyElements_Elementor\Pro\Licenses\EasyelLicense::get_instance();
533
534 if ( method_exists( $manager, 'license_page_html' ) ) {
535 $manager->license_page_html();
536 }
537 }
538
539 } else {
540 if (
541 did_action( 'plugins_loaded' ) &&
542 class_exists( '\Easyel_License_Manager' ) &&
543 $tab_slug === 'activate_license'
544 ) {
545 $manager = new \Easyel_License_Manager();
546 if ( method_exists( $manager, 'license_page_html' ) ) {
547 $manager->license_page_html();
548 }
549 }
550 }
551
552
553
554
555 ?>
556 </div>
557 <?php endforeach; ?>
558 </div>
559
560 </div>
561 </div>
562
563 <!-- JavaScript functionality is handled by admin.js -->
564 <?php
565 }
566
567 ////////****************** AJAX Toggle ********************************
568
569 public function Easyel_Elements_enqueue_admin_assets($hook) {
570 if (strpos($hook, 'easy-elements') === false) {
571 return;
572 }
573
574 // Enqueue admin JavaScript
575 wp_enqueue_script(
576 'easy-elements-admin',
577 EASYELEMENTS_DIR_URL . 'assets/js/admin.js',
578 ['jquery'],
579 '1.0.0',
580 true
581 );
582
583
584 // Localize script with all necessary data
585 wp_localize_script('easy-elements-admin', 'easyElementsData', [
586 'ajaxurl' => admin_url('admin-ajax.php'),
587 'nonce' => wp_create_nonce('easy_elements_nonce'),
588 'widget_settings_nonce' => wp_create_nonce('easy_elements_widget_settings_nonce'),
589 'bulk_action_nonce' => wp_create_nonce('easy_elements_bulk_action_nonce'),
590 'advance_settings_nonce' => wp_create_nonce('easy_elements_save_advance_settings_nonce'),
591 'js_animation_nonce' => wp_create_nonce('easyel_js_animation_nonce'),
592 'strings' => [
593 'confirm_activate_all' => __('Are you sure you want to activate all widgets?', 'easy-elements'),
594 'confirm_deactivate_all' => __('Are you sure you want to deactivate all widgets?', 'easy-elements'),
595 'processing' => __('Processing...', 'easy-elements'),
596 'saving' => __('Saving...', 'easy-elements'),
597 'saved' => __('Saved!', 'easy-elements'),
598 'error' => __('Error!', 'easy-elements'),
599 'updated' => __('Updated!', 'easy-elements'),
600 ]
601 ]);
602 }
603
604 function easyel_elements_get_available_widgets() {
605 $widgets = [
606 'heading' => [
607 'icon' => 'easyelIcon-heading',
608 'title' => 'Heading',
609 'description' => 'Add customizable headings with style options.',
610 'demo_url' => 'https://wpeasyelements.com/heading/',
611 'docx_url' => 'https://wpeasyelements.com/docs/heading/',
612 'is_pro' => false,
613 'tab' => 'widget',
614 ],
615 'clients_logo' => [
616 'icon' => 'easyelIcon-clients-logo-grid',
617 'title' => 'Clients Logo Grid',
618 'description' => 'Showcase client logos in a neat grid layout.',
619 'demo_url' => 'https://wpeasyelements.com/clients-logo-grid/',
620 'docx_url' => 'https://wpeasyelements.com/docs/clients-logo-grid',
621 'is_pro' => false,
622 'tab' => 'widget',
623 ],
624 'clients_logo_slider' => [
625 'icon' => 'easyelIcon-clients-logo-slider',
626 'title' => 'Clients Logo Slider',
627 'description' => 'Display client logos in a slider format.',
628 'demo_url' => 'https://wpeasyelements.com/clients-logo-slider/',
629 'docx_url' => 'https://wpeasyelements.com/docs/clients-logo-slider/',
630 'is_pro' => true,
631 'group' => 'Creative Widgets',
632 'tab' => 'widget',
633 ],
634 'simple_tab' => [
635 'icon' => 'easyelIcon-tab',
636 'title' => 'Tab',
637 'description' => 'Add simple tab content.',
638 'demo_url' => 'https://wpeasyelements.com/tab',
639 'docx_url' => 'https://wpeasyelements.com/docs/tab',
640 'is_pro' => false,
641 'tab' => 'widget',
642 ],
643 'tab_advance' => [
644 'icon' => 'easyelIcon-tab',
645 'title' => 'Advanced Tab',
646 'description' => 'Create advanced tab content.',
647 'demo_url' => 'https://wpeasyelements.com/advanced-tab/',
648 'docx_url' => 'https://wpeasyelements.com/docs/advanced-tab/',
649 'is_pro' => true,
650 'tab' => 'widget',
651 ],
652 'testimonials' => [
653 'icon' => 'easyelIcon-testimonials-grid',
654 'title' => 'Testimonials Grid',
655 'description' => 'Show testimonials in a grid format.',
656 'demo_url' => 'https://wpeasyelements.com/testimonials-grid',
657 'docx_url' => 'https://wpeasyelements.com/docs/testimonials-grid',
658 'is_pro' => false,
659 'tab' => 'widget',
660 ],
661 'testimonials_slider' => [
662 'icon' => 'easyelIcon-testimonials-slider',
663 'title' => 'Testimonials Slider',
664 'description' => 'Display testimonials in a slider format.',
665 'demo_url' => 'https://wpeasyelements.com/testimonials-slider/',
666 'docx_url' => 'https://wpeasyelements.com/docs/testimonials-slider/',
667 'is_pro' => true,
668 'tab' => 'widget',
669 ],
670 'image_carousel' => [
671 'icon' => 'easyelIcon-image-carousel',
672 'title' => 'Image Carousel',
673 'description' => 'Create an image slider with multiple images.',
674 'demo_url' => 'https://wpeasyelements.com/image-carousel/',
675 'docx_url' => 'https://wpeasyelements.com/docs/image-carousel',
676 'is_pro' => true,
677 'tab' => 'widget',
678 ],
679 'image_reveal' => [
680 'icon' => 'easyelIcon-marquee-logo',
681 'title' => 'Reveal Image',
682 'description' => 'reveal Image Here',
683 'demo_url' => 'https://wpeasyelements.com/reveal-image/',
684 'docx_url' => 'https://wpeasyelements.com/docs/reveal-image/',
685 'is_pro' => true,
686 'tab' => 'widget',
687 ],
688 'rotate_text' => [
689 'icon' => 'easyelIcon-heading',
690 'title' => 'Rotate Text',
691 'description' => 'rotate text here',
692 'demo_url' => 'https://wpeasyelements.com/rotate-text/',
693 'docx_url' => 'https://wpeasyelements.com/docs/rotate-text/',
694 'is_pro' => true,
695 'tab' => 'widget',
696 ],
697 'icon_box' => [
698 'icon' => 'easyelIcon-iconbox',
699 'title' => 'Info Box',
700 'description' => 'Display content with an icon.',
701 'demo_url' => 'https://wpeasyelements.com/info-box',
702 'docx_url' => 'https://wpeasyelements.com/docs/info-box',
703 'is_pro' => false,
704 'tab' => 'widget',
705 ],
706 'process_grid' => [
707 'icon' => 'easyelIcon-process-grid',
708 'title' => 'Process Grid',
709 'description' => 'Show process steps in a grid format.',
710 'demo_url' => 'https://wpeasyelements.com/process-grid',
711 'docx_url' => 'https://wpeasyelements.com/docs/process-grid',
712 'is_pro' => false,
713 'tab' => 'widget',
714 ],
715 'process_slider' => [
716 'icon' => 'easyelIcon-process-slider',
717 'title' => 'Process Slider',
718 'description' => 'Show process steps in a slider.',
719 'demo_url' => 'https://wpeasyelements.com/process-slider/',
720 'docx_url' => 'https://wpeasyelements.com/docs/process-slider/',
721 'is_pro' => true,
722 'tab' => 'widget',
723 ],
724 'team_grid' => [
725 'icon' => 'easyelIcon-team-grid',
726 'title' => 'Team Grid',
727 'description' => 'Display team members in a grid format.',
728 'demo_url' => 'https://wpeasyelements.com/team-grid',
729 'docx_url' => 'https://wpeasyelements.com/docs/team-grid',
730 'is_pro' => false,
731 'tab' => 'widget',
732 ],
733 'team_slider' => [
734 'icon' => 'easyelIcon-team-slider',
735 'title' => 'Team Slider',
736 'description' => 'Showcase team members in a slider format.',
737 'demo_url' => 'https://wpeasyelements.com/team-slider',
738 'docx_url' => 'https://wpeasyelements.com/docs/team-slider',
739 'is_pro' => true,
740 'tab' => 'widget',
741 ],
742 'contact_box' => [
743 'icon' => 'easyelIcon-contact-box',
744 'title' => 'Contact Box',
745 'description' => 'Contact Box.',
746 'demo_url' => 'https://wpeasyelements.com/contact-box',
747 'docx_url' => 'https://wpeasyelements.com/docs/contact-box',
748 'is_pro' => false,
749 'tab' => 'widget',
750 ],
751 'icon_box_slider' => [
752 'icon' => 'easyelIcon-icon-box-slider',
753 'title' => 'Info Box Slider',
754 'description' => 'Info Box Slider.',
755 'demo_url' => 'https://wpeasyelements.com/info-box-slider/',
756 'docx_url' => 'https://wpeasyelements.com/docs/info-box-slider/',
757 'is_pro' => true,
758 'tab' => 'widget',
759 ],
760 'timeline_slider' => [
761 'icon' => 'easyelIcon-timeline-slider',
762 'title' => 'Timeline Slider',
763 'description' => 'Timeline Slider.',
764 'demo_url' => 'https://wpeasyelements.com/timeline-slider/',
765 'docx_url' => 'https://wpeasyelements.com/docs/timeline-slider',
766 'is_pro' => true,
767 'group' => 'Creative Widgets',
768 'tab' => 'widget',
769 ],
770 'faq' => [
771 'icon' => 'easyelIcon-faq-1',
772 'title' => 'FAQ',
773 'description' => 'FAQ.',
774 'demo_url' => 'https://wpeasyelements.com/faq',
775 'docx_url' => 'https://wpeasyelements.com/docs/faq',
776 'is_pro' => false,
777 'tab' => 'widget',
778 ],
779 'blog_grid' => [
780 'icon' => 'easyelIcon-post-grid',
781 'title' => 'Post Grid',
782 'description' => 'Post.',
783 'demo_url' => 'https://wpeasyelements.com/post-grid',
784 'docx_url' => 'https://wpeasyelements.com/docs/post-grid',
785 'is_pro' => false,
786 'tab' => 'widget',
787 ],
788 'post_slider' => [
789 'icon' => 'easyelIcon-post-slider',
790 'title' => 'Post Slider',
791 'description' => 'Post Slider.',
792 'demo_url' => 'https://wpeasyelements.com/post-slider/',
793 'docx_url' => 'https://wpeasyelements.com/docs/post-slider/',
794 'is_pro' => true,
795 'tab' => 'widget',
796 ],
797 'easy_cf7' => [
798 'icon' => 'easyelIcon-contact-form',
799 'title' => 'Contact Form 7',
800 'description' => 'Contact form 7.',
801 'demo_url' => 'https://wpeasyelements.com/contact-form-7',
802 'docx_url' => 'https://wpeasyelements.com/docs/contact-form-7',
803 'is_pro' => false,
804 'tab' => 'widget',
805 ],
806 'video' => [
807 'icon' => 'easyelIcon-video',
808 'title' => 'Video',
809 'description' => 'Video.',
810 'demo_url' => 'https://wpeasyelements.com/video',
811 'docx_url' => 'https://wpeasyelements.com/docs/video',
812 'is_pro' => false,
813 'tab' => 'widget',
814 ],
815 'pricing_table' => [
816 'icon' => 'easyelIcon-pricing-table',
817 'title' => 'Pricing Table',
818 'description' => 'Pricing Table.',
819 'demo_url' => 'https://wpeasyelements.com/pricing-table',
820 'docx_url' => 'https://wpeasyelements.com/docs/pricing-table',
821 'is_pro' => false,
822 'group' => 'Marketing Widgets',
823 'tab' => 'widget',
824 ],
825 'pricing_list' => [
826 'icon' => 'easyelIcon-pricing-list',
827 'title' => 'Pricing List',
828 'description' => 'Pricing List.',
829 'demo_url' => 'https://wpeasyelements.com/pricing-list/',
830 'docx_url' => 'https://wpeasyelements.com/docs/pricing-list/',
831 'is_pro' => true,
832 'group' => 'Marketing Widgets',
833 'tab' => 'widget',
834 ],
835 'pricing_tab' => [
836 'icon' => 'easyelIcon-pricing-table',
837 'title' => 'Pricing Tab',
838 'description' => 'Pricing Tab.',
839 'demo_url' => 'https://wpeasyelements.com/pricing-tab/',
840 'docx_url' => 'https://wpeasyelements.com/docs/pricing-tab/',
841 'is_pro' => true,
842 'group' => 'Marketing Widgets',
843 'tab' => 'widget',
844 ],
845 'service_list' => [
846 'icon' => 'easyelIcon-service-list',
847 'title' => 'Service List',
848 'description' => 'Service List.',
849 'demo_url' => 'https://wpeasyelements.com/service-list',
850 'docx_url' => 'https://wpeasyelements.com/docs/service-list/',
851 'is_pro' => false,
852 'tab' => 'widget',
853 ],
854 'advance_service' => [
855 'icon' => 'easyelIcon-service-list',
856 'title' => 'Advance Service',
857 'description' => 'Advance Service.',
858 'demo_url' => 'https://wpeasyelements.com/advance-service',
859 'docx_url' => 'https://wpeasyelements.com/docs/advance-service/',
860 'is_pro' => true,
861 'tab' => 'widget',
862 ],
863 'feature_list' => [
864 'icon' => 'easyelIcon-service-list',
865 'title' => 'Feature List',
866 'description' => 'Feature List.',
867 'demo_url' => 'https://wpeasyelements.com/features-list',
868 'docx_url' => 'https://wpeasyelements.com/docs/features-list/',
869 'is_pro' => false,
870 'tab' => 'widget',
871 ],
872 'process_list' => [
873 'icon' => 'easyelIcon-process-list',
874 'title' => 'Process List',
875 'description' => 'Process List.',
876 'demo_url' => 'https://wpeasyelements.com/process-list/',
877 'docx_url' => 'https://wpeasyelements.com/docs/process-list/',
878 'is_pro' => false,
879 'tab' => 'widget',
880 ],
881 'marquee_logo' => [
882 'icon' => 'easyelIcon-marquee-logo',
883 'title' => 'Marquee',
884 'description' => 'Marquee.',
885 'demo_url' => 'https://wpeasyelements.com/marquee/',
886 'docx_url' => 'https://wpeasyelements.com/docs/marquee/',
887 'is_pro' => true,
888 'tab' => 'widget',
889 ],
890 'button' => [
891 'icon' => 'easyelIcon-button',
892 'title' => 'Button',
893 'description' => 'Button.',
894 'demo_url' => 'https://wpeasyelements.com/button/',
895 'docx_url' => 'https://wpeasyelements.com/docs/button',
896 'is_pro' => false,
897 'tab' => 'widget',
898 ],
899 'social_share' => [
900 'icon' => 'easyelIcon-social-share',
901 'title' => 'Social Share',
902 'description' => 'Social Share.',
903 'demo_url' => 'https://wpeasyelements.com/',
904 'docx_url' => 'https://wpeasyelements.com/docs/',
905 'is_pro' => false,
906 'tab' => 'widget',
907 ],
908 'social_icon' => [
909 'icon' => 'easyelIcon-social-icons',
910 'title' => 'Social Icon',
911 'description' => 'Social Icon.',
912 'demo_url' => 'https://wpeasyelements.com/social-icon',
913 'docx_url' => 'https://wpeasyelements.com/docs/social-icon',
914 'is_pro' => false,
915 'tab' => 'widget',
916 ],
917 'breadcrumb' => [
918 'icon' => 'easyelIcon-breadcumb',
919 'title' => 'Breadcrumb',
920 'description' => 'Breadcrumb.',
921 'demo_url' => 'https://wpeasyelements.com/breadcrumb',
922 'docx_url' => 'https://wpeasyelements.com/docs/breadcrumb',
923 'is_pro' => false,
924 'tab' => 'widget',
925 ],
926 'easy_slider' => [
927 'icon' => 'easyelIcon-slider',
928 'title' => 'Slider',
929 'description' => 'Slider.',
930 'demo_url' => 'https://wpeasyelements.com/slider',
931 'docx_url' => 'https://wpeasyelements.com/docs/slider',
932 'is_pro' => true,
933 'tab' => 'widget',
934 ],
935 'image_accordion' => [
936 'icon' => 'easyelIcon-image-accordion',
937 'title' => 'Image Accordion',
938 'description' => 'Image Accordion',
939 'demo_url' => 'https://wpeasyelements.com/image-accordion/',
940 'docx_url' => 'https://wpeasyelements.com/docs/image-accordion/',
941 'is_pro' => true,
942 'tab' => 'widget',
943 ],
944 'domain_search' => [
945 'icon' => 'easyelIcon-domain-search',
946 'title' => 'Domain Search',
947 'description' => 'Domain Search.',
948 'demo_url' => 'https://wpeasyelements.com/',
949 'docx_url' => 'https://wpeasyelements.com/docs/',
950 'is_pro' => false,
951 'tab' => 'widget',
952 ],
953 'featured_project' => [
954 'icon' => 'easyelIcon-custom-projects',
955 'title' => 'Custom Projects',
956 'description' => 'Custom Projects.',
957 'demo_url' => 'https://wpeasyelements.com/',
958 'docx_url' => 'https://wpeasyelements.com/docs/',
959 'is_pro' => true,
960 'tab' => 'widget',
961 ],
962 'advance_button' => [
963 'icon' => 'easyelIcon-button',
964 'title' => 'Advance Button',
965 'description' => 'Advance Button.',
966 'demo_url' => 'https://wpeasyelements.com/advance-button/',
967 'docx_url' => 'https://wpeasyelements.com/docs/advance-button',
968 'is_pro' => true,
969 'tab' => 'widget',
970 ],
971 'hr_image_scroll' => [
972 'icon' => 'easyelIcon-image-horizontal-scroll',
973 'title' => 'Horizontal Scroll',
974 'description' => 'Horizontal Scroll.',
975 'demo_url' => 'https://wpeasyelements.com/horizontal-scroll/',
976 'docx_url' => 'https://wpeasyelements.com/docs/horizontal-scroll/',
977 'is_pro' => true,
978 'tab' => 'widget',
979 ],
980 'scrolltrigger_title' => [
981 'icon' => 'easyelIcon-title-scrolltrigger',
982 'title' => 'Content ScrollTrigger',
983 'description' => 'Content ScrollTrigger.',
984 'demo_url' => 'https://wpeasyelements.com/title-scrolltrigger/',
985 'docx_url' => 'https://wpeasyelements.com/docs/title-scrolltrigger/',
986 'is_pro' => true,
987 'tab' => 'widget',
988 ],
989 'Flip_Box' => [
990 'icon' => 'easyelIcon-flip-box',
991 'title' => 'Flip Box',
992 'description' => 'Flip Box.',
993 'demo_url' => 'https://wpeasyelements.com/flip-box',
994 'docx_url' => 'https://wpeasyelements.com/docs/flip-box',
995 'is_pro' => true,
996 'group' => 'Creative Widgets',
997 'tab' => 'widget',
998 ],
999 'easy_offcanvas' => [
1000 'icon' => 'easyelIcon-canvas',
1001 'title' => 'Offcanvas',
1002 'description' => 'Offcanvas.',
1003 'demo_url' => 'https://wpeasyelements.com/offcanvas',
1004 'docx_url' => 'https://wpeasyelements.com/docs/offcanvas',
1005 'is_pro' => false,
1006 'group' => 'Header & Footer Widget',
1007 'tab' => 'widget',
1008 ],
1009 'site_logo' => [
1010 'icon' => 'easyelIcon-site-logo',
1011 'title' => 'Site Logo',
1012 'description' => 'Display your website logo easily with this widget.',
1013 'demo_url' => 'https://wpeasyelements.com/site-logo/',
1014 'docx_url' => 'https://wpeasyelements.com/docs/site-logo/',
1015 'is_pro' => false,
1016 'group' => 'Header & Footer Widget',
1017 'tab' => 'widget',
1018 ],
1019 'search' => [
1020 'icon' => 'easyelIcon-search',
1021 'title' => 'Simple Search',
1022 'description' => 'Search All Content.',
1023 'demo_url' => 'https://wpeasyelements.com/search',
1024 'docx_url' => 'https://wpeasyelements.com/docs/search',
1025 'is_pro' => false,
1026 'group' => 'Header & Footer Widget',
1027 'tab' => 'widget',
1028 ],
1029 'navigation_menu' => [
1030 'icon' => 'easyelIcon-navigation',
1031 'title' => 'Navigation Menu',
1032 'description' => 'Navigation Menu.',
1033 'demo_url' => 'https://wpeasyelements.com/',
1034 'docx_url' => 'https://wpeasyelements.com/docs/',
1035 'is_pro' => false,
1036 'group' => 'Header & Footer Widget',
1037 'tab' => 'widget',
1038 ],
1039 'single_navigation_menu' => [
1040 'icon' => 'easyelIcon-navigation',
1041 'title' => 'Single Navigation Menu',
1042 'description' => 'SingleNavigation Menu.',
1043 'demo_url' => 'https://wpeasyelements.com/',
1044 'docx_url' => 'https://wpeasyelements.com/docs/',
1045 'is_pro' => false,
1046 'group' => 'Header & Footer Widget',
1047 'tab' => 'widget',
1048 ],
1049 'mega_menu_widget' => [
1050 'icon' => 'easyelIcon-navigation',
1051 'title' => 'Mega Menu',
1052 'description' => 'Mega Menu.',
1053 'demo_url' => 'https://wpeasyelements.com/mega-menu/',
1054 'docx_url' => 'https://wpeasyelements.com/docs/mega-menu/',
1055 'is_pro' => true,
1056 'group' => 'Header & Footer Widget',
1057 'tab' => 'widget',
1058 ],
1059 'page_title' => [
1060 'icon' => 'easyelIcon-page-title',
1061 'title' => 'Page Title',
1062 'description' => 'Page Title.',
1063 'demo_url' => 'https://wpeasyelements.com/',
1064 'docx_url' => 'https://wpeasyelements.com/docs/',
1065 'is_pro' => false,
1066 'group' => 'Header & Footer Widget',
1067 'tab' => 'widget',
1068 ],
1069 'post_tags' => [
1070 'icon' => 'easyelIcon-post-tag',
1071 'title' => 'Current Post Tags',
1072 'description' => 'Current Post Tags.',
1073 'demo_url' => 'https://wpeasyelements.com/',
1074 'docx_url' => 'https://wpeasyelements.com/docs/',
1075 'is_pro' => false,
1076 'group' => 'Theme Builder Widget',
1077 'tab' => 'widget',
1078 ],
1079 'post_author' => [
1080 'icon' => 'easyelIcon-author',
1081 'title' => 'Post Author Info',
1082 'description' => 'Post Author Info.',
1083 'demo_url' => 'https://wpeasyelements.com/',
1084 'docx_url' => 'https://wpeasyelements.com/docs/',
1085 'is_pro' => false,
1086 'group' => 'Theme Builder Widget',
1087 'tab' => 'widget',
1088 ],
1089 'post_title' => [
1090 'icon' => 'easyelIcon-post-title',
1091 'title' => 'Post Title',
1092 'description' => 'Post Title.',
1093 'demo_url' => 'https://wpeasyelements.com/',
1094 'docx_url' => 'https://wpeasyelements.com/docs/',
1095 'is_pro' => false,
1096 'group' => 'Theme Builder Widget',
1097 'tab' => 'widget',
1098 ],
1099 'post_content' => [
1100 'icon' => 'easyelIcon-post-content',
1101 'title' => 'Post Content',
1102 'description' => 'Post Content.',
1103 'demo_url' => 'https://wpeasyelements.com/',
1104 'docx_url' => 'https://wpeasyelements.com/docs/',
1105 'is_pro' => false,
1106 'group' => 'Theme Builder Widget',
1107 'tab' => 'widget',
1108 ],
1109 'excerpt' => [
1110 'icon' => 'easyelIcon-post-excerpt',
1111 'title' => 'Post Excerpt',
1112 'description' => 'Post Excerpt.',
1113 'demo_url' => 'https://wpeasyelements.com/',
1114 'docx_url' => 'https://wpeasyelements.com/docs/',
1115 'is_pro' => false,
1116 'group' => 'Theme Builder Widget',
1117 'tab' => 'widget',
1118 ],
1119 'related_post' => [
1120 'icon' => 'easyelIcon-related-post',
1121 'title' => 'Related Post',
1122 'description' => 'Related Post.',
1123 'demo_url' => 'https://wpeasyelements.com/',
1124 'docx_url' => 'https://wpeasyelements.com/docs/',
1125 'is_pro' => true,
1126 'group' => 'Theme Builder Widget',
1127 'tab' => 'widget',
1128 ],
1129 'post_pagination' => [
1130 'icon' => 'easyelIcon-pagination',
1131 'title' => 'Post Pagination',
1132 'description' => 'Post Pagination.',
1133 'demo_url' => 'https://wpeasyelements.com/',
1134 'docx_url' => 'https://wpeasyelements.com/docs/',
1135 'is_pro' => false,
1136 'group' => 'Theme Builder Widget',
1137 'tab' => 'widget',
1138 ],
1139 'post_meta' => [
1140 'icon' => 'easyelIcon-meta',
1141 'title' => 'Post Meta',
1142 'description' => 'Post Meta.',
1143 'demo_url' => 'https://wpeasyelements.com/',
1144 'docx_url' => 'https://wpeasyelements.com/docs/',
1145 'is_pro' => false,
1146 'group' => 'Theme Builder Widget',
1147 'tab' => 'widget',
1148 ],
1149 'post_comments' => [
1150 'icon' => 'easyelIcon-comments',
1151 'title' => 'Post Comments',
1152 'description' => 'Post Comments.',
1153 'demo_url' => 'https://wpeasyelements.com/',
1154 'docx_url' => 'https://wpeasyelements.com/docs/',
1155 'is_pro' => false,
1156 'group' => 'Theme Builder Widget',
1157 'tab' => 'widget',
1158 ],
1159 'featured_image' => [
1160 'icon' => 'easyelIcon-image-carousel',
1161 'title' => 'Featured Image',
1162 'description' => 'Featured Image.',
1163 'demo_url' => 'https://wpeasyelements.com/',
1164 'docx_url' => 'https://wpeasyelements.com/docs/',
1165 'is_pro' => false,
1166 'group' => 'Theme Builder Widget',
1167 'tab' => 'widget',
1168 ],
1169 'easy_scroll_to_top' => [
1170 'icon' => 'easyelIcon-scroll-top',
1171 'title' => 'Scroll Top',
1172 'description' => 'Scroll Top.',
1173 'demo_url' => 'https://wpeasyelements.com/docs/scroll-to-top/',
1174 'docx_url' => 'https://wpeasyelements.com/docs/scroll-to-top/',
1175 'is_pro' => false,
1176 'group' => 'Theme Builder Widget',
1177 'tab' => 'widget',
1178 ],
1179 'easy_table' => [
1180 'icon' => 'easyelIcon-clients-logo-grid',
1181 'title' => 'Table',
1182 'description' => 'Table.',
1183 'demo_url' => 'https://wpeasyelements.com/table',
1184 'docx_url' => 'https://wpeasyelements.com/docs/table',
1185 'is_pro' => false,
1186 'tab' => 'widget',
1187 ],
1188 'advance_image' => [
1189 'icon' => 'easyelIcon-image-carousel',
1190 'title' => 'Advance Image',
1191 'description' => 'Advance Image Here.',
1192 'demo_url' => 'https://wpeasyelements.com/advance-image/',
1193 'docx_url' => 'https://wpeasyelements.com/docs/advance-image/',
1194 'is_pro' => true,
1195 'group' => 'Animations',
1196 'tab' => 'widget',
1197 ],
1198 'bmi_calculator' => [
1199 'icon' => 'easyelIcon-calculator',
1200 'title' => 'BMI Calculator',
1201 'description' => 'BMI Calculator.',
1202 'demo_url' => 'https://wpeasyelements.com/bmi-calculator/',
1203 'docx_url' => 'https://wpeasyelements.com/docs/bmi-calculator/',
1204 'is_pro' => true,
1205 'group' => 'Creative Widgets',
1206 'tab' => 'widget',
1207 ],
1208 'typewriter' => [
1209 'icon' => 'easyelIcon-heading',
1210 'title' => 'Typewriter',
1211 'description' => 'Animated typewriter text effect.',
1212 'demo_url' => 'https://wpeasyelements.com/',
1213 'docx_url' => 'https://wpeasyelements.com/docs/',
1214 'is_pro' => true,
1215 'group' => 'Animations',
1216 'tab' => 'widget',
1217 ],
1218 'animated_title' => [
1219 'icon' => 'easyelIcon-animated-title',
1220 'title' => 'Animated Title',
1221 'description' => 'Animated title text effect.',
1222 'demo_url' => 'https://wpeasyelements.com/animated-title/',
1223 'docx_url' => 'https://wpeasyelements.com/docs/',
1224 'is_pro' => true,
1225 'group' => 'Animations',
1226 'tab' => 'widget',
1227 ],
1228 'easytext_animation' => [
1229 'icon' => 'easyelIcon-heading',
1230 'title' => 'Animated Text',
1231 'description' => 'Animated text animation effect.',
1232 'demo_url' => 'https://wpeasyelements.com/',
1233 'docx_url' => 'https://wpeasyelements.com/docs/',
1234 'is_pro' => true,
1235 'group' => 'Animations',
1236 'tab' => 'widget',
1237 ],
1238 'easy_feature' => [
1239 'icon' => 'easyelIcon-marquee-logo',
1240 'title' => 'Hover Image Box',
1241 'description' => 'Hover image box content.',
1242 'demo_url' => 'https://wpeasyelements.com/hover-image-box/',
1243 'docx_url' => 'https://wpeasyelements.com/docs/hover-image-box/',
1244 'is_pro' => true,
1245 'tab' => 'widget',
1246 ],
1247 'easy_gallery' => [
1248 'icon' => 'easyelIcon-marquee-logo',
1249 'title' => 'Simple Gallery',
1250 'description' => 'Gallery',
1251 'demo_url' => 'https://wpeasyelements.com/simple-gallery/',
1252 'docx_url' => 'https://wpeasyelements.com/docs/simple-gallery/',
1253 'is_pro' => false,
1254 'tab' => 'widget',
1255 ],
1256 'image_gallery_filter' => [
1257 'icon' => 'easyelIcon-filterable-gallery',
1258 'title' => 'Filterable Gallery',
1259 'description' => 'filterable Gallery',
1260 'demo_url' => 'https://wpeasyelements.com/gallery-filter/',
1261 'docx_url' => 'https://wpeasyelements.com/gallery-filter/',
1262 'is_pro' => true,
1263 'group' => 'Creative Widgets',
1264 'tab' => 'widget',
1265 ],
1266 'portfolio_pro' => [
1267 'icon' => 'easyelIcon-marquee-logo',
1268 'title' => 'Portfolio',
1269 'description' => 'Portfolio',
1270 'demo_url' => 'https://wpeasyelements.com/portfolio/',
1271 'docx_url' => 'https://wpeasyelements.com/docs/portfolio/',
1272 'is_pro' => true,
1273 'tab' => 'widget',
1274 ],
1275 'portfolio_filter' => [
1276 'icon' => 'easyelIcon-marquee-logo',
1277 'title' => 'Portfolio Filter',
1278 'description' => 'Portfolio filter',
1279 'demo_url' => 'https://wpeasyelements.com/portfolio-filter/',
1280 'docx_url' => 'https://wpeasyelements.com/docs/portfolio-filter/',
1281 'is_pro' => true,
1282 'tab' => 'widget',
1283 ],
1284 'protected_content' => [
1285 'icon' => 'easyelIcon-protected-content',
1286 'title' => 'Protected Content',
1287 'description' => 'This Widget is protected content',
1288 'demo_url' => 'https://wpeasyelements.com/protected-contents/',
1289 'docx_url' => 'https://wpeasyelements.com/docs/protected-contents/',
1290 'is_pro' => true,
1291 'group' => 'Creative Widgets',
1292 'tab' => 'widget',
1293 ],
1294 'advanced_search' => [
1295 'icon' => 'easyelIcon-advance-search',
1296 'title' => 'Advanced Search',
1297 'description' => 'This Widget is advanced search',
1298 'demo_url' => 'https://wpeasyelements.com/advanced-search/',
1299 'docx_url' => 'https://wpeasyelements.com/docs/advanced-search/',
1300 'is_pro' => true,
1301 'tab' => 'widget',
1302 ],
1303 'enable_image_hover_effect' => [
1304 'icon' => 'easyelIcon-marquee-logo',
1305 'title' => 'Image Hover Effect',
1306 'description' => 'This Widget is image hover effect',
1307 'demo_url' => 'https://wpeasyelements.com/image-hover-effect/',
1308 'docx_url' => 'https://wpeasyelements.com/docs/image-hover-effect/',
1309 'is_pro' => true,
1310 'group' => 'Creative Widgets',
1311 'tab' => 'widget',
1312 ],
1313 'image_hotspot' => [
1314 'icon' => 'easyelIcon-marquee-logo',
1315 'title' => 'image Hotspot',
1316 'description' => 'This Widget is Image Hotspot',
1317 'demo_url' => 'https://wpeasyelements.com/image-hotspot/',
1318 'docx_url' => 'https://wpeasyelements.com/docs/image-hotspot/',
1319 'is_pro' => true,
1320 'group' => 'Creative Widgets',
1321 'tab' => 'widget',
1322 ],
1323 'hr_image_scroll' => [
1324 'icon' => 'easyelIcon-image-horizontal-scroll',
1325 'title' => 'ScrollTrigger',
1326 'description' => 'This Widget is image hover effect',
1327 'demo_url' => 'https://wpeasyelements.com/horizontal-scroll/',
1328 'docx_url' => 'https://wpeasyelements.com/docs/horizontal-scroll/',
1329 'is_pro' => true,
1330 'group' => 'Animations',
1331 'tab' => 'widget',
1332 ],
1333 'archive_post' => [
1334 'icon' => 'easyelIcon-post-grid',
1335 'title' => 'Archive Post',
1336 'description' => 'This Widget is archive post widget',
1337 'demo_url' => 'https://wpeasyelements.com/post-grid/',
1338 'docx_url' => 'https://wpeasyelements.com/docs/post-grid/',
1339 'is_pro' => false,
1340 'tab' => 'widget',
1341 ],
1342 'counter' => [
1343 'icon' => 'easyelIcon-counter',
1344 'title' => 'Counter',
1345 'description' => 'This is a widget that counts up.',
1346 'demo_url' => 'https://wpeasyelements.com/counter/',
1347 'docx_url' => 'https://wpeasyelements.com/docs/counter/',
1348 'is_pro' => false,
1349 'group' => 'Creative Widgets',
1350 'tab' => 'widget',
1351 ],
1352 'countdown' => [
1353 'icon' => 'easyelIcon-countdown',
1354 'title' => 'Countdown',
1355 'description' => 'This is a countdown widget.',
1356 'demo_url' => 'https://wpeasyelements.com/countdown/',
1357 'docx_url' => 'https://wpeasyelements.com/docs/countdown/',
1358 'is_pro' => false,
1359 'group' => 'Creative Widgets',
1360 'tab' => 'widget',
1361 ],
1362 'easy_progress' => [
1363 'icon' => 'easyelIcon-progress-bar',
1364 'title' => 'Progress Bar',
1365 'description' => 'This is a Progress bar widget.',
1366 'demo_url' => 'https://wpeasyelements.com/progressbar/',
1367 'docx_url' => 'https://wpeasyelements.com/docs/progressbar/',
1368 'is_pro' => false,
1369 'group' => 'Creative Widgets',
1370 'tab' => 'widget',
1371 ],
1372 'facebook_feed' => [
1373 'icon' => 'easyelIcon-facebook-feed',
1374 'title' => 'Facebook Feed',
1375 'description' => 'This Widget is facebook feeds',
1376 'demo_url' => 'https://wpeasyelements.com/facebook-feed/',
1377 'docx_url' => 'https://wpeasyelements.com/docs/facebook-feed/',
1378 'is_pro' => true,
1379 'group' => 'Social Media Feeds',
1380 'tab' => 'widget',
1381 ],
1382 'instagram_feed' => [
1383 'icon' => 'easyelIcon-instagram-feed',
1384 'title' => 'Instagram Feed',
1385 'description' => 'This Widget is instagram feeds',
1386 'demo_url' => 'https://wpeasyelements.com/instagram-feed/',
1387 'docx_url' => 'https://wpeasyelements.com/docs/instagram-feed/',
1388 'is_pro' => true,
1389 'group' => 'Social Media Feeds',
1390 'tab' => 'widget',
1391 ],
1392 'login_register' => [
1393 'icon' => 'easyelIcon-login',
1394 'title' => 'Login / Register',
1395 'description' => 'This Widget is login and register form',
1396 'demo_url' => 'https://wpeasyelements.com/register/',
1397 'docx_url' => 'https://wpeasyelements.com/docs/login-register/',
1398 'is_pro' => false,
1399 'group' => 'Form Widgets',
1400 'tab' => 'widget',
1401 ],
1402 'table_of_content' => [
1403 'icon' => 'easyelIcon-pricing-list',
1404 'title' => 'Table Of Content',
1405 'description' => 'This is a widget that creates a table of content.',
1406 'demo_url' => 'https://wpeasyelements.com/table-of-content/',
1407 'docx_url' => 'https://wpeasyelements.com/docs/table-of-content/',
1408 'is_pro' => true,
1409 'group' => 'Creative Widgets',
1410 'tab' => 'widget',
1411 ],
1412 ];
1413
1414 $feature_widget_map = [
1415 'enable_megamenu_builder' => 'mega_menu_widget',
1416 ];
1417
1418 // Condition apply
1419 if ( function_exists( 'easy_element_is_enabled' ) ) {
1420 foreach ( $feature_widget_map as $feature => $widget_key ) {
1421 if ( ! easy_element_is_enabled( $feature ) ) {
1422 unset( $widgets[ $widget_key ] );
1423 }
1424 }
1425 }
1426
1427 return apply_filters( 'easyel_available_widgets', $widgets );
1428
1429 }
1430
1431 /**
1432 * Admin page HTML
1433 */
1434 function easyel_custom_fonts_page_html() {
1435 if ( ! current_user_can( 'manage_options' ) ) return;
1436
1437 if ( ! defined( 'EASY_ELEMENTS_PRO_ACTIVE' ) || ! EASY_ELEMENTS_PRO_ACTIVE ) { ?>
1438 <div class="easyel-custom-font-page">
1439 <div class="easyel-custom-font-banner">
1440 <div class="easyel-custom-font-banner-content">
1441 <h1><?php esc_html_e( 'Custom Fonts', 'easy-elements' ); ?></h1>
1442
1443 <p>
1444 <?php esc_html_e(
1445 'Upload and manage custom fonts.',
1446 'easy-elements'
1447 ); ?>
1448 </p>
1449 <p>Upload TTF, OTF, WOFF</p>
1450 <a
1451 href="https://wpeasyelements.com/pricing/"
1452 target="_blank"
1453 class="easyel-upgrade-btn-custom-font"
1454 >
1455 <?php esc_html_e( 'Upgrade to Pro', 'easy-elements' ); ?>
1456 </a>
1457 </div>
1458 </div>
1459 </div>
1460 <?php
1461 return;
1462 }
1463
1464 $pro_version = easyel_get_pro_clean_version();
1465
1466 if (
1467 $pro_version &&
1468 version_compare( $pro_version, '1.0.8', '>=' )
1469 ) {
1470 if (
1471 did_action( 'plugins_loaded' ) &&
1472 class_exists( '\EasyElements_Elementor\Pro\CustomFont\FontUploader' ) ) {
1473 $manager = \EasyElements_Elementor\Pro\CustomFont\FontUploader::get_instance();
1474
1475 if ( method_exists( $manager, 'easyel_pro_custom_fonts_page' ) ) {
1476 $manager->easyel_pro_custom_fonts_page();
1477 }
1478 }
1479 } else {
1480 easyel_pro_custom_fonts_page();
1481 }
1482
1483 }
1484
1485 /**
1486 * Hide admin notices on the Easy Elements dashboard page.
1487 */
1488 function easyel_hide_admin_notices() {
1489 $screen = get_current_screen();
1490
1491 if ( $screen && 'toplevel_page_easy-elements-dashboard' === $screen->id ) {
1492
1493 $custom_css = '
1494 /* Hide all common notices */
1495 .notice,
1496 .updated,
1497 .error,
1498 .update-nag,
1499 .notice-success,
1500 .notice-error,
1501 .notice-warning {
1502 display: none !important;
1503 }
1504
1505 /* But allow EasyEL notice */
1506 .easyel-promo-notice {
1507 display: block !important;
1508 }
1509 ';
1510
1511 $handle = 'easyel-admin-hide-notices';
1512 wp_register_style( $handle, false, [], EASYELEMENTS_VER );
1513 wp_enqueue_style( $handle );
1514 wp_add_inline_style( $handle, $custom_css );
1515 }
1516 }
1517
1518 public function easyel_smooth_scroller_popup_display() {
1519
1520 $options = get_option('easyel_scroll_smoother_settings', []);
1521
1522 ?>
1523 <div class="easyel-smooth-scroll-popup">
1524 <div class="ajax-search-close-icon">
1525 <a class="easyel-smooth-scroll-popup-close-icon rbt-round-btn" href="#">
1526 <svg width="14" height="14" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
1527 <path d="M9.08366 1.73916L8.26116 0.916656L5.00033 4.17749L1.73949 0.916656L0.916992 1.73916L4.17783 4.99999L0.916992 8.26082L1.73949 9.08332L5.00033 5.82249L8.26116 9.08332L9.08366 8.26082L5.82283 4.99999L9.08366 1.73916Z" fill="currentColor"></path>
1528 </svg>
1529 </a>
1530 </div>
1531
1532 <div class="wrapper">
1533 <h2 class="easyel-smooth-scroll-heading"><?php echo esc_html__("Smooth Scroll Settings","easy-elements"); ?></h2>
1534 <form method="post" action="">
1535 <div class="easyel-smooth-scroll-settings-main-wrapper">
1536
1537 <!-- Smooth Speed -->
1538 <div class="easyel-smooth-scroll-item">
1539 <span class="easy-field-label"><?php echo esc_html__("Speed (2.0–5):","easy-elements"); ?></span>
1540 <label class="easy-field-item">
1541 <input type="number"
1542 name="smooth_scroll_speed"
1543 min="0.1" max="5" step="0.1"
1544 value="<?php echo isset($options['smooth_scroll_speed']) ? esc_attr($options['smooth_scroll_speed']) : '2.0'; ?>">
1545 </label>
1546 </div>
1547
1548 <!-- Normalize Scroll -->
1549 <div class="easyel-smooth-scroll-item">
1550 <span class="easy-field-label"><?php echo esc_html__("Normalize Scroll","easy-elements"); ?></span>
1551 <label class="easy-field-item easy-toggle-switch">
1552 <input type="checkbox"
1553 name="smooth_scroll_normalize"
1554 value="1"
1555 <?php checked( isset($options['smooth_scroll_normalize']) ? $options['smooth_scroll_normalize'] : 1, 1 ); ?>>
1556 <span class="slider round"></span>
1557 </label>
1558 </div>
1559
1560 <!-- Enable on Mobile -->
1561 <div class="easyel-smooth-scroll-item">
1562 <span class="easy-field-label"><?php echo esc_html__("Enable on Mobile Devices","easy-elements"); ?></span>
1563 <label class="easy-field-item easy-toggle-switch">
1564 <input type="checkbox"
1565 name="smooth_scroll_enable_mobile"
1566 value="1"
1567 <?php checked( isset($options['smooth_scroll_enable_mobile']) ? $options['smooth_scroll_enable_mobile'] : 0, 1 ); ?>>
1568 <span class="slider round"></span>
1569 </label>
1570 </div>
1571
1572 <!-- Disable on Editor Mode -->
1573 <div class="easyel-smooth-scroll-item">
1574 <span class="easy-field-label"><?php echo esc_html__("Disable on Editor Mode","easy-elements"); ?></span>
1575 <label class="easy-field-item easy-toggle-switch">
1576 <input type="checkbox"
1577 name="smooth_scroll_disable_editor_mode"
1578 value="1"
1579 <?php checked( isset($options['smooth_scroll_disable_editor_mode']) ? $options['smooth_scroll_disable_editor_mode'] : 0, 1 ); ?>>
1580 <span class="slider round"></span>
1581 </label>
1582 </div>
1583
1584 </div>
1585
1586 <div class="easyel-smooth-scroll-save">
1587 <input type="submit"
1588 class="smooth_scroll_popup_item_save"
1589 name="smooth_scroll_popup_item_save"
1590 value="<?php echo esc_attr__('Save Changes', 'easy-elements'); ?>">
1591 </div>
1592 </form>
1593 </div>
1594
1595 </div>
1596 <?php
1597 }
1598
1599 public function easyel_smooth_scroller_popup_callback() {
1600 $this->easyel_smooth_scroller_popup_display();
1601 }
1602
1603 function save_smooth_scroll_settings() {
1604
1605 // Permission check
1606 if ( ! current_user_can('manage_options') ) {
1607 wp_send_json_error(__('Unauthorized', 'easy-elements'));
1608 }
1609
1610 // Nonce check
1611 check_ajax_referer('easy_elements_nonce', 'nonce');
1612
1613 if ( ! isset($_POST['settings']) ) {
1614 wp_send_json_error(['message' => 'No settings received']);
1615 }
1616
1617 // Sanitize deeply
1618 $settings = map_deep( wp_unslash( $_POST['settings'] ), 'sanitize_text_field');
1619
1620 // Save all settings under one option name
1621 update_option('easyel_scroll_smoother_settings', $settings);
1622
1623 wp_send_json_success(['message' => 'Saved successfully']);
1624 }
1625
1626 }
1627
1628 // Initialize the plugin
1629 Admin_Settings::get_instance();