PluginProbe ʕ •ᴥ•ʔ
My Sticky Bar – Floating Notification Bar & Sticky Header (formerly myStickymenu) / 2.8.3
My Sticky Bar – Floating Notification Bar & Sticky Header (formerly myStickymenu) v2.8.3
2.9.1 2.9.0 2.8.9 2.8.8 trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9 1.9.1 2.0 2.0.1 2.0.3 2.0.4 2.0.5 2.0.6 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3 2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 2.4 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.5 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.6.6 2.6.7 2.6.8 2.6.9 2.7 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7
mystickymenu / mystickymenu.php
mystickymenu Last commit date
admin 9 months ago css 1 year ago fonts 4 years ago images 1 year ago js 9 months ago languages 2 years ago class-email-signup.php 1 year ago class-help.php 1 year ago class-review-box.php 1 year ago class-upgrade-box.php 9 months ago index.php 8 years ago mystickymenu-admin-widgetanalytics.php 1 year ago mystickymenu-affiliate.php 9 months ago mystickymenu-contact-leads.php 1 year ago mystickymenu-deactivate-form.php 1 year ago mystickymenu-fonts.php 2 years ago mystickymenu-popup.php 1 year ago mystickymenu-review-popup.php 9 months ago mystickymenu.php 9 months ago mystickymeny-new-welcomebar.php 1 year ago readme.txt 8 months ago recommended-plugins.php 1 year ago stickymenu-dashboard.php 9 months ago uninstall.php 2 years ago upgrade-to-pro.php 1 year ago welcome-bar.php 9 months ago
mystickymenu.php
2438 lines
1 <?php
2 /*
3 Plugin Name: My Sticky Bar
4 Plugin URI: https://premio.io/
5 Description: Create a notification bar for your website with My Sticky Bar. You can customize the design, collect leads, and enjoy other advanced features. You can also make your menu sticky using My Sticky Bar.
6 Version: 2.8.3
7 Author: Premio
8 Author URI: https://premio.io/downloads/mystickymenu/
9 Text Domain: mystickymenu
10 Domain Path: /languages
11 License: GPLv3
12 */
13
14 defined('ABSPATH') or die("Cannot access pages directly.");
15 define('MYSTICKY_VERSION', '2.8.3');
16 define('MYSTICKYMENU_URL', plugins_url('/', __FILE__)); // Define Plugin URL
17 define('MYSTICKYMENU_PATH', plugin_dir_path(__FILE__)); // Define Plugin Directory Path
18 define('MYSTICKYMENU_BASE', plugin_basename(__FILE__));
19
20 require_once("mystickymenu-fonts.php");
21 require_once("welcome-bar.php");
22
23 if( is_admin() ) {
24 //include_once 'class-review-box.php';
25 include_once 'class-upgrade-box.php';
26 include_once 'class-email-signup.php';
27 include_once 'class-help.php';
28
29 }
30
31 class MyStickyMenuBackend
32 {
33 private $options;
34
35 public function __construct()
36 {
37 add_action( 'admin_menu', array( $this, 'add_plugin_page' ) );
38 add_action( 'admin_init', array( $this, 'mysticky_load_transl') );
39 add_action( 'admin_init', array( $this, 'mysticky_default_options' ) );
40 add_action( 'admin_enqueue_scripts', array( $this, 'mysticky_admin_script' ) );
41 add_filter( 'plugin_action_links_'.MYSTICKYMENU_BASE, array( $this, 'mystickymenu_settings_link' ) );
42 add_action( 'activated_plugin', array( $this, 'mystickymenu_activation_redirect' ) );
43 add_action( "wp_ajax_mystickymenu_update_popup_status", array($this, 'mystickymenu_popup_status'));
44 add_action( 'admin_footer', array( $this, 'mystickymenu_deactivate' ) );
45 add_action( 'wp_ajax_mystickymenu_plugin_deactivate', array( $this, 'mystickymenu_plugin_deactivate' ) );
46 add_action( 'wp_ajax_stickymenu_widget_delete', array( $this, 'stickymenu_widget_delete' ) );
47 add_action( 'wp_ajax_mystickymenu_widget_status', array( $this, 'mystickymenu_widget_status' ) );
48 add_action( 'wp_ajax_stickymenu_status_update', array( $this, 'stickymenu_status_update' ) );
49 add_action( 'wp_ajax_mystickymenu_delete_contact_lead', array( $this, 'mystickymenu_delete_contact_lead' ) );
50 add_action( 'wp_ajax_my_sticky_menu_bulks', array( $this, 'my_sticky_menu_bulks' ) );
51
52 add_action( 'wp_ajax_mystickymenu_admin_send_message_to_owner', array( $this, 'mystickymenu_admin_send_message_to_owner' ) );
53
54 add_action( 'wp_ajax_mystickymenu_review_box', [$this, "mystickymenu_review_box"]);
55 add_action( 'wp_ajax_mystickymenu_review_box_message', [$this, "mystickymenu_review_box_message"]);
56 add_action( 'admin_init' , [$this, 'check_for_redirection']);
57
58 }
59
60
61
62
63 public function stickymenu_status_update(){
64 if (!current_user_can('manage_options')) {
65 wp_die(0);
66 }
67 check_ajax_referer( 'mystickymenu', 'wpnonce' );
68 $mysticky_options = get_option( 'mysticky_option_name' );
69 if( isset($_POST['stickymenu_status']) && $_POST['stickymenu_status'] != '' ){
70
71 $stickymenu_status = $_POST['stickymenu_status'];
72 $mysticky_options['stickymenu_enable'] = $stickymenu_status;
73 update_option('mysticky_option_name',$mysticky_options);
74 }
75 wp_die();
76 }
77
78 public function mystickymenu_popup_status() {
79 if(!empty($_REQUEST['nonce']) && wp_verify_nonce($_REQUEST['nonce'], 'mystickymenu_update_popup_status')) {
80 update_option("mystickymenu_intro_box", "hide");
81 }
82 echo esc_attr("1");
83 die;
84 }
85
86 public function mystickymenu_widget_status() {
87 if (!current_user_can('manage_options')) {
88 wp_die(0);
89 }
90 check_ajax_referer( 'mystickymenu', 'wpnonce' );
91
92 if ( isset($_POST['widget_id']) && $_POST['widget_id'] != '' && isset($_POST['widget_status']) && $_POST['widget_status'] != '' ) {
93 $welcomebars_widgets = get_option( 'mystickymenu-welcomebars' );
94 $widget_id = $_POST['widget_id'];
95 $welcomebars_widget_no = '-' . $widget_id ;
96
97 if( $widget_id == 0 || $welcomebars_widgets[$widget_id] == 'default' ){
98 $stickymenu_widget = get_option('mysticky_option_welcomebar');
99 $welcomebars_widget_no = '';
100 }
101 $widget_status = $_POST['widget_status'];
102 $stickymenu_widget['mysticky_welcomebar_enable'] = $widget_status;
103
104 update_option( 'mysticky_option_welcomebar',$stickymenu_widget);
105 }
106 wp_die();
107 }
108
109 public function stickymenu_widget_delete(){
110 if (!current_user_can('manage_options')) {
111 wp_die(0);
112 }
113 check_ajax_referer( 'mystickymenu', 'wpnonce' );
114 if ( isset($_POST['widget_id']) && $_POST['widget_id'] != '' && isset($_POST['widget_delete']) && $_POST['widget_delete'] == 1 ) {
115 $welcomebars_widgets = get_option( 'mystickymenu-welcomebars' );
116 $widget_id = $_POST['widget_id'];
117 foreach( $welcomebars_widgets as $key => $widget_value ){
118 $element_widget_no = '';
119 if ( $key != 0 ) {
120 $element_widget_no = '-' . $key;
121 }
122 delete_option( 'mysticky_option_welcomebar' . $element_widget_no );
123 }
124
125 delete_option( 'mystickymenu-welcomebars' );
126 }
127 wp_die();
128 }
129
130
131
132
133 public function mystickymenu_delete_contact_lead(){
134 global $wpdb;
135 if ( ! current_user_can( 'manage_options' ) ) {
136 wp_die(0);
137 }
138 check_ajax_referer( 'mystickymenu', 'wpnonce' );
139
140 if ( isset($_POST['ID']) && $_POST['ID'] != '' ) {
141 $ID = sanitize_text_field($_POST['ID']);
142 $table = $wpdb->prefix . 'mystickymenu_contact_lists';
143 $delete_sql = $wpdb->prepare("DELETE FROM {$table} WHERE id = %d",$ID);
144 $delete = $wpdb->query($delete_sql);
145 }
146
147 if ( isset($_POST['all_leads']) && $_POST['all_leads'] == 1 ) {
148 $table = $wpdb->prefix . 'mystickymenu_contact_lists';
149 $delete = $wpdb->query("TRUNCATE TABLE $table");
150 }
151 wp_die();
152
153 }
154
155
156 public function my_sticky_menu_bulks(){
157 global $wpdb;
158 if (!current_user_can('manage_options')) {
159 wp_die(0);
160 }
161 check_ajax_referer( 'mystickymenu', 'wpnonce' );
162 if( isset($_POST['wpnonce']) ){
163 $bulks = isset($_POST['bulks']) ? $_POST['bulks'] : array();
164 foreach( $bulks as $key => $bulk ){
165 $ID = sanitize_text_field($bulk);
166 $table = $wpdb->prefix . 'mystickymenu_contact_lists';
167 $delete_sql = $wpdb->prepare("DELETE FROM {$table} WHERE id = %d",$ID);
168 $delete = $wpdb->query($delete_sql);
169 }
170 }
171 wp_die();
172 }
173
174 public function mystickymenu_admin_send_message_to_owner() {
175 if (!current_user_can('manage_options')) {
176 wp_die(0);
177 }
178 $response = array();
179 $response['status'] = 0;
180 $response['error'] = 0;
181 $response['errors'] = array();
182 $response['message'] = "";
183 $errorArray = [];
184 $errorMessage = __("%1\$s is required", "mystickymenu");
185 $postData = $_POST;
186 if(!isset($postData['textarea_text']) || trim($postData['textarea_text']) == "") {
187 $error = array(
188 "key" => "textarea_text",
189 "message" => __("Please enter your message","wcp")
190 );
191 $errorArray[] = $error;
192 }
193 if(!isset($postData['user_email']) || trim($postData['user_email']) == "") {
194 $error = array(
195 "key" => "user_email",
196 "message" => sprintf($errorMessage,__("Email","wcp"))
197 );
198 $errorArray[] = $error;
199 } else if(!filter_var($postData['user_email'], FILTER_VALIDATE_EMAIL)) {
200 $error = array(
201 'key' => "user_email",
202 "message" => "Email is not valid"
203 );
204 $errorArray[] = $error;
205 }
206 if(empty($errorArray)) {
207 if(!isset($_REQUEST['nonce']) || empty($_REQUEST['nonce'])) {
208 $error = array(
209 'key' => "nonce",
210 "message" => "Your request is not valid"
211 );
212 $errorArray[] = $error;
213 } else if(!wp_verify_nonce($_REQUEST['nonce'], "mystickymenu_send_message_to_owner")) {
214 $error = array(
215 'key' => "nonce",
216 "message" => "Your request is not valid"
217 );
218 $errorArray[] = $error;
219 }
220 }
221 if(empty($errorArray)) {
222 global $current_user;
223 $text_message = $postData['textarea_text'];
224 $email = $postData['user_email'];
225 $domain = site_url();
226 $user_name = $current_user->first_name." ".$current_user->last_name;
227
228 $response['status'] = 1;
229
230 /* sending message to Crisp */
231 $post_message = array();
232
233 $message_data = array();
234 $message_data['key'] = "Plugin";
235 $message_data['value'] = "My Sticky Bar";
236 $post_message[] = $message_data;
237
238 $message_data = array();
239 $message_data['key'] = "Domain";
240 $message_data['value'] = $domain;
241 $post_message[] = $message_data;
242
243 $message_data = array();
244 $message_data['key'] = "Email";
245 $message_data['value'] = $email;
246 $post_message[] = $message_data;
247
248 $message_data = array();
249 $message_data['key'] = "Message";
250 $message_data['value'] = $text_message;
251 $post_message[] = $message_data;
252
253 $api_params = array(
254 'domain' => $domain,
255 'email' => $email,
256 'url' => site_url(),
257 'name' => $user_name,
258 'message' => $post_message,
259 'plugin' => "My Sticky Bar",
260 'type' => "Need Help",
261 );
262
263 /* Sending message to Crisp API */
264
265 $crisp_response = wp_safe_remote_post("https://premioapps.com/premio/send-message-api.php", array('body' => $api_params, 'timeout' => 15, 'sslverify' => true));
266
267 if (is_wp_error($crisp_response)) {
268 wp_safe_remote_post("https://premioapps.com/premio/send-message-api.php", array('body' => $api_params, 'timeout' => 15, 'sslverify' => false));
269 }
270 } else {
271 $response['error'] = 1;
272 $response['errors'] = $errorArray;
273 }
274 wp_send_json($response);
275 wp_die();
276 }
277
278
279 public function mystickymenu_settings_link($links){
280 $settings_link = '<a href="admin.php?page=my-stickymenu-welcomebar">Settings</a>';
281
282 $links['need_help'] = '<a href="https://wordpress.org/support/plugin/mystickymenu/" target="_blank">'.__( 'Need help?', 'mystickymenu' ).'</a>';
283
284 $links['go_pro'] = '<a href="'. admin_url("admin.php?page=my-stickymenu-upgrade&type=upgrade").'" style="color: #FF5983; font-weight: bold; display: inline-block; border: solid 1px #FF5983; border-radius: 4px; padding: 0 5px;">'.__( 'Upgrade', 'stars-testimonials' ).'</a>';
285 array_unshift($links, $settings_link);
286 return $links;
287 }
288
289 public function mystickymenu_activation_redirect( $plugin) {
290 if( $plugin == plugin_basename( __FILE__ ) ) {
291
292 $option = get_option("mystickymenu_intro_box");
293 if($option === false) {
294 add_option("mystickymenu_intro_box", "show");
295 }
296 if(!defined( 'DOING_AJAX' )) {
297 add_option("msm_redirection", 1);
298 }
299 }
300 }
301
302 public function check_for_redirection()
303 {
304 if(!defined( 'DOING_AJAX' )) {
305 $status = get_option("msm_redirection");
306 if($status) {
307 delete_option("msm_redirection");
308 $welcomebar_widgets = get_option("mysticky_option_welcomebar");
309 if ($welcomebar_widgets) {
310 wp_redirect(admin_url('admin.php?page=my-stickymenu-welcomebar'));
311 } else {
312 wp_redirect(admin_url('admin.php?page=my-stickymenu-welcomebar&widget=0'));
313 }
314 exit;
315 }
316 }
317 }
318
319 public function mysticky_admin_script($hook) {
320
321 if ( !isset($_GET['page']) || ( isset($_GET['page']) && $_GET['page'] != 'my-stickymenu-settings' && $_GET['page'] != 'my-stickymenu-welcomebar' && $_GET['page'] != 'my-stickymenu-new-welcomebar' && $_GET['page'] != 'my-sticky-menu-analytics' && $_GET['page'] != 'my-stickymenu-upgrade' && $_GET['page'] != 'msm-recommended-plugins' && $_GET['page'] != 'my-sticky-menu-leads' )) {
322 return;
323 }
324
325 wp_enqueue_style('mystickymenuAdminStyle', plugins_url('/css/mystickymenu-admin.css', __FILE__), array(), MYSTICKY_VERSION );
326 wp_style_add_data( 'mystickymenuAdminStyle', 'rtl', 'replace' );
327 wp_enqueue_style('mystickybar-style', plugins_url('/css/mystickybar-admin.css', __FILE__), array(), MYSTICKY_VERSION );
328 wp_style_add_data( 'mystickybar-style', 'rtl', 'replace' );
329
330 wp_enqueue_style('mystickymenuHelpStyle', plugins_url('/css/mystickymenu-help.css', __FILE__), array(), MYSTICKY_VERSION );
331 wp_style_add_data( 'mystickymenuHelpStyle', 'rtl', 'replace' );
332 wp_enqueue_style( 'wp-color-picker' );
333 wp_enqueue_style( 'wp-jquery-ui-dialog' );
334 wp_enqueue_style('jquery-ui');
335
336 wp_enqueue_script('jquery-ui');
337 wp_enqueue_script('jquery-ui-slider');
338 wp_enqueue_script( 'jquery-ui-dialog' );
339
340 if ( isset($_GET['page']) && $_GET['page'] == 'my-stickymenu-upgrade' ) {
341 wp_enqueue_script( 'my-select2', plugins_url('js/select2.min.js', __FILE__ ), array( 'wp-color-picker' ), MYSTICKY_VERSION, ['strategy' => 'defer', 'in_footer'=> true ] );
342 wp_enqueue_style('my-css-select2', plugins_url('css/select2.min.css', __FILE__), array(), MYSTICKY_VERSION );
343
344 wp_enqueue_style('stickymenu-pricing-table', plugins_url('/css/pricing-table.css', __FILE__), [], MYSTICKY_VERSION);
345 $queryArgs = [
346 'family' => 'Poppins:wght@400;500;600;700&display=swap',
347 'subset' => 'latin,latin-ext',
348 ];
349 wp_enqueue_style('google-poppins-fonts', add_query_arg($queryArgs, "//fonts.googleapis.com/css2"), [], MYSTICKY_VERSION);
350
351 wp_enqueue_script('stickymenu-slick', plugins_url('/js/slick.min.js', __FILE__), ['jquery'], MYSTICKY_VERSION, ['strategy' => 'defer', 'in_footer'=> true ]);
352 }
353
354 wp_enqueue_style("mystickyelements-star-rating-svg-css", plugins_url('css/star-rating-svg.css', __FILE__), [], MYSTICKY_VERSION );
355 wp_enqueue_script("mystickyelements-star-rating-svg-js", plugins_url('js/jquery.star-rating-svg.min.js', __FILE__), ['jquery'], MYSTICKY_VERSION, ['strategy' => 'defer', 'in_footer'=> true ]);
356
357 wp_enqueue_script( 'morphext-js', plugins_url('/js/morphext/morphext.min.js', __FILE__) , array('jquery'), MYSTICKY_VERSION, ['strategy' => 'defer', 'in_footer'=> true ] );
358
359 wp_enqueue_script( 'mailcheck-js', plugins_url('/js/mailcheck.js', __FILE__), ['jquery'], MYSTICKY_VERSION, true);
360 wp_enqueue_script('autocomplete-email-js', plugins_url('/js/jquery.email-autocomplete.js', __FILE__), ['jquery'], MYSTICKY_VERSION, true);
361 wp_enqueue_script('mystickymenuAdminScript', plugins_url('/js/mystickymenu-admin.js', __FILE__), array( 'jquery', 'jquery-ui-slider', 'wp-color-picker' ), MYSTICKY_VERSION,['strategy' => 'defer', 'in_footer'=> true ]);
362
363 $locale_settings = array(
364 'ajaxurl' => admin_url('admin-ajax.php'),
365 'mystickymenu_url' => MYSTICKYMENU_URL,
366 'ajax_nonce' => wp_create_nonce('mystickymenu'),
367 );
368
369 wp_localize_script('mystickymenuAdminScript', 'mystickymenu', $locale_settings);
370
371 }
372
373 public function mysticky_load_transl(){
374 load_plugin_textdomain('mystickymenu', FALSE, dirname(plugin_basename(__FILE__)).'/languages/');
375 }
376
377 function sanitize_options($value) {
378 $value = stripslashes($value);
379 $value = filter_var($value, FILTER_SANITIZE_STRING);
380 return $value;
381 }
382
383 public function add_plugin_page(){
384 if ( isset($_GET['hide_msmrecommended_plugin']) && $_GET['hide_msmrecommended_plugin'] == 1) {
385 update_option('hide_msmrecommended_plugin',true);
386 }
387 $hide_msmrecommended_plugin = get_option('hide_msmrecommended_plugin');
388 // This page will be under "Settings"
389 add_menu_page(
390 'Settings Admin',
391 'My Sticky Bar',
392 'manage_options',
393 'my-stickymenu-welcomebar',
394 array( $this, 'mystickystickymenu_admin_welcomebar_page' )
395 );
396 add_submenu_page(
397 'my-stickymenu-welcomebar',
398 'Settings Admin',
399 'Dashboard',
400 'manage_options',
401 'my-stickymenu-welcomebar',
402 array( $this, 'mystickystickymenu_admin_welcomebar_page' )
403 );
404
405 add_submenu_page(
406 'my-stickymenu-welcomebar',
407 'Settings Admin',
408 '+ Create New Bar',
409 'manage_options',
410 'my-stickymenu-new-welcomebar',
411 array( $this, 'mystickystickymenu_admin_new_welcomebar_page' )
412 );
413
414 if( class_exists( 'POPTIN_Plugin_Base' ) ) {
415 add_submenu_page(
416 'my-stickymenu-welcomebar',
417 'Settings Admin',
418 'Poptin Popups',
419 'manage_options',
420 'manage-poptin-plugin',
421 array( $this, 'mystickymenu_manage_poptin_plugin' )
422 );
423 } else {
424 add_submenu_page(
425 'my-stickymenu-welcomebar',
426 'Settings Admin',
427 'Poptin Popups',
428 'manage_options',
429 'install-poptin-plugin',
430 array( $this, 'mystickymenu_install_poptin_plugin' )
431 );
432 }
433
434 add_submenu_page(
435 'my-stickymenu-welcomebar',
436 'Settings Admin',
437 'Widget Analytics',
438 'manage_options',
439 'my-sticky-menu-analytics',
440 array( $this, 'mystickymenu_admin_widget_analytics_page' )
441 );
442
443 add_submenu_page(
444 'my-stickymenu-welcomebar',
445 'Settings Admin',
446 'Contact Form Leads',
447 'manage_options',
448 'my-sticky-menu-leads',
449 array( $this, 'mystickymenu_admin_leads_page' )
450 );
451
452 add_submenu_page(
453 'my-stickymenu-welcomebar',
454 'Settings Admin',
455 'Sticky Menu Settings',
456 'manage_options',
457 'my-stickymenu-settings',
458 array( $this, 'create_admin_page' )
459 );
460
461
462 if ( !$hide_msmrecommended_plugin){
463 add_submenu_page(
464 'my-stickymenu-welcomebar',
465 'msm-recommended-plugins',
466 'Recommended Plugins',
467 'manage_options',
468 'msm-recommended-plugins',
469 array( $this, 'mystickymenu_recommended_plugins' )
470 );
471 }
472 add_submenu_page(
473 'my-stickymenu-welcomebar',
474 'Upgrade to Pro ⭐️',
475 'Upgrade to Pro ⭐️',
476 'manage_options',
477 'my-stickymenu-upgrade',
478 array( $this, 'mystickymenu_admin_upgrade_to_pro' )
479 );
480 }
481
482 public function create_admin_page(){
483
484
485 $is_shown = myStickyMenu_SIGNUP_CLASS::check_modal_status();
486 if($is_shown) {
487 include_once MYSTICKYMENU_PATH . 'admin/email-signup.php';
488 return;
489 }
490
491 $upgarde_url = admin_url("admin.php?page=my-stickymenu-upgrade");
492 // Set class property
493 if (isset($_POST['mysticky_option_name']) && !empty($_POST['mysticky_option_name']) && isset($_POST['nonce'])) {
494 if(!empty($_REQUEST['nonce']) && wp_verify_nonce($_REQUEST['nonce'], 'mysticky_option_backend_update')) {
495 $post = $_POST['mysticky_option_name'];
496 foreach($post as $key=>$value) {
497 $post[$key] = self::sanitize_options($value);
498 }
499
500 $post['device_desktop'] = 'on';
501 $post['device_mobile'] = 'on';
502 update_option( 'mysticky_option_name', $post);
503 $this->mysticky_clear_all_caches();
504
505
506 if(isset($_POST['submit']) && $_POST['submit'] == 'SAVE & VIEW DASHBOARD'){
507 ?>
508 <script>
509 window.location.href = '<?php echo esc_url(admin_url("admin.php?page=my-stickymenu-welcomebar"));?>';
510 </script>
511 <?php
512 }
513 echo '<div class="updated settings-error notice is-dismissible "><p><strong>' . esc_html__('Settings saved.','mystickymenu'). '</p></strong></div>';
514 } else {
515 wp_verify_nonce($_GET['nonce'], 'wporg_frontend_delete');
516 echo '<div class="error settings-error notice is-dismissible "><p><strong>' . esc_html__('Unable to complete your request','mystickymenu'). '</p></strong></div>';
517 }
518 }
519
520 $mysticky_options = get_option( 'mysticky_option_name');
521 $is_old = get_option("has_sticky_header_old_version");
522 $is_old = ($is_old == "yes")?true:false;
523 $nonce = wp_create_nonce('mysticky_option_backend_update');
524 $pro_url = "https://go.premio.io/?edd_action=add_to_cart&download_id=2199&edd_options[price_id]=";
525
526 $mysticky_options['stickymenu_enable'] = isset($mysticky_options['stickymenu_enable']) ? $mysticky_options['stickymenu_enable'] : '';
527 $mysticky_options['myfixed_disable_scroll_down'] = isset($mysticky_options['myfixed_disable_scroll_down']) ? $mysticky_options['myfixed_disable_scroll_down'] : '';
528 $mysticky_options['disable_css'] = isset($mysticky_options['disable_css']) ? $mysticky_options['disable_css'] : '';
529 $mysticky_options['mysticky_disable_at_front_home'] = isset($mysticky_options['mysticky_disable_at_front_home']) ? $mysticky_options['mysticky_disable_at_front_home'] : '';
530 $mysticky_options['mysticky_disable_at_blog'] = isset($mysticky_options['mysticky_disable_at_blog']) ? $mysticky_options['mysticky_disable_at_blog'] : '';
531 $mysticky_options['mysticky_disable_at_page'] = isset($mysticky_options['mysticky_disable_at_page']) ? $mysticky_options['mysticky_disable_at_page'] : '';
532 $mysticky_options['mysticky_disable_at_tag'] = isset($mysticky_options['mysticky_disable_at_tag']) ? $mysticky_options['mysticky_disable_at_tag'] : '';
533 $mysticky_options['mysticky_disable_at_category'] = isset($mysticky_options['mysticky_disable_at_category']) ? $mysticky_options['mysticky_disable_at_category'] : '';
534 $mysticky_options['mysticky_disable_at_single'] = isset($mysticky_options['mysticky_disable_at_single']) ? $mysticky_options['mysticky_disable_at_single'] : '';
535 $mysticky_options['mysticky_disable_at_archive'] = isset($mysticky_options['mysticky_disable_at_archive']) ? $mysticky_options['mysticky_disable_at_archive'] : '';
536 $mysticky_options['mysticky_disable_at_search'] = isset($mysticky_options['mysticky_disable_at_search']) ? $mysticky_options['mysticky_disable_at_search'] : '';
537 $mysticky_options['mysticky_disable_at_404'] = isset($mysticky_options['mysticky_disable_at_404']) ? $mysticky_options['mysticky_disable_at_404'] : '';
538
539 $is_shown = myStickyMenu_SIGNUP_CLASS::check_modal_status();
540 if($is_shown) {
541 include_once MYSTICKYMENU_PATH . 'admin/email-signup.php';
542 return;
543 } else {
544
545 $option = get_option("mystickymenu_intro_box");
546 if($option == "show") {
547 include_once dirname(__FILE__) . "/mystickymenu-popup.php";
548 }
549 ?>
550 <style>
551 div#wpcontent {
552 background: rgba(101,114,219,1);
553 background: -moz-linear-gradient(-45deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
554 background: -webkit-gradient(left top, right bottom, color-stop(0%, rgba(101,114,219,1)), color-stop(67%, rgba(238,134,198,1)), color-stop(100%, rgba(238,134,198,1)));
555 background: -webkit-linear-gradient(-45deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
556 background: -o-linear-gradient(-45deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
557 background: -ms-linear-gradient(-45deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
558 background: linear-gradient(135deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
559 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6572db', endColorstr='#ee86c6', GradientType=1 );
560 }
561 </style>
562 <div id="mystickymenu" class="wrap mystickymenu">
563
564 <div id="sticky-header-settings" class="sticky-header-content">
565
566 <form class="mysticky-form" id="mystickymenuform" method="post" action="#">
567 <div class="mystickymenu-heading">
568 <div class="mysticky-stickymenu-header-title mystickymenu-content-section">
569 <h3><?php esc_html_e('Sticky menu', 'myStickymenu'); ?></h3>
570 <label for="mysticky-stickymenu-form-enabled" class="mysticky-welcomebar-switch stickymenu-switch">
571 <input type="checkbox" id="mysticky-stickymenu-form-enabled" name="mysticky_option_name[stickymenu_enable]" value="1" <?php checked( @$mysticky_options['stickymenu_enable'], '1' );?> />
572 <span class="slider"></span>
573 </label>
574 <div class="mysticky-stickymenu-backword-page">
575 <a href="<?php echo esc_url(admin_url("admin.php?page=my-stickymenu-welcomebar"));?>"><span class="dashicons dashicons-arrow-left-alt2 back-dashboard" style="color: unset;font-size: 17px;"></span> <?php esc_html_e('Back to Dashboard', 'myStickymenu'); ?></a>
576 </div>
577 </div>
578 <div class="myStickymenu-header-title">
579 <h3><?php esc_html_e('How To Make a Sticky Header', 'mystickymenu'); ?></h3>
580 </div>
581 <p><?php esc_html_e("Add sticky menu / header to any theme. <br />Simply change 'Sticky Class' to HTML element class desired to be sticky (div id can be used as well).", 'mystickymenu'); ?></p>
582 </div>
583 <div class="mystickymenu-content-section sticky-class-sec">
584 <table>
585 <tr>
586 <td>
587 <label class="mysticky_title"><?php esc_html_e("Sticky Class", 'mystickymenu')?></label>
588 <br /><br />
589 <?php $nav_menus = wp_get_nav_menus();
590 $menu_locations = get_nav_menu_locations();
591 $locations = get_registered_nav_menus();
592 ?>
593 <select name="mysticky_option_name[mysticky_class_id_selector]" id="mystickymenu-select">
594 <option value=""><?php esc_html_e( 'Select Sticky Menu', 'mystickymenu' ); ?></option>
595
596 <?php foreach ( (array) $nav_menus as $_nav_menu ) : ?>
597 <option value="<?php echo esc_attr( $_nav_menu->slug ); ?>" <?php selected( $_nav_menu->slug, $mysticky_options['mysticky_class_id_selector'] ); ?>>
598 <?php
599 echo esc_html( $_nav_menu->name );
600
601 if ( ! empty( $menu_locations ) && in_array( $_nav_menu->term_id, $menu_locations ) ) {
602 $locations_assigned_to_this_menu = array();
603 foreach ( array_keys( $menu_locations, $_nav_menu->term_id ) as $menu_location_key ) {
604 if ( isset( $locations[ $menu_location_key ] ) ) {
605 $locations_assigned_to_this_menu[] = $locations[ $menu_location_key ];
606 }
607 }
608
609 /**
610 * Filters the number of locations listed per menu in the drop-down select.
611 *
612 * @since 3.6.0
613 *
614 * @param int $locations Number of menu locations to list. Default 3.
615 */
616 $assigned_locations = array_slice( $locations_assigned_to_this_menu, 0, absint( apply_filters( 'wp_nav_locations_listed_per_menu', 3 ) ) );
617
618 // Adds ellipses following the number of locations defined in $assigned_locations.
619 if ( ! empty( $assigned_locations ) ) {
620 printf(
621 ' (%1$s%2$s)',
622 implode( ', ', $assigned_locations ),
623 count( $locations_assigned_to_this_menu ) > count( $assigned_locations ) ? ' &hellip;' : ''
624 );
625 }
626 }
627 ?>
628 </option>
629 <?php endforeach; ?>
630 <option value="custom" <?php selected( 'custom', $mysticky_options['mysticky_class_id_selector'] ); ?>><?php esc_html_e( 'Other Class Or ID', 'mystickymenu' );?></option>
631 </select>
632
633 <input type="text" size="18" id="mysticky_class_selector" class="mystickyinput" name="mysticky_option_name[mysticky_class_selector]" value="<?php echo esc_attr($mysticky_options['mysticky_class_selector']);?>" />
634
635 <p class="description mystuckymenu-class-id">
636 <span class="dashicons dashicons-info"></span>&nbsp;
637 <span>
638 <?php echo sprintf(__('Need help finding your ID/Class? Install <a href="%1$s" target="_blank">CSS Peeper</a> to quickly get your navigation menu ID/Class. Here\'s a quick <a href="%2$s" target="_blank">video <span class="dashicons dashicons-controls-play"></span></a> of how you can do it.', 'mystickymenu'), 'https://chrome.google.com/webstore/detail/css-peeper/mbnbehikldjhnfehhnaidhjhoofhpehk?hl=en', 'https://www.youtube.com/watch?v=uuNqSkBPnLU');?>
639 </span>
640 </p>
641 </td>
642 <td>
643 <div class="mysticky_device_upgrade">
644 <label class="mysticky_title"><?php esc_html_e("Devices", 'mystickymenu')?></label>
645 <span class="myStickymenu-upgrade"><a class="sticky-header-upgrade" href="<?php echo esc_url($upgarde_url); ?>" target="_blank"><?php esc_html_e( 'Upgrade Now', 'mystickymenu' );?></a></span>
646
647 <ul class="mystickymenu-input-multicheckbox">
648 <li>
649 <label>
650 <input id="disable_css" name="mysticky_option_name[device_desktop]" type="checkbox" checked disabled />
651 <?php esc_html_e( 'Desktop', 'mystickymenu' );?>
652 </label>
653 </li>
654 <li>
655 <label>
656 <input id="disable_css" name="mysticky_option_name[device_mobile]" type="checkbox" checked disabled />
657 <?php esc_html_e( 'Mobile', 'mystickymenu' );?>
658 </label>
659 </li>
660 </ul>
661 </div>
662 </td>
663 </tr>
664 </table>
665 </div>
666 <div class="mystickymenu-content-section">
667 <h3><?php esc_html_e( 'Settings', 'mystickymenu' );?></h3>
668 <table class="form-table">
669 <tr>
670 <td>
671 <label for="myfixed_zindex" class="mysticky_title"><?php esc_html_e("Sticky z-index", 'mystickymenu')?></label>
672 </td>
673 <td>
674 <input type="number" min="0" max="2147483647" step="1" class="mysticky-number" id="myfixed_zindex" name="mysticky_option_name[myfixed_zindex]" value="<?php echo esc_attr($mysticky_options['myfixed_zindex']);?>" />
675 </td>
676 <td>
677 <label class="mysticky_title myssticky-remove-hand"><?php esc_html_e("Fade or slide effect", 'mystickymenu')?></label>
678 </td>
679 <td>
680 <label>
681 <input name="mysticky_option_name[myfixed_fade]" value= "slide" type="radio" <?php checked( @$mysticky_options['myfixed_fade'], 'slide' );?> />
682 <?php esc_html_e("Slide", 'mystickymenu'); ?>
683 </label>
684 <label>
685 <input name="mysticky_option_name[myfixed_fade]" value="fade" type="radio" <?php checked( @$mysticky_options['myfixed_fade'], 'fade' );?> />
686 <?php esc_html_e("Fade", 'mystickymenu'); ?>
687 </label>
688 </td>
689 </tr>
690 <tr>
691 <td>
692 <label for="myfixed_disable_small_screen" class="mysticky_title"><?php esc_html_e("Disable at Small Screen Sizes", 'mystickymenu')?></label>
693 <p class="description"><?php esc_attr_e('Less than chosen screen width, set 0 to disable','mystickymenu');?></p>
694 </td>
695 <td>
696 <div class="px-wrap">
697 <input type="number" class="" min="0" step="1" id="myfixed_disable_small_screen" name="mysticky_option_name[myfixed_disable_small_screen]" value="<?php echo esc_attr($mysticky_options['myfixed_disable_small_screen']);?>" />
698 <span class="input-px">PX</span>
699 </div>
700 </td>
701 <td>
702 <label for="mysticky_active_on_height" class="mysticky_title"><?php esc_html_e("Make visible on Scroll", 'mystickymenu')?></label>
703 <p class="description"><?php esc_attr_e('If set to 0 auto calculate will be used.','mystickymenu');?></p>
704 </td>
705 <td>
706 <div class="px-wrap">
707 <input type="number" class="small-text" min="0" step="1" id="mysticky_active_on_height" name="mysticky_option_name[mysticky_active_on_height]" value="<?php echo esc_attr($mysticky_options['mysticky_active_on_height']);?>" />
708 <span class="input-px">PX</span>
709 </div>
710 </td>
711 </tr>
712 <tr>
713 <td>
714 <label for="mysticky_active_on_height_home" class="mysticky_title"><?php esc_html_e("Make visible on Scroll at homepage", 'mystickymenu')?></label>
715 <p class="description"><?php esc_html_e( 'If set to 0 it will use initial Make visible on Scroll value.', 'mystickymenu' );?></p>
716 </td>
717 <td>
718 <div class="px-wrap">
719 <input type="number" class="small-text" min="0" step="1" id="mysticky_active_on_height_home" name="mysticky_option_name[mysticky_active_on_height_home]" value="<?php echo esc_attr($mysticky_options['mysticky_active_on_height_home']);;?>" />
720 <span class="input-px">PX</span>
721 </div>
722 </td>
723 <td>
724 <label for="myfixed_bgcolor" class="mysticky_title myssticky-remove-hand"><?php esc_html_e("Sticky Background Color", 'mystickymenu')?></label>
725 </td>
726 <td>
727 <input type="text" id="myfixed_bgcolor" name="mysticky_option_name[myfixed_bgcolor]" class="my-color-field" data-alpha="true" value="<?php echo esc_attr($mysticky_options['myfixed_bgcolor']);;?>" />
728
729 </td>
730 </tr>
731 <tr>
732 <td>
733 <label for="myfixed_transition_time" class="mysticky_title"><?php esc_html_e("Sticky Transition Time", 'mystickymenu')?></label>
734 </td>
735 <td>
736 <input type="number" class="small-text" min="0" step="0.1" id="myfixed_transition_time" name="mysticky_option_name[myfixed_transition_time]" value="<?php echo esc_attr($mysticky_options['myfixed_transition_time']);?>" />
737 </td>
738 <td>
739 <label for="myfixed_textcolor" class="mysticky_title myssticky-remove-hand"><?php esc_html_e("Sticky Text Color", 'mystickymenu')?></label>
740 </td>
741 <td>
742 <input type="text" id="myfixed_textcolor" name="mysticky_option_name[myfixed_textcolor]" class="my-color-field" data-alpha="true" value="<?php echo (isset($mysticky_options['myfixed_textcolor'])) ? esc_attr($mysticky_options['myfixed_textcolor']) : '';?>" />
743
744 </td>
745 </tr>
746 <tr>
747 <td>
748 <label for="myfixed_opacity" class="mysticky_title myssticky-remove-hand"><?php esc_html_e("Sticky Opacity", 'mystickymenu')?></label>
749 <p class="description"><?php esc_html_e( 'numbers 1-100.', 'mystickymenu');?></p>
750 </td>
751 <td>
752 <input type="hidden" class="small-text mysticky-slider" min="0" step="1" max="100" id="myfixed_opacity" name="mysticky_option_name[myfixed_opacity]" value="<?php echo esc_attr($mysticky_options['myfixed_opacity']);;?>" />
753 <div id="slider">
754 <div id="custom-handle" class="ui-slider-handle"><?php //echo esc_attr($mysticky_options['myfixed_opacity']);?></div>
755 </div>
756
757 </td>
758 </tr>
759 </table>
760 </div>
761
762 <div class="mystickymenu-content-section <?php echo !$is_old?"mystickymenu-content-upgrade":""?>" >
763
764 <div class="mystickymenu-content-option">
765 <label class="mysticky_title css-style-title"><?php esc_html_e("Hide on Scroll Down", 'mystickymenu'); ?></label>
766 <?php if(!$is_old) { ?><span class="myStickymenu-upgrade"><a class="sticky-header-upgrade" href="<?php echo esc_url($upgarde_url); ?>" target="_blank"><?php esc_html_e( 'Upgrade Now', 'mystickymenu' );?></a></span><?php } ?>
767 <p>
768 <label class="mysticky_text">
769 <input id="myfixed_disable_scroll_down" name="mysticky_option_name[myfixed_disable_scroll_down]" type="checkbox" <?php checked( @$mysticky_options['myfixed_disable_scroll_down'], 'on' );?> <?php echo !$is_old?"disabled":"" ?> />
770 <?php esc_html_e("Disable sticky menu at scroll down", 'mystickymenu'); ?>
771 </label>
772 </p>
773 </div>
774 <div class="mysticky-page-target-setting mystickymenu-content-option">
775 <label class="mysticky_title"><?php esc_attr_e('Page targeting', 'myStickymenu'); ?></label>
776 <div class="mystickymenu-input-section mystickymenu-page-target-wrap">
777 <div class="mysticky-welcomebar-setting-content-right">
778 <div class="mysticky-page-options" id="mysticky-welcomebar-page-options">
779 <?php $page_option = (isset($mysticky_options['mysticky_page_settings'])) ? $mysticky_options['mysticky_page_settings'] : array();
780 $url_options = array(
781 'page_contains' => 'pages that contain',
782 'page_has_url' => 'a specific page',
783 'page_start_with' => 'pages starting with',
784 'page_end_with' => 'pages ending with',
785 );
786
787 if(!empty($page_option) && is_array($page_option)) {
788 $count = 0;
789 foreach($page_option as $k=>$option) {
790 $count++;
791 ?>
792 <div class="mysticky-page-option <?php echo ( $k==count($page_option) ) ? "last":""; ?>">
793 <div class="url-content">
794 <div class="mysticky-welcomebar-url-select">
795 <select name="mysticky_option_name[mysticky_page_settings][<?php echo esc_attr($count); ?>][shown_on]" id="url_shown_on_<?php echo esc_attr($count); ?>_option">
796 <option value="show_on" <?php echo ($option['shown_on']=="show_on" ) ? "selected":"" ?> ><?php esc_html_e( 'Show on', 'mysticky' )?></option>
797 <option value="not_show_on" <?php echo ($option['shown_on']=="not_show_on" )? "selected":""; ?>><?php esc_html_e( "Don't show on", "mysticky" );?></option>
798 </select>
799 </div>
800 <div class="mysticky-welcomebar-url-option">
801 <select class="mysticky-url-options" name="mysticky_option_name[mysticky_page_settings][<?php echo esc_attr($count);; ?>][option]" id="url_rules_<?php echo esc_attr($count); ?>_option">
802 <option disabled value=""><?php esc_html_e( "Select Rule", "mysticky" );?></option>
803 <?php foreach($url_options as $key=>$value) {
804 $selected = ( isset($option['option']) && $option['option']==$key )?" selected='selected' ":"";
805 echo '<option ' . esc_attr($selected) . ' value="' . esc_attr($key) . '">' . esc_html($value) . '</option>';
806 } ?>
807 </select>
808 </div>
809 <div class="mysticky-welcomebar-url-box">
810 <span class='mysticky-welcomebar-url'><?php echo esc_url(site_url("/")); ?></span>
811 </div>
812 <div class="mysticky-welcomebar-url-values">
813 <input type="text" value="<?php echo esc_attr($option['value']) ?>" name="mysticky_option_name[mysticky_page_settings][<?php echo esc_attr($count); ?>][value]" id="url_rules_<?php echo esc_attr($count);; ?>_value" />
814 </div>
815 <div class="mysticky-welcomebar-url-buttons">
816 <a class="mysticky-remove-rule" href="#">x</a>
817 </div>
818 <div class="clear"></div>
819 </div>
820 </div>
821 <?php
822 }
823 }
824 ?>
825 </div>
826 <a href="#" class="create-rule" id="mysticky_create-rule"><?php esc_html_e( "Add Rule", "mystickymenu" );?></a>
827 </div>
828 <input type="hidden" id="mysticky_welcomebar_site_url" value="<?php echo esc_url(site_url("/")) ?>" />
829 <div class="mysticky-page-options-html" style="display: none;">
830 <div class="mysticky-page-option">
831 <div class="url-content">
832 <div class="mysticky-welcomebar-url-select">
833 <select name="" id="url_shown_on___count___option">
834 <option value="show_on"><?php esc_html_e("Show on", "mysticky" );?></option>
835 <option value="not_show_on"><?php esc_html_e("Don't show on", "mysticky" );?></option>
836 </select>
837 </div>
838 <div class="mysticky-welcomebar-url-option">
839 <select class="mysticky-url-options" name="" id="url_rules___count___option">
840 <option selected="selected" disabled value=""><?php esc_html_e("Select Rule", "mysticky" );?></option>
841 <?php foreach($url_options as $key=>$value) {
842 echo '<option value="'. esc_attr($key) . '">' . esc_html($value) . '</option>';
843 } ?>
844 </select>
845 </div>
846 <div class="mysticky-welcomebar-url-box">
847 <span class='mysticky-welcomebar-url'><?php echo esc_url(site_url("/")); ?></span>
848 </div>
849 <div class="mysticky-welcomebar-url-values">
850 <input type="text" value="" name="mysticky_option_name[mysticky_page_settings][__count__][value]" id="url_rules___count___value" disabled />
851 </div>
852 <div class="clear"></div>
853 </div>
854 <span class="myStickymenu-upgrade"><a class="sticky-header-upgrade" href="<?php echo esc_url($upgarde_url); ?>" target="_blank"><?php esc_html_e( 'Upgrade Now', 'mystickymenu' );?></a></span>
855 </div>
856 </div>
857 </div>
858 </div>
859 <div class="mystickymenu-content-option">
860 <label class="mysticky_title css-style-title"><?php esc_html_e("CSS style", 'mystickymenu'); ?></label>
861 <span class="mysticky_text"><?php esc_html_e( 'Add/edit CSS style. Leave it blank for default style.', 'mystickymenu');?></span>
862 <div class="mystickymenu-input-section">
863 <textarea type="text" rows="4" cols="60" id="myfixed_cssstyle" name="mysticky_option_name[myfixed_cssstyle]" <?php echo !$is_old?"disabled":"" ?> ><?php echo ( isset($mysticky_options['myfixed_cssstyle']) ) ? $mysticky_options['myfixed_cssstyle']: '';?></textarea>
864 </div>
865 <p><?php esc_html_e( "CSS ID's and Classes to use:", "mystickymenu" );?></p>
866 <p>
867 #mysticky-wrap { }<br/>
868 #mysticky-nav.wrapfixed { }<br/>
869 #mysticky-nav.wrapfixed.up { }<br/>
870 #mysticky-nav.wrapfixed.down { }<br/>
871 #mysticky-nav .navbar { }<br/>
872 #mysticky-nav .navbar.myfixed { }<br/>
873 </p>
874 </div>
875
876 <div class="mystickymenu-content-option">
877 <label class="mysticky_title" for="disable_css"><?php esc_html_e("Disable CSS style", 'mystickymenu'); ?></label>
878 <div class="mystickymenu-input-section">
879 <label>
880 <input id="disable_css" name="mysticky_option_name[disable_css]" type="checkbox" <?php echo !$is_old?"disabled":"" ?> <?php checked( @$mysticky_options['disable_css'], 'on' );?> />
881 <?php esc_html_e( 'Use this option if you plan to include CSS Style manually', 'mystickymenu' );?>
882 </label>
883 </div>
884 <p></p>
885 </div>
886
887 <div class="mystickymenu-content-option">
888 <label class="mysticky_title"><?php esc_html_e("Disable at", 'mystickymenu'); ?></label>
889 <?php if(!$is_old) { ?><span class="myStickymenu-upgrade"><a class="sticky-header-upgrade" href="<?php echo esc_url($upgarde_url); ?>" target="_blank"><?php esc_html_e( 'Upgrade Now', 'mystickymenu' );?></a></span><?php } ?>
890 <div class="mystickymenu-input-section">
891 <ul class="mystickymenu-input-multicheckbox">
892 <li>
893 <label>
894 <input id="mysticky_disable_at_front_home" name="mysticky_option_name[mysticky_disable_at_front_home]" type="checkbox" <?php echo !$is_old?"disabled":"" ?> <?php checked( @$mysticky_options['mysticky_disable_at_front_home'], 'on' );?>/>
895 <span><?php esc_attr_e('front page', 'mystickymenu' );?></span>
896 </label>
897 </li>
898 <li>
899 <label>
900 <input id="mysticky_disable_at_blog" name="mysticky_option_name[mysticky_disable_at_blog]" type="checkbox" <?php echo !$is_old?"disabled":"" ?> <?php checked( @$mysticky_options['mysticky_disable_at_blog'], 'on' );?>/>
901 <span><?php esc_attr_e('blog page', 'mystickymenu' );?></span>
902 </label>
903 </li>
904 <li>
905 <label>
906 <input id="mysticky_disable_at_page" name="mysticky_option_name[mysticky_disable_at_page]" type="checkbox" <?php echo !$is_old?"disabled":"" ?> <?php checked( @$mysticky_options['mysticky_disable_at_page'], 'on' );?> />
907 <span><?php esc_attr_e('pages', 'mystickymenu' );?> </span>
908 </label>
909 </li>
910 <li>
911 <label>
912 <input id="mysticky_disable_at_tag" name="mysticky_option_name[mysticky_disable_at_tag]" type="checkbox" <?php echo !$is_old?"disabled":"" ?> <?php checked( @$mysticky_options['mysticky_disable_at_tag'], 'on' );?> />
913 <span><?php esc_attr_e('tags', 'mystickymenu' );?> </span>
914 </label>
915 </li>
916 <li>
917 <label>
918 <input id="mysticky_disable_at_category" name="mysticky_option_name[mysticky_disable_at_category]" type="checkbox" <?php echo !$is_old?"disabled":"" ?> <?php checked( @$mysticky_options['mysticky_disable_at_category'], 'on' );?>/>
919 <span><?php esc_attr_e('categories', 'mystickymenu' );?></span>
920 </label>
921 </li>
922 <li>
923 <label>
924 <input id="mysticky_disable_at_single" name="mysticky_option_name[mysticky_disable_at_single]" type="checkbox" <?php echo !$is_old?"disabled":"" ?> <?php checked( @$mysticky_options['mysticky_disable_at_single'], 'on' );?> />
925 <span><?php esc_attr_e('posts', 'mystickymenu' );?> </span>
926 </label>
927 </li>
928 <li>
929 <label>
930 <input id="mysticky_disable_at_archive" name="mysticky_option_name[mysticky_disable_at_archive]" type="checkbox" <?php echo !$is_old?"disabled":"" ?> <?php checked( @$mysticky_options['mysticky_disable_at_archive'], 'on' );?> />
931 <span><?php esc_attr_e('archives', 'mystickymenu' );?> </span>
932 </label>
933 </li>
934 <li>
935 <label>
936 <input id="mysticky_disable_at_search" name="mysticky_option_name[mysticky_disable_at_search]" type="checkbox" <?php echo !$is_old?"disabled":"" ?> <?php checked( @$mysticky_options['mysticky_disable_at_search'], 'on' );?> />
937 <span><?php esc_attr_e('search', 'mystickymenu' );?> </span>
938 </label>
939 </li>
940 <li>
941 <label>
942 <input id="mysticky_disable_at_404" name="mysticky_option_name[mysticky_disable_at_404]" type="checkbox" <?php echo !$is_old?"disabled":"" ?> <?php checked( @$mysticky_options['mysticky_disable_at_404'], 'on' );?>/>
943 <span><?php esc_attr_e('404', 'mystickymenu' );?> </span>
944 </label>
945 </li>
946 </ul>
947
948 <?php
949 if (isset ( $mysticky_options['mysticky_disable_at_page'] ) == true ) {
950 echo '<div class="mystickymenu-input-section">';
951 _e('<span class="description"><strong>Except for this pages:</strong> </span>', 'mystickymenu');
952
953 printf(
954 '<input disabled type="text" size="26" class="mystickymenu_normal_text" id="mysticky_enable_at_pages" name="mysticky_option_name[mysticky_enable_at_pages]" value="%s" /> ',
955 isset( $mysticky_options['mysticky_enable_at_pages'] ) ? esc_attr( $mysticky_options['mysticky_enable_at_pages']) : ''
956 );
957
958 _e('<span class="description">Comma separated list of pages to enable. It should be page name, id or slug. Example: about-us, 1134, Contact Us. Leave blank if you realy want to disable sticky menu for all pages.</span>', 'mystickymenu');
959 echo '</div>';
960 }
961
962 if (isset ( $mysticky_options['mysticky_disable_at_single'] ) == true ) {
963
964 echo '<div class="mystickymenu-input-section">';
965 _e('<span class="description"><strong>Except for this posts:</strong> </span>', 'mystickymenu');
966
967 printf(
968 '<input disabled type="text" size="26" class="mystickymenu_normal_text" id="mysticky_enable_at_posts" name="mysticky_option_name[mysticky_enable_at_posts]" value="%s" /> ',
969 isset( $mysticky_options['mysticky_enable_at_posts'] ) ? esc_attr( $mysticky_options['mysticky_enable_at_posts']) : ''
970 );
971
972 _e('<span class="description">Comma separated list of posts to enable. It should be post name, id or slug. Example: about-us, 1134, Contact Us. Leave blank if you realy want to disable sticky menu for all posts.</span>', 'mystickymenu');
973 echo '</div>';
974
975 }
976 ?>
977 <p></p>
978 </div>
979 </div>
980 </div>
981
982 <!-- Mysticky Menu: Save & Save Dashbaord Submission Validation Popup -->
983
984 <div class="mystickymenu-action-popup new-center" id="mysticky-sticky-save-confirm" style="display:none;">
985 <div class="mystickymenu-action-popup-header">
986 <h3><?php esc_html_e("Turn on Sticky Menu","mystickymenu"); ?></h3>
987 <span class="dashicons dashicons-no-alt close-button" data-from = "stickymenu-confirm"></span>
988 </div>
989 <div class="mystickymenu-action-popup-body">
990 <p><?php esc_html_e("Sticky Menu is not turned on. Turn on Sticky Menu to activate sticky menu on your website.","mystickymenu"); ?></p>
991 </div>
992 <div class="mystickymenu-action-popup-footer">
993 <button type="button" class="btn-enable btn-nevermind-status" id="stickymenu_status_dolater" ><?php esc_html_e("Just save & keep it off","mystickymenu"); ?></button>
994 <button type="button" class="btn-disable-cancel" id="stickymenu_status_ok" ><?php esc_html_e("Save & Turn on Sticky Menu","mystickymenu"); ?></button>
995 </div>
996 </div>
997 <div class="mystickymenupopup-overlay" id="stickymenu-option-overlay-popup"></div>
998
999 <!-- End Save & Save Dashbaord Submission Validation Popup -->
1000
1001 <p class="submit">
1002 <input type="submit" name="submit" id="submit" class="button button-primary btn-save-stickymenu" value="<?php esc_attr_e('Save', 'mystickymenu');?>">
1003
1004 <input type="submit" name="submit" id="submit" class="button button-primary save_view_dashboard" style="width: auto;" value="<?php esc_html_e('SAVE & VIEW DASHBOARD', 'mystickymenu');?>">
1005 </p>
1006 <input type="hidden" name="nonce" value="<?php echo esc_attr($nonce); ?>">
1007 <input type="hidden" id="save_stickymenu" value=""/>
1008 </form>
1009 <form class="mysticky-hideformreset" method="post" action="">
1010 <input name="reset_mysticky_options" class="button button-secondary confirm" type="submit" value="<?php esc_attr_e('Reset', 'mystickymenu');?>" >
1011 <input type="hidden" name="action" value="reset" />
1012 <?php $nonce = wp_create_nonce('mysticky_option_backend_reset_nonce'); ?>
1013 <input type="hidden" name="nonce" value="<?php echo esc_attr($nonce); ?>">
1014 </form>
1015 <p class="myStickymenu-review"><a href="https://wordpress.org/support/plugin/mystickymenu/reviews/" target="_blank"><?php esc_attr_e('Leave a review','mystickymenu'); ?></a></p>
1016 </div>
1017 </div>
1018 <?php }
1019 }
1020
1021
1022 public function mystickystickymenu_admin_welcomebar_page() {
1023
1024 $is_shown = myStickyMenu_SIGNUP_CLASS::check_modal_status();
1025 if($is_shown) {
1026 include_once MYSTICKYMENU_PATH . 'admin/email-signup.php';
1027 return;
1028 }
1029
1030
1031 /*
1032 DATE : 2022-08-04
1033 Welcome bar save data function
1034 */
1035 if (isset($_POST['mysticky_option_welcomebar']) && !empty($_POST['mysticky_option_welcomebar']) && isset($_POST['nonce'])) {
1036 if(!empty($_POST['nonce']) && wp_verify_nonce($_POST['nonce'], 'mysticky_option_welcomebar_update')) {
1037
1038
1039 $widgets = get_option( 'mysticky_option_welcomebar' );
1040
1041 $is_first_widget = 0;
1042 if( isset($widgets) && $widgets == '' ){
1043 $is_first_widget = 1;
1044 }
1045
1046
1047
1048 $welcomebars_widgets[0] = 'Bar #0';
1049 update_option( 'mystickymenu-welcomebars', $welcomebars_widgets );
1050
1051 $mysticky_option_welcomebar = mysticky_bar_sanitize_options($_POST['mysticky_option_welcomebar']);
1052
1053 $mysticky_option_welcomebar['mysticky_welcomebar_bar_text'] = wp_kses(stripslashes($_POST['mysticky_option_welcomebar']['mysticky_welcomebar_bar_text']) , [
1054 'a' => array(
1055 'href' => array(),
1056 'title' => array(),
1057 'rel' => array(),
1058 'target' => array()
1059 ),
1060 'p' => array(
1061 'style' => array(),
1062 ),
1063 'br' => array(),
1064 'em' => array(),
1065 'u' => array(),
1066 'strong' => array(),
1067 ]);
1068 $mysticky_option_welcomebar['mysticky_welcomebar_thankyou_screen_text'] = wp_kses(stripslashes($_POST['mysticky_option_welcomebar']['mysticky_welcomebar_thankyou_screen_text']) , [
1069 'a' => array(
1070 'href' => array(),
1071 'title' => array(),
1072 'rel' => array(),
1073 'target' => array()
1074 ),
1075 'p' => array(
1076 'style' => array(),
1077 ),
1078 'br' => array(),
1079 'em' => array(),
1080 'u' => array(),
1081 'strong' => array(),
1082 ]);
1083 $mysticky_option_welcomebar['mysticky_welcomebar_height'] = 60;
1084 $mysticky_option_welcomebar['mysticky_welcomebar_device_desktop'] = 'desktop';
1085 $mysticky_option_welcomebar['mysticky_welcomebar_device_mobile'] = 'mobile';
1086 $mysticky_option_welcomebar['mysticky_welcomebar_trigger'] = 'after_a_few_seconds';
1087 $mysticky_option_welcomebar['mysticky_welcomebar_triggersec'] = '0';
1088 $mysticky_option_welcomebar['mysticky_welcomebar_expirydate'] = '';
1089 $mysticky_option_welcomebar['mysticky_welcomebar_page_settings'] = '';
1090 $mysticky_option_welcomebar['mysticky_welcomebar_text_type'] = 'static_text';
1091
1092 update_option( 'mysticky_option_welcomebar', $mysticky_option_welcomebar);
1093
1094 $this->mysticky_clear_all_caches();
1095
1096 if(isset($_POST['submit']) && ( $_POST['submit'] == 'SAVE & VIEW DASHBOARD' || $_POST['submit']== '' ) ){
1097 if ( isset($is_first_widget) && $is_first_widget == 1 ) { ?>
1098 <script>
1099 window.location.href = '<?php echo admin_url("admin.php?page=my-stickymenu-welcomebar&first_widget=".$is_first_widget);?>';
1100 </script>
1101 <?php } else { ?>
1102 <script>
1103 window.location.href = '<?php echo admin_url("admin.php?page=my-stickymenu-welcomebar");?>';
1104 </script>
1105 <?php
1106 }
1107 } else {
1108
1109 if ( isset($is_first_widget) && $is_first_widget == 1 ) { ?>
1110 <script>
1111 window.location.href = '<?php echo admin_url("admin.php?page=my-stickymenu-welcomebar&widget=0&isedit=1&first_widget=".$is_first_widget);?>';
1112 </script>
1113 <?php } else { ?>
1114 <script>
1115 window.location.href = '<?php echo admin_url("admin.php?page=my-stickymenu-welcomebar&widget=0&isedit=1");?>';
1116 </script>
1117 <?php
1118 }
1119 }
1120 echo '<div class="updated settings-error notice is-dismissible "><p><strong>' . esc_html__('Settings saved.','mystickymenu'). '</p></strong></div>';
1121 } else {
1122 wp_verify_nonce($_GET['nonce'], 'wporg_frontend_delete');
1123 echo '<div class="error settings-error notice is-dismissible "><p><strong>' . esc_html__('Unable to complete your request','mystickymenu'). '</p></strong></div>';
1124 }
1125 }
1126
1127
1128
1129 if (isset($_POST['mysticky_welcomebar_reset']) && !empty($_POST['mysticky_welcomebar_reset']) && isset($_POST['nonce_reset'])) {
1130 if(!empty($_POST['nonce_reset']) && wp_verify_nonce($_POST['nonce_reset'], 'mysticky_option_welcomebar_reset')) {
1131 $mysticky_option_welcomebar_reset = mysticky_welcomebar_pro_widget_default_fields();
1132 update_option( 'mysticky_option_welcomebar', $mysticky_option_welcomebar_reset);
1133 $this->mysticky_clear_all_caches();
1134 echo '<div class="updated settings-error notice is-dismissible "><p><strong>' . esc_html__('Reset Settings saved.','mystickymenu'). '</p></strong></div>';
1135 } else {
1136 wp_verify_nonce($_GET['nonce'], 'wporg_frontend_delete');
1137 echo '<div class="error settings-error notice is-dismissible "><p><strong>' . esc_html__('Unable to complete your request','mystickymenu'). '</p></strong></div>';
1138 }
1139 }
1140
1141
1142
1143 $mysticky_options = get_option( 'mysticky_option_name');
1144 $is_old = get_option("has_sticky_header_old_version");
1145 $is_old = ($is_old == "yes") ? true : false;
1146 $nonce = wp_create_nonce('mysticky_option_backend_update');
1147 $pro_url = "https://go.premio.io/?edd_action=add_to_cart&download_id=2199&edd_options[price_id]=";
1148
1149 ?>
1150 <style>
1151 div#wpcontent {
1152 background: rgba(101,114,219,1);
1153 background: -moz-linear-gradient(-45deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
1154 background: -webkit-gradient(left top, right bottom, color-stop(0%, rgba(101,114,219,1)), color-stop(67%, rgba(238,134,198,1)), color-stop(100%, rgba(238,134,198,1)));
1155 background: -webkit-linear-gradient(-45deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
1156 background: -o-linear-gradient(-45deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
1157 background: -ms-linear-gradient(-45deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
1158 background: linear-gradient(135deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
1159 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6572db', endColorstr='#ee86c6', GradientType=1 );
1160 }
1161 </style>
1162 <div id="mystickymenu" class="wrap mystickymenu">
1163
1164 <div id="sticky-header-welcome-bar" class="sticky-header-content">
1165 <?php
1166
1167 $welcomebars_widgets = get_option( 'mysticky_option_welcomebar' );
1168 if ( !isset($_GET['widget']) && isset( $_GET['page'] ) && $_GET['page'] == 'my-stickymenu-welcomebar' ) {
1169 include_once( 'admin/stickymenu-dashboard.php');
1170 }elseif ( !isset($_GET['isedit']) && !isset($_GET['save']) && isset($welcomebars_widgets) && !empty($welcomebars_widgets) ) {
1171 ?>
1172 <div id="mystickymenu" class="wrap mystickymenu mystickymenu-new-widget-wrap">
1173 <?php include_once dirname(__FILE__) . '/mystickymeny-new-welcomebar.php';?>
1174 </div>
1175 <?php
1176 }else{
1177 include_once( 'admin/bar-settings.php');
1178 //mysticky_welcome_bar_backend();
1179 }
1180
1181 if( isset($_GET['first_widget']) && $_GET['first_widget'] == 1 ) : ?>
1182
1183 <div class="main-popup-mystickymenu-bg first-widget-popup">
1184 <div class="main-popup-mystickymenu-bg mystickymenu_container_popupbox">
1185 <div class="firstwidget-popup-contain">
1186 <img src="<?php echo esc_url( MYSTICKYMENU_URL .'/images/firstwidget_congratulations.svg');?>">
1187 <h4>Congratulations! 🎉</h4>
1188 <p> Your first widget is now up and running on your website!</p>
1189 <div class="first-widget-popup-contant">
1190 <h4><?php esc_html_e('Upgrade to pro today','mystickyelement'); ?></h4>
1191 <p> <?php esc_html_e('🎨 Display coupon codes and add sliding text to the widget.','mystickyelement') ?> </p>
1192 <p> <?php esc_html_e('📱 Create multiple widgets for different devices, pages and languages.','mystickyelement') ?> </p>
1193 <p> <?php esc_html_e('🎯 Targeting by country, page, and device','mystickyelement') ?> </p>
1194 <p> <?php esc_html_e('⏱️ Add a countdown timer to increase the conversion rate','mystickyelement') ?> </p>
1195 </div>
1196 <a href="<?php echo esc_url(admin_url("admin.php?page=my-stickymenu-upgrade"));?>" class="mystickymenu btn-black btn-back-dashboard"><?php esc_html_e('Upgrade to Pro','mystickyelement');?></a><br>
1197 <a href="#" class="mystickymenu btn-black btn-dashboard btn-close-dashboard"><?php esc_html_e('Close','mystickyelement');?></a>
1198
1199 </div>
1200 <div class="popup-modul-close-btn firstwidget-model">
1201 <a href="#" class="close-chaty-maxvisitor-popup" id="close-first-popup">
1202 <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15 5L5 15" stroke="#4A4A4A" stroke-width="2.08" stroke-linecap="round" stroke-linejoin="round"/><path d="M5 5L15 15" stroke="#4A4A4A" stroke-width="2.08" stroke-linecap="round" stroke-linejoin="round"/></svg>
1203 </a>
1204 </div>
1205 </div>
1206 </div>
1207 <div class="mystickymenupopup-overlay" id="first_widget_overlay" style="display:block;"></div>
1208
1209 <?php endif; ?>
1210 </div>
1211 </div>
1212 <?php
1213 require_once MYSTICKYMENU_PATH . 'mystickymenu-review-popup.php';
1214 }
1215
1216 public function mystickystickymenu_admin_new_welcomebar_page() {
1217
1218 $is_shown = myStickyMenu_SIGNUP_CLASS::check_modal_status();
1219 if($is_shown) {
1220 include_once MYSTICKYMENU_PATH . 'admin/email-signup.php';
1221 return;
1222 }
1223
1224 $welcomebars_widgets = get_option( 'mysticky_option_welcomebar' );
1225 if( isset($welcomebars_widgets) && !empty($welcomebars_widgets)){
1226 ?>
1227 <div id="mystickymenu" class="wrap mystickymenu mystickymenu-new-widget-wrap">
1228 <?php include_once dirname(__FILE__) . '/mystickymeny-new-welcomebar.php';?>
1229 </div>
1230 <?php
1231 }else{ ?>
1232 <div id="mystickymenu" class="wrap mystickymenu">
1233 <div id="sticky-header-welcome-bar" class="sticky-header-content">
1234 <?php
1235 include_once( 'admin/bar-settings.php');
1236 //mysticky_welcome_bar_backend(); ?>
1237 </div>
1238 </div>
1239 <?php
1240 }
1241
1242 }
1243 public function mystickymenu_manage_poptin_plugin() {
1244 ?>
1245 <script>
1246 window.location.href= '<?php echo admin_url( "admin.php?page=poptin" )?>'
1247 </script>
1248 <?php
1249 exit;
1250 }
1251 public function mystickymenu_install_poptin_plugin() {
1252 include_once 'admin/poptin-plugin.php';
1253 }
1254 public function mystickymenu_admin_widget_analytics_page(){
1255
1256 $is_shown = myStickyMenu_SIGNUP_CLASS::check_modal_status();
1257 if($is_shown) {
1258 include_once MYSTICKYMENU_PATH . 'admin/email-signup.php';
1259 return;
1260 } else {
1261 include('mystickymenu-admin-widgetanalytics.php');
1262 }
1263 }
1264
1265 public function mystickymenu_recommended_plugins() {
1266 $is_shown = myStickyMenu_SIGNUP_CLASS::check_modal_status();
1267 if($is_shown) {
1268 include_once MYSTICKYMENU_PATH . 'admin/email-signup.php';
1269 return;
1270 } else {
1271 include_once 'recommended-plugins.php';
1272 }
1273 }
1274
1275 public function mystickymenu_admin_upgrade_to_pro() {
1276 $is_shown = myStickyMenu_SIGNUP_CLASS::check_modal_status();
1277 if($is_shown) {
1278 include_once MYSTICKYMENU_PATH . 'admin/email-signup.php';
1279 return;
1280 } else {
1281
1282 $pro_url = "https://go.premio.io/checkount/?edd_action=add_to_cart&download_id=2199&edd_options[price_id]=";
1283 ?>
1284 <style>
1285 div#wpcontent {
1286 background: rgba(101,114,219,1);
1287 background: -moz-linear-gradient(-45deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
1288 background: -webkit-gradient(left top, right bottom, color-stop(0%, rgba(101,114,219,1)), color-stop(67%, rgba(238,134,198,1)), color-stop(100%, rgba(238,134,198,1)));
1289 background: -webkit-linear-gradient(-45deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
1290 background: -o-linear-gradient(-45deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
1291 background: -ms-linear-gradient(-45deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
1292 background: linear-gradient(135deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
1293 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6572db', endColorstr='#ee86c6', GradientType=1 );
1294 }
1295 </style>
1296 <div id="mystickymenu" class="wrap mystickymenu">
1297 <?php include_once "upgrade-to-pro.php"; ?>
1298 </div>
1299 <?php
1300 }
1301
1302 }
1303
1304 public function mysticky_default_options() {
1305
1306 global $options;
1307 $menu_locations = get_nav_menu_locations();
1308 $menu_object = isset($menu_locations['menu-1']) ? wp_get_nav_menu_object( $menu_locations['menu-1'] ) : array();
1309
1310 if ( is_object($menu_object) && $menu_object->slug != '' ) {
1311 $mysticky_class_id_selector = $menu_object->slug;
1312 } else {
1313 $mysticky_class_id_selector = 'custom';
1314 }
1315
1316 $mystickyClass = '.navbar';
1317 $template_name = get_template();
1318 switch( $template_name ){
1319 case 'ashe':
1320 $mysticky_class_id_selector = 'custom';
1321 $mystickyClass = '#main-nav';
1322 break;
1323 case 'astra':
1324 case 'hello-elementor':
1325 case 'sydney':
1326 case 'twentysixteen':
1327 $mysticky_class_id_selector = 'custom';
1328 $mystickyClass = 'header.site-header';
1329 break;
1330 case 'generatepress':
1331 $mysticky_class_id_selector = 'custom';
1332 $mystickyClass = 'nav.main-navigation';
1333 break;
1334 case 'transportex':
1335 $mysticky_class_id_selector = 'custom';
1336 $mystickyClass = '.transportex-menu-full';
1337 break;
1338 case 'hestia':
1339 case 'neve':
1340 $mysticky_class_id_selector = 'custom';
1341 $mystickyClass = 'header.header';
1342 break;
1343 case 'mesmerize':
1344 $mysticky_class_id_selector = 'custom';
1345 $mystickyClass = '.navigation-bar';
1346 break;
1347 case 'oceanwp':
1348 $mysticky_class_id_selector = 'custom';
1349 $mystickyClass = 'header#site-header';
1350 break;
1351 case 'shapely':
1352 $mysticky_class_id_selector = 'custom';
1353 $mystickyClass = '#site-navigation';
1354 break;
1355 case 'storefront':
1356 $mysticky_class_id_selector = 'custom';
1357 $mystickyClass = '.storefront-primary-navigation';
1358 break;
1359 case 'twentynineteen':
1360 $mysticky_class_id_selector = 'custom';
1361 $mystickyClass = '#site-navigation';
1362 break;
1363 case 'twentyseventeen':
1364 $mysticky_class_id_selector = 'custom';
1365 $mystickyClass = '.navigation-top';
1366 break;
1367 default:
1368 break;
1369 }
1370
1371 $default = array(
1372 'mysticky_class_id_selector' => $mysticky_class_id_selector,
1373 'mysticky_class_selector' => $mystickyClass,
1374 'device_desktop' => 'on',
1375 'device_mobile' => 'on',
1376 'myfixed_zindex' => '99990',
1377 'myfixed_bgcolor' => '#f7f5e7',
1378 'myfixed_opacity' => '90',
1379 'myfixed_transition_time' => '0.3',
1380 'myfixed_disable_small_screen' => '0',
1381 'myfixed_disable_large_screen' => '0',
1382 'mysticky_active_on_height' => '0',
1383 'mysticky_active_on_height_home'=> '0',
1384 'myfixed_fade' => 'slide',
1385 'myfixed_cssstyle' => '#mysticky-nav .myfixed { margin:0 auto; float:none; border:0px; background:none; max-width:100%; }'
1386 );
1387
1388 if ( get_option('mysticky_option_name') == false && current_user_can( 'manage_options' ) ) {
1389 $status = get_option("sticky_header_status");
1390 if($status == false) {
1391 update_option("sticky_header_status", "done");
1392 update_option("has_sticky_header_old_version", "no");
1393 }
1394 update_option( 'mysticky_option_name', $default );
1395 } else {
1396 $status = get_option("sticky_header_status");
1397 if($status == false) {
1398 update_option("sticky_header_status", "done");
1399 update_option("has_sticky_header_old_version", "yes");
1400 }
1401 }
1402
1403 if(isset($_POST['reset_mysticky_options']) && current_user_can( 'manage_options' )) {
1404 if(isset($_REQUEST['nonce']) && !empty($_REQUEST['nonce']) && wp_verify_nonce($_REQUEST['nonce'], 'mysticky_option_backend_reset_nonce')) {
1405 update_option('mysticky_option_name', $default);
1406 } else {
1407
1408 }
1409 }
1410
1411 if ( !get_option( 'update_mysticky_version_2_6') && current_user_can( 'manage_options' )) {
1412 $mysticky_option_name = get_option( 'mysticky_option_name' );
1413 $mysticky_option_name['mysticky_class_id_selector'] = 'custom';
1414 if ($mysticky_option_name['myfixed_fade'] == 'on'){
1415 $mysticky_option_name['myfixed_fade'] = 'slide';
1416 }else{
1417 $mysticky_option_name['myfixed_fade'] = 'fade';
1418 }
1419 update_option( 'mysticky_option_name', $mysticky_option_name );
1420 update_option( 'update_mysticky_version_2_6', true );
1421 }
1422
1423 if ( !get_option( 'update_mysticky_version_2_5_7') && current_user_can( 'manage_options' )) {
1424 $mysticky_option_name = get_option( 'mysticky_option_name' );
1425 $mysticky_option_name['stickymenu_enable'] = 1;
1426 update_option( 'mysticky_option_name', $mysticky_option_name );
1427 update_option( 'update_mysticky_version_2_5_7', true );
1428 }
1429 }
1430
1431 /*
1432 * clear cache when any option is updated
1433 *
1434 */
1435 public function mysticky_clear_all_caches(){
1436
1437 try {
1438 global $wp_fastest_cache;
1439
1440 // if W3 Total Cache is being used, clear the cache
1441 if (function_exists('w3tc_flush_all')) {
1442 w3tc_flush_all();
1443 }
1444 /* if WP Super Cache is being used, clear the cache */
1445 if (function_exists('wp_cache_clean_cache')) {
1446 global $file_prefix, $supercachedir;
1447 if (empty($supercachedir) && function_exists('get_supercache_dir')) {
1448 $supercachedir = get_supercache_dir();
1449 }
1450 wp_cache_clean_cache($file_prefix);
1451 }
1452
1453 if (class_exists('WpeCommon')) {
1454 //be extra careful, just in case 3rd party changes things on us
1455 if (method_exists('WpeCommon', 'purge_memcached')) {
1456 //WpeCommon::purge_memcached();
1457 }
1458 if (method_exists('WpeCommon', 'clear_maxcdn_cache')) {
1459 //WpeCommon::clear_maxcdn_cache();
1460 }
1461 if (method_exists('WpeCommon', 'purge_varnish_cache')) {
1462 //WpeCommon::purge_varnish_cache();
1463 }
1464 }
1465
1466 if (method_exists('WpFastestCache', 'deleteCache') && !empty($wp_fastest_cache)) {
1467 $wp_fastest_cache->deleteCache();
1468 }
1469 if (function_exists('rocket_clean_domain')) {
1470 rocket_clean_domain();
1471 // Preload cache.
1472 if (function_exists('run_rocket_sitemap_preload')) {
1473 run_rocket_sitemap_preload();
1474 }
1475 }
1476
1477 if (class_exists("autoptimizeCache") && method_exists("autoptimizeCache", "clearall")) {
1478 autoptimizeCache::clearall();
1479 }
1480
1481 if (class_exists("LiteSpeed_Cache_API") && method_exists("autoptimizeCache", "purge_all")) {
1482 LiteSpeed_Cache_API::purge_all();
1483 }
1484
1485 if ( class_exists( '\Hummingbird\Core\Utils' ) ) {
1486
1487 $modules = \Hummingbird\Core\Utils::get_active_cache_modules();
1488 foreach ( $modules as $module => $name ) {
1489 $mod = \Hummingbird\Core\Utils::get_module( $module );
1490
1491 if ( $mod->is_active() ) {
1492 if ( 'minify' === $module ) {
1493 $mod->clear_files();
1494 } else {
1495 $mod->clear_cache();
1496 }
1497 }
1498 }
1499 }
1500
1501 } catch (Exception $e) {
1502 return 1;
1503 }
1504 }
1505
1506 public function mystickymenu_deactivate() {
1507 global $pagenow;
1508
1509 if ( 'plugins.php' !== $pagenow ) {
1510 return;
1511 }
1512 include dirname(__FILE__) . "/mystickymenu-deactivate-form.php";
1513 }
1514 public function mystickymenu_plugin_deactivate() {
1515 global $current_user;
1516 if ( ! current_user_can( 'manage_options' ) ) {
1517 wp_die(0);
1518 }
1519 check_ajax_referer( 'mystickymenu_deactivate_nonce', 'nonce' );
1520
1521 $postData = $_POST;
1522 $errorCounter = 0;
1523 $response = array();
1524 $response['status'] = 0;
1525 $response['message'] = "";
1526 $response['valid'] = 1;
1527 if(!isset($postData['reason']) || empty($postData['reason'])) {
1528 $errorCounter++;
1529 $response['message'] = "Please provide reason";
1530 } else if(!isset($postData['reason']) || empty($postData['reason'])) {
1531 $errorCounter++;
1532 $response['message'] = "Please provide reason";
1533 } else {
1534 $nonce = $postData['nonce'];
1535 if(!wp_verify_nonce($nonce, 'mystickymenu_deactivate_nonce')) {
1536 $response['message'] = __("Your request is not valid", "mystickymenu");
1537 $errorCounter++;
1538 $response['valid'] = 0;
1539 }
1540 }
1541 if($errorCounter == 0) {
1542 global $current_user;
1543 $plugin_info = get_plugin_data( dirname(__FILE__) . "/mystickymenu.php" );
1544 $postData = $_POST;
1545 $email = "none@none.none";
1546
1547 if (isset($postData['email_id']) && !empty($postData['email_id']) && filter_var($postData['email_id'], FILTER_VALIDATE_EMAIL)) {
1548 $email = $postData['email_id'];
1549 }
1550 $domain = site_url();
1551 $user_name = $current_user->first_name . " " . $current_user->last_name;
1552
1553 $response['status'] = 1;
1554
1555 /* sending message to Crisp */
1556 $post_message = array();
1557
1558 $message_data = array();
1559 $message_data['key'] = "Plugin";
1560 $message_data['value'] = "My Sticky Bar";
1561 $post_message[] = $message_data;
1562
1563 $message_data = array();
1564 $message_data['key'] = "Plugin Version";
1565 $message_data['value'] = $plugin_info['Version'];
1566 $post_message[] = $message_data;
1567
1568 $message_data = array();
1569 $message_data['key'] = "Domain";
1570 $message_data['value'] = $domain;
1571 $post_message[] = $message_data;
1572
1573 $message_data = array();
1574 $message_data['key'] = "Email";
1575 $message_data['value'] = $email;
1576 $post_message[] = $message_data;
1577
1578 $message_data = array();
1579 $message_data['key'] = "WordPress Version";
1580 $message_data['value'] = esc_attr(get_bloginfo('version'));
1581 $post_message[] = $message_data;
1582
1583 $message_data = array();
1584 $message_data['key'] = "PHP Version";
1585 $message_data['value'] = PHP_VERSION;
1586 $post_message[] = $message_data;
1587
1588 $message_data = array();
1589 $message_data['key'] = "Message";
1590 $message_data['value'] = $postData['reason'];
1591 $post_message[] = $message_data;
1592
1593 $api_params = array(
1594 'domain' => $domain,
1595 'email' => $email,
1596 'url' => site_url(),
1597 'name' => $user_name,
1598 'message' => $post_message,
1599 'plugin' => "My Sticky Bar",
1600 'type' => "Uninstall",
1601 );
1602
1603 /* Sending message to Crisp API */
1604 $crisp_response = wp_safe_remote_post("https://premioapps.com/premio/send-message-api.php", array('body' => $api_params, 'timeout' => 15, 'sslverify' => true));
1605
1606 if (is_wp_error($crisp_response)) {
1607 wp_safe_remote_post("https://premioapps.com/premio/send-message-api.php", array('body' => $api_params, 'timeout' => 15, 'sslverify' => false));
1608 }
1609 }
1610 echo json_encode($response);
1611 wp_die();
1612 }
1613
1614 /* *
1615 * Mysticky Menu : Contact Lead function for show all the lead which send by user.
1616 * DATE : 2022-08-04
1617 * */
1618
1619 public function mystickymenu_admin_leads_page(){
1620 global $wpdb;
1621 $is_shown = myStickyMenu_SIGNUP_CLASS::check_modal_status();
1622 if($is_shown) {
1623 include_once MYSTICKYMENU_PATH . 'admin/email-signup.php';
1624 return;
1625 }
1626 $where_search = '';
1627 $table_name = $wpdb->prefix . "mystickymenu_contact_lists";
1628 $elements_widgets = get_option( 'mystickymenu-welcomebars' );
1629
1630 $custom_fields = array();
1631 if ( !empty($elements_widgets)) {
1632 foreach( $elements_widgets as $key=>$value) {
1633 $widget_no = '-'.$key;
1634 if ( $key == 0 ) {
1635 $widget_no = '';
1636 }
1637 }
1638 }
1639
1640 $download_file_url = plugins_url('mystickymenu-contact-leads.php?download_file=mystickybar_contact_leads.csv',__FILE__);
1641 ?>
1642 <!-- /**/ */ -->
1643 <div class="wrap mystickymenu-contact-wrap">
1644 <h2><?php esc_html_e( 'Contact Form Leads', 'mystickymenu' ); ?></h2>
1645 <p class="description">
1646 <strong><?php esc_html_e("Contact's data is saved locally do make backup or export before uninstalling plugin", 'mystickymenu');?></strong>
1647 </p>
1648 <div>
1649 <div class="mystickymenu-btnmbox">
1650 <div class="mystickymenu-btnbx">
1651 <strong><?php esc_html_e('Download & Export All Subscriber to CSV file:','mystickymenu' );?> </strong>
1652 <a href="<?php echo esc_url(wp_nonce_url($download_file_url,'MSB_file_download', 'mystickymenu_nonce')); ?>" class="wpappp_buton" id="wpappp_export_to_csv" value="Export to CSV" href="#"><?php esc_html_e('Download & Export to CSV', 'mystickymenu' );?></a>
1653 </div>
1654 <div class="mystickymenu-btnbx">
1655 <strong><?php esc_html_e('Delete All Subscibers from Database:','mystickymenu');?> </strong>
1656
1657 <input type="button" class="wpappp_buton" id="mystickymenu_delete_all_leads" value="<?php esc_attr_e('Delete All Data', 'mystickymenu' );?>" />
1658 </div>
1659 </div>
1660 <input type="hidden" id="delete_nonce" name="delete_nonce" value="<?php echo esc_attr(wp_create_nonce("mysticky_menu_delete_nonce")) ?>" />
1661 </div>
1662
1663 <?php
1664 if ( isset($_REQUEST['search-contact']) && $_REQUEST['search-contact'] != '' ) {
1665 $where_search = "WHERE contact_name like '%" . $_REQUEST['search-contact'] . "%' OR contact_email like '%".$_REQUEST['search-contact']."%' OR contact_phone like '%".$_REQUEST['search-contact']."%' OR widget_name like '%".$_REQUEST['search-contact']."%' ";
1666 }
1667 ?>
1668 <div>
1669 <div class="tablenav top">
1670 <form action="<?php echo esc_url(admin_url("admin.php?page=my-sticky-menu-leads"));?>" method="post">
1671 <div class="alignleft actions bulkactions">
1672 <select name="action" id="bulk-action-selector-top">
1673 <option value="">Bulk Actions</option>
1674 <option value="delete_message">Delete</option>
1675 </select>
1676 <input type="submit" id="doaction" class="button action" value="Apply">
1677 <?php wp_nonce_field( 'stickyelement-contatc-submit', 'stickyelement-contatc-submit' ); ?>
1678 </div>
1679 </form>
1680 <form action="<?php echo esc_url(admin_url("admin.php?page=my-sticky-menu-leads"));?>" method='get'>
1681 <input type="hidden" name="page" value='my-sticky-menu-leads'/>
1682 <p class="search-box">
1683 <label class="screen-reader-text" for="post-search-input"><?php esc_html_e( 'Search', 'mystickymenu');?></label>
1684 <input type="search" id="post-search-input" name="search-contact" value="<?php echo (isset($_GET['search-contact']) && $_GET['search-contact'] != '') ? esc_attr($_GET['search-contact']) : ''; ?>" placeholder="Search by name, email, phone, widget name">
1685 <input type="submit" id="search-submit" class="button" value="<?php esc_html_e( 'Search', 'mystickymenu');?>">
1686 </p>
1687 </form>
1688 </div>
1689
1690 <table border="1" class="responstable">
1691 <tr>
1692 <th style="width:1%"><?php esc_html_e( 'Bulk', 'mystickymenu' );?></th>
1693 <th><?php esc_html_e( 'ID', 'mystickymenu');?></th>
1694 <th><?php esc_html_e( 'Widget Name', 'mystickymenu');?></th>
1695 <th><?php esc_html_e( 'Name', 'mystickymenu');?></th>
1696 <th><?php esc_html_e( 'Email', 'mystickymenu');?></th>
1697 <th><?php esc_html_e( 'Phone', 'mystickymenu');?></th>
1698 <th><?php esc_html_e( 'Date', 'mystickymenu');?></th>
1699 <th><?php esc_html_e( 'URL', 'mystickymenu');?></th>
1700 <th style="width:11%"><?php esc_html_e( 'Delete', 'mystickymenu');?></th>
1701 </tr>
1702 <?php
1703 $customPagHTML = "";
1704 $total_query = "SELECT count(*) FROM ".$table_name ." {$where_search} ORDER BY ID DESC";
1705 $total = $wpdb->get_var( $total_query );
1706 $items_per_page = 20;
1707 $page = ( isset( $_GET['cpage'] ) ) ? abs( (int) $_GET['cpage'] ) : 1;
1708 $offset = ( $page * $items_per_page ) - $items_per_page;
1709 $query = "SELECT * FROM " . $table_name ." {$where_search} ORDER BY ID DESC LIMIT {$offset}, {$items_per_page}";
1710 $result = $wpdb->get_results( $query );
1711 $total_page = ceil($total / $items_per_page);
1712
1713 if($result){
1714
1715 foreach ( $result as $res ) { ?>
1716
1717 <tr>
1718 <td><input id="cb-select-80" class="cb-select-blk" type="checkbox" name="delete_message[]" value="<?php echo esc_attr($res->ID);?>"></td>
1719 <td><?php echo esc_html($res->ID);?></td>
1720
1721 <td>
1722 <?php if($res->widget_id !== NULL): ?>
1723 <a target="_blank" href="<?php echo admin_url( 'admin.php?page=my-stickymenu-welcomebar&widget=' . $res->widget_id . '&isedit=1' );?>"><?php echo esc_html($res->widget_name);?></a>
1724 <?php else: ?>
1725 <?php echo esc_html($res->widget_name);?>
1726 <?php endif; ?>
1727 </td>
1728
1729 <td><?php echo esc_html($res->contact_name);?></td>
1730 <td><?php echo esc_html($res->contact_email);?></td>
1731 <td><?php echo esc_html($res->contact_phone);?></td>
1732 <td><?php echo ( isset($res->message_date) ) ? esc_html($res->message_date) : '-' ;?></td>
1733 <td>
1734 <?php if ( $res->page_link) :?>
1735 <a class="external-link" href="<?php echo esc_url($res->page_link);?>" target="_blank"><span class="dashicons dashicons-external"></span></a>
1736 <?php endif;?>
1737 </td>
1738
1739 <td>
1740 <input type="button" data-delete="<?php echo esc_attr($res->ID);?>" class="mystickymenu-delete-entry" value="<?php esc_attr_e('Delete', 'mystickymenu');?>" />
1741 </td>
1742 </tr>
1743 <?php }
1744 } else { ?>
1745 <tr>
1746 <td colspan="9" align="center">
1747 <p class="mystickymenu-no-contact"> <?php esc_html_e('No Contact Form Leads Found!','mystickymenu');?>
1748 </p>
1749 </td>
1750 </tr>
1751 <?php } ?>
1752
1753 </table>
1754
1755 <?php if($total_page > 1){ ?>
1756 <div class="contactleads-pagination">
1757 <?php
1758 $big = 999999999; // need an unlikely integer
1759 echo paginate_links( array(
1760 'base' => add_query_arg( 'cpage', '%#%' ),
1761 'format' => '',
1762 'current' => $page,
1763 'total' => $total_page
1764 ) );?>
1765 </div>
1766 <?php }?>
1767 </form>
1768 </div>
1769 </div>
1770
1771 <!-- -->
1772 <?php
1773 }
1774
1775 public function mystickymenu_review_box() {
1776
1777 if (current_user_can('manage_options')) {
1778 $nonce = filter_input(INPUT_POST, 'nonce');
1779 $days = filter_input(INPUT_POST, 'days');
1780 if (!empty($nonce) && wp_verify_nonce($nonce, 'mystickymenu')) {
1781 if ($days == -1) {
1782 add_option("my-sticky-menu_hide_review_box", "1");
1783 update_option("get_mystickybar_page_views", -1);
1784 } else {
1785 $date = date("Y-m-d", strtotime("+".$days." days"));
1786 update_option("my-sticky-menu_show_review_box_after", $date);
1787 update_option("get_mystickybar_page_views", 4);
1788 }
1789 }
1790 }
1791 wp_die();
1792 }
1793
1794 public function mystickymenu_review_box_message (){
1795 if (current_user_can('manage_options')) {
1796 $nonce = filter_input(INPUT_POST, 'nonce');
1797 if (!empty($nonce) && wp_verify_nonce($nonce, 'mystickymenu')) {
1798 add_option("my-sticky-menu_hide_review_box", "1");
1799 update_option("get_mystickybar_page_views", -1);
1800 $rating = filter_input(INPUT_POST, 'rating');
1801 $message = filter_input(INPUT_POST, 'message');
1802
1803 if ( $message != '' ) {
1804 global $current_user;
1805 $postMessage = [];
1806
1807 $domain = site_url();
1808 $user_name = $current_user->first_name." ".$current_user->last_name;
1809 $email = $current_user->user_email;
1810
1811 $messageData = [];
1812 $messageData['key'] = "email";
1813 $messageData['value'] = $email;
1814 $postMessage[] = $messageData;
1815
1816 $messageData = [];
1817 $messageData['key'] = "website";
1818 $messageData['value'] = $domain;
1819 $postMessage[] = $messageData;
1820
1821 $messageData = [];
1822 $messageData['key'] = "message";
1823 $messageData['value'] = $message;
1824 $postMessage[] = $messageData;
1825
1826 $messageData = [];
1827 $messageData['key'] = "rating";
1828 $messageData['value'] = $rating;
1829 $postMessage[] = $messageData;
1830
1831 $apiParams = [
1832 'title' => 'Review for My Sticky Bar WordPress',
1833 'domain' => $domain,
1834 'email' => "contact@premio.io",
1835 'url' => site_url(),
1836 'name' => $user_name,
1837 'message' => $postMessage,
1838 'plugin' => 'My Sticky Bar',
1839 'type' => "Review",
1840 ];
1841
1842 // Sending message to Crisp API
1843 $apiResponse = wp_safe_remote_post("https://premioapps.com/premio/send-feedback-api.php", ['body' => $apiParams, 'timeout' => 15, 'sslverify' => true]);
1844
1845 if (is_wp_error($apiResponse)) {
1846 wp_safe_remote_post("https://premioapps.com/premio/send-feedback-api.php", ['body' => $apiParams, 'timeout' => 15, 'sslverify' => false]);
1847 }
1848 }
1849 }
1850 wp_die();
1851 }
1852 }
1853 }
1854
1855
1856
1857 class MyStickyMenuFrontend
1858 {
1859
1860 public function __construct()
1861 {
1862 add_action( 'wp_head', array( $this, 'mysticky_build_stylesheet_content' ) );
1863 add_action( 'wp_enqueue_scripts', array( $this, 'mysticky_disable_at' ) );
1864
1865 add_action('wp_ajax_stickymenu_contact_lead_form', array($this, 'stickymenu_contact_lead_form'));
1866 add_action('wp_ajax_nopriv_stickymenu_contact_lead_form', array($this, 'stickymenu_contact_lead_form'));
1867 }
1868
1869 public function mysticky_build_stylesheet_content() {
1870
1871 $mysticky_options = get_option( 'mysticky_option_name' );
1872
1873 if (isset($mysticky_options['disable_css'])) {
1874 //do nothing
1875 } else {
1876 $mysticky_options['disable_css'] = false;
1877 }
1878
1879 if ($mysticky_options ['disable_css'] == false ) {
1880
1881 echo '<style id="mystickymenu" type="text/css">';
1882 echo '#mysticky-nav { width:100%; position: static; height: auto !important; }';
1883 echo '#mysticky-nav.wrapfixed { position:fixed; left: 0px; margin-top:0px; z-index: '. esc_attr($mysticky_options ['myfixed_zindex']) .'; -webkit-transition: ' . esc_attr($mysticky_options ['myfixed_transition_time']) . 's; -moz-transition: ' . esc_attr($mysticky_options ['myfixed_transition_time']) . 's; -o-transition: ' . esc_attr($mysticky_options ['myfixed_transition_time']) . 's; transition: ' . esc_attr($mysticky_options ['myfixed_transition_time']) . 's; -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=' . esc_attr($mysticky_options ['myfixed_opacity']) . ')"; filter: alpha(opacity=' . esc_attr($mysticky_options ['myfixed_opacity']) . '); opacity:' . esc_attr($mysticky_options ['myfixed_opacity']) / 100 . '; background-color: ' . esc_attr($mysticky_options ['myfixed_bgcolor']) . ';}';
1884
1885 echo '#mysticky-nav.wrapfixed .myfixed{ background-color: ' . esc_attr($mysticky_options ['myfixed_bgcolor']) . '; position: relative;top: auto;left: auto;right: auto;}';
1886
1887 if ( isset($mysticky_options ['myfixed_textcolor']) && $mysticky_options ['myfixed_textcolor'] != '' ) {
1888 echo '#mysticky-nav.wrapfixed ul li.menu-item a { color: ' . esc_attr($mysticky_options ['myfixed_textcolor']) . ';}';
1889 }
1890
1891
1892 if ($mysticky_options ['myfixed_disable_small_screen'] > 0 ){
1893 //echo '@media (max-width: '.$mysticky_options['myfixed_disable_small_screen'].'px) {#mysticky-nav.wrapfixed {position: static;} }';
1894 };
1895 if ( !isset( $mysticky_options['myfixed_cssstyle'] ) ) {
1896 echo '#mysticky-nav .myfixed { margin:0 auto; float:none; border:0px; background:none; max-width:100%; }';
1897 }
1898 if ( isset( $mysticky_options['myfixed_cssstyle'] ) && $mysticky_options['myfixed_cssstyle'] != '' ) {
1899 echo esc_attr($mysticky_options ['myfixed_cssstyle']);
1900 }
1901 echo '</style>';
1902 $template_name = get_template();
1903 ?>
1904 <style type="text/css">
1905 <?php if( $template_name == 'hestia' ) { ?>
1906 #mysticky-nav.wrapfixed {box-shadow: 0 1px 10px -6px #0000006b,0 1px 10px 0 #0000001f,0 4px 5px -2px #0000001a;}
1907 #mysticky-nav.wrapfixed .navbar {position: relative;background-color: transparent;box-shadow: none;}
1908 <?php } ?>
1909 <?php if( $template_name == 'shapely' ) { ?>
1910 #mysticky-nav.wrapfixed #site-navigation {position: relative;}
1911 <?php } ?>
1912 <?php if( $template_name == 'storefront' ) { ?>
1913 #mysticky-nav.wrapfixed > .site-header {margin-bottom: 0;}
1914 #mysticky-nav.wrapfixed > .storefront-primary-navigation {padding: 10px 0;}
1915 <?php } ?>
1916 <?php if( $template_name == 'transportex' ) { ?>
1917 #mysticky-nav.wrapfixed > .transportex-menu-full {margin: 0 auto;}
1918 .transportex-headwidget #mysticky-nav.wrapfixed .navbar-wp {top: 0;}
1919 <?php } ?>
1920 <?php if( $template_name == 'twentynineteen' ) { ?>
1921 #mysticky-nav.wrapfixed {padding: 10px;}
1922 <?php } ?>
1923 <?php if( $template_name == 'twentysixteen' ) { ?>
1924 #mysticky-nav.wrapfixed > .site-header {padding-top: 0;padding-bottom: 0;}
1925 <?php } ?>
1926 <?php if( $template_name == 'twentytwenty' ) { ?>
1927 #site-header {background: transparent;}
1928 <?php } ?>
1929 </style>
1930 <?php
1931 }
1932 }
1933
1934 public function mystickymenu_google_fonts_url() {
1935 $welcomebar = get_option( 'mysticky_option_welcomebar' );
1936
1937 $default_fonts = array('System Stack','Arial', 'Tahoma', 'Verdana', 'Helvetica', 'Times New Roman', 'Trebuchet MS', 'Georgia' );
1938 $fonts_url = '';
1939 $fonts = array();
1940 $font_args = array();
1941 $base_url = "https://fonts.googleapis.com/css";
1942 $fonts['family']['Lato'] = 'Lato:400,500,600,700';
1943 if ( isset($welcomebar['mysticky_welcomebar_font']) && $welcomebar['mysticky_welcomebar_font'] !='' && !in_array( $welcomebar['mysticky_welcomebar_font'], $default_fonts) ) {
1944 $fonts['family'][$welcomebar['mysticky_welcomebar_font']] = $welcomebar['mysticky_welcomebar_font'] . ':400,500,600,700';
1945 }
1946 if ( isset($welcomebar['mysticky_welcomebar_btnfont']) && $welcomebar['mysticky_welcomebar_btnfont'] !='' && !in_array( $welcomebar['mysticky_welcomebar_btnfont'], $default_fonts) ) {
1947 $fonts['family'][$welcomebar['mysticky_welcomebar_btnfont']] = $welcomebar['mysticky_welcomebar_btnfont'] . ':400,500,600,700';
1948 }
1949
1950 /* Prepapre URL if font family defined. */
1951 if( !empty( $fonts['family'] ) ) {
1952
1953 /* format family to string */
1954 if( is_array($fonts['family']) ){
1955 $fonts['family'] = implode( '|', $fonts['family'] );
1956 }
1957
1958 $font_args['family'] = urlencode( trim( $fonts['family'] ) );
1959
1960 if( !empty( $fonts['subsets'] ) ){
1961
1962 /* format subsets to string */
1963 if( is_array( $fonts['subsets'] ) ){
1964 $fonts['subsets'] = implode( ',', $fonts['subsets'] );
1965 }
1966
1967 $font_args['subsets'] = urlencode( trim( $fonts['subsets'] ) );
1968 }
1969
1970 $fonts_url = add_query_arg( $font_args, $base_url );
1971 }
1972
1973 return esc_url_raw( $fonts_url );
1974 }
1975
1976 public function mystickymenu_script() {
1977
1978 wp_enqueue_script( 'jquery' );
1979
1980 $mysticky_options = get_option( 'mysticky_option_name' );
1981
1982 if ( is_admin_bar_showing() ) {
1983 $top = "true";
1984 } else {
1985 $top = "false";
1986 }
1987
1988 $welcomebar = get_option( 'mysticky_option_welcomebar' );
1989 if ( isset($welcomebar['mysticky_welcomebar_enable']) && $welcomebar['mysticky_welcomebar_enable'] == 1 ) {
1990 wp_enqueue_style('google-fonts', $this->mystickymenu_google_fonts_url(),array(), MYSTICKY_VERSION );
1991 }
1992
1993 wp_enqueue_script( 'morphext-js', plugins_url('/js/morphext/morphext.min.js', __FILE__) , array('jquery'), MYSTICKY_VERSION, ['strategy' => 'defer', 'in_footer'=> true ] );
1994 wp_register_script('welcomebar-frontjs', plugins_url('/js/welcomebar-front.js', __FILE__), array( 'jquery', 'morphext-js' ), MYSTICKY_VERSION, ['strategy' => 'defer', 'in_footer'=> true ]);
1995 wp_enqueue_script('welcomebar-frontjs');
1996
1997 wp_localize_script( 'welcomebar-frontjs', 'welcomebar_frontjs',
1998 array(
1999 'ajaxurl' => admin_url( 'admin-ajax.php' ) ,
2000 'days' => __( 'Days', 'mystickymenu' ),
2001 'hours' => __( 'Hours', 'mystickymenu' ),
2002 'minutes' => __( 'Minutes', 'mystickymenu' ),
2003 'seconds' => __( 'Seconds', 'mystickymenu' ),
2004 'ajax_nonce' => wp_create_nonce('mystickymenu'),
2005 )
2006 );
2007
2008 if( !isset($mysticky_options['stickymenu_enable']) || isset($mysticky_options['stickymenu_enable']) && $mysticky_options['stickymenu_enable'] == 0){
2009 return;
2010 }
2011 // needed for update 1.7 => 1.8 ... will be removed in the future ()
2012 if (isset($mysticky_options['mysticky_active_on_height_home'])) {
2013 //do nothing
2014 } else {
2015 $mysticky_options['mysticky_active_on_height_home'] = $mysticky_options['mysticky_active_on_height'];
2016 }
2017
2018
2019 if ($mysticky_options['mysticky_active_on_height_home'] == 0 ) {
2020 $mysticky_options['mysticky_active_on_height_home'] = $mysticky_options['mysticky_active_on_height'];
2021 }
2022
2023
2024 if ( is_front_page() && is_home() ) {
2025
2026 $mysticky_options['mysticky_active_on_height'] = $mysticky_options['mysticky_active_on_height_home'];
2027
2028 } elseif ( is_front_page()){
2029
2030 $mysticky_options['mysticky_active_on_height'] = $mysticky_options['mysticky_active_on_height_home'];
2031
2032 }
2033 wp_register_script('detectmobilebrowser', plugins_url( 'js/detectmobilebrowser.js', __FILE__ ), array('jquery'), MYSTICKY_VERSION, ['strategy' => 'defer', 'in_footer'=> true ]);
2034 wp_enqueue_script( 'detectmobilebrowser' );
2035
2036 wp_register_script('mystickymenu', plugins_url( 'js/mystickymenu.min.js', __FILE__ ), array('jquery'), MYSTICKY_VERSION, ['strategy' => 'defer', 'in_footer'=> true ]);
2037 wp_enqueue_script( 'mystickymenu' );
2038
2039
2040
2041 $myfixed_disable_scroll_down = isset($mysticky_options['myfixed_disable_scroll_down']) ? esc_attr($mysticky_options['myfixed_disable_scroll_down']) : 'false';
2042 $mystickyTransition = isset($mysticky_options['myfixed_fade']) ? esc_attr($mysticky_options['myfixed_fade']) : 'fade';
2043 $mystickyDisableLarge = isset($mysticky_options['myfixed_disable_large_screen']) ? esc_attr($mysticky_options['myfixed_disable_large_screen']) : '0';
2044
2045 $mystickyClass = ( $mysticky_options['mysticky_class_id_selector'] != 'custom') ? '.menu-' . $mysticky_options['mysticky_class_id_selector'] .'-container' : $mysticky_options['mysticky_class_selector'];
2046
2047 if ( $mysticky_options['mysticky_class_id_selector'] != 'custom' ) {
2048 $template_name = get_template();
2049 switch( $template_name ){
2050 case 'ashe':
2051 $mystickyClass = '#main-nav';
2052 break;
2053 case 'astra':
2054 case 'hello-elementor':
2055 case 'sydney':
2056 case 'twentysixteen':
2057 $mystickyClass = 'header.site-header';
2058 break;
2059 case 'generatepress':
2060 $mystickyClass = 'nav.main-navigation';
2061 break;
2062 case 'transportex':
2063 $mystickyClass = '.transportex-menu-full';
2064 break;
2065 case 'hestia':
2066 case 'neve':
2067 $mystickyClass = 'header.header';
2068 break;
2069 case 'mesmerize':
2070 $mystickyClass = '.navigation-bar';
2071 break;
2072 case 'oceanwp':
2073 $mystickyClass = 'header#site-header';
2074 break;
2075 case 'shapely':
2076 $mystickyClass = '#site-navigation';
2077 break;
2078 case 'storefront':
2079 $mystickyClass = '.storefront-primary-navigation';
2080 break;
2081 case 'twentynineteen':
2082 $mystickyClass = '#site-navigation';
2083 break;
2084 case 'twentyseventeen':
2085 $mystickyClass = '.navigation-top';
2086 break;
2087 default:
2088 break;
2089 }
2090 }
2091
2092
2093 $mysticky_translation_array = array(
2094 'mystickyClass' => $mystickyClass,
2095 'activationHeight' => $mysticky_options['mysticky_active_on_height'],
2096 'disableWidth' => $mysticky_options['myfixed_disable_small_screen'],
2097 'disableLargeWidth' => $mystickyDisableLarge,
2098 'adminBar' => $top,
2099 'device_desktop' => true,
2100 'device_mobile' => true,
2101 'mystickyTransition' => $mystickyTransition,
2102 'mysticky_disable_down' => $myfixed_disable_scroll_down,
2103
2104
2105 );
2106 wp_localize_script( 'mystickymenu', 'option', $mysticky_translation_array );
2107 }
2108
2109 public function mysticky_disable_at() {
2110
2111
2112 $mysticky_options = get_option( 'mysticky_option_name' );
2113
2114 $mysticky_disable_at_front_home = isset($mysticky_options['mysticky_disable_at_front_home']);
2115 $mysticky_disable_at_blog = isset($mysticky_options['mysticky_disable_at_blog']);
2116 $mysticky_disable_at_page = isset($mysticky_options['mysticky_disable_at_page']);
2117 $mysticky_disable_at_tag = isset($mysticky_options['mysticky_disable_at_tag']);
2118 $mysticky_disable_at_category = isset($mysticky_options['mysticky_disable_at_category']);
2119 $mysticky_disable_at_single = isset($mysticky_options['mysticky_disable_at_single']);
2120 $mysticky_disable_at_archive = isset($mysticky_options['mysticky_disable_at_archive']);
2121 $mysticky_disable_at_search = isset($mysticky_options['mysticky_disable_at_search']);
2122 $mysticky_disable_at_404 = isset($mysticky_options['mysticky_disable_at_404']);
2123 $mysticky_enable_at_pages = isset($mysticky_options['mysticky_enable_at_pages']) ? esc_attr($mysticky_options['mysticky_enable_at_pages']) : '';
2124 $mysticky_enable_at_posts = isset($mysticky_options['mysticky_enable_at_posts']) ? esc_attr($mysticky_options['mysticky_enable_at_posts']) : '';
2125
2126 // Trim input to ignore empty spaces
2127 $mysticky_enable_at_pages_exp = array_map('trim', explode(',', $mysticky_enable_at_pages));
2128 $mysticky_enable_at_posts_exp = array_map('trim', explode(',', $mysticky_enable_at_posts));
2129
2130
2131
2132
2133 if ( is_front_page() && is_home() ) { /* Default homepage */
2134
2135 if ( $mysticky_disable_at_front_home == false ) {
2136 $this->mystickymenu_script();
2137 }
2138 } elseif ( is_front_page()){ /* Static homepage */
2139
2140 if ( $mysticky_disable_at_front_home == false ) {
2141 $this->mystickymenu_script();
2142 }
2143
2144 } elseif ( is_home()){ /* Blog page */
2145
2146 if ( $mysticky_disable_at_blog == false ) {
2147 $this->mystickymenu_script();
2148 }
2149
2150 } elseif ( is_page() ){ /* Single page*/
2151
2152 if ( $mysticky_disable_at_page == false ) {
2153 $this->mystickymenu_script();
2154 }
2155 if ( is_page( $mysticky_enable_at_pages_exp ) ){
2156 $this->mystickymenu_script();
2157 }
2158
2159 } elseif ( is_tag()){ /* Tag page */
2160
2161 if ( $mysticky_disable_at_tag == false ) {
2162 $this->mystickymenu_script();
2163 }
2164
2165 } elseif ( is_category()){ /* Category page */
2166
2167 if ( $mysticky_disable_at_category == false ) {
2168 $this->mystickymenu_script();
2169 }
2170
2171 } elseif ( is_single()){ /* Single post */
2172
2173 if ( $mysticky_disable_at_single == false ) {
2174 $this->mystickymenu_script();
2175 }
2176
2177 if ( is_single( $mysticky_enable_at_posts_exp ) ){
2178 $this->mystickymenu_script();
2179 }
2180
2181 } elseif ( is_archive()){ /* Archive */
2182
2183 if ( $mysticky_disable_at_archive == false ) {
2184 $this->mystickymenu_script();
2185 }
2186
2187 } elseif ( is_search()){ /* Search */
2188
2189 if ( $mysticky_disable_at_search == false ) {
2190 $this->mystickymenu_script();
2191 }
2192
2193 } elseif ( is_404()){ /* 404 */
2194
2195 if ( $mysticky_disable_at_404 == false ) {
2196 $this->mystickymenu_script();
2197 }
2198 }
2199
2200 }
2201
2202 /**
2203 * Mysticky Menu: Contact Form Lead Submission Function
2204 * DATE : 2022-08-04
2205 * */
2206
2207 public function stickymenu_contact_lead_form(){
2208 global $wpdb;
2209 global $wp;
2210 $stickymenus_widgets = get_option( 'mystickymenu-welcomebars' );
2211 $errors = array();
2212 $element_widget_no = $_POST['widget_id'];
2213
2214 $element_widget_name = (isset($stickymenus_widgets[$element_widget_no]) && $stickymenus_widgets[$element_widget_no] != '' ) ? esc_html($stickymenus_widgets[$element_widget_no]) : '';
2215
2216 $flag = true;
2217 if( isset($element_widget_name) && $element_widget_name != ''){
2218 if( !isset($_POST['contact_name']) || $_POST['contact_name'] == ''){
2219 $error = array(
2220 'key' => "contact-form-name",
2221 'message' => __( "This field is required", "mystickymenu" )
2222 );
2223 $errors[] = $error;
2224 $flag = false;
2225 }else{
2226 $contact_lists_table = $wpdb->prefix . 'mystickymenu_contact_lists';
2227 $postArr = $_POST;
2228
2229 if( $element_widget_no == 0 ){
2230 $element_widget_no = '';
2231 }
2232
2233 $welcomebar = get_option( 'mysticky_option_welcomebar' . $element_widget_no );
2234
2235 foreach( $postArr as $key => $val ){
2236 if( $key != 'action' && $key != 'widget_id' && $key != 'save_form_lead' && $key != 'wpnonce'){
2237 $params[$key] = (isset($val) && $val != '') ? esc_sql( sanitize_text_field($val) ) : '';
2238 }
2239 }
2240
2241 $params["widget_id"] = esc_sql( sanitize_text_field($element_widget_no));
2242 $params["widget_name"] = esc_sql( sanitize_text_field($element_widget_name));
2243 $params["message_date"] = date('Y-m-d H:i:s');
2244 $params["contact_email"] = (isset($params["contact_email"]) && $params["contact_email"] != '' ) ? sanitize_email($params["contact_email"]) : '';
2245
2246 if( isset($params) && !empty($params) ){
2247 $wpdb->insert($contact_lists_table, $params);
2248 die;
2249 }
2250
2251
2252 }
2253 }
2254
2255 if( $flag != true ){
2256 echo json_encode(array("status" => 0, "error" => 1, "errors" => $errors, "message" => $errors['message']));
2257 }
2258 die;
2259 }
2260
2261 }
2262
2263 if( is_admin() ) {
2264 require_once 'mystickymenu-affiliate.php';
2265 }
2266
2267 new MyStickyMenuBackend();
2268 new MyStickyMenuFrontend();
2269
2270 register_activation_hook( __FILE__, 'mystickymenu_activate' );
2271
2272 function mystickymenu_activate() {
2273 update_option( 'update_mysticky_version_2_5_7', true );
2274
2275 global $wpdb;
2276 require_once( ABSPATH . 'wp-admin/includes/upgrade.php');
2277 $charset_collate = $wpdb->get_charset_collate();
2278
2279 $contact_lists_table = $wpdb->prefix . 'mystickymenu_contact_lists';
2280
2281 if ($wpdb->get_var("show tables like '$contact_lists_table'") != $contact_lists_table) {
2282
2283 $contact_lists_table_sql = "CREATE TABLE $contact_lists_table (
2284 ID int(11) NOT NULL AUTO_INCREMENT,
2285 widget_id INT(11) NULL,
2286 contact_name varchar(255) NULL,
2287 contact_phone varchar(255) NULL,
2288 contact_email varchar(255) NULL,
2289 widget_name varchar(255) NULL,
2290 page_link varchar(522) NULL,
2291 message_date DATETIME NOT NULL default '0000-00-00 00:00:00',
2292 PRIMARY KEY (ID)
2293 ) $charset_collate;";
2294 dbDelta($contact_lists_table_sql);
2295 }
2296 }
2297
2298
2299 add_action( 'admin_init' , 'mystickymenu_admin_init' );
2300
2301 function mystickymenu_admin_init(){
2302
2303 global $wpdb;
2304 require_once( ABSPATH . 'wp-admin/includes/upgrade.php');
2305 $charset_collate = $wpdb->get_charset_collate();
2306
2307 $contact_lists_table = $wpdb->prefix . 'mystickymenu_contact_lists';
2308
2309 if ($wpdb->get_var("show tables like '$contact_lists_table'") != $contact_lists_table) {
2310
2311 $contact_lists_table_sql = "CREATE TABLE $contact_lists_table (
2312 ID int(11) NOT NULL AUTO_INCREMENT,
2313 widget_id INT(11) NULL,
2314 contact_name varchar(255) NULL,
2315 contact_phone varchar(255) NULL,
2316 contact_email varchar(255) NULL,
2317 widget_name varchar(255) NULL,
2318 page_link varchar(522) NULL,
2319 message_date DATETIME NOT NULL default '0000-00-00 00:00:00',
2320 PRIMARY KEY (ID)
2321 ) $charset_collate;";
2322 dbDelta($contact_lists_table_sql);
2323 }
2324
2325 if(get_option('msb_cl_widget_id_exists', false) == false){
2326 // Check if the column already exists
2327
2328 $column_exists = $wpdb->get_results(
2329 $wpdb->prepare(
2330 "SHOW COLUMNS FROM $contact_lists_table LIKE %s",
2331 'widget_id'
2332 )
2333 );
2334
2335 if (empty($column_exists)) {
2336 update_option('msb_cl_widget_id_exists', true);
2337 $wpdb->query(
2338 "ALTER TABLE $contact_lists_table ADD COLUMN widget_id INT(11) NULL AFTER ID"
2339 );
2340 }
2341 }
2342
2343 }
2344
2345 function mystickymenu_change_menu_text() {
2346 global $submenu;
2347 if(isset($submenu['my-stickymenu-welcomebar'])) {
2348 $totalItems = count($submenu['my-stickymenu-welcomebar'])-1;
2349 if(isset($submenu['my-stickymenu-welcomebar'][$totalItems][0])) {
2350 $submenu['my-stickymenu-welcomebar'][$totalItems][0] = '<span><svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2351 <path d="M13.0518 4.01946C12.9266 3.91499 12.7747 3.84781 12.6132 3.82557C12.4517 3.80333 12.2872 3.82693 12.1385 3.89367L9.3713 5.12414L7.76349 2.22571C7.68664 2.09039 7.5753 1.97785 7.44081 1.89956C7.30632 1.82127 7.15348 1.78003 6.99786 1.78003C6.84224 1.78003 6.6894 1.82127 6.55491 1.89956C6.42042 1.97785 6.30908 2.09039 6.23224 2.22571L4.62442 5.12414L1.85724 3.89367C1.70822 3.82703 1.54352 3.8034 1.38178 3.82545C1.22003 3.84751 1.06768 3.91437 0.941941 4.01849C0.816207 4.1226 0.722106 4.25982 0.670275 4.41461C0.618444 4.56941 0.610951 4.73562 0.648642 4.89446L2.0377 10.8171C2.06427 10.9318 2.11383 11.0399 2.18339 11.1348C2.25295 11.2297 2.34107 11.3096 2.44239 11.3695C2.57957 11.4516 2.73642 11.495 2.8963 11.4952C2.97402 11.4951 3.05133 11.484 3.12599 11.4624C5.65792 10.7624 8.33233 10.7624 10.8643 11.4624C11.0955 11.5232 11.3413 11.4898 11.5479 11.3695C11.6498 11.3103 11.7384 11.2307 11.8081 11.1357C11.8777 11.0406 11.9269 10.9321 11.9525 10.8171L13.3471 4.89446C13.3843 4.73558 13.3764 4.56945 13.3243 4.41482C13.2721 4.2602 13.1777 4.12326 13.0518 4.01946V4.01946Z" fill="white"/>
2352 </svg></span> '.esc_html__( 'Upgrade to Pro' , 'chaty');
2353 }
2354 }
2355 }
2356 add_action('admin_init', 'mystickymenu_change_menu_text');
2357
2358 add_action('admin_footer', 'mystickymenu_admin_footer_style');
2359 function mystickymenu_admin_footer_style() {
2360 ?>
2361 <style>
2362 #adminmenu .toplevel_page_my-stickymenu-welcomebar > ul > li:last-child {
2363 padding: 5px 10px;
2364 }
2365 #adminmenu .toplevel_page_my-stickymenu-welcomebar > ul > li:last-child a {
2366 display: flex;
2367 background-color: #B78DEB;
2368 border-radius: 6px;
2369 font-size: 12px;
2370 gap: 4px;
2371 padding: 4px 8px;
2372 color: #ffffff;
2373 align-items: center;
2374 transition: all 0.2s linear;
2375 font-weight: normal;
2376 box-shadow: 0px 6px 8px 0px #B78DEB3D;
2377 justify-content: center;
2378 }
2379 #adminmenu .toplevel_page_my-stickymenu-welcomebar > ul > li:last-child a:hover, #adminmenu .toplevel_page_my-stickymenu-welcomebar > ul > li:last-child a.current {
2380 box-shadow: 0px 6px 8px 0px #B78DEB3D;
2381 color: #ffffff;
2382 background-color: #9565d0;
2383 font-weight: normal;
2384 }
2385 #adminmenu .toplevel_page_my-stickymenu-welcomebar > ul > li:last-child a span {
2386 flex: 0 0 16px;
2387 height: 16px;
2388 background-color: #c5a4ef;
2389 border-radius: 4px;
2390 padding: 2px;
2391 display: inline-flex;
2392 transition: all 0.2s linear;
2393 }
2394 #adminmenu .toplevel_page_my-stickymenu-welcomebar > ul > li:last-child a:hover span {
2395 background-color: #B78DEB;
2396 }
2397 #adminmenu .toplevel_page_my-stickymenu-welcomebar > ul > li:last-child a span svg {
2398 width: 100%;
2399 height: 100%;
2400 }
2401 </style>
2402 <?php
2403 }
2404
2405
2406 /*
2407 * Sanitize Sticky Bar option fields
2408 * Return $sanitized_array Sanitize array
2409 *
2410 * @since 2.7.3
2411 */
2412 function mysticky_bar_sanitize_options( $welcomebar_options ) {
2413 $sanitized_array = [];
2414 foreach ($welcomebar_options as $key => $value) {
2415
2416 if (is_array($value)) {
2417 $sanitized_array[$key] = mysticky_bar_sanitize_options($value); // Recursive call for nested arrays
2418 } else {
2419
2420 switch ($key) {
2421 case 'sender_email':
2422 $sanitized_array[$key] = sanitize_email($value);
2423 break;
2424 case 'mysticky_welcomebar_redirect':
2425 $sanitized_array[$key] = sanitize_url($value);
2426 break;
2427 case 'mysticky_welcomebar_bar_text':
2428 case 'mysticky_welcomebar_thankyou_screen_text':
2429 $sanitized_array[$key] = sanitize_textarea_field($value);
2430 break;
2431 default:
2432 $sanitized_array[$key] = sanitize_text_field($value);
2433 }
2434
2435 }
2436 }
2437 return $sanitized_array;
2438 }