PluginProbe ʕ •ᴥ•ʔ
Spider Elements – Premium Elementor Widgets & Addons Library / 1.7.0
Spider Elements – Premium Elementor Widgets & Addons Library v1.7.0
trunk 1.0.0 1.1.0 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.7.0 1.8.0 1.9.0
spider-elements / includes / Admin / dashboard / features.php
spider-elements / includes / Admin / dashboard Last commit date
elements.php 6 months ago features.php 6 months ago integration.php 6 months ago popup-pro.php 6 months ago sidebar.php 6 months ago welcome.php 6 months ago
features.php
147 lines
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit; // Exit if accessed directly
4 }
5
6 use SPEL\includes\Admin\Module_Settings;
7
8 $features = Module_Settings::get_widget_settings();
9
10 // Global switcher
11 $opt = get_option( 'spel_features_settings' );
12 $global_switcher = $opt['features_global_switcher'] ?? '';
13 $is_checked = ! empty ( $global_switcher == 'on' ) ? ' checked' : '';
14 $checked = ! isset ( $opt['features_global_switcher'] ) ? ' checked' : $is_checked;
15
16 // Get the current theme
17 $theme = wp_get_theme();
18 $theme = in_array( $theme->get( 'Name' ), [ 'jobi', 'Jobi', 'jobi-child', 'Jobi Child' ] );
19 ?>
20 <div id="features" class="tab-box">
21
22 <div class="elements_tab_menu">
23 <div class="tab_contents">
24 <div class="icon">
25 <i class="icon-feature_two"></i>
26 </div>
27 <div class="content">
28 <h3><?php esc_html_e( 'Features', 'spider-elements' ); ?></h3>
29 </div>
30 </div>
31
32 <div class="menu_right_content">
33 <div class="plugin_active_switcher">
34 <label class="toggler" id="features_disabled"><?php esc_html_e( 'Disable All', 'spider-elements' ); ?></label>
35 <div class="toggle">
36 <input type="checkbox" data-id="widget-list" id="features_switcher" name="features_global_switcher" class="check features_global_switcher">
37 <label class="b switch" for="features_switcher"></label>
38 </div>
39 <label class="toggler" id="features_enabled"><?php esc_html_e( 'Enabled All', 'spider-elements' ); ?></label>
40 </div>
41 <button type="submit" name="features-submit" id="features-submit" class="dashboard_btn save_btn">
42 <?php esc_html_e( 'Save Changes', 'spider-elements' ); ?>
43 </button>
44 <?php wp_nonce_field( 'spel_features_nonce', 'spel_features_nonce' ); ?>
45 </div>
46
47 </div>
48
49 <div class="elements_tab" id="elements_filter">
50 <div class="filter_data active" data-filter="*">
51 <i class="icon-star"></i>
52 <?php esc_html_e( 'All', 'spider-elements' ); ?>
53 </div>
54 <div class="filter_data" data-filter=".free">
55 <i class="icon-gift"></i>
56 <?php esc_html_e( 'Free', 'spider-elements' ); ?>
57 </div>
58 <div class="filter_data" data-filter=".pro">
59 <i class="icon-premium"></i>
60 <?php esc_html_e( 'Pro', 'spider-elements' ); ?>
61 </div>
62 </div>
63
64 <div class="filter_content ezd-d-flex" id="features_gallery">
65 <?php
66 if ( isset( $features['spider_elements_features'] ) && is_array( $features['spider_elements_features'] ) ) {
67 foreach ( $features['spider_elements_features'] as $item ) {
68
69 $feature_type = $item['feature_type'] ?? '';
70 $feature_name = $item['name'] ?? '';
71
72 // Default class and attributes for widgets
73 $is_pro_feature = $feature_type === 'pro' ? ' pro_popup' : '';
74 $is_pro_feature_enabled = $feature_type === 'pro' ? ' disabled' : '';
75
76 // Unlock specific features for Jobi theme users
77 if ( in_array( $item['name'], [ 'spel_badge', 'spel_heading_highlighted' ] ) && $theme || spel_is_premium() ) {
78 $is_pro_feature = ''; // Remove pro_popup class
79 $is_pro_feature_enabled = ''; // Enable widget
80 }
81
82 // By default, only free features are checked
83 $opt_input = $opt[ $feature_name ] ?? '';
84 if ( $feature_type === 'pro' && ! spel_is_premium() && ! ( in_array( $item['name'], [ 'spel_badge', 'spel_heading_highlighted' ] ) && $theme ) ) {
85 // Pro feature: unchecked by default
86 $checked = ! isset( $opt[ $feature_name ] ) ? '' : ( ! empty( $opt_input == 'on' ) ? ' checked' : '' );
87 } else {
88 // Free feature or unlocked pro: checked by default
89 $is_checked = ! empty( $opt_input == 'on' ) ? ' checked' : '';
90 $checked = ! isset( $opt[ $feature_name ] ) ? ' checked' : $is_checked;
91 }
92 ?>
93 <div class="ezd-colum-space-4 <?php echo esc_attr( $item['feature_type'] ) ?>">
94 <div class="element_box element_switch badge">
95 <div class="element_content">
96 <?php
97 if ( ! empty( $item['icon'] ) ) { ?>
98 <i class="<?php echo esc_attr( $item['icon'] ) ?>"></i>
99 <?php
100 }
101 if ( ! empty( $item['label'] ) ) { ?>
102 <label for="elementor-video"><?php echo esc_html( $item['label'] ) ?></label>
103 <?php
104 }
105 ?>
106 </div>
107 <div class="element_right">
108 <?php
109 if ( ! empty( $item['label'] ) ) {
110 ?>
111 <div class="link">
112
113 <?php
114 if ( ! empty( $item['demo_url'] ) ) {
115 ?>
116 <a href="<?php echo esc_url( $item['demo_url'] ) ?>" class="tooltip-top" data-tooltip="<?php echo esc_attr( sprintf( __( 'View %s Feature Demo', 'spider-elements' ), $item['label'] ) ); ?>" target="_blank">
117 <img src="<?php echo esc_url( SPEL_IMG . '/dashboard/icon-demo.svg' ) ?>" alt="<?php esc_attr_e( 'Widget Demo', 'spider-elements' ); ?>">
118 </a>
119 <?php
120 }
121 if ( ! empty( $item['demo_url'] ) ) {
122 ?>
123 <a href="<?php echo esc_url( $item['video_url'] ) ?>" class="tooltip-top" data-tooltip="<?php echo esc_attr( sprintf( __( 'View %s Video Tutorial', 'spider-elements' ), $item['label'] ) ); ?>"
124 target="_blank">
125 <img src="<?php echo esc_url( SPEL_IMG . '/dashboard/icon-video.svg' ) ?>" alt="<?php esc_attr_e( 'Video Tutorial', 'spider-elements' ); ?>">
126 </a>
127 <?php
128 }
129
130 ?>
131 </div>
132 <?php
133 }
134 ?>
135 <label for="<?php echo esc_attr( $item['name'] ) ?>" class="switch_label<?php echo esc_attr( $is_pro_feature ) ?>">
136 <input type="checkbox" class="widget_checkbox widget-list" name="<?php echo esc_attr( $item['name'] ) ?>" id="<?php echo esc_attr( $item['name'] ) ?>" <?php echo esc_attr( $checked . $is_pro_feature_enabled ); ?>>
137 <span class="widget_switcher"></span>
138 </label>
139 </div>
140 </div>
141 </div>
142 <?php
143 }
144 }
145 ?>
146 </div>
147 </div>