Header Footer Elementor - Version 1.5.0

Version Description

  • New: Search widget.
  • New: Users can now share non-personal usage data to help us test and develop better products. ( Know More )
  • Improvement: UI improvements.
  • Improvement: Navigation Menu - Added active color for dropdown and current menu parent.
  • Improvement: Navigation Menu - Changed the tablet breakpoint to 1024 in order to support iPad Pro.
  • Fix: Compatibility to PHP v7.4.
  • Fix: GeneratePress theme header now overriden by EHF.
  • Fix: Cart - Count not increasing with AJAX call.
  • Fix: Page Title - Added support for archive title.
  • Fix: Site Title - Custom URL not working.
Download this release

Release Info

Developer Nikschavan
Plugin Icon Header Footer Elementor
Version 1.5.0
Comparing to
See all releases

Code changes from version 1.4.1 to 1.5.0

admin/assets/css/ehf-admin.css CHANGED
@@ -56,13 +56,6 @@ input.hfe-large-text{
56
width: 95%;
57
}
58
59
- .hfe-options-row-heading-help{
60
- color: #b3b3b3;
61
- cursor: help;
62
- float: right;
63
- font-size: 18px;
64
- }
65
-
66
.hfe_radio_options {
67
display: inline-block;
68
}
56
width: 95%;
57
}
58
59
.hfe_radio_options {
60
display: inline-block;
61
}
admin/bsf-analytics/assets/css/minified/style.min-rtl.css ADDED
@@ -0,0 +1 @@
1
+ #bsf-optin-notice{padding:1px 12px;border-right-color:#007cba}#bsf-optin-notice .notice-container{padding-top:10px;padding-bottom:12px}#bsf-optin-notice .notice-content{margin:0}#bsf-optin-notice .notice-heading{padding:0 0 12px 20px}#bsf-optin-notice .button-primary{margin-left:5px}
admin/bsf-analytics/assets/css/minified/style.min.css ADDED
@@ -0,0 +1 @@
1
+ #bsf-optin-notice{padding:1px 12px;border-left-color:#007cba}#bsf-optin-notice .notice-container{padding-top:10px;padding-bottom:12px}#bsf-optin-notice .notice-content{margin:0}#bsf-optin-notice .notice-heading{padding:0 20px 12px 0}#bsf-optin-notice .button-primary{margin-right:5px}
admin/bsf-analytics/assets/css/unminified/style-rtl.css ADDED
@@ -0,0 +1,21 @@
1
+ #bsf-optin-notice {
2
+ padding: 1px 12px;
3
+ border-right-color: #007cba;
4
+ }
5
+
6
+ #bsf-optin-notice .notice-container {
7
+ padding-top: 10px;
8
+ padding-bottom: 12px;
9
+ }
10
+
11
+ #bsf-optin-notice .notice-content {
12
+ margin: 0;
13
+ }
14
+
15
+ #bsf-optin-notice .notice-heading {
16
+ padding: 0 0 12px 20px;
17
+ }
18
+
19
+ #bsf-optin-notice .button-primary {
20
+ margin-left: 5px;
21
+ }
admin/bsf-analytics/assets/css/unminified/style.css ADDED
@@ -0,0 +1,21 @@
1
+ #bsf-optin-notice {
2
+ padding: 1px 12px;
3
+ border-left-color: #007cba;
4
+ }
5
+
6
+ #bsf-optin-notice .notice-container {
7
+ padding-top: 10px;
8
+ padding-bottom: 12px;
9
+ }
10
+
11
+ #bsf-optin-notice .notice-content {
12
+ margin: 0;
13
+ }
14
+
15
+ #bsf-optin-notice .notice-heading {
16
+ padding: 0 20px 12px 0;
17
+ }
18
+
19
+ #bsf-optin-notice .button-primary {
20
+ margin-right: 5px;
21
+ }
admin/bsf-analytics/class-bsf-analytics-stats.php ADDED
@@ -0,0 +1,257 @@
1
+ <?php
2
+ /**
3
+ * BSF analytics stat class file.
4
+ *
5
+ * @package bsf-analytics
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit; // Exit if accessed directly.
10
+ }
11
+
12
+ if ( ! class_exists( 'BSF_Analytics_Stats' ) ) {
13
+ /**
14
+ * BSF analytics stat class.
15
+ */
16
+ class BSF_Analytics_Stats {
17
+
18
+ /**
19
+ * Active plugins.
20
+ *
21
+ * Holds the sites active plugins list.
22
+ *
23
+ * @var array
24
+ */
25
+ private $plugins;
26
+
27
+ /**
28
+ * Instance of BSF_Analytics_Stats.
29
+ *
30
+ * Holds only the first object of class.
31
+ *
32
+ * @var object
33
+ */
34
+ private static $instance = null;
35
+
36
+ /**
37
+ * Create only once instance of a class.
38
+ *
39
+ * @return object
40
+ * @since 1.0.0
41
+ */
42
+ public static function instance() {
43
+ if ( null === self::$instance ) {
44
+ self::$instance = new self();
45
+ }
46
+
47
+ return self::$instance;
48
+ }
49
+
50
+ /**
51
+ * Get stats.
52
+ *
53
+ * @return array stats data.
54
+ * @since 1.0.0
55
+ */
56
+ public function get_stats() {
57
+ return apply_filters( 'bsf_core_stats', $this->get_default_stats() );
58
+ }
59
+
60
+ /**
61
+ * Retrieve stats for site.
62
+ *
63
+ * @return array stats data.
64
+ * @since 1.0.0
65
+ */
66
+ private function get_default_stats() {
67
+ return [
68
+ 'graupi_version' => defined( 'BSF_UPDATER_VERSION' ) ? BSF_UPDATER_VERSION : false,
69
+ 'domain_name' => get_site_url(),
70
+ 'php_os' => PHP_OS,
71
+ 'server_software' => $_SERVER['SERVER_SOFTWARE'],
72
+ 'mysql_version' => $this->get_mysql_version(),
73
+ 'php_version' => $this->get_php_version(),
74
+ 'php_max_input_vars' => ini_get( 'max_input_vars' ), // phpcs:ignore:PHPCompatibility.IniDirectives.NewIniDirectives.max_input_varsFound
75
+ 'php_post_max_size' => ini_get( 'post_max_size' ),
76
+ 'php_max_execution_time' => ini_get( 'max_execution_time' ),
77
+ 'php_memory_limit' => ini_get( 'memory_limit' ),
78
+ 'zip_installed' => extension_loaded( 'zip' ),
79
+ 'imagick_availabile' => extension_loaded( 'imagick' ),
80
+ 'xmlreader_exists' => class_exists( 'XMLReader' ),
81
+ 'gd_available' => extension_loaded( 'gd' ),
82
+ 'curl_version' => $this->get_curl_version(),
83
+ 'curl_ssl_version' => $this->get_curl_ssl_version(),
84
+ 'is_writable' => $this->is_content_writable(),
85
+
86
+ 'wp_version' => get_bloginfo( 'version' ),
87
+ 'user_count' => $this->get_user_count(),
88
+ 'site_language' => get_locale(),
89
+ 'timezone' => wp_timezone_string(),
90
+ 'is_ssl' => is_ssl(),
91
+ 'is_multisite' => is_multisite(),
92
+ 'network_url' => network_site_url(),
93
+ 'external_object_cache' => (bool) wp_using_ext_object_cache(),
94
+ 'wp_debug' => WP_DEBUG,
95
+ 'wp_debug_display' => WP_DEBUG_DISPLAY,
96
+ 'script_debug' => SCRIPT_DEBUG,
97
+
98
+ 'active_plugins' => $this->get_active_plugins(),
99
+
100
+ 'active_theme' => get_template(),
101
+ 'active_stylesheet' => get_stylesheet(),
102
+ ];
103
+ }
104
+
105
+ /**
106
+ * Get installed PHP version.
107
+ *
108
+ * @return float PHP version.
109
+ * @since 1.0.0
110
+ */
111
+ private function get_php_version() {
112
+ if ( defined( 'PHP_MAJOR_VERSION' ) && defined( 'PHP_MINOR_VERSION' ) && defined( 'PHP_RELEASE_VERSION' ) ) { // phpcs:ignore
113
+ return PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION . '.' . PHP_RELEASE_VERSION;
114
+ }
115
+
116
+ return phpversion();
117
+ }
118
+
119
+ /**
120
+ * User count on site.
121
+ *
122
+ * @return int User count.
123
+ * @since 1.0.0
124
+ */
125
+ private function get_user_count() {
126
+ if ( is_multisite() ) {
127
+ $user_count = get_user_count();
128
+ } else {
129
+ $count = count_users();
130
+ $user_count = $count['total_users'];
131
+ }
132
+
133
+ return $user_count;
134
+ }
135
+
136
+ /**
137
+ * Get active plugin's data.
138
+ *
139
+ * @return array active plugin's list.
140
+ * @since 1.0.0
141
+ */
142
+ private function get_active_plugins() {
143
+ if ( ! $this->plugins ) {
144
+ // Ensure get_plugin_data function is loaded.
145
+ if ( ! function_exists( 'get_plugin_data' ) ) {
146
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
147
+ }
148
+
149
+ $plugins = wp_get_active_and_valid_plugins();
150
+ $plugins = array_map( 'get_plugin_data', $plugins );
151
+ $this->plugins = array_map( [ $this, 'format_plugin' ], $plugins );
152
+ }
153
+
154
+ return $this->plugins;
155
+ }
156
+
157
+ /**
158
+ * Format plugin data.
159
+ *
160
+ * @param string $plugin plugin.
161
+ * @return array formatted plugin data.
162
+ * @since 1.0.0
163
+ */
164
+ public function format_plugin( $plugin ) {
165
+ return [
166
+ 'name' => html_entity_decode( $plugin['Name'], ENT_COMPAT, 'UTF-8' ),
167
+ 'url' => $plugin['PluginURI'],
168
+ 'version' => $plugin['Version'],
169
+ 'slug' => $plugin['TextDomain'],
170
+ 'author_name' => html_entity_decode( wp_strip_all_tags( $plugin['Author'] ), ENT_COMPAT, 'UTF-8' ),
171
+ 'author_url' => $plugin['AuthorURI'],
172
+ ];
173
+ }
174
+
175
+ /**
176
+ * Curl SSL version.
177
+ *
178
+ * @return float SSL version.
179
+ * @since 1.0.0
180
+ */
181
+ private function get_curl_ssl_version() {
182
+ $curl = [];
183
+ if ( function_exists( 'curl_version' ) ) {
184
+ $curl = curl_version();
185
+ }
186
+
187
+ return isset( $curl['ssl_version'] ) ? $curl['ssl_version'] : false;
188
+ }
189
+
190
+ /**
191
+ * Get cURL version.
192
+ *
193
+ * @return float cURL version.
194
+ * @since 1.0.0
195
+ */
196
+ private function get_curl_version() {
197
+ $curl = [];
198
+ if ( function_exists( 'curl_version' ) ) {
199
+ $curl = curl_version();
200
+ }
201
+
202
+ return isset( $curl['version'] ) ? $curl['version'] : false;
203
+ }
204
+
205
+ /**
206
+ * Get MySQL version.
207
+ *
208
+ * @return float MySQL version.
209
+ * @since 1.0.0
210
+ */
211
+ private function get_mysql_version() {
212
+ global $wpdb;
213
+ return $wpdb->db_version();
214
+ }
215
+
216
+ /**
217
+ * Check if content directory is writable.
218
+ *
219
+ * @return bool
220
+ * @since 1.0.0
221
+ */
222
+ private function is_content_writable() {
223
+ $upload_dir = wp_upload_dir();
224
+ return wp_is_writable( $upload_dir['basedir'] );
225
+ }
226
+ }
227
+ }
228
+
229
+ /**
230
+ * Polyfill for sites using WP version less than 5.3
231
+ */
232
+ if ( ! function_exists( 'wp_timezone_string' ) ) {
233
+ /**
234
+ * Get timezone string.
235
+ *
236
+ * @return string timezone string.
237
+ * @since 1.0.0
238
+ */
239
+ function wp_timezone_string() {
240
+ $timezone_string = get_option( 'timezone_string' );
241
+
242
+ if ( $timezone_string ) {
243
+ return $timezone_string;
244
+ }
245
+
246
+ $offset = (float) get_option( 'gmt_offset' );
247
+ $hours = (int) $offset;
248
+ $minutes = ( $offset - $hours );
249
+
250
+ $sign = ( $offset < 0 ) ? '-' : '+';
251
+ $abs_hour = abs( $hours );
252
+ $abs_mins = abs( $minutes * 60 );
253
+ $tz_offset = sprintf( '%s%02d:%02d', $sign, $abs_hour, $abs_mins );
254
+
255
+ return $tz_offset;
256
+ }
257
+ }
admin/bsf-analytics/class-bsf-analytics.php ADDED
@@ -0,0 +1,503 @@
1
+ <?php
2
+ /**
3
+ * BSF analytics class file.
4
+ *
5
+ * @version 1.0.0
6
+ *
7
+ * @package bsf-analytics
8
+ */
9
+
10
+ if ( ! defined( 'ABSPATH' ) ) {
11
+ exit; // Exit if accessed directly.
12
+ }
13
+
14
+ if ( ! class_exists( 'BSF_Analytics' ) ) {
15
+
16
+ /**
17
+ * BSF analytics
18
+ */
19
+ class BSF_Analytics {
20
+
21
+ /**
22
+ * Member Variable
23
+ *
24
+ * @var string Usage tracking document URL
25
+ */
26
+ private $usage_doc_link = 'https://store.brainstormforce.com/usage-tracking/?utm_source=wp_dashboard&utm_medium=general_settings&utm_campaign=usage_tracking';
27
+
28
+ /**
29
+ * Setup actions, load files.
30
+ *
31
+ * @since 1.0.0
32
+ */
33
+ public function __construct() {
34
+
35
+ define( 'BSF_ANALYTICS_FILE', __FILE__ );
36
+ define( 'BSF_ANALYTICS_VERSION', '1.0.0' );
37
+ define( 'BSF_ANALYTICS_PATH', dirname( __FILE__ ) );
38
+ define( 'BSF_ANALYTICS_URI', $this->bsf_analytics_url() );
39
+
40
+ add_action( 'admin_init', [ $this, 'handle_optin_optout' ] );
41
+ add_action( 'cron_schedules', [ $this, 'every_two_days_schedule' ] );
42
+ add_action( 'admin_notices', [ $this, 'option_notice' ] );
43
+ add_action( 'astra_notice_before_markup_bsf-optin-notice', [ $this, 'enqueue_assets' ] );
44
+
45
+ add_action( 'init', [ $this, 'schedule_unschedule_event' ] );
46
+
47
+ if ( ! has_action( 'bsf_analytics_send', [ $this, 'send' ] ) ) {
48
+ add_action( 'bsf_analytics_send', [ $this, 'send' ] );
49
+ }
50
+
51
+ add_action( 'admin_init', [ $this, 'register_usage_tracking_setting' ] );
52
+
53
+ add_action( 'update_option_bsf_analytics_optin', [ $this, 'update_analytics_option_callback' ], 10, 3 );
54
+ add_action( 'add_option_bsf_analytics_optin', [ $this, 'add_analytics_option_callback' ], 10, 2 );
55
+
56
+ $this->includes();
57
+ }
58
+
59
+ /**
60
+ * BSF Analytics URL
61
+ *
62
+ * @return String URL of bsf-analytics directory.
63
+ * @since 1.0.0
64
+ */
65
+ public function bsf_analytics_url() {
66
+
67
+ $path = wp_normalize_path( BSF_ANALYTICS_PATH );
68
+ $theme_dir = wp_normalize_path( get_template_directory() );
69
+
70
+ if ( strpos( $path, $theme_dir ) !== false ) {
71
+ return rtrim( get_template_directory_uri() . '/admin/bsf-analytics/', '/' );
72
+ } else {
73
+ return rtrim( plugin_dir_url( BSF_ANALYTICS_FILE ), '/' );
74
+ }
75
+ }
76
+
77
+ /**
78
+ * Get API URL for sending analytics.
79
+ *
80
+ * @return string API URL.
81
+ * @since 1.0.0
82
+ */
83
+ private function get_api_url() {
84
+ return defined( 'BSF_API_URL' ) ? BSF_API_URL : 'https://support.brainstormforce.com/';
85
+ }
86
+
87
+ /**
88
+ * Enqueue Scripts.
89
+ *
90
+ * @since 1.0.0
91
+ * @return void
92
+ */
93
+ public function enqueue_assets() {
94
+
95
+ /**
96
+ * Load unminified if SCRIPT_DEBUG is true.
97
+ *
98
+ * Directory and Extensions.
99
+ */
100
+ $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified';
101
+ $file_rtl = ( is_rtl() ) ? '-rtl' : '';
102
+ $css_ext = ( SCRIPT_DEBUG ) ? '.css' : '.min.css';
103
+
104
+ $css_uri = BSF_ANALYTICS_URI . '/assets/css/' . $dir_name . '/style' . $file_rtl . $css_ext;
105
+
106
+ wp_enqueue_style( 'bsf-analytics-admin-style', $css_uri, false, BSF_ANALYTICS_VERSION, 'all' );
107
+ }
108
+
109
+ /**
110
+ * Send analytics API call.
111
+ *
112
+ * @since 1.0.0
113
+ */
114
+ public function send() {
115
+ wp_remote_post(
116
+ $this->get_api_url() . 'wp-json/bsf-core/v1/analytics/',
117
+ [
118
+ 'body' => BSF_Analytics_Stats::instance()->get_stats(),
119
+ 'timeout' => 5,
120
+ 'blocking' => false,
121
+ ]
122
+ );
123
+ }
124
+
125
+ /**
126
+ * Check if usage tracking is enabled.
127
+ *
128
+ * @return bool
129
+ * @since 1.0.0
130
+ */
131
+ public function is_tracking_enabled() {
132
+ $is_enabled = get_site_option( 'bsf_analytics_optin' ) === 'yes' ? true : false;
133
+ $is_enabled = $this->is_white_label_enabled() ? false : $is_enabled;
134
+
135
+ return apply_filters( 'bsf_tracking_enabled', $is_enabled );
136
+ }
137
+
138
+ /**
139
+ * Check if WHITE label is enabled for BSF products.
140
+ *
141
+ * @return bool
142
+ * @since 1.0.0
143
+ */
144
+ public function is_white_label_enabled() {
145
+
146
+ $options = apply_filters( 'bsf_white_label_options', [] );
147
+ $is_enabled = false;
148
+
149
+ if ( is_array( $options ) ) {
150
+ foreach ( $options as $option ) {
151
+ if ( true === $option ) {
152
+ $is_enabled = true;
153
+ break;
154
+ }
155
+ }
156
+ }
157
+
158
+ return $is_enabled;
159
+ }
160
+
161
+ /**
162
+ * Display admin notice for usage tracking.
163
+ *
164
+ * @since 1.0.0
165
+ */
166
+ public function option_notice() {
167
+
168
+ if ( ! current_user_can( 'manage_options' ) ) {
169
+ return;
170
+ }
171
+
172
+ // Don't display the notice if tracking is disabled or White Label is enabled for any of our plugins.
173
+ if ( false !== get_site_option( 'bsf_analytics_optin', false ) || $this->is_white_label_enabled() ) {
174
+ return;
175
+ }
176
+
177
+ // Show tracker consent notice after 24 hours from installed time.
178
+ if ( strtotime( '+24 hours', $this->get_analytics_install_time() ) > time() ) {
179
+ return;
180
+ }
181
+
182
+ /* translators: %s product name */
183
+ $notice_string = __( 'Want to help make <strong>%1s</strong> even more awesome? Allow us to collect non-sensitive diagnostic data and usage information. ', 'header-footer-elementor' );
184
+
185
+ if ( is_multisite() ) {
186
+ $notice_string .= __( 'This will be applicable for all sites from the network.', 'header-footer-elementor' );
187
+ }
188
+
189
+ Astra_Notices::add_notice(
190
+ [
191
+ 'id' => 'bsf-optin-notice',
192
+ 'type' => '',
193
+ 'message' => sprintf(
194
+ '<div class="notice-content">
195
+ <div class="notice-heading">
196
+ %1$s
197
+ </div>
198
+ <div class="astra-notices-container">
199
+ <a href="%2$s" class="astra-notices button-primary">
200
+ %3$s
201
+ </a>
202
+ <a href="%4$s" data-repeat-notice-after="%5$s" class="astra-notices button-secondary">
203
+ %6$s
204
+ </a>
205
+ </div>
206
+ </div>',
207
+ /* translators: %s usage doc link */
208
+ sprintf( $notice_string . '<a href="%2s" target="_blank" rel="noreferrer noopener">%3s</a>', $this->get_product_name(), esc_url( $this->usage_doc_link ), __( ' Know More.', 'header-footer-elementor' ) ),
209
+ add_query_arg(
210
+ [
211
+ 'bsf_analytics_optin' => 'yes',
212
+ 'bsf_analytics_nonce' => wp_create_nonce( 'bsf_analytics_optin' ),
213
+ ]
214
+ ),
215
+ __( 'Yes! Allow it', 'header-footer-elementor' ),
216
+ add_query_arg(
217
+ [
218
+ 'bsf_analytics_optin' => 'no',
219
+ 'bsf_analytics_nonce' => wp_create_nonce( 'bsf_analytics_optin' ),
220
+ ]
221
+ ),
222
+ MONTH_IN_SECONDS,
223
+ __( 'No Thanks', 'header-footer-elementor' )
224
+ ),
225
+ 'show_if' => true,
226
+ 'repeat-notice-after' => false,
227
+ 'priority' => 18,
228
+ 'display-with-other-notices' => true,
229
+ ]
230
+ );
231
+ }
232
+
233
+ /**
234
+ * Process usage tracking opt out.
235
+ *
236
+ * @since 1.0.0
237
+ */
238
+ public function handle_optin_optout() {
239
+ if ( ! isset( $_GET['bsf_analytics_nonce'] ) ) {
240
+ return;
241
+ }
242
+
243
+ if ( ! wp_verify_nonce( sanitize_text_field( $_GET['bsf_analytics_nonce'] ), 'bsf_analytics_optin' ) ) {
244
+ return;
245
+ }
246
+
247
+ $optin_status = sanitize_text_field( $_GET['bsf_analytics_optin'] );
248
+
249
+ if ( 'yes' === $optin_status ) {
250
+ $this->optin();
251
+ } elseif ( 'no' === $optin_status ) {
252
+ $this->optout();
253
+ }
254
+
255
+ wp_safe_redirect(
256
+ remove_query_arg(
257
+ [
258
+ 'bsf_analytics_optin',
259
+ 'bsf_analytics_nonce',
260
+ ]
261
+ )
262
+ );
263
+ }
264
+
265
+ /**
266
+ * Opt in to usage tracking.
267
+ *
268
+ * @since 1.0.0
269
+ */
270
+ private function optin() {
271
+ update_site_option( 'bsf_analytics_optin', 'yes' );
272
+ }
273
+
274
+ /**
275
+ * Opt out to usage tracking.
276
+ *
277
+ * @since 1.0.0
278
+ */
279
+ private function optout() {
280
+ update_site_option( 'bsf_analytics_optin', 'no' );
281
+ }
282
+
283
+ /**
284
+ * Add two days event schedule variables.
285
+ *
286
+ * @param array $schedules scheduled array data.
287
+ * @since 1.0.0
288
+ */
289
+ public function every_two_days_schedule( $schedules ) {
290
+ $schedules['every_two_days'] = [
291
+ 'interval' => 2 * DAY_IN_SECONDS,
292
+ 'display' => __( 'Every two days', 'header-footer-elementor' ),
293
+ ];
294
+
295
+ return $schedules;
296
+ }
297
+
298
+ /**
299
+ * Schedule usage tracking event.
300
+ *
301
+ * @since 1.0.0
302
+ */
303
+ private function schedule_event() {
304
+ if ( ! wp_next_scheduled( 'bsf_analytics_send' ) && $this->is_tracking_enabled() ) {
305
+ wp_schedule_event( time(), 'every_two_days', 'bsf_analytics_send' );
306
+ }
307
+ }
308
+
309
+ /**
310
+ * Unschedule usage tracking event.
311
+ *
312
+ * @since 1.0.0
313
+ */
314
+ private function unschedule_event() {
315
+ wp_clear_scheduled_hook( 'bsf_analytics_send' );
316
+ }
317
+
318
+ /**
319
+ * Load analytics stat class.
320
+ *
321
+ * @since 1.0.0
322
+ */
323
+ private function includes() {
324
+ require_once __DIR__ . '/class-bsf-analytics-stats.php';
325
+ }
326
+
327
+ /**
328
+ * Register usage tracking option in General settings page.
329
+ *
330
+ * @since 1.0.0
331
+ */
332
+ public function register_usage_tracking_setting() {
333
+
334
+ if ( ! apply_filters( 'bsf_tracking_enabled', true ) || $this->is_white_label_enabled() ) {
335
+ return;
336
+ }
337
+
338
+ register_setting(
339
+ 'general', // Options group.
340
+ 'bsf_analytics_optin', // Option name/database.
341
+ [ 'sanitize_callback' => [ $this, 'sanitize_option' ] ] // sanitize callback function.
342
+ );
343
+
344
+ add_settings_field(
345
+ 'bsf-analytics-optin', // Field ID.
346
+ __( 'Usage Tracking', 'header-footer-elementor' ), // Field title.
347
+ [ $this, 'render_settings_field_html' ], // Field callback function.
348
+ 'general' // Settings page slug.
349
+ );
350
+ }
351
+
352
+ /**
353
+ * Sanitize Callback Function
354
+ *
355
+ * @param bool $input Option value.
356
+ * @since 1.0.0
357
+ */
358
+ public function sanitize_option( $input ) {
359
+
360
+ if ( ! $input || 'no' === $input ) {
361
+ return 'no';
362
+ }
363
+
364
+ return 'yes';
365
+ }
366
+
367
+ /**
368
+ * Print settings field HTML.
369
+ *
370
+ * @since 1.0.0
371
+ */
372
+ public function render_settings_field_html() {
373
+ ?>
374
+ <label for="bsf-analytics-optin">
375
+ <input id="bsf-analytics-optin" type="checkbox" value="1" name="bsf_analytics_optin" <?php checked( get_site_option( 'bsf_analytics_optin', 'no' ), 'yes' ); ?>>
376
+ <?php
377
+ esc_html_e( 'Allow Brainstorm Force products to track non-sensitive usage tracking data.', 'header-footer-elementor' );
378
+
379
+ if ( is_multisite() ) {
380
+ esc_html_e( ' This will be applicable for all sites from the network.', 'header-footer-elementor' );
381
+ }
382
+ ?>
383
+ </label>
384
+ <?php
385
+ echo wp_kses_post( sprintf( '<a href="%1s" target="_blank" rel="noreferrer noopener">%2s</a>', esc_url( $this->usage_doc_link ), __( 'Learn More.', 'header-footer-elementor' ) ) );
386
+ }
387
+
388
+ /**
389
+ * Get current product name.
390
+ *
391
+ * @return string $plugin_data['Name] Name of plugin.
392
+ * @since 1.0.0
393
+ */
394
+ private function get_product_name() {
395
+
396
+ $base = wp_normalize_path( dirname( __FILE__ ) );
397
+ $theme_dir = wp_normalize_path( get_template_directory() );
398
+
399
+ if ( false !== strpos( $base, $theme_dir ) ) {
400
+ $theme = wp_get_theme( get_template() );
401
+ return $theme->get( 'Name' );
402
+ }
403
+
404
+ $base = plugin_basename( __FILE__ );
405
+
406
+ $exploded_path = explode( '/', $base, 2 );
407
+ $plugin_slug = $exploded_path[0];
408
+
409
+ if ( ! function_exists( 'get_plugin_data' ) ) {
410
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
411
+ }
412
+
413
+ $plugin_main_file = WP_PLUGIN_DIR . '/' . $plugin_slug . '/' . $plugin_slug . '.php';
414
+ $plugin_data = get_plugin_data( wp_normalize_path( $plugin_main_file ) );
415
+
416
+ return $plugin_data['Name'];
417
+ }
418
+
419
+ /**
420
+ * Set analytics installed time in option.
421
+ *
422
+ * @return string $time analytics installed time.
423
+ * @since 1.0.0
424
+ */
425
+ private function get_analytics_install_time() {
426
+
427
+ $time = get_site_option( 'bsf_analytics_installed_time' );
428
+
429
+ if ( ! $time ) {
430
+ $time = time();
431
+ update_site_option( 'bsf_analytics_installed_time', time() );
432
+ }
433
+
434
+ return $time;
435
+ }
436
+
437
+ /**
438
+ * Schedule/unschedule cron event on updation of option.
439
+ *
440
+ * @param string $old_value old value of option.
441
+ * @param string $value value of option.
442
+ * @param string $option Option name.
443
+ * @since 1.0.0
444
+ */
445
+ public function update_analytics_option_callback( $old_value, $value, $option ) {
446
+ $this->add_option_to_network( $value );
447
+ }
448
+
449
+ /**
450
+ * Analytics option add callback.
451
+ *
452
+ * @param string $option Option name.
453
+ * @param string $value value of option.
454
+ * @since 1.0.0
455
+ */
456
+ public function add_analytics_option_callback( $option, $value ) {
457
+ $this->add_option_to_network( $value );
458
+ }
459
+
460
+ /**
461
+ * Schedule or unschedule event based on analytics option value.
462
+ *
463
+ * @since 1.0.0
464
+ */
465
+ public function schedule_unschedule_event() {
466
+
467
+ if ( true === $this->is_white_label_enabled() ) {
468
+ $this->unschedule_event();
469
+ return;
470
+ }
471
+
472
+ $analytics_option = get_site_option( 'bsf_analytics_optin' );
473
+
474
+ if ( 'no' === $analytics_option ) {
475
+ $this->unschedule_event();
476
+ } elseif ( 'yes' === $analytics_option ) {
477
+ $this->schedule_event();
478
+ }
479
+ }
480
+
481
+ /**
482
+ * Save analytics option to network.
483
+ *
484
+ * @param string $value value of option.
485
+ * @since 1.0.0
486
+ */
487
+ public function add_option_to_network( $value ) {
488
+
489
+ // If action coming from general settings page.
490
+ if ( isset( $_POST['option_page'] ) && 'general' === $_POST['option_page'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
491
+
492
+ if ( get_site_option( 'bsf_analytics_optin' ) ) {
493
+ update_site_option( 'bsf_analytics_optin', $value );
494
+ } else {
495
+ add_site_option( 'bsf_analytics_optin', $value );
496
+ }
497
+ }
498
+ }
499
+ }
500
+
501
+ new BSF_Analytics();
502
+
503
+ }
admin/class-hfe-admin.php CHANGED
@@ -89,7 +89,6 @@ class HFE_Admin {
89
add_filter( 'manage_elementor-hf_posts_columns', [ $this, 'column_headings' ] );
90
}
91
}
92
-
93
/**
94
* Script for Elementor Pro full site editing support.
95
*
@@ -213,24 +212,24 @@ class HFE_Admin {
213
214
215
/**
216
- * Register Post type for header footer templates
217
*/
218
public function header_footer_posttype() {
219
$labels = [
220
- 'name' => __( 'Header Footers Template', 'header-footer-elementor' ),
221
- 'singular_name' => __( 'Elementor Header Footer', 'header-footer-elementor' ),
222
- 'menu_name' => __( 'Header Footers Template', 'header-footer-elementor' ),
223
- 'name_admin_bar' => __( 'Elementor Header Footer', 'header-footer-elementor' ),
224
'add_new' => __( 'Add New', 'header-footer-elementor' ),
225
- 'add_new_item' => __( 'Add New Header Footer', 'header-footer-elementor' ),
226
- 'new_item' => __( 'New Header Footers Template', 'header-footer-elementor' ),
227
- 'edit_item' => __( 'Edit Header Footers Template', 'header-footer-elementor' ),
228
- 'view_item' => __( 'View Header Footers Template', 'header-footer-elementor' ),
229
- 'all_items' => __( 'All Elementor Header Footers', 'header-footer-elementor' ),
230
- 'search_items' => __( 'Search Header Footers Templates', 'header-footer-elementor' ),
231
- 'parent_item_colon' => __( 'Parent Header Footers Templates:', 'header-footer-elementor' ),
232
- 'not_found' => __( 'No Header Footers Templates found.', 'header-footer-elementor' ),
233
- 'not_found_in_trash' => __( 'No Header Footers Templates found in Trash.', 'header-footer-elementor' ),
234
];
235
236
$args = [
@@ -250,17 +249,17 @@ class HFE_Admin {
250
}
251
252
/**
253
- * Register the admin menu for Header Footer builder.
254
*
255
* @since 1.0.0
256
* @since 1.0.1
257
- * Moved the menu under Appearance -> Header Footer Builder
258
*/
259
public function register_admin_menu() {
260
add_submenu_page(
261
'themes.php',
262
- __( 'Header Footer Builder', 'header-footer-elementor' ),
263
- __( 'Header Footer Builder', 'header-footer-elementor' ),
264
'edit_pages',
265
'edit.php?post_type=elementor-hf'
266
);
@@ -272,7 +271,7 @@ class HFE_Admin {
272
function ehf_register_metabox() {
273
add_meta_box(
274
'ehf-meta-box',
275
- __( 'Elementor Header Footer options', 'header-footer-elementor' ),
276
[
277
$this,
278
'efh_metabox_render',
@@ -381,7 +380,7 @@ class HFE_Admin {
381
<td class="bsf-target-rules-row-heading hfe-options-row-heading">
382
<label><?php esc_html_e( 'Do Not Display On', 'header-footer-elementor' ); ?></label>
383
<i class="bsf-target-rules-heading-help dashicons dashicons-editor-help"
384
- title="<?php echo esc_attr__( 'This Advanced Header will not appear at these locations.', 'header-footer-elementor' ); ?>"></i>
385
</td>
386
<td class="bsf-target-rules-row-content hfe-options-row-content">
387
<?php
@@ -517,7 +516,7 @@ class HFE_Admin {
517
}
518
519
/**
520
- * Don't display the elementor header footer templates on the frontend for non edit_posts capable users.
521
*
522
* @since 1.0.0
523
*/
89
add_filter( 'manage_elementor-hf_posts_columns', [ $this, 'column_headings' ] );
90
}
91
}
92
/**
93
* Script for Elementor Pro full site editing support.
94
*
212
213
214
/**
215
+ * Register Post type for header footer & blocks templates
216
*/
217
public function header_footer_posttype() {
218
$labels = [
219
+ 'name' => __( 'Elementor - Header Footer & Blocks Template', 'header-footer-elementor' ),
220
+ 'singular_name' => __( 'Elementor Header Footer & Blocks', 'header-footer-elementor' ),
221
+ 'menu_name' => __( 'Elementor - Header Footer & Blocks Template', 'header-footer-elementor' ),
222
+ 'name_admin_bar' => __( 'Elementor Header Footer & Blocks', 'header-footer-elementor' ),
223
'add_new' => __( 'Add New', 'header-footer-elementor' ),
224
+ 'add_new_item' => __( 'Add New Header, Footer or Block', 'header-footer-elementor' ),
225
+ 'new_item' => __( 'New Header Footer & Blocks Template', 'header-footer-elementor' ),
226
+ 'edit_item' => __( 'Edit Header Footer & Blocks Template', 'header-footer-elementor' ),
227
+ 'view_item' => __( 'View Header Footer & Blocks Template', 'header-footer-elementor' ),
228
+ 'all_items' => __( 'All Elementor Header Footer & Blocks', 'header-footer-elementor' ),
229
+ 'search_items' => __( 'Search Header Footer & Blocks Templates', 'header-footer-elementor' ),
230
+ 'parent_item_colon' => __( 'Parent Header Footer & Blocks Templates:', 'header-footer-elementor' ),
231
+ 'not_found' => __( 'No Header Footer & Blocks Templates found.', 'header-footer-elementor' ),
232
+ 'not_found_in_trash' => __( 'No Header Footer & Blocks Templates found in Trash.', 'header-footer-elementor' ),
233
];
234
235
$args = [
249
}
250
251
/**
252
+ * Register the admin menu for Header Footer & Blocks builder.
253
*
254
* @since 1.0.0
255
* @since 1.0.1
256
+ * Moved the menu under Appearance -> Header Footer & Blocks Builder
257
*/
258
public function register_admin_menu() {
259
add_submenu_page(
260
'themes.php',
261
+ __( 'Header Footer & Blocks', 'header-footer-elementor' ),
262
+ __( 'Header Footer & Blocks', 'header-footer-elementor' ),
263
'edit_pages',
264
'edit.php?post_type=elementor-hf'
265
);
271
function ehf_register_metabox() {
272
add_meta_box(
273
'ehf-meta-box',
274
+ __( 'Elementor - Header Footer & Block Options', 'header-footer-elementor' ),
275
[
276
$this,
277
'efh_metabox_render',
380
<td class="bsf-target-rules-row-heading hfe-options-row-heading">
381
<label><?php esc_html_e( 'Do Not Display On', 'header-footer-elementor' ); ?></label>
382
<i class="bsf-target-rules-heading-help dashicons dashicons-editor-help"
383
+ title="<?php echo esc_attr__( 'Add locations for where this template should not appear.', 'header-footer-elementor' ); ?>"></i>
384
</td>
385
<td class="bsf-target-rules-row-content hfe-options-row-content">
386
<?php
516
}
517
518
/**
519
+ * Don't display the elementor header footer & blocks templates on the frontend for non edit_posts capable users.
520
*
521
* @since 1.0.0
522
*/
assets/css/header-footer-elementor.css CHANGED
@@ -30,4 +30,4 @@
30
.ehf-header #masthead {
31
z-index: 99;
32
position: relative;
33
- }
30
.ehf-header #masthead {
31
z-index: 99;
32
position: relative;
33
+ }
assets/css/style.css CHANGED
@@ -25,7 +25,7 @@
25
}
26
27
.elementor-element [class*="hfe-icon-"]:after {
28
- content: "HFE";
29
position: absolute;
30
top: 0;
31
right: 0;
@@ -40,28 +40,33 @@
40
border-style: solid;
41
}
42
43
- .hfe-icon-navigation-menu:before {
44
- content: "\e900";
45
color: #556068;
46
}
47
- .hfe-icon-menu-cart:before {
48
content: "\e901";
49
}
50
- .hfe-icon-copyright-widget:before {
51
content: "\e902";
52
}
53
- .hfe-icon-retina-image:before {
54
content: "\e903";
55
}
56
- .hfe-icon-page-title:before {
57
content: "\e904";
58
}
59
- .hfe-icon-site-logo:before {
60
content: "\e905";
61
}
62
- .hfe-icon-site-tagline:before {
63
content: "\e906";
64
}
65
- .hfe-icon-site-title:before {
66
content: "\e907";
67
}
25
}
26
27
.elementor-element [class*="hfe-icon-"]:after {
28
+ content: "HFB";
29
position: absolute;
30
top: 0;
31
right: 0;
40
border-style: solid;
41
}
42
43
+ .hfe-icon-search:before {
44
+ content: "\e908";
45
color: #556068;
46
}
47
+ .hfe-icon-site-logo:before {
48
+ content: "\e900";
49
+ }
50
+ .hfe-icon-site-title:before {
51
content: "\e901";
52
}
53
+ .hfe-icon-site-tagline:before {
54
content: "\e902";
55
}
56
+ .hfe-icon-page-title:before {
57
content: "\e903";
58
}
59
+ .hfe-icon-navigation-menu:before {
60
content: "\e904";
61
+ color: #556068;
62
}
63
+ .hfe-icon-menu-cart:before {
64
content: "\e905";
65
+ color: #556068;
66
}
67
+ .hfe-icon-copyright-widget:before {
68
content: "\e906";
69
}
70
+ .hfe-icon-retina-image:before {
71
content: "\e907";
72
}
assets/fonts/hfe.eot CHANGED
Binary file
assets/fonts/hfe.svg CHANGED
@@ -3,16 +3,17 @@
3
<svg xmlns="http://www.w3.org/2000/svg">
4
<metadata>Generated by IcoMoon</metadata>
5
<defs>
6
- <font id="icomoon" horiz-adv-x="1024">
7
<font-face units-per-em="1024" ascent="960" descent="-64" />
8
<missing-glyph horiz-adv-x="1024" />
9
<glyph unicode="&#x20;" horiz-adv-x="512" d="" />
10
- <glyph unicode="&#xe900;" glyph-name="navigation-menu" d="M921.6 467.626c0 10.834-8.794 19.628-19.626 19.628h-779.948c-10.832 0-19.626-8.794-19.626-19.628v-39.252c0-10.834 8.794-19.628 19.626-19.628h779.948c10.832 0 19.626 8.794 19.626 19.628v39.252zM921.6 254.294c0 10.832-8.794 19.626-19.626 19.626h-779.948c-10.832 0-19.626-8.794-19.626-19.626v-39.254c0-10.832 8.794-19.626 19.626-19.626h779.948c10.832 0 19.626 8.794 19.626 19.626v39.254zM921.6 680.96c0 10.832-8.794 19.626-19.626 19.626h-779.948c-10.832 0-19.626-8.794-19.626-19.626v-39.254c0-10.832 8.794-19.626 19.626-19.626h779.948c10.832 0 19.626 8.794 19.626 19.626v39.254z" />
11
- <glyph unicode="&#xe901;" glyph-name="menu-cart" d="M513.065 767.324l83.968-71.967c0.041-0.020 0.061-0.041 0.102-0.061 0.676-0.594 1.434-1.106 2.212-1.577 0.102-0.061 0.205-0.123 0.328-0.184 0.758-0.43 1.536-0.819 2.355-1.106 0.143-0.041 0.266-0.102 0.389-0.143 0.819-0.287 1.659-0.492 2.499-0.655 0.143-0.020 0.266-0.041 0.41-0.061 1.761-0.328 3.564-0.328 5.325 0 0.143 0.020 0.266 0.020 0.41 0.061 0.84 0.164 1.679 0.369 2.499 0.655 0.123 0.041 0.246 0.102 0.389 0.143 0.819 0.307 1.597 0.676 2.355 1.106 0.123 0.061 0.225 0.123 0.328 0.184 0.778 0.471 1.516 0.983 2.212 1.577 0.041 0.020 0.061 0.041 0.102 0.061l83.968 71.967c7.045 6.042 7.864 16.65 1.823 23.675-6.021 7.045-16.65 7.864-23.675 1.823l-56.259-48.21v198.595c0 9.277-7.496 16.794-16.773 16.794s-16.794-7.516-16.794-16.794v-198.615l-56.238 48.23c-7.045 6.042-17.633 5.222-23.675-1.823-6.124-7.025-5.304-17.633 1.741-23.675v0zM32.174 751.124h102.441c33.649 0.123 62.321-24.31 67.543-57.528l81.080-608.010c0-0.123 0.020-0.287 0.041-0.41 7.68-49.684 50.524-86.282 100.762-86.077h14.090c6.185-36.434 37.765-63.119 74.752-63.119 36.966 0 68.547 26.685 74.732 63.119h140.288c6.492-38.031 40.53-65.167 79.094-62.956s69.284 33.034 71.373 71.598c2.13 38.543-25.088 72.52-63.16 78.93s-74.875-16.835-85.484-53.965h-143.954c-9.277 32.563-39.035 55.009-72.888 55.009s-63.631-22.446-72.909-55.009h-15.933c-33.649-0.143-62.321 24.33-67.564 57.549l-24.433 183.255h523.981c43.459 0 82.145 27.546 96.399 68.608l95.232 274.883c1.782 5.14 0.963 10.813-2.171 15.237-3.154 4.424-8.253 7.066-13.701 7.066h-748.483l-7.864 58.941c-0.020 0.143-0.020 0.287-0.061 0.41-7.66 49.684-50.504 86.262-100.762 86.057h-102.42c-9.277 0-16.794-7.516-16.794-16.794s7.496-16.773 16.773-16.794v0zM762.655 54.149c23.347 0 42.25-18.903 42.25-42.25 0-23.327-18.903-42.25-42.25-42.25s-42.25 18.924-42.25 42.25c0.020 23.306 18.944 42.23 42.25 42.25zM472.883 54.149c23.327 0 42.25-18.903 42.25-42.25 0-23.327-18.903-42.25-42.25-42.25s-42.25 18.924-42.25 42.25c0.041 23.306 18.944 42.23 42.25 42.25v0zM968.233 605.716l-87.511-252.58c-9.564-27.566-35.492-46.019-64.655-46.019h-528.466l-39.813 298.619h720.445z" />
12
- <glyph unicode="&#xe902;" glyph-name="copyright-widget" d="M512-64c-282.312 0-512 229.688-512 512s229.688 512 512 512 512-229.688 512-512-229.688-512-512-512zM512 896c-247.032 0-448-200.968-448-448s200.968-448 448-448 448 200.968 448 448-200.968 448-448 448zM512 191.999c-141.156 0-256.001 114.843-256.001 256.001s114.843 256.001 256.001 256.001c69.406 0 134.344-27.313 182.906-76.906l-45.749-44.749c-36.405 37.188-85.093 57.657-137.157 57.657-105.876 0-192.001-86.125-192.001-192.001s86.125-192.001 192.001-192.001c52.032 0 100.72 20.469 137.157 57.657l45.687-44.814c-48.533-49.563-113.468-76.844-182.844-76.846z" />
13
- <glyph unicode="&#xe903;" glyph-name="retina-image" d="M512 277.333c-94.123 0-170.667 76.544-170.667 170.667s76.544 170.667 170.667 170.667 170.667-76.544 170.667-170.667-76.544-170.667-170.667-170.667zM512 554.667c-58.795 0-106.667-47.872-106.667-106.667s47.872-106.667 106.667-106.667 106.667 47.872 106.667 106.667-47.872 106.667-106.667 106.667zM512 106.667c-202.88 0-392.747 121.728-507.861 325.589-5.504 9.771-5.504 21.675 0 31.445 115.115 203.904 304.981 325.632 507.861 325.632s392.747-121.728 507.861-325.589c5.504-9.771 5.504-21.675 0-31.445-115.115-203.904-304.981-325.632-507.861-325.632zM69.035 448c104.235-174.037 268.672-277.333 442.965-277.333s338.731 103.296 442.965 277.333c-104.235 174.037-268.672 277.333-442.965 277.333s-338.731-103.296-442.965-277.333zM992 603.819c-17.664 0-32 14.336-32 32v206.848c0 29.397-23.936 53.333-53.333 53.333h-206.848c-17.664 0-32 14.336-32 32s14.336 32 32 32h206.848c64.683 0 117.333-52.651 117.333-117.333v-206.848c0-17.664-14.336-32-32-32zM32 603.819c-17.664 0-32 14.336-32 32v206.848c0 64.683 52.651 117.333 117.333 117.333h206.848c17.664 0 32-14.336 32-32s-14.336-32-32-32h-206.848c-29.397 0-53.333-23.936-53.333-53.333v-206.848c0-17.664-14.336-32-32-32zM906.667-64h-206.848c-17.664 0-32 14.336-32 32s14.336 32 32 32h206.848c29.397 0 53.333 23.936 53.333 53.333v206.848c0 17.664 14.336 32 32 32s32-14.336 32-32v-206.848c0-64.683-52.651-117.333-117.333-117.333zM324.181-64h-206.848c-64.683 0-117.333 52.651-117.333 117.333v206.848c0 17.664 14.336 32 32 32s32-14.336 32-32v-206.848c0-29.397 23.936-53.333 53.333-53.333h206.848c17.664 0 32-14.336 32-32s-14.336-32-32-32z" />
14
- <glyph unicode="&#xe904;" glyph-name="page-title" d="M553.613 952.083c-4.695 4.946-11.132 7.913-17.805 7.913h-399.462c-73.71 0-134.555-60.602-134.555-134.304v-755.383c0-73.712 60.845-134.312 134.555-134.312h542.175c73.71 0 134.555 60.6 134.555 134.312v599.803c0 6.429-2.968 12.609-7.172 17.314l-252.291 264.657zM560.785 872.683l168.938-177.344h-109.82c-32.65 0-59.117 26.217-59.117 58.867v118.477zM678.521-14.535h-542.175c-46.25 0-85.086 38.335-85.086 84.844v755.383c0 46.25 38.585 84.836 85.086 84.836h374.97v-156.321c0-60.101 48.485-108.336 108.586-108.336h143.705v-575.564c0-46.509-38.587-84.842-85.086-84.842zM300.571 417.609c7.633 0 13.879 6.242 13.879 13.879v16.795h61.069v-144.352h-25.953c-7.637 0-13.881-6.248-13.881-13.883 0-7.631 6.244-13.879 13.881-13.879h79.806c7.639 0 13.881 6.248 13.881 13.879 0 7.635-6.242 13.883-13.881 13.883h-26.093v144.348h61.075v-16.795c0-7.633 6.242-13.879 13.879-13.879 7.633 0 13.879 6.246 13.879 13.879v31.093c0 7.637-6.523 13.462-14.156 13.462h-177.11c-7.633 0-14.156-5.825-14.156-13.462v-31.093c-0.002-7.633 6.246-13.875 13.879-13.875z" />
15
- <glyph unicode="&#xe905;" glyph-name="site-logo" d="M619.652 354.789l-53.825-61.702-112.904 160.165c-4.644 6.978-12.637 10.976-21.005 10.504-8.217-0.193-15.919-4.046-21.005-10.504l-173.292-233.682c-5.975-8.956-6.968-20.341-2.626-30.194 4.219-9.539 13.25-16.062 23.631-17.067h480.492c10.38 1.005 19.414 7.528 23.631 17.067 4.372 9.4 3.37 20.424-2.626 28.882l-99.774 133.908c-4.402 6.752-11.662 11.109-19.693 11.815-8.079 0.525-15.909-2.902-21.005-9.192zM526.441 224.821h-215.304l120.779 162.791 114.215-162.791h-19.69zM686.606 224.821h-76.144l-13.127 21.005 40.698 45.949 48.573-66.954zM573.702 426.995c44.228 0 80.081 35.853 80.081 80.081s-35.853 80.081-80.081 80.081-80.081-35.853-80.081-80.081v0c0-44.228 35.853-80.081 80.081-80.081zM546.134 507.076c0 15.225 12.343 27.568 27.568 27.568s27.568-12.343 27.568-27.568c0-15.225-12.343-27.568-27.568-27.568s-27.568 12.343-27.568 27.568c0 0 0 0 0 0zM911.099 675.119l-278.32 277.003c-4.847 4.948-11.453 7.777-18.379 7.878h-378.092c-72.505 0-131.282-58.777-131.282-131.282v-761.435c0-72.505 58.777-131.282 131.282-131.282h551.386c72.505 0 131.282 58.777 131.282 131.282v589.458c-0.101 6.923-2.932 13.529-7.878 18.379zM643.282 697.435v170.668l185.107-183.795h-171.98c-6.481-0.771-12.358 3.857-13.127 10.338-0.111 0.925-0.111 1.862 0 2.789zM866.461 67.282c0-43.502-35.267-78.769-78.769-78.769h-551.383c-43.502 0-78.769 35.265-78.769 78.769v761.435c0 43.502 35.265 78.769 78.769 78.769h354.461v-210.052c0-36.252 29.387-65.64 65.64-65.64h210.052v-564.513z" />
16
- <glyph unicode="&#xe906;" glyph-name="site-tagline" d="M553.613 952.083c-4.695 4.946-11.132 7.913-17.805 7.913h-399.462c-73.71 0-134.555-60.602-134.555-134.304v-755.383c0-73.712 60.845-134.312 134.555-134.312h542.175c73.71 0 134.555 60.6 134.555 134.312v599.803c0 6.429-2.968 12.609-7.172 17.314l-252.291 264.657zM560.785 872.683l168.938-177.344h-109.82c-32.65 0-59.117 26.217-59.117 58.867v118.477zM678.521-14.535h-542.175c-46.25 0-85.086 38.335-85.086 84.844v755.383c0 46.25 38.585 84.836 85.086 84.836h374.97v-156.321c0-60.101 48.485-108.336 108.586-108.336h143.705v-575.564c0-46.509-38.587-84.842-85.086-84.842zM535.324 446.395h-354.679c-11.849 0-21.548-7.008-21.548-15.58 0-8.567 9.699-15.578 21.548-15.578h354.895c11.849 0 21.548 7.012 21.548 15.578 0 8.573-9.699 15.58-21.765 15.58zM535.324 352.211h-354.679c-11.849 0-21.548-7.008-21.548-15.58 0-8.567 9.699-15.578 21.548-15.578h354.895c11.849 0 21.548 7.012 21.548 15.578 0 8.573-9.699 15.58-21.765 15.58zM535.324 262.65h-354.679c-11.849 0-21.548-7.008-21.548-15.58 0-8.567 9.699-15.578 21.548-15.578h354.895c11.849 0 21.548 7.012 21.548 15.578 0 8.573-9.699 15.58-21.765 15.58zM178.859 677.192c8.016 0 14.576 6.555 14.576 14.574v17.636h64.131v-151.588h-27.255c-8.020 0-14.576-6.561-14.576-14.576s6.557-14.574 14.576-14.574h83.806c8.020 0 14.576 6.561 14.576 14.574 0 8.016-6.555 14.576-14.576 14.576h-27.402v151.584h64.135v-17.636c0-8.016 6.555-14.574 14.574-14.574 8.016 0 14.576 6.559 14.576 14.574v32.65c0 8.020-6.851 14.14-14.867 14.14h-185.985c-8.016 0-14.865-6.118-14.865-14.14v-32.65c-0.002-8.016 6.559-14.57 14.574-14.57z" />
17
- <glyph unicode="&#xe907;" glyph-name="site-title" d="M659.821 954.086c-4.695 4.945-11.133 7.914-17.805 7.914h-399.462c-73.711 0-134.555-60.602-134.555-134.305v-755.384c0-73.711 60.844-134.313 134.555-134.313h542.173c73.711 0 134.555 60.602 134.555 134.313v599.806c0 6.43-2.969 12.609-7.172 17.313zM666.992 874.687l168.938-177.344h-109.821c-32.648 0-59.117 26.219-59.117 58.867zM784.727-12.533h-542.173c-46.25 0-85.086 38.336-85.086 84.844v755.384c0 46.25 38.586 84.836 85.086 84.836h374.969v-156.321c0-60.102 48.484-108.336 108.586-108.336h143.703v-575.564c0-46.508-38.586-84.844-85.086-84.844zM717.204 158.131h-407.126c-13.602 0-24.734-11.125-24.734-24.734 0-13.602 11.133-24.734 24.734-24.734h407.376c13.602 0 24.734 11.133 24.734 24.734 0 13.609-11.133 24.734-24.984 24.734zM355.343 504.171c13.602 0 24.734 11.125 24.734 24.734v29.93h108.828v-257.243h-46.25c-13.609 0-24.734-11.133-24.734-24.734s11.125-24.734 24.734-24.734h142.219c13.609 0 24.734 11.133 24.734 24.734s-11.125 24.734-24.734 24.734h-46.5v257.235h108.836v-29.93c0-13.602 11.125-24.734 24.734-24.734 13.602 0 24.734 11.133 24.734 24.734v55.406c0 13.609-11.625 23.992-25.227 23.992h-315.618c-13.602 0-25.227-10.383-25.227-23.992v-55.406c0-13.602 11.133-24.727 24.734-24.727z" />
18
</font></defs></svg>
3
<svg xmlns="http://www.w3.org/2000/svg">
4
<metadata>Generated by IcoMoon</metadata>
5
<defs>
6
+ <font id="uael" horiz-adv-x="1024">
7
<font-face units-per-em="1024" ascent="960" descent="-64" />
8
<missing-glyph horiz-adv-x="1024" />
9
<glyph unicode="&#x20;" horiz-adv-x="512" d="" />
10
+ <glyph unicode="&#xe900;" glyph-name="site-logo" d="M619.652 354.789l-53.825-61.702-112.904 160.165c-4.644 6.978-12.637 10.976-21.005 10.504-8.217-0.193-15.919-4.046-21.005-10.504l-173.292-233.682c-5.975-8.956-6.968-20.341-2.626-30.194 4.219-9.539 13.25-16.062 23.631-17.067h480.492c10.38 1.005 19.414 7.528 23.631 17.067 4.372 9.4 3.37 20.424-2.626 28.882l-99.774 133.908c-4.402 6.752-11.662 11.109-19.693 11.815-8.079 0.525-15.909-2.902-21.005-9.192zM526.441 224.821h-215.304l120.779 162.791 114.215-162.791h-19.69zM686.606 224.821h-76.144l-13.127 21.005 40.698 45.949 48.573-66.954zM573.702 426.995c44.228 0 80.081 35.853 80.081 80.081s-35.853 80.081-80.081 80.081-80.081-35.853-80.081-80.081v0c0-44.228 35.853-80.081 80.081-80.081zM546.134 507.076c0 15.225 12.343 27.568 27.568 27.568s27.568-12.343 27.568-27.568c0-15.225-12.343-27.568-27.568-27.568s-27.568 12.343-27.568 27.568c0 0 0 0 0 0zM911.099 675.119l-278.32 277.003c-4.847 4.948-11.453 7.777-18.379 7.878h-378.092c-72.505 0-131.282-58.777-131.282-131.282v-761.435c0-72.505 58.777-131.282 131.282-131.282h551.386c72.505 0 131.282 58.777 131.282 131.282v589.458c-0.101 6.923-2.932 13.529-7.878 18.379zM643.282 697.435v170.668l185.107-183.795h-171.98c-6.481-0.771-12.358 3.857-13.127 10.338-0.111 0.925-0.111 1.862 0 2.789zM866.461 67.282c0-43.502-35.267-78.769-78.769-78.769h-551.383c-43.502 0-78.769 35.265-78.769 78.769v761.435c0 43.502 35.265 78.769 78.769 78.769h354.461v-210.052c0-36.252 29.387-65.64 65.64-65.64h210.052v-564.513z" />
11
+ <glyph unicode="&#xe901;" glyph-name="site-title" d="M659.821 954.086c-4.695 4.945-11.133 7.914-17.805 7.914h-399.462c-73.711 0-134.555-60.602-134.555-134.305v-755.384c0-73.711 60.844-134.313 134.555-134.313h542.173c73.711 0 134.555 60.602 134.555 134.313v599.806c0 6.43-2.969 12.609-7.172 17.313zM666.992 874.687l168.938-177.344h-109.821c-32.648 0-59.117 26.219-59.117 58.867zM784.727-12.533h-542.173c-46.25 0-85.086 38.336-85.086 84.844v755.384c0 46.25 38.586 84.836 85.086 84.836h374.969v-156.321c0-60.102 48.484-108.336 108.586-108.336h143.703v-575.564c0-46.508-38.586-84.844-85.086-84.844zM717.204 158.131h-407.126c-13.602 0-24.734-11.125-24.734-24.734 0-13.602 11.133-24.734 24.734-24.734h407.376c13.602 0 24.734 11.133 24.734 24.734 0 13.609-11.133 24.734-24.984 24.734zM355.343 504.171c13.602 0 24.734 11.125 24.734 24.734v29.93h108.828v-257.243h-46.25c-13.609 0-24.734-11.133-24.734-24.734s11.125-24.734 24.734-24.734h142.219c13.609 0 24.734 11.133 24.734 24.734s-11.125 24.734-24.734 24.734h-46.5v257.235h108.836v-29.93c0-13.602 11.125-24.734 24.734-24.734 13.602 0 24.734 11.133 24.734 24.734v55.406c0 13.609-11.625 23.992-25.227 23.992h-315.618c-13.602 0-25.227-10.383-25.227-23.992v-55.406c0-13.602 11.133-24.727 24.734-24.727z" />
12
+ <glyph unicode="&#xe902;" glyph-name="site-tagline" d="M553.613 952.083c-4.695 4.946-11.132 7.913-17.805 7.913h-399.462c-73.71 0-134.555-60.602-134.555-134.304v-755.383c0-73.712 60.845-134.312 134.555-134.312h542.175c73.71 0 134.555 60.6 134.555 134.312v599.803c0 6.429-2.968 12.609-7.172 17.314l-252.291 264.657zM560.785 872.683l168.938-177.344h-109.82c-32.65 0-59.117 26.217-59.117 58.867v118.477zM678.521-14.535h-542.175c-46.25 0-85.086 38.335-85.086 84.844v755.383c0 46.25 38.585 84.836 85.086 84.836h374.97v-156.321c0-60.101 48.485-108.336 108.586-108.336h143.705v-575.564c0-46.509-38.587-84.842-85.086-84.842zM535.324 446.395h-354.679c-11.849 0-21.548-7.008-21.548-15.58 0-8.567 9.699-15.578 21.548-15.578h354.895c11.849 0 21.548 7.012 21.548 15.578 0 8.573-9.699 15.58-21.765 15.58zM535.324 352.211h-354.679c-11.849 0-21.548-7.008-21.548-15.58 0-8.567 9.699-15.578 21.548-15.578h354.895c11.849 0 21.548 7.012 21.548 15.578 0 8.573-9.699 15.58-21.765 15.58zM535.324 262.65h-354.679c-11.849 0-21.548-7.008-21.548-15.58 0-8.567 9.699-15.578 21.548-15.578h354.895c11.849 0 21.548 7.012 21.548 15.578 0 8.573-9.699 15.58-21.765 15.58zM178.859 677.192c8.016 0 14.576 6.555 14.576 14.574v17.636h64.131v-151.588h-27.255c-8.020 0-14.576-6.561-14.576-14.576s6.557-14.574 14.576-14.574h83.806c8.020 0 14.576 6.561 14.576 14.574 0 8.016-6.555 14.576-14.576 14.576h-27.402v151.584h64.135v-17.636c0-8.016 6.555-14.574 14.574-14.574 8.016 0 14.576 6.559 14.576 14.574v32.65c0 8.020-6.851 14.14-14.867 14.14h-185.985c-8.016 0-14.865-6.118-14.865-14.14v-32.65c-0.002-8.016 6.559-14.57 14.574-14.57z" />
13
+ <glyph unicode="&#xe903;" glyph-name="page-title" d="M553.613 952.083c-4.695 4.946-11.132 7.913-17.805 7.913h-399.462c-73.71 0-134.555-60.602-134.555-134.304v-755.383c0-73.712 60.845-134.312 134.555-134.312h542.175c73.71 0 134.555 60.6 134.555 134.312v599.803c0 6.429-2.968 12.609-7.172 17.314l-252.291 264.657zM560.785 872.683l168.938-177.344h-109.82c-32.65 0-59.117 26.217-59.117 58.867v118.477zM678.521-14.535h-542.175c-46.25 0-85.086 38.335-85.086 84.844v755.383c0 46.25 38.585 84.836 85.086 84.836h374.97v-156.321c0-60.101 48.485-108.336 108.586-108.336h143.705v-575.564c0-46.509-38.587-84.842-85.086-84.842zM300.571 417.609c7.633 0 13.879 6.242 13.879 13.879v16.795h61.069v-144.352h-25.953c-7.637 0-13.881-6.248-13.881-13.883 0-7.631 6.244-13.879 13.881-13.879h79.806c7.639 0 13.881 6.248 13.881 13.879 0 7.635-6.242 13.883-13.881 13.883h-26.093v144.348h61.075v-16.795c0-7.633 6.242-13.879 13.879-13.879 7.633 0 13.879 6.246 13.879 13.879v31.093c0 7.637-6.523 13.462-14.156 13.462h-177.11c-7.633 0-14.156-5.825-14.156-13.462v-31.093c-0.002-7.633 6.246-13.875 13.879-13.875z" />
14
+ <glyph unicode="&#xe904;" glyph-name="navigation-menu" d="M921.6 467.626c0 10.834-8.794 19.628-19.626 19.628h-779.948c-10.832 0-19.626-8.794-19.626-19.628v-39.252c0-10.834 8.794-19.628 19.626-19.628h779.948c10.832 0 19.626 8.794 19.626 19.628v39.252zM921.6 254.294c0 10.832-8.794 19.626-19.626 19.626h-779.948c-10.832 0-19.626-8.794-19.626-19.626v-39.254c0-10.832 8.794-19.626 19.626-19.626h779.948c10.832 0 19.626 8.794 19.626 19.626v39.254zM921.6 680.96c0 10.832-8.794 19.626-19.626 19.626h-779.948c-10.832 0-19.626-8.794-19.626-19.626v-39.254c0-10.832 8.794-19.626 19.626-19.626h779.948c10.832 0 19.626 8.794 19.626 19.626v39.254z" />
15
+ <glyph unicode="&#xe905;" glyph-name="menu-cart" d="M513.065 767.324l83.968-71.967c0.041-0.020 0.061-0.041 0.102-0.061 0.676-0.594 1.434-1.106 2.212-1.577 0.102-0.061 0.205-0.123 0.328-0.184 0.758-0.43 1.536-0.819 2.355-1.106 0.143-0.041 0.266-0.102 0.389-0.143 0.819-0.287 1.659-0.492 2.499-0.655 0.143-0.020 0.266-0.041 0.41-0.061 1.761-0.328 3.564-0.328 5.325 0 0.143 0.020 0.266 0.020 0.41 0.061 0.84 0.164 1.679 0.369 2.499 0.655 0.123 0.041 0.246 0.102 0.389 0.143 0.819 0.307 1.597 0.676 2.355 1.106 0.123 0.061 0.225 0.123 0.328 0.184 0.778 0.471 1.516 0.983 2.212 1.577 0.041 0.020 0.061 0.041 0.102 0.061l83.968 71.967c7.045 6.042 7.864 16.65 1.823 23.675-6.021 7.045-16.65 7.864-23.675 1.823l-56.259-48.21v198.595c0 9.277-7.496 16.794-16.773 16.794s-16.794-7.516-16.794-16.794v-198.615l-56.238 48.23c-7.045 6.042-17.633 5.222-23.675-1.823-6.124-7.025-5.304-17.633 1.741-23.675v0zM32.174 751.124h102.441c33.649 0.123 62.321-24.31 67.543-57.528l81.080-608.010c0-0.123 0.020-0.287 0.041-0.41 7.68-49.684 50.524-86.282 100.762-86.077h14.090c6.185-36.434 37.765-63.119 74.752-63.119 36.966 0 68.547 26.685 74.732 63.119h140.288c6.492-38.031 40.53-65.167 79.094-62.956s69.284 33.034 71.373 71.598c2.13 38.543-25.088 72.52-63.16 78.93s-74.875-16.835-85.484-53.965h-143.954c-9.277 32.563-39.035 55.009-72.888 55.009s-63.631-22.446-72.909-55.009h-15.933c-33.649-0.143-62.321 24.33-67.564 57.549l-24.433 183.255h523.981c43.459 0 82.145 27.546 96.399 68.608l95.232 274.883c1.782 5.14 0.963 10.813-2.171 15.237-3.154 4.424-8.253 7.066-13.701 7.066h-748.483l-7.864 58.941c-0.020 0.143-0.020 0.287-0.061 0.41-7.66 49.684-50.504 86.262-100.762 86.057h-102.42c-9.277 0-16.794-7.516-16.794-16.794s7.496-16.773 16.773-16.794v0zM762.655 54.149c23.347 0 42.25-18.903 42.25-42.25 0-23.327-18.903-42.25-42.25-42.25s-42.25 18.924-42.25 42.25c0.020 23.306 18.944 42.23 42.25 42.25zM472.883 54.149c23.327 0 42.25-18.903 42.25-42.25 0-23.327-18.903-42.25-42.25-42.25s-42.25 18.924-42.25 42.25c0.041 23.306 18.944 42.23 42.25 42.25v0zM968.233 605.716l-87.511-252.58c-9.564-27.566-35.492-46.019-64.655-46.019h-528.466l-39.813 298.619h720.445z" />
16
+ <glyph unicode="&#xe906;" glyph-name="copyright-widget" d="M512-64c-282.312 0-512 229.688-512 512s229.688 512 512 512 512-229.688 512-512-229.688-512-512-512zM512 896c-247.032 0-448-200.968-448-448s200.968-448 448-448 448 200.968 448 448-200.968 448-448 448zM512 191.999c-141.156 0-256.001 114.843-256.001 256.001s114.843 256.001 256.001 256.001c69.406 0 134.344-27.313 182.906-76.906l-45.749-44.749c-36.405 37.188-85.093 57.657-137.157 57.657-105.876 0-192.001-86.125-192.001-192.001s86.125-192.001 192.001-192.001c52.032 0 100.72 20.469 137.157 57.657l45.687-44.814c-48.533-49.563-113.468-76.844-182.844-76.846z" />
17
+ <glyph unicode="&#xe907;" glyph-name="retina-image" d="M512 277.333c-94.123 0-170.667 76.544-170.667 170.667s76.544 170.667 170.667 170.667 170.667-76.544 170.667-170.667-76.544-170.667-170.667-170.667zM512 554.667c-58.795 0-106.667-47.872-106.667-106.667s47.872-106.667 106.667-106.667 106.667 47.872 106.667 106.667-47.872 106.667-106.667 106.667zM512 106.667c-202.88 0-392.747 121.728-507.861 325.589-5.504 9.771-5.504 21.675 0 31.445 115.115 203.904 304.981 325.632 507.861 325.632s392.747-121.728 507.861-325.589c5.504-9.771 5.504-21.675 0-31.445-115.115-203.904-304.981-325.632-507.861-325.632zM69.035 448c104.235-174.037 268.672-277.333 442.965-277.333s338.731 103.296 442.965 277.333c-104.235 174.037-268.672 277.333-442.965 277.333s-338.731-103.296-442.965-277.333zM992 603.819c-17.664 0-32 14.336-32 32v206.848c0 29.397-23.936 53.333-53.333 53.333h-206.848c-17.664 0-32 14.336-32 32s14.336 32 32 32h206.848c64.683 0 117.333-52.651 117.333-117.333v-206.848c0-17.664-14.336-32-32-32zM32 603.819c-17.664 0-32 14.336-32 32v206.848c0 64.683 52.651 117.333 117.333 117.333h206.848c17.664 0 32-14.336 32-32s-14.336-32-32-32h-206.848c-29.397 0-53.333-23.936-53.333-53.333v-206.848c0-17.664-14.336-32-32-32zM906.667-64h-206.848c-17.664 0-32 14.336-32 32s14.336 32 32 32h206.848c29.397 0 53.333 23.936 53.333 53.333v206.848c0 17.664 14.336 32 32 32s32-14.336 32-32v-206.848c0-64.683-52.651-117.333-117.333-117.333zM324.181-64h-206.848c-64.683 0-117.333 52.651-117.333 117.333v206.848c0 17.664 14.336 32 32 32s32-14.336 32-32v-206.848c0-29.397 23.936-53.333 53.333-53.333h206.848c17.664 0 32-14.336 32-32s-14.336-32-32-32z" />
18
+ <glyph unicode="&#xe908;" glyph-name="search" d="M616.53 951.951c-225.178 0-407.45-182.272-407.45-407.47 0-100.782 36.454-193.004 97.567-263.782l-300.216-300.216c-8.581-8.581-8.581-21.463 0-30.024 4.28-4.301 9.646-6.431 15.012-6.431s10.711 2.13 15.012 6.431l299.151 299.131c72.909-69.673 172.626-112.579 280.924-112.579 225.178 0 407.47 182.272 407.47 407.47s-182.272 407.47-407.47 407.47zM616.53 179.937c-200.499 0-364.564 164.045-364.564 364.564s164.065 364.564 364.564 364.564c200.52 0 364.585-164.045 364.585-364.564s-164.045-364.564-364.585-364.564zM375.296 686.039c4.28-3.215 8.581-4.28 12.861-4.28 6.431 0 12.861 3.195 17.142 8.561l9.646 12.882c7.516 9.646 5.366 22.528-4.28 30.024s-22.508 5.366-30.024-4.28l-9.646-12.882c-7.496-9.646-5.345-22.528 4.301-30.024zM442.839 356.864c-52.531 47.186-83.62 115.794-83.62 187.638 0 22.528 3.215 43.95 8.561 65.413 3.215 11.776-3.215 23.572-15.012 26.808-11.796 3.215-23.593-3.215-26.808-15.012-6.431-24.658-10.732-50.401-10.732-76.124 0-83.64 35.389-164.065 98.652-220.897 4.28-3.215 9.646-5.366 13.947-5.366 5.366 0 11.796 2.13 16.077 7.516 7.516 8.561 7.516 22.508-1.065 30.024z" />
19
</font></defs></svg>
assets/fonts/hfe.ttf CHANGED
Binary file
assets/fonts/hfe.woff CHANGED
Binary file
header-footer-elementor.php CHANGED
@@ -7,12 +7,12 @@
7
* Author URI: https://www.brainstormforce.com/
8
* Text Domain: header-footer-elementor
9
* Domain Path: /languages
10
- * Version: 1.4.1
11
*
12
* @package header-footer-elementor
13
*/
14
15
- define( 'HFE_VER', '1.4.1' );
16
define( 'HFE_DIR', plugin_dir_path( __FILE__ ) );
17
define( 'HFE_URL', plugins_url( '/', __FILE__ ) );
18
define( 'HFE_PATH', plugin_basename( __FILE__ ) );
7
* Author URI: https://www.brainstormforce.com/
8
* Text Domain: header-footer-elementor
9
* Domain Path: /languages
10
+ * Version: 1.5.0
11
*
12
* @package header-footer-elementor
13
*/
14
15
+ define( 'HFE_VER', '1.5.0' );
16
define( 'HFE_DIR', plugin_dir_path( __FILE__ ) );
17
define( 'HFE_URL', plugins_url( '/', __FILE__ ) );
18
define( 'HFE_PATH', plugin_basename( __FILE__ ) );
inc/class-header-footer-elementor.php CHANGED
@@ -88,6 +88,10 @@ class Header_Footer_Elementor {
88
89
add_action( 'astra_notice_before_markup_header-footer-elementor-rating', [ $this, 'rating_notice_css' ] );
90
add_action( 'admin_notices', [ $this, 'register_notices' ] );
91
} else {
92
add_action( 'admin_notices', [ $this, 'elementor_not_available' ] );
93
add_action( 'network_admin_notices', [ $this, 'elementor_not_available' ] );
@@ -172,16 +176,35 @@ class Header_Footer_Elementor {
172
* Prints the admin notics when Elementor is not installed or activated.
173
*/
174
public function elementor_not_available() {
175
- if ( file_exists( WP_PLUGIN_DIR . '/elementor/elementor.php' ) ) {
176
- $url = network_admin_url() . 'plugins.php?s=elementor';
177
- } else {
178
- $url = network_admin_url() . 'plugin-install.php?s=elementor';
179
- }
180
181
- echo '<div class="notice notice-error">';
182
- /* Translators: URL to install or activate Elementor plugin. */
183
- echo '<p>' . sprintf( __( 'The <strong>Header Footer Elementor</strong> plugin requires <strong><a href="%s">Elementor</strong></a> plugin installed & activated.', 'header-footer-elementor' ) . '</p>', $url );
184
- echo '</div>';
185
}
186
187
/**
@@ -413,3 +436,19 @@ class Header_Footer_Elementor {
413
}
414
415
}
88
89
add_action( 'astra_notice_before_markup_header-footer-elementor-rating', [ $this, 'rating_notice_css' ] );
90
add_action( 'admin_notices', [ $this, 'register_notices' ] );
91
+
92
+ // BSF Analytics Tracker.
93
+ require_once HFE_DIR . 'admin/bsf-analytics/class-bsf-analytics.php';
94
+
95
} else {
96
add_action( 'admin_notices', [ $this, 'elementor_not_available' ] );
97
add_action( 'network_admin_notices', [ $this, 'elementor_not_available' ] );
176
* Prints the admin notics when Elementor is not installed or activated.
177
*/
178
public function elementor_not_available() {
179
180
+ if ( ! did_action( 'elementor/loaded' ) ) {
181
+ // Check user capability.
182
+ if ( ! ( current_user_can( 'activate_plugins' ) && current_user_can( 'install_plugins' ) ) ) {
183
+ return;
184
+ }
185
+
186
+ /* TO DO */
187
+ $class = 'notice notice-error';
188
+ /* translators: %s: html tags */
189
+ $message = sprintf( __( 'The %1$sElementor - Header Footer and Blocks%2$s plugin requires %1$sElementor%2$s plugin installed & activated.', 'header-footer-elementor' ), '<strong>', '</strong>' );
190
+
191
+ $plugin = 'elementor/elementor.php';
192
+
193
+ if ( _is_elementor_installed() ) {
194
+
195
+ $action_url = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $plugin . '&amp;plugin_status=all&amp;paged=1&amp;s', 'activate-plugin_' . $plugin );
196
+ $button_label = __( 'Activate Elementor', 'header-footer-elementor' );
197
+
198
+ } else {
199
+
200
+ $action_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=elementor' ), 'install-plugin_elementor' );
201
+ $button_label = __( 'Install Elementor', 'header-footer-elementor' );
202
+ }
203
+
204
+ $button = '<p><a href="' . $action_url . '" class="button-primary">' . $button_label . '</a></p><p></p>';
205
+
206
+ printf( '<div class="%1$s"><p>%2$s</p>%3$s</div>', esc_attr( $class ), wp_kses_post( $message ), wp_kses_post( $button ) );
207
+ }
208
}
209
210
/**
436
}
437
438
}
439
+ /**
440
+ * Is elementor plugin installed.
441
+ */
442
+ if ( ! function_exists( '_is_elementor_installed' ) ) {
443
+
444
+ /**
445
+ * Check if Elementor is installed
446
+ *
447
+ * @since 1.5.0
448
+ *
449
+ * @access public
450
+ */
451
+ function _is_elementor_installed() {
452
+ return defined( 'ELEMENTOR_VERSION' ) ? true : false;
453
+ }
454
+ }
inc/js/{hfe-nav-menu.js → frontend.js} RENAMED
@@ -1,6 +1,57 @@
1
( function( $ ) {
2
3
/**
4
* Nav Menu handler Function.
5
*
6
*/
@@ -8,7 +59,7 @@
8
9
if ( 'undefined' == typeof $scope )
10
return;
11
-
12
var id = $scope.data( 'id' );
13
var wrapper = $scope.find('.elementor-widget-hfe-nav-menu ');
14
var layout = $( '.elementor-element-' + id + ' .hfe-nav-menu' ).data( 'layout' );
@@ -26,7 +77,7 @@
26
}else if ( 'horizontal' === layout && window.matchMedia( "( max-width: 767px )" ).matches ) {
27
28
_eventClick( id );
29
- }else if ( 'horizontal' === layout && window.matchMedia( "( max-width: 1023px )" ).matches ) {
30
31
_eventClick( id );
32
}
@@ -70,7 +121,7 @@
70
}else if ( 'horizontal' === layout && window.matchMedia( "( max-width: 767px )" ).matches ) {
71
72
_eventClick( id );
73
- }else if ( 'horizontal' === layout && window.matchMedia( "( max-width: 1023px )" ).matches ) {
74
75
_eventClick( id );
76
}
@@ -87,7 +138,7 @@
87
if( window.matchMedia( "( max-width: 767px )" ).matches && ($( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-tablet') || $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-mobile'))){
88
89
_toggleClick( id );
90
- }else if ( window.matchMedia( "( max-width: 1023px )" ).matches && $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-tablet') ) {
91
92
_toggleClick( id );
93
}
@@ -153,7 +204,7 @@
153
} else if ( 'horizontal' === layout && window.matchMedia( "( max-width: 767px )" ).matches && ($( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-tablet') || $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-mobile'))) {
154
155
$this.next().css( 'position', 'relative');
156
- } else if ( 'horizontal' === layout && window.matchMedia( "( max-width: 1023px )" ).matches ) {
157
158
if ( $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-tablet') ) {
159
@@ -293,7 +344,7 @@
293
event.preventDefault();
294
295
$this.next().css( 'position', 'relative' );
296
- }else if ( 'horizontal' === layout && window.matchMedia( "( max-width: 1023px )" ).matches && ( $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-tablet') || $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-mobile'))) {
297
298
event.preventDefault();
299
@@ -320,7 +371,7 @@
320
321
$this.next().css( 'position', 'relative' );
322
323
- } else if ( 'horizontal' === layout && window.matchMedia( "( max-width: 1023px )" ).matches && ( $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-tablet') || $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-mobile'))) {
324
325
$this.next().css( 'position', 'absolute' );
326
}
@@ -336,7 +387,7 @@
336
337
event.preventDefault();
338
$this.next().css( 'position', 'relative');
339
- } else if ( 'horizontal' === layout && window.matchMedia( "( max-width: 1023px )" ).matches ) {
340
event.preventDefault();
341
342
if ( $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-tablet') ) {
@@ -372,7 +423,7 @@
372
} else if ( 'horizontal' === layout && window.matchMedia( "( max-width: 767px )" ).matches && ($( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-tablet') || $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-mobile'))) {
373
374
$this.parent().parent().next().css( 'position', 'relative');
375
- } else if ( 'horizontal' === layout && window.matchMedia( "( max-width: 1023px )" ).matches ) {
376
377
if ( $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-tablet') ) {
378
@@ -396,7 +447,7 @@
396
} else if ( 'horizontal' === layout && window.matchMedia( "( max-width: 767px )" ).matches && ($( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-tablet') || $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-mobile'))) {
397
398
$this.parent().parent().next().css( 'position', 'relative');
399
- } else if ( 'horizontal' === layout && window.matchMedia( "( max-width: 1023px )" ).matches ) {
400
401
if ( $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-tablet') ) {
402
@@ -435,7 +486,7 @@
435
$( '.elementor-element-' + id + ' li.menu-item:last-child a.hfe-menu-item' ).addClass( 'elementor-button' );
436
}
437
}
438
- }else if ( window.matchMedia( "( max-width: 1023px )" ).matches ) {
439
440
if( $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-tablet') ) {
441
@@ -535,7 +586,6 @@
535
$( window ).on( 'elementor/frontend/init', function () {
536
537
elementorFrontend.hooks.addAction( 'frontend/element_ready/navigation-menu.default', WidgethfeNavMenuHandler );
538
-
539
});
540
-
541
} )( jQuery );
1
( function( $ ) {
2
3
/**
4
+ * Search widget JS
5
+ */
6
+
7
+ var WidgethfeSearchButton = function( $scope, $ ){
8
+
9
+ if ( 'undefined' == typeof $scope )
10
+ return;
11
+
12
+ var $input = $scope.find( "input.hfe-search-form__input" );
13
+ var $clear = $scope.find( "button#clear" );
14
+ var $clear_with_button = $scope.find( "button#clear-with-button" );
15
+ var $search_button = $scope.find( ".hfe-search-submit" );
16
+ var $toggle_search = $scope.find( ".hfe-search-icon-toggle input" );
17
+
18
+ $scope.find( '.hfe-search-icon-toggle' ).on( 'click', function( ){
19
+ $scope.find( ".hfe-search-form__input" ).focus();
20
+ });
21
+
22
+ $scope.find( ".hfe-search-form__input" ).focus( function(){
23
+ $scope.find( ".hfe-search-button-wrapper" ).addClass( "hfe-input-focus" );
24
+ });
25
+
26
+ $scope.find( ".hfe-search-form__input" ).blur( function() {
27
+ $scope.find( ".hfe-search-button-wrapper" ).removeClass( "hfe-input-focus" );
28
+ });
29
+
30
+
31
+ $search_button.on( 'touchstart click', function(){
32
+ $input.submit();
33
+ });
34
+
35
+ $toggle_search.css( 'padding-right', $toggle_search.next().outerWidth() + 'px' );
36
+
37
+
38
+ $input.on( 'keyup', function(){
39
+ $clear.style = (this.value.length) ? $clear.css('visibility','visible'): $clear.css('visibility','hidden');
40
+ $clear_with_button.style = (this.value.length) ? $clear_with_button.css('visibility','visible'): $clear_with_button.css('visibility','hidden');
41
+ $clear_with_button.css( 'right', $search_button.outerWidth() + 'px' );
42
+ });
43
+
44
+ $clear.on("click",function(){
45
+ this.style = $clear.css('visibility','hidden');
46
+ $input.value = "";
47
+ });
48
+ $clear_with_button.on("click",function(){
49
+ this.style = $clear_with_button.css('visibility','hidden');
50
+ $input.value = "";
51
+ });
52
+
53
+ };
54
+ /**
55
* Nav Menu handler Function.
56
*
57
*/
59
60
if ( 'undefined' == typeof $scope )
61
return;
62
+
63
var id = $scope.data( 'id' );
64
var wrapper = $scope.find('.elementor-widget-hfe-nav-menu ');
65
var layout = $( '.elementor-element-' + id + ' .hfe-nav-menu' ).data( 'layout' );
77
}else if ( 'horizontal' === layout && window.matchMedia( "( max-width: 767px )" ).matches ) {
78
79
_eventClick( id );
80
+ }else if ( 'horizontal' === layout && window.matchMedia( "( max-width: 1024px )" ).matches ) {
81
82
_eventClick( id );
83
}
121
}else if ( 'horizontal' === layout && window.matchMedia( "( max-width: 767px )" ).matches ) {
122
123
_eventClick( id );
124
+ }else if ( 'horizontal' === layout && window.matchMedia( "( max-width: 1024px )" ).matches ) {
125
126
_eventClick( id );
127
}
138
if( window.matchMedia( "( max-width: 767px )" ).matches && ($( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-tablet') || $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-mobile'))){
139
140
_toggleClick( id );
141
+ }else if ( window.matchMedia( "( max-width: 1024px )" ).matches && $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-tablet') ) {
142
143
_toggleClick( id );
144
}
204
} else if ( 'horizontal' === layout && window.matchMedia( "( max-width: 767px )" ).matches && ($( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-tablet') || $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-mobile'))) {
205
206
$this.next().css( 'position', 'relative');
207
+ } else if ( 'horizontal' === layout && window.matchMedia( "( max-width: 1024px )" ).matches ) {
208
209
if ( $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-tablet') ) {
210
344
event.preventDefault();
345
346
$this.next().css( 'position', 'relative' );
347
+ }else if ( 'horizontal' === layout && window.matchMedia( "( max-width: 1024px )" ).matches && ( $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-tablet') || $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-mobile'))) {
348
349
event.preventDefault();
350
371
372
$this.next().css( 'position', 'relative' );
373
374
+ } else if ( 'horizontal' === layout && window.matchMedia( "( max-width: 1024px )" ).matches && ( $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-tablet') || $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-mobile'))) {
375
376
$this.next().css( 'position', 'absolute' );
377
}
387
388
event.preventDefault();
389
$this.next().css( 'position', 'relative');
390
+ } else if ( 'horizontal' === layout && window.matchMedia( "( max-width: 1024px )" ).matches ) {
391
event.preventDefault();
392
393
if ( $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-tablet') ) {
423
} else if ( 'horizontal' === layout && window.matchMedia( "( max-width: 767px )" ).matches && ($( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-tablet') || $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-mobile'))) {
424
425
$this.parent().parent().next().css( 'position', 'relative');
426
+ } else if ( 'horizontal' === layout && window.matchMedia( "( max-width: 1024px )" ).matches ) {
427
428
if ( $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-tablet') ) {
429
447
} else if ( 'horizontal' === layout && window.matchMedia( "( max-width: 767px )" ).matches && ($( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-tablet') || $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-mobile'))) {
448
449
$this.parent().parent().next().css( 'position', 'relative');
450
+ } else if ( 'horizontal' === layout && window.matchMedia( "( max-width: 1024px )" ).matches ) {
451
452
if ( $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-tablet') ) {
453
486
$( '.elementor-element-' + id + ' li.menu-item:last-child a.hfe-menu-item' ).addClass( 'elementor-button' );
487
}
488
}
489
+ }else if ( window.matchMedia( "( max-width: 1024px )" ).matches ) {
490
491
if( $( '.elementor-element-' + id ).hasClass('hfe-nav-menu__breakpoint-tablet') ) {
492
586
$( window ).on( 'elementor/frontend/init', function () {
587
588
elementorFrontend.hooks.addAction( 'frontend/element_ready/navigation-menu.default', WidgethfeNavMenuHandler );
589
+ elementorFrontend.hooks.addAction( 'frontend/element_ready/hfe-search-button.default', WidgethfeSearchButton );
590
});
591
} )( jQuery );
inc/widgets-css/frontend.css CHANGED
@@ -1110,7 +1110,7 @@ a.hfe-menu-item.elementor-button {
1110
}
1111
1112
/* Tablet */
1113
- @media only screen and ( max-width: 1023px ) {
1114
1115
.hfe-nav-menu__breakpoint-tablet .hfe-nav-menu__layout-horizontal li,
1116
.hfe-nav-menu__breakpoint-tablet .hfe-nav-menu{
@@ -1695,7 +1695,8 @@ a.hfe-menu-item.elementor-button {
1695
}
1696
1697
.hfe-menu-cart__toggle .elementor-button-text {
1698
- margin-right: 0.3em; }
1699
1700
.hfe-menu-cart__toggle .elementor-button-icon {
1701
position: relative;
@@ -1742,3 +1743,147 @@ a.hfe-menu-item.elementor-button {
1742
color:#4d4848;
1743
}
1744
1110
}
1111
1112
/* Tablet */
1113
+ @media only screen and ( max-width: 1024px ) {
1114
1115
.hfe-nav-menu__breakpoint-tablet .hfe-nav-menu__layout-horizontal li,
1116
.hfe-nav-menu__breakpoint-tablet .hfe-nav-menu{
1695
}
1696
1697
.hfe-menu-cart__toggle .elementor-button-text {
1698
+ margin-right: 0.3em;
1699
+ }
1700
1701
.hfe-menu-cart__toggle .elementor-button-icon {
1702
position: relative;
1743
color:#4d4848;
1744
}
1745
1746
+ /*Search Box CSS*/
1747
+
1748
+ .hfe-search-button-wrapper {
1749
+ display: block;
1750
+ cursor: pointer;
1751
+ vertical-align: middle;
1752
+ text-align: right;
1753
+ }
1754
+
1755
+ .hfe-search-form__container {
1756
+ display: flex;
1757
+ overflow: hidden;
1758
+ }
1759
+
1760
+ .hfe-search-form__input {
1761
+ flex-basis: 100%;
1762
+ }
1763
+
1764
+ .hfe-search-icon-toggle i.fa-search {
1765
+ display: inline-block;
1766
+ position: absolute;
1767
+ width: 20px;
1768
+ box-sizing: content-box;
1769
+ padding: 10px;
1770
+ }
1771
+
1772
+ .hfe-search-icon-toggle i:before {
1773
+ vertical-align: middle;
1774
+ }
1775
+ /*search icon toggle css*/
1776
+
1777
+ /*search icon toggle css*/
1778
+
1779
+ .hfe-search-button-wrapper input[type=search] {
1780
+ border: 0;
1781
+ padding: 10px;
1782
+ cursor: pointer;
1783
+ border-radius: 0;
1784
+ transition: all .5s;
1785
+ box-sizing: border-box;
1786
+ outline: none;
1787
+ }
1788
+
1789
+ .hfe-search-button-wrapper button {
1790
+ border: none;
1791
+ border-radius: 0;
1792
+ padding: 0;
1793
+ }
1794
+
1795
+ .hfe-search-button-wrapper input[type=search]:focus {
1796
+ cursor: auto;
1797
+ border: none;
1798
+ box-shadow: none;
1799
+ }
1800
+
1801
+ .hfe-search-icon-toggle input:-moz-placeholder,
1802
+ .hfe-search-icon-toggle input::-webkit-input-placeholder {
1803
+ color: transparent;
1804
+ }
1805
+
1806
+ .hfe-search-layout-icon .hfe-search-icon-toggle .hfe-search-form__input {
1807
+ background-color: unset;
1808
+ height: 100%;
1809
+ }
1810
+
1811
+ .hfe-search-button-wrapper.hfe-input-focus {
1812
+ display: flex;
1813
+ }
1814
+
1815
+ .hfe-search-form__container .hfe-search-submit {
1816
+ min-width: 3%;
1817
+ position:relative;
1818
+ }
1819
+
1820
+ .hfe-search-form__container button#clear,
1821
+ .hfe-search-icon-toggle button#clear {
1822
+ visibility: hidden;
1823
+ position: absolute;
1824
+ right:0;
1825
+ top:0;
1826
+ padding: 0 8px;
1827
+ font-style: normal;
1828
+ user-select: none;
1829
+ cursor: pointer;
1830
+ bottom:0;
1831
+ margin-right:10px;
1832
+ background-color: transparent;
1833
+ }
1834
+
1835
+ .hfe-search-button-wrapper input[type="search"]::-webkit-search-decoration,
1836
+ .hfe-search-button-wrapper input[type="search"]::-webkit-search-cancel-button,
1837
+ .hfe-search-button-wrapper input[type="search"]::-webkit-search-results-button,
1838
+ .hfe-search-button-wrapper input[type="search"]::-webkit-search-results-decoration {
1839
+ display: none;
1840
+ }
1841
+
1842
+ .hfe-search-form__container button#clear-with-button{
1843
+ visibility: hidden;
1844
+ position: absolute;
1845
+ top: 0;
1846
+ padding: 0 8px;
1847
+ font-style: normal;
1848
+ font-size: 1.2em;
1849
+ user-select: none;
1850
+ cursor: pointer;
1851
+ bottom:0;
1852
+ background-color: transparent;
1853
+ }
1854
+
1855
+ .hfe-search-button-wrapper,
1856
+ .hfe-search-form__container,
1857
+ .hfe-search-icon-toggle,
1858
+ .hfe-search-button-wrapper .hfe-search-icon-toggle i,
1859
+ .hfe-search-button-wrapper .hfe-search-icon-toggle i:before {
1860
+ position: relative;
1861
+ }
1862
+
1863
+ .hfe-search-button-wrapper .hfe-search-icon-toggle .hfe-search-form__input {
1864
+ position: absolute;
1865
+ width: 0;
1866
+ right: 0;
1867
+ background-color: transparent;
1868
+ }
1869
+
1870
+ .hfe-search-icon-toggle {
1871
+ width: 100%!important;
1872
+ }
1873
+
1874
+ .hfe-search-button-wrapper.hfe-input-focus .hfe-search-icon-toggle .hfe-search-form__input{
1875
+ position: absolute;
1876
+ width: 250px;
1877
+ right: 0;
1878
+ }
1879
+
1880
+ .hfe-search-layout-text .hfe-search-form__container,
1881
+ .hfe-search-layout-icon_text .hfe-search-form__container,
1882
+ .hfe-search-layout-text .hfe-search-form__container .hfe-search-form__input,
1883
+ .hfe-search-layout-icon_text .hfe-search-form__container .hfe-search-form__input {
1884
+ width: 100%;
1885
+ }
1886
+
1887
+ .hfe-search-icon-toggle {
1888
+ line-height: 1.5;
1889
+ }
inc/widgets-manager/class-widgets-loader.php CHANGED
@@ -56,6 +56,12 @@ class Widgets_Loader {
56
57
// Add svg support.
58
add_filter( 'upload_mimes', [ $this, 'hfe_svg_mime_types' ] );
59
}
60
61
/**
@@ -66,8 +72,8 @@ class Widgets_Loader {
66
*/
67
public static function get_widget_script() {
68
$js_files = [
69
- 'hfe-nav-menu' => [
70
- 'path' => 'inc/js/hfe-nav-menu.js',
71
'dep' => [ 'jquery' ],
72
'in_footer' => true,
73
],
@@ -94,6 +100,7 @@ class Widgets_Loader {
94
'site-tagline',
95
'site-logo',
96
'cart',
97
];
98
99
return $widget_list;
@@ -180,10 +187,53 @@ class Widgets_Loader {
180
Plugin::instance()->widgets_manager->register_widget_type( new Widgets\Site_Title() );
181
Plugin::instance()->widgets_manager->register_widget_type( new Widgets\Site_Tagline() );
182
Plugin::instance()->widgets_manager->register_widget_type( new Widgets\Site_Logo() );
183
-
184
if ( class_exists( 'woocommerce' ) ) {
185
Plugin::instance()->widgets_manager->register_widget_type( new Widgets\Cart() );
186
}
187
}
188
}
189
56
57
// Add svg support.
58
add_filter( 'upload_mimes', [ $this, 'hfe_svg_mime_types' ] );
59
+
60
+ // Refresh the cart fragments.
61
+ if ( class_exists( 'woocommerce' ) ) {
62
+ add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'init_cart' ], 10, 0 );
63
+ add_filter( 'woocommerce_add_to_cart_fragments', [ $this, 'wc_refresh_mini_cart_count' ] );
64
+ }
65
}
66
67
/**
72
*/
73
public static function get_widget_script() {
74
$js_files = [
75
+ 'hfe-frontend-js' => [
76
+ 'path' => 'inc/js/frontend.js',
77
'dep' => [ 'jquery' ],
78
'in_footer' => true,
79
],
100
'site-tagline',
101
'site-logo',
102
'cart',
103
+ 'search-button',
104
];
105
106
return $widget_list;
187
Plugin::instance()->widgets_manager->register_widget_type( new Widgets\Site_Title() );
188
Plugin::instance()->widgets_manager->register_widget_type( new Widgets\Site_Tagline() );
189
Plugin::instance()->widgets_manager->register_widget_type( new Widgets\Site_Logo() );
190
+ Plugin::instance()->widgets_manager->register_widget_type( new Widgets\Search_Button() );
191
if ( class_exists( 'woocommerce' ) ) {
192
Plugin::instance()->widgets_manager->register_widget_type( new Widgets\Cart() );
193
}
194
+
195
+ }
196
+
197
+ /**
198
+ * Initialize the cart.
199
+ *
200
+ * @since 1.5.0
201
+ * @access public
202
+ */
203
+ public function init_cart() {
204
+ $has_cart = is_a( WC()->cart, 'WC_Cart' );
205
+
206
+ if ( ! $has_cart ) {
207
+ $session_class = apply_filters( 'woocommerce_session_handler', 'WC_Session_Handler' );
208
+ WC()->session = new $session_class();
209
+ WC()->session->init();
210
+ WC()->cart = new \WC_Cart();
211
+ WC()->customer = new \WC_Customer( get_current_user_id(), true );
212
+ }
213
+ }
214
+
215
+ /**
216
+ * Cart Fragments.
217
+ *
218
+ * Refresh the cart fragments.
219
+ *
220
+ * @since 1.5.0
221
+ * @param array $fragments Array of fragments.
222
+ * @access public
223
+ */
224
+ public function wc_refresh_mini_cart_count( $fragments ) {
225
+
226
+ ob_start();
227
+
228
+ include HFE_DIR . '/inc/widgets-manager/widgets/class-cart.php';
229
+
230
+ $cart_type = get_option( 'hfe_cart_widget_type' );
231
+
232
+ \HFE\WidgetsManager\Widgets\Cart::get_cart_link( $cart_type );
233
+
234
+ $fragments['body:not(.elementor-editor-active) a.hfe-cart-container'] = ob_get_clean();
235
+
236
+ return $fragments;
237
}
238
}
239
inc/widgets-manager/widgets/class-cart.php CHANGED
@@ -548,6 +548,44 @@ class Cart extends Widget_Base {
548
$this->end_controls_section();
549
}
550
551
/**
552
* Render Menu Cart output on the frontend.
553
*
@@ -558,40 +596,21 @@ class Cart extends Widget_Base {
558
*/
559
protected function render() {
560
561
- $settings = $this->get_settings();
562
- global $woocommerce;
563
-
564
- if ( empty( $woocommerce ) ) {
565
- return;
566
- }
567
?>
568
569
<div class="hfe-masthead-custom-menu-items woocommerce-custom-menu-item">
570
<div id="hfe-site-header-cart" class="hfe-site-header-cart hfe-menu-cart-with-border">
571
<div class="hfe-site-header-cart-li current-menu-item">
572
- <?php if ( 'default' === $settings['hfe_cart_type'] ) { ?>
573
- <a class="hfe-cart-container" href="<?php echo esc_url( wc_get_cart_url() ); ?>" title="View your shopping cart">
574
- <div class="hfe-cart-menu-wrap-<?php echo $settings['hfe_cart_type']; ?>">
575
- <span class="count">
576
- <?php
577
- echo ( ( empty( $woocommerce->cart ) ) ? 0 : $woocommerce->cart->cart_contents_count );
578
- ?>
579
- </span>
580
- </div>
581
- </a>
582
- <?php } else { ?>
583
<div class="hfe-menu-cart__toggle elementor-button-wrapper">
584
- <a id="hfe-menu-cart__toggle_button" href="<?php echo esc_url( wc_get_cart_url() ); ?>" class="elementor-button">
585
- <span class="elementor-button-text">
586
- <?php
587
- echo ( ( empty( $woocommerce->cart ) ) ? 0 : $woocommerce->cart->get_cart_total() );
588
- ?>
589
- </span>
590
- <span class="elementor-button-icon" data-counter="<?php echo ( ( empty( $woocommerce->cart ) ) ? 0 : $woocommerce->cart->cart_contents_count ); ?>">
591
- <i class="eicon" aria-hidden="true"></i>
592
- <span class="elementor-screen-only"><?php _e( 'Cart', 'header-footer-elementor' ); ?></span>
593
- </span>
594
- </a>
595
</div>
596
<?php } ?>
597
</div>
548
$this->end_controls_section();
549
}
550
551
+ /**
552
+ * Fetch the cart layout.
553
+ *
554
+ * @since 1.5.0
555
+ * @param string $cart_type Menu Cart type.
556
+ * @access public
557
+ */
558
+ public static function get_cart_link( $cart_type ) {
559
+ if ( null === WC()->cart ) {
560
+ return;
561
+ }
562
+
563
+ if ( \Elementor\Plugin::instance()->editor->is_edit_mode() ) {
564
+ update_option( 'hfe_cart_widget_type', $cart_type );
565
+ }
566
+
567
+ if ( 'default' === $cart_type ) { ?>
568
+ <a class="hfe-cart-container" href="<?php echo esc_url( wc_get_cart_url() ); ?>" title="View your shopping cart">
569
+ <div class="hfe-cart-menu-wrap-default">
570
+ <span class="count">
571
+ <?php echo WC()->cart->get_cart_contents_count(); ?>
572
+ </span>
573
+ </div>
574
+ </a>
575
+ <?php } else { ?>
576
+ <a id="hfe-menu-cart__toggle_button" href="<?php echo esc_url( wc_get_cart_url() ); ?>" class="elementor-button hfe-cart-container">
577
+ <span class="elementor-button-text">
578
+ <?php echo WC()->cart->get_cart_subtotal(); ?>
579
+ </span>
580
+ <span class="elementor-button-icon" data-counter="<?php echo WC()->cart->get_cart_contents_count(); ?>">
581
+ <i class="eicon" aria-hidden="true"></i>
582
+ <span class="elementor-screen-only"><?php _e( 'Cart', 'header-footer-elementor' ); ?></span>
583
+ </span>
584
+ </a>
585
+ <?php
586
+ }
587
+ }
588
+
589
/**
590
* Render Menu Cart output on the frontend.
591
*
596
*/
597
protected function render() {
598
599
+ $settings = $this->get_settings_for_display();
600
+ $cart_type = $settings['hfe_cart_type'];
601
?>
602
603
<div class="hfe-masthead-custom-menu-items woocommerce-custom-menu-item">
604
<div id="hfe-site-header-cart" class="hfe-site-header-cart hfe-menu-cart-with-border">
605
<div class="hfe-site-header-cart-li current-menu-item">
606
+ <?php
607
+ if ( 'default' === $cart_type ) {
608
+
609
+ $this->get_cart_link( 'default' );
610
+ } else {
611
+ ?>
612
<div class="hfe-menu-cart__toggle elementor-button-wrapper">
613
+ <?php $this->get_cart_link( 'custom' ); ?>
614
</div>
615
<?php } ?>
616
</div>
inc/widgets-manager/widgets/class-menu-walker.php CHANGED
@@ -66,8 +66,9 @@ class Menu_Walker extends \Walker_Nav_Menu {
66
if ( 0 === $depth ) {
67
$item_output .= ' class = "hfe-menu-item"';
68
} else {
69
- $item_output .= ' class = "hfe-sub-menu-item"';
70
}
71
$item_output .= '>';
72
$item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
73
if ( $args->has_children ) {
66
if ( 0 === $depth ) {
67
$item_output .= ' class = "hfe-menu-item"';
68
} else {
69
+ $item_output .= in_array( 'current-menu-item', $item->classes ) ? ' class = "hfe-sub-menu-item hfe-sub-menu-item-active"' : ' class = "hfe-sub-menu-item"';
70
}
71
+
72
$item_output .= '>';
73
$item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
74
if ( $args->has_children ) {
inc/widgets-manager/widgets/class-navigation-menu.php CHANGED
@@ -105,7 +105,7 @@ class Navigation_Menu extends Widget_Base {
105
* @return array Widget scripts dependencies.
106
*/
107
public function get_script_depends() {
108
- return [ 'hfe-nav-menu' ];
109
}
110
111
/**
@@ -444,8 +444,8 @@ class Navigation_Menu extends Widget_Base {
444
'type' => Controls_Manager::SELECT,
445
'default' => 'tablet',
446
'options' => [
447
- 'mobile' => __( 'Mobile (767px >)', 'header-footer-elementor' ),
448
- 'tablet' => __( 'Tablet (1023px >)', 'header-footer-elementor' ),
449
'none' => __( 'None', 'header-footer-elementor' ),
450
],
451
'prefix_class' => 'hfe-nav-menu__breakpoint-',
@@ -998,7 +998,8 @@ class Navigation_Menu extends Widget_Base {
998
'type' => Controls_Manager::COLOR,
999
'default' => '',
1000
'selectors' => [
1001
- '{{WRAPPER}} .menu-item.current-menu-item a.hfe-menu-item' => 'color: {{VALUE}}',
1002
],
1003
]
1004
);
@@ -1010,7 +1011,8 @@ class Navigation_Menu extends Widget_Base {
1010
'type' => Controls_Manager::COLOR,
1011
'default' => '',
1012
'selectors' => [
1013
- '{{WRAPPER}} .menu-item.current-menu-item a.hfe-menu-item' => 'background-color: {{VALUE}}',
1014
],
1015
'condition' => [
1016
'layout!' => 'flyout',
@@ -1115,7 +1117,7 @@ class Navigation_Menu extends Widget_Base {
1115
{{WRAPPER}} nav.hfe-dropdown .menu-item a.hfe-menu-item,
1116
{{WRAPPER}} nav.hfe-dropdown .menu-item a.hfe-sub-menu-item' => 'background-color: {{VALUE}}',
1117
],
1118
- 'separator' => 'none',
1119
]
1120
);
1121
@@ -1158,12 +1160,54 @@ class Navigation_Menu extends Widget_Base {
1158
{{WRAPPER}} nav.hfe-dropdown-expandible li a.hfe-menu-item:hover,
1159
{{WRAPPER}} nav.hfe-dropdown-expandible li a.hfe-sub-menu-item:hover' => 'background-color: {{VALUE}}',
1160
],
1161
- 'separator' => 'none',
1162
]
1163
);
1164
1165
$this->end_controls_tab();
1166
1167
$this->end_controls_tabs();
1168
1169
$this->add_group_control(
@@ -1831,8 +1875,11 @@ class Navigation_Menu extends Widget_Base {
1831
<div <?php echo $this->get_render_attribute_string( 'hfe-main-menu' ); ?>>
1832
<div class="hfe-nav-menu__toggle elementor-clickable">
1833
<div class="hfe-nav-menu-icon">
1834
- <?php if ( $this->is_elementor_updated() ) { ?>
1835
- <i class="<?php echo esc_attr( $settings['dropdown_icon']['value'] ); ?>" aria-hidden="true" tabindex="0"></i>
1836
<?php } else { ?>
1837
<i class="<?php echo esc_attr( $settings['dropdown_icon'] ); ?>" aria-hidden="true" tabindex="0"></i>
1838
<?php } ?>
105
* @return array Widget scripts dependencies.
106
*/
107
public function get_script_depends() {
108
+ return [ 'hfe-frontend-js' ];
109
}
110
111
/**
444
'type' => Controls_Manager::SELECT,
445
'default' => 'tablet',
446
'options' => [
447
+ 'mobile' => __( 'Mobile (768px >)', 'header-footer-elementor' ),
448
+ 'tablet' => __( 'Tablet (1025px >)', 'header-footer-elementor' ),
449
'none' => __( 'None', 'header-footer-elementor' ),
450
],
451
'prefix_class' => 'hfe-nav-menu__breakpoint-',
998
'type' => Controls_Manager::COLOR,
999
'default' => '',
1000
'selectors' => [
1001
+ '{{WRAPPER}} .menu-item.current-menu-item a.hfe-menu-item,
1002
+ {{WRAPPER}} .menu-item.current-menu-ancestor a.hfe-menu-item' => 'color: {{VALUE}}',
1003
],
1004
]
1005
);
1011
'type' => Controls_Manager::COLOR,
1012
'default' => '',
1013
'selectors' => [
1014
+ '{{WRAPPER}} .menu-item.current-menu-item a.hfe-menu-item,
1015
+ {{WRAPPER}} .menu-item.current-menu-ancestor a.hfe-menu-item' => 'background-color: {{VALUE}}',
1016
],
1017
'condition' => [
1018
'layout!' => 'flyout',
1117
{{WRAPPER}} nav.hfe-dropdown .menu-item a.hfe-menu-item,
1118
{{WRAPPER}} nav.hfe-dropdown .menu-item a.hfe-sub-menu-item' => 'background-color: {{VALUE}}',
1119
],
1120
+ 'separator' => 'after',
1121
]
1122
);
1123
1160
{{WRAPPER}} nav.hfe-dropdown-expandible li a.hfe-menu-item:hover,
1161
{{WRAPPER}} nav.hfe-dropdown-expandible li a.hfe-sub-menu-item:hover' => 'background-color: {{VALUE}}',
1162
],
1163
+ 'separator' => 'after',
1164
]
1165
);
1166
1167
$this->end_controls_tab();
1168
1169
+ $this->start_controls_tab(
1170
+ 'tab_dropdown_item_active',
1171
+ [
1172
+ 'label' => __( 'Active', 'header-footer-elementor' ),
1173
+ ]
1174
+ );
1175
+
1176
+ $this->add_control(
1177
+ 'color_dropdown_item_active',
1178
+ [
1179
+ 'label' => __( 'Text Color', 'header-footer-elementor' ),
1180
+ 'type' => Controls_Manager::COLOR,
1181
+ 'default' => '',
1182
+ 'selectors' => [
1183
+ '{{WRAPPER}} .sub-menu .menu-item.current-menu-item a.hfe-sub-menu-item.hfe-sub-menu-item-active,
1184
+ {{WRAPPER}} nav.hfe-dropdown .menu-item.current-menu-item a.hfe-menu-item,
1185
+ {{WRAPPER}} nav.hfe-dropdown .menu-item.current-menu-ancestor a.hfe-menu-item,
1186
+ {{WRAPPER}} nav.hfe-dropdown .sub-menu .menu-item.current-menu-item a.hfe-sub-menu-item.hfe-sub-menu-item-active
1187
+ ' => 'color: {{VALUE}}',
1188
+
1189
+ ],
1190
+ ]
1191
+ );
1192
+
1193
+ $this->add_control(
1194
+ 'background_color_dropdown_item_active',
1195
+ [
1196
+ 'label' => __( 'Background Color', 'header-footer-elementor' ),
1197
+ 'type' => Controls_Manager::COLOR,
1198
+ 'default' => '',
1199
+ 'selectors' => [
1200
+ '{{WRAPPER}} .sub-menu .menu-item.current-menu-item a.hfe-sub-menu-item.hfe-sub-menu-item-active,
1201
+ {{WRAPPER}} nav.hfe-dropdown .menu-item.current-menu-item a.hfe-menu-item,
1202
+ {{WRAPPER}} nav.hfe-dropdown .menu-item.current-menu-ancestor a.hfe-menu-item,
1203
+ {{WRAPPER}} nav.hfe-dropdown .sub-menu .menu-item.current-menu-item a.hfe-sub-menu-item.hfe-sub-menu-item-active' => 'background-color: {{VALUE}}',
1204
+ ],
1205
+ 'separator' => 'after',
1206
+ ]
1207
+ );
1208
+
1209
+ $this->end_controls_tabs();
1210
+
1211
$this->end_controls_tabs();
1212
1213
$this->add_group_control(
1875
<div <?php echo $this->get_render_attribute_string( 'hfe-main-menu' ); ?>>
1876
<div class="hfe-nav-menu__toggle elementor-clickable">
1877
<div class="hfe-nav-menu-icon">
1878
+ <?php
1879
+ if ( $this->is_elementor_updated() ) {
1880
+ $dropdown_icon_value = isset( $settings['dropdown_icon']['value'] ) ? $settings['dropdown_icon']['value'] : '';
1881
+ ?>
1882
+ <i class="<?php echo esc_attr( $dropdown_icon_value ); ?>" aria-hidden="true" tabindex="0"></i>
1883
<?php } else { ?>
1884
<i class="<?php echo esc_attr( $settings['dropdown_icon'] ); ?>" aria-hidden="true" tabindex="0"></i>
1885
<?php } ?>
inc/widgets-manager/widgets/class-page-title.php CHANGED
@@ -110,6 +110,16 @@ class Page_Title extends Widget_Base {
110
]
111
);
112
113
$this->add_control(
114
'before',
115
[
@@ -392,6 +402,7 @@ class Page_Title extends Widget_Base {
392
* @access protected
393
*/
394
protected function render() {
395
$settings = $this->get_settings_for_display();
396
397
$this->add_inline_editing_attributes( 'page_title', 'basic' );
@@ -410,8 +421,13 @@ class Page_Title extends Widget_Base {
410
}
411
?>
412
<div class="hfe-page-title hfe-page-title-wrapper elementor-widget-heading">
413
- <?php if ( '' != $settings['page_heading_link']['url'] && 'custom' === $settings['page_custom_link'] ) { ?>
414
- <a <?php echo esc_attr( $link ); ?> >
415
<?php } else { ?>
416
<a href="<?php echo esc_url( get_home_url() ); ?>">
417
<?php } ?>
@@ -422,17 +438,24 @@ class Page_Title extends Widget_Base {
422
<?php } ?>
423
<?php if ( '' != $settings['before'] ) { ?>
424
<?php echo wp_kses_post( $settings['before'] ); ?>
425
- <?php } ?>
426
427
- <?php echo wp_kses_post( get_the_title() ); ?>
428
429
- <?php if ( '' != $settings['after'] ) { ?>
430
<?php echo wp_kses_post( $settings['after'] ); ?>
431
<?php } ?>
432
</<?php echo wp_kses_post( $settings['heading_tag'] ); ?> >
433
</a>
434
</div>
435
<?php
436
}
437
438
/**
@@ -444,6 +467,7 @@ class Page_Title extends Widget_Base {
444
* @access protected
445
*/
446
protected function content_template() {
447
?>
448
<#
449
if ( '' == settings.page_title ) {
@@ -468,7 +492,13 @@ class Page_Title extends Widget_Base {
468
<# if ( '' != settings.before ) { #>