PluginProbe ʕ •ᴥ•ʔ
My Sticky Bar – Floating Notification Bar & Sticky Header (formerly myStickymenu) / 2.4.7
My Sticky Bar – Floating Notification Bar & Sticky Header (formerly myStickymenu) v2.4.7
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
css 5 years ago fonts 7 years ago images 5 years ago js 5 years ago languages 7 years ago class-review-box.php 6 years ago index.php 8 years ago mystickymenu-affiliate.php 6 years ago mystickymenu-deactivate-form.php 5 years ago mystickymenu-fonts.php 6 years ago mystickymenu-popup.php 6 years ago mystickymenu.php 5 years ago mystickymeny-new-welcomebar.php 5 years ago readme.txt 5 years ago recommended-plugins.php 5 years ago uninstall.php 7 years ago upgrade-to-pro.php 5 years ago welcome-bar.php 5 years ago
mystickymenu.php
1412 lines
1 <?php
2 /*
3 Plugin Name: myStickymenu
4 Plugin URI: https://premio.io/
5 Description: Simple sticky (fixed on top) menu implementation for navigation menu and Welcome bar for announcements and promotion. After install go to Settings / myStickymenu and change Sticky Class to .your_navbar_class or #your_navbar_id.
6 Version: 2.4.7
7 Author: Premio
8 Author URI: https://premio.io/downloads/mystickymenu/
9 Text Domain: mystickymenu
10 Domain Path: /languages
11 License: GPLv2 or later
12 */
13
14 defined('ABSPATH') or die("Cannot access pages directly.");
15 define( 'MYSTICKY_VERSION', '2.4.7' );
16 define('MYSTICKYMENU_URL', plugins_url('/', __FILE__)); // Define Plugin URL
17 define('MYSTICKYMENU_PATH', plugin_dir_path(__FILE__)); // Define Plugin Directory Path
18
19 require_once("mystickymenu-fonts.php");
20 require_once("welcome-bar.php");
21
22 if( is_admin() ) {
23 include_once 'class-review-box.php';
24 }
25
26 class MyStickyMenuBackend
27 {
28 private $options;
29
30 public function __construct()
31 {
32 add_action( 'admin_menu', array( $this, 'add_plugin_page' ) );
33 add_action( 'admin_init', array( $this, 'mysticky_load_transl') );
34
35 add_action( 'admin_init', array( $this, 'mysticky_default_options' ) );
36 add_action( 'admin_enqueue_scripts', array( $this, 'mysticky_admin_script' ) );
37
38 add_filter( 'plugin_action_links_mystickymenu/mystickymenu.php', array( $this, 'mystickymenu_settings_link' ) );
39
40 add_action( 'activated_plugin', array( $this, 'mystickymenu_activation_redirect' ) );
41
42 add_action("wp_ajax_sticky_menu_update_status", array($this, 'sticky_menu_update_status'));
43
44 add_action("wp_ajax_mystickymenu_update_popup_status", array($this, 'mystickymenu_popup_status'));
45
46 add_action( 'admin_footer', array( $this, 'mystickymenu_deactivate' ) );
47 add_action( 'wp_ajax_mystickymenu_plugin_deactivate', array( $this, 'mystickymenu_plugin_deactivate' ) );
48 }
49
50 public function mystickymenu_popup_status() {
51 if(!empty($_REQUEST['nonce']) && wp_verify_nonce($_REQUEST['nonce'], 'mystickymenu_update_popup_status')) {
52 update_option("mystickymenu_intro_box", "hide");
53 }
54 echo esc_attr("1");
55 die;
56 }
57
58 public function sticky_menu_update_status() {
59 if(!empty($_REQUEST['nonce']) && wp_verify_nonce($_REQUEST['nonce'], 'myStickymenu_update_nonce')) {
60 $status = self::sanitize_options($_REQUEST['status']);
61 $email = self::sanitize_options($_REQUEST['email']);
62 update_option("mystickymenu_update_message", 2);
63 if($status == 1) {
64 $url = 'https://go.premio.io/api/update.php?email='.$email.'&plugin=myStickymenu';
65 $handle = curl_init();
66 curl_setopt($handle, CURLOPT_URL, $url);
67 curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
68 $response = curl_exec($handle);
69 curl_close($handle);
70 }
71 }
72 echo "1";
73 die;
74 }
75
76 public function mystickymenu_settings_link($links){
77 $settings_link = '<a href="admin.php?page=my-stickymenu-settings">Settings</a>';
78 $links['go_pro'] = '<a href="'.admin_url("admin.php?page=my-stickymenu-settings&type=upgrade").'" style="color: #FF5983;font-weight: bold;">'.__( 'Upgrade', 'stars-testimonials' ).'</a>';
79 array_unshift($links, $settings_link);
80 return $links;
81 }
82
83 public function mystickymenu_activation_redirect( $plugin) {
84 if( $plugin == plugin_basename( __FILE__ ) ) {
85 $is_shown = get_option("mystickymenu_update_message");
86 if($is_shown === false) {
87 add_option("mystickymenu_update_message", 1);
88 }
89 $option = get_option("mystickymenu_intro_box");
90 if($option === false) {
91 add_option("mystickymenu_intro_box", "show");
92 }
93 wp_redirect( admin_url( 'admin.php?page=my-stickymenu-settings' ) ) ;
94 exit;
95 }
96 }
97
98 public function mysticky_admin_script($hook) {
99
100 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-stickymenu-upgrade' && $_GET['page'] != 'msm-recommended-plugins' )) {
101 return;
102 }
103
104 wp_enqueue_style('mystickymenuAdminStyle', plugins_url('/css/mystickymenu-admin.css', __FILE__), array(), MYSTICKY_VERSION );
105 wp_enqueue_style( 'wp-color-picker' );
106 //wp_enqueue_script( 'wp-color-picker-alpha', plugins_url('/js/wp-color-picker-alpha.min.js', __FILE__), array( 'wp-color-picker' ), MYSTICKY_VERSION );
107 wp_enqueue_style( 'wp-jquery-ui-dialog' );
108 wp_enqueue_style('jquery-ui');
109
110 wp_enqueue_script('jquery-ui');
111 wp_enqueue_script('jquery-ui-slider');
112 //wp_enqueue_script('jquery-ui-datepicker');
113 wp_enqueue_script( 'jquery-ui-dialog' );
114 wp_enqueue_script( 'my-script-handle', plugins_url('js/iris-script.js', __FILE__ ), array( 'wp-color-picker' ), false, true );
115
116 if($hook == "mystickymenu_page_my-stickymenu-upgrade") {
117 wp_enqueue_script( 'my-select2', plugins_url('js/select2.min.js', __FILE__ ), array( 'wp-color-picker' ), false, true );
118 wp_enqueue_style('my-css-select2', plugins_url('css/select2.min.css', __FILE__), array(), MYSTICKY_VERSION );
119 wp_enqueue_style('my-css-admin-settings', plugins_url('css/admin-setting.css', __FILE__), array(), MYSTICKY_VERSION );
120 }
121
122 wp_enqueue_script('mystickymenuAdminScript', plugins_url('/js/mystickymenu-admin.js', __FILE__), array( 'jquery', 'jquery-ui-slider' ), MYSTICKY_VERSION);
123 }
124
125 public function mysticky_load_transl(){
126 load_plugin_textdomain('mystickymenu', FALSE, dirname(plugin_basename(__FILE__)).'/languages/');
127 }
128
129 function sanitize_options($value) {
130 $value = stripslashes($value);
131 $value = filter_var($value, FILTER_SANITIZE_STRING);
132 return $value;
133 }
134
135 public function add_plugin_page(){
136 if ( isset($_GET['hide_msmrecommended_plugin']) && $_GET['hide_msmrecommended_plugin'] == 1) {
137 update_option('hide_msmrecommended_plugin',true);
138 }
139 $hide_msmrecommended_plugin = get_option('hide_msmrecommended_plugin');
140 // This page will be under "Settings"
141 add_menu_page(
142 'Settings Admin',
143 'myStickymenu',
144 'manage_options',
145 'my-stickymenu-settings',
146 array( $this, 'create_admin_page' )
147 );
148 add_submenu_page(
149 'my-stickymenu-settings',
150 'Settings Admin',
151 'Settings',
152 'manage_options',
153 'my-stickymenu-settings',
154 array( $this, 'create_admin_page' )
155 );
156 add_submenu_page(
157 'my-stickymenu-settings',
158 'Settings Admin',
159 'Welcome Bar',
160 'manage_options',
161 'my-stickymenu-welcomebar',
162 array( $this, 'mystickystickymenu_admin_welcomebar_page' )
163 );
164 add_submenu_page(
165 'my-stickymenu-settings',
166 'Settings Admin',
167 '+ Create New Welcome Bar',
168 'manage_options',
169 'my-stickymenu-new-welcomebar',
170 array( $this, 'mystickystickymenu_admin_new_welcomebar_page' )
171 );
172 if ( !$hide_msmrecommended_plugin){
173 add_submenu_page(
174 'my-stickymenu-settings',
175 'msm-recommended-plugins',
176 'Recommended Plugins',
177 'manage_options',
178 'msm-recommended-plugins',
179 array( $this, 'mystickymenu_recommended_plugins' )
180 );
181 }
182 add_submenu_page(
183 'my-stickymenu-settings',
184 'Upgrade to Pro',
185 'Upgrade to Pro',
186 'manage_options',
187 'my-stickymenu-upgrade',
188 array( $this, 'mystickymenu_admin_upgrade_to_pro' )
189 );
190 }
191
192 public function create_admin_page(){
193
194 $upgarde_url = admin_url("admin.php?page=my-stickymenu-upgrade");
195 // Set class property
196 if (isset($_POST['mysticky_option_name']) && !empty($_POST['mysticky_option_name']) && isset($_POST['nonce'])) {
197 if(!empty($_REQUEST['nonce']) && wp_verify_nonce($_REQUEST['nonce'], 'mysticky_option_backend_update')) {
198 $post = $_POST['mysticky_option_name'];
199 foreach($post as $key=>$value) {
200 $post[$key] = self::sanitize_options($value);
201 }
202
203 $post['device_desktop'] = 'on';
204 $post['device_mobile'] = 'on';
205 update_option( 'mysticky_option_name', $post);
206 $this->mysticky_clear_all_caches();
207 echo '<div class="updated settings-error notice is-dismissible "><p><strong>' . esc_html__('Settings saved.','mystickymenu'). '</p></strong></div>';
208 } else {
209 wp_verify_nonce($_GET['nonce'], 'wporg_frontend_delete');
210 echo '<div class="error settings-error notice is-dismissible "><p><strong>' . esc_html__('Unable to complete your request','mystickymenu'). '</p></strong></div>';
211 }
212 }
213
214 $mysticky_options = get_option( 'mysticky_option_name');
215 $is_old = get_option("has_sticky_header_old_version");
216 $is_old = ($is_old == "yes")?true:false;
217 $nonce = wp_create_nonce('mysticky_option_backend_update');
218 $pro_url = "https://go.premio.io/?edd_action=add_to_cart&download_id=2199&edd_options[price_id]=";
219
220 $is_shown = get_option("mystickymenu_update_message");
221 if($is_shown == 1) {?>
222 <div class="updates-form-form" >
223 <div class="popup-form-content">
224 <div id="add-update-folder-title" class="add-update-folder-title">
225 Would you like to get feature updates for myStickymenu in real-time?
226 </div>
227 <div class="folder-form-input">
228 <input id="myStickymenu_update_email" autocomplete="off" value="<?php echo get_option( 'admin_email' ) ?>" placeholder="Email address">
229 </div>
230 <div class="updates-content-buttons">
231 <button href="javascript:;" class="button button-primary form-submit-btn yes">Yes, I want</button>
232 <button href="javascript:;" class="button button-secondary form-cancel-btn no">Skip</button>
233 <div style="clear: both"></div>
234 </div>
235 <input type="hidden" id="myStickymenu_update_nonce" value="<?php echo wp_create_nonce("myStickymenu_update_nonce") ?>">
236 </div>
237 </div>
238 <?php } else {
239
240 $option = get_option("mystickymenu_intro_box");
241 if($option == "show") {
242 include_once dirname(__FILE__) . "/mystickymenu-popup.php";
243 }
244 ?>
245 <style>
246 div#wpcontent {
247 background: rgba(101,114,219,1);
248 background: -moz-linear-gradient(-45deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
249 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)));
250 background: -webkit-linear-gradient(-45deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
251 background: -o-linear-gradient(-45deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
252 background: -ms-linear-gradient(-45deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
253 background: linear-gradient(135deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
254 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6572db', endColorstr='#ee86c6', GradientType=1 );
255 }
256 </style>
257 <div id="mystickymenu" class="wrap mystickymenu">
258 <div class="sticky-header-menu">
259 <ul>
260 <li><a href="<?php echo admin_url( 'admin.php?page=my-stickymenu-settings' ) ?>" class="active" ><?php _e('Sticky Menu', 'mystickymenu'); ?></a></li>
261 <li><a href="<?php echo admin_url( 'admin.php?page=my-stickymenu-welcomebar' ) ?>" ><?php _e('Welcome Bar', 'mystickymenu'); ?></a></li>
262 <li><a href="<?php echo admin_url( 'admin.php?page=my-stickymenu-upgrade' ) ?>"><?php _e('Upgrade to Pro', 'mystickymenu'); ?></a></li>
263 </ul>
264 </div>
265 <div id="sticky-header-settings" class="sticky-header-content">
266 <div class="mystickymenu-heading">
267 <div class="myStickymenu-header-title">
268 <h3><?php esc_attr_e('How To Make a Sticky Header', 'mystickymenu'); ?></h3>
269 </div>
270 <p><?php _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>
271 </div>
272
273 <form class="mysticky-form" method="post" action="#">
274 <div class="mystickymenu-content-section sticky-class-sec">
275 <table>
276 <tr>
277 <td>
278 <label class="mysticky_title"><?php _e("Sticky Class", 'mystickymenu')?></label>
279 <br /><br />
280 <?php $nav_menus = wp_get_nav_menus();
281 $menu_locations = get_nav_menu_locations();
282 $locations = get_registered_nav_menus();
283 ?>
284 <select name="mysticky_option_name[mysticky_class_id_selector]" id="mystickymenu-select">
285 <option value=""><?php _e( 'Select Sticky Menu', 'mystickymenu' ); ?></option>
286
287 <?php foreach ( (array) $nav_menus as $_nav_menu ) : ?>
288 <option value="<?php echo esc_attr( $_nav_menu->slug ); ?>" <?php selected( $_nav_menu->slug, $mysticky_options['mysticky_class_id_selector'] ); ?>>
289 <?php
290 echo esc_html( $_nav_menu->name );
291
292 if ( ! empty( $menu_locations ) && in_array( $_nav_menu->term_id, $menu_locations ) ) {
293 $locations_assigned_to_this_menu = array();
294 foreach ( array_keys( $menu_locations, $_nav_menu->term_id ) as $menu_location_key ) {
295 if ( isset( $locations[ $menu_location_key ] ) ) {
296 $locations_assigned_to_this_menu[] = $locations[ $menu_location_key ];
297 }
298 }
299
300 /**
301 * Filters the number of locations listed per menu in the drop-down select.
302 *
303 * @since 3.6.0
304 *
305 * @param int $locations Number of menu locations to list. Default 3.
306 */
307 $assigned_locations = array_slice( $locations_assigned_to_this_menu, 0, absint( apply_filters( 'wp_nav_locations_listed_per_menu', 3 ) ) );
308
309 // Adds ellipses following the number of locations defined in $assigned_locations.
310 if ( ! empty( $assigned_locations ) ) {
311 printf(
312 ' (%1$s%2$s)',
313 implode( ', ', $assigned_locations ),
314 count( $locations_assigned_to_this_menu ) > count( $assigned_locations ) ? ' &hellip;' : ''
315 );
316 }
317 }
318 ?>
319 </option>
320 <?php endforeach; ?>
321 <option value="custom" <?php selected( 'custom', $mysticky_options['mysticky_class_id_selector'] ); ?>><?php esc_html_e( 'Other Class Or ID', 'mystickymenu' );?></option>
322 </select>
323
324 <input type="text" size="18" id="mysticky_class_selector" class="mystickyinput" name="mysticky_option_name[mysticky_class_selector]" value="<?php echo $mysticky_options['mysticky_class_selector'];?>" />
325
326 <p class="description"><?php _e("menu or header element class or id.", 'mystickymenu')?></p>
327 </td>
328 <td>
329 <div class="mysticky_device_upgrade">
330 <label class="mysticky_title"><?php _e("Devices", 'mystickymenu')?></label>
331 <span class="myStickymenu-upgrade"><a class="sticky-header-upgrade" href="<?php echo esc_url($upgarde_url); ?>" target="_blank"><?php _e( 'Upgrade Now', 'mystickymenu' );?></a></span>
332
333 <ul class="mystickymenu-input-multicheckbox">
334 <li>
335 <label>
336 <input id="disable_css" name="mysticky_option_name[device_desktop]" type="checkbox" checked disabled />
337 <?php _e( 'Desktop', 'mystickymenu' );?>
338 </label>
339 </li>
340 <li>
341 <label>
342 <input id="disable_css" name="mysticky_option_name[device_mobile]" type="checkbox" checked disabled />
343 <?php _e( 'Mobile', 'mystickymenu' );?>
344 </label>
345 </li>
346 </ul>
347 </div>
348 </td>
349 </tr>
350 </table>
351 </div>
352
353
354 <div class="mystickymenu-content-section">
355 <h3><?php esc_html_e( 'Settings', 'mystickymenu' );?></h3>
356 <table class="form-table">
357 <tr>
358 <td>
359 <label for="myfixed_zindex" class="mysticky_title"><?php _e("Sticky z-index", 'mystickymenu')?></label>
360 </td>
361 <td>
362 <input type="number" min="0" max="2147483647" step="1" class="mysticky-number" id="myfixed_zindex" name="mysticky_option_name[myfixed_zindex]" value="<?php echo $mysticky_options['myfixed_zindex'];?>" />
363 </td>
364 <td>
365 <label class="mysticky_title myssticky-remove-hand"><?php _e("Fade or slide effect", 'mystickymenu')?></label>
366 </td>
367 <td>
368 <label>
369 <input name="mysticky_option_name[myfixed_fade]" value= "slide" type="radio" <?php checked( @$mysticky_options['myfixed_fade'], 'slide' );?> />
370 <?php _e("Slide", 'mystickymenu'); ?>
371 </label>
372 <label>
373 <input name="mysticky_option_name[myfixed_fade]" value="fade" type="radio" <?php checked( @$mysticky_options['myfixed_fade'], 'fade' );?> />
374 <?php _e("Fade", 'mystickymenu'); ?>
375 </label>
376 </td>
377 </tr>
378 <tr>
379 <td>
380 <label for="myfixed_disable_small_screen" class="mysticky_title"><?php _e("Disable at Small Screen Sizes", 'mystickymenu')?></label>
381 <p class="description"><?php esc_attr_e('Less than chosen screen width, set 0 to disable','mystickymenu');?></p>
382 </td>
383 <td>
384 <div class="px-wrap">
385 <input type="number" class="" min="0" step="1" id="myfixed_disable_small_screen" name="mysticky_option_name[myfixed_disable_small_screen]" value="<?php echo $mysticky_options['myfixed_disable_small_screen'];?>" />
386 <span class="input-px">PX</span>
387 </div>
388 </td>
389 <td>
390 <label for="mysticky_active_on_height" class="mysticky_title"><?php _e("Make visible on Scroll", 'mystickymenu')?></label>
391 <p class="description"><?php esc_attr_e('If set to 0 auto calculate will be used.','mystickymenu');?></p>
392 </td>
393 <td>
394 <div class="px-wrap">
395 <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 $mysticky_options['mysticky_active_on_height'];?>" />
396 <span class="input-px">PX</span>
397 </div>
398 </td>
399 </tr>
400 <tr>
401 <td>
402 <label for="mysticky_active_on_height_home" class="mysticky_title"><?php _e("Make visible on Scroll at homepage", 'mystickymenu')?></label>
403 <p class="description"><?php _e( 'If set to 0 it will use initial Make visible on Scroll value.', 'mystickymenu' );?></p>
404 </td>
405 <td>
406 <div class="px-wrap">
407 <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 $mysticky_options['mysticky_active_on_height_home'];?>" />
408 <span class="input-px">PX</span>
409 </div>
410 </td>
411 <td>
412 <label for="myfixed_bgcolor" class="mysticky_title myssticky-remove-hand"><?php _e("Sticky Background Color", 'mystickymenu')?></label>
413 </td>
414 <td>
415 <input type="text" id="myfixed_bgcolor" name="mysticky_option_name[myfixed_bgcolor]" class="my-color-field" data-alpha="true" value="<?php echo $mysticky_options['myfixed_bgcolor'];?>" />
416
417 </td>
418 </tr>
419 <tr>
420 <td>
421 <label for="myfixed_transition_time" class="mysticky_title"><?php _e("Sticky Transition Time", 'mystickymenu')?></label>
422 </td>
423 <td>
424 <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 $mysticky_options['myfixed_transition_time'];?>" />
425 </td>
426 <td>
427 <label for="myfixed_textcolor" class="mysticky_title myssticky-remove-hand"><?php _e("Sticky Text Color", 'mystickymenu')?></label>
428 </td>
429 <td>
430 <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'])) ? $mysticky_options['myfixed_textcolor'] : '';?>" />
431
432 </td>
433 </tr>
434 <tr>
435 <td>
436 <label for="myfixed_opacity" class="mysticky_title myssticky-remove-hand"><?php _e("Sticky Opacity", 'mystickymenu')?></label>
437 <p class="description"><?php _e( 'numbers 1-100.', 'mystickymenu');?></p>
438 </td>
439 <td>
440 <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 $mysticky_options['myfixed_opacity'];?>" />
441 <div id="slider">
442 <div id="custom-handle" class="ui-slider-handle"><?php //echo $mysticky_options['myfixed_opacity'];?></div>
443 </div>
444
445 </td>
446 </tr>
447 </table>
448 </div>
449
450 <div class="mystickymenu-content-section <?php echo !$is_old?"mystickymenu-content-upgrade":""?>" >
451
452 <div class="mystickymenu-content-option">
453 <label class="mysticky_title css-style-title"><?php _e("Hide on Scroll Down", 'mystickymenu'); ?></label>
454 <?php if(!$is_old) { ?><span class="myStickymenu-upgrade"><a class="sticky-header-upgrade" href="<?php echo esc_url($upgarde_url); ?>" target="_blank"><?php _e( 'Upgrade Now', 'mystickymenu' );?></a></span><?php } ?>
455 <p>
456 <label class="mysticky_text">
457 <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":"" ?> />
458 <?php _e("Disable sticky menu at scroll down", 'mystickymenu'); ?>
459 </label>
460 </p>
461 </div>
462 <div class="mysticky-page-target-setting mystickymenu-content-option">
463 <label class="mysticky_title"><?php esc_attr_e('Page targeting', 'myStickymenu'); ?></label>
464 <div class="mystickymenu-input-section mystickymenu-page-target-wrap">
465 <div class="mysticky-welcomebar-setting-content-right">
466 <div class="mysticky-page-options" id="mysticky-welcomebar-page-options">
467 <?php $page_option = (isset($mysticky_options['mysticky_page_settings'])) ? $mysticky_options['mysticky_page_settings'] : array();
468 $url_options = array(
469 'page_contains' => 'pages that contain',
470 'page_has_url' => 'a specific page',
471 'page_start_with' => 'pages starting with',
472 'page_end_with' => 'pages ending with',
473 );
474
475 if(!empty($page_option) && is_array($page_option)) {
476 $count = 0;
477 foreach($page_option as $k=>$option) {
478 $count++;
479 ?>
480 <div class="mysticky-page-option <?php echo $k==count($page_option)?"last":""; ?>">
481 <div class="url-content">
482 <div class="mysticky-welcomebar-url-select">
483 <select name="mysticky_option_name[mysticky_page_settings][<?php echo $count; ?>][shown_on]" id="url_shown_on_<?php echo $count ?>_option">
484 <option value="show_on" <?php echo $option['shown_on']=="show_on"?"selected":"" ?> ><?php esc_html_e( 'Show on', 'mysticky' )?></option>
485 <option value="not_show_on" <?php echo $option['shown_on']=="not_show_on"?"selected":"" ?>><?php esc_html_e( "Don't show on", "mysticky" );?></option>
486 </select>
487 </div>
488 <div class="mysticky-welcomebar-url-option">
489 <select class="mysticky-url-options" name="mysticky_option_name[mysticky_page_settings][<?php echo $count; ?>][option]" id="url_rules_<?php echo $count ?>_option">
490 <option disabled value=""><?php esc_html_e( "Select Rule", "mysticky" );?></option>
491 <?php foreach($url_options as $key=>$value) {
492 $selected = ( isset($option['option']) && $option['option']==$key )?" selected='selected' ":"";
493 echo '<option '.$selected.' value="'.$key.'">'.$value.'</option>';
494 } ?>
495 </select>
496 </div>
497 <div class="mysticky-welcomebar-url-box">
498 <span class='mysticky-welcomebar-url'><?php echo site_url("/"); ?></span>
499 </div>
500 <div class="mysticky-welcomebar-url-values">
501 <input type="text" value="<?php echo $option['value'] ?>" name="mysticky_option_name[mysticky_page_settings][<?php echo $count; ?>][value]" id="url_rules_<?php echo $count; ?>_value" />
502 </div>
503 <div class="mysticky-welcomebar-url-buttons">
504 <a class="mysticky-remove-rule" href="javascript:;">x</a>
505 </div>
506 <div class="clear"></div>
507 </div>
508 </div>
509 <?php
510 }
511 }
512 ?>
513 </div>
514 <a href="javascript:void(0);" class="create-rule" id="mysticky_create-rule"><?php esc_html_e( "Add Rule", "mystickymenu" );?></a>
515 </div>
516 <input type="hidden" id="mysticky_welcomebar_site_url" value="<?php echo site_url("/") ?>" />
517 <div class="mysticky-page-options-html" style="display: none;">
518 <div class="mysticky-page-option">
519 <div class="url-content">
520 <div class="mysticky-welcomebar-url-select">
521 <select name="" id="url_shown_on___count___option">
522 <option value="show_on"><?php esc_html_e("Show on", "mysticky" );?></option>
523 <option value="not_show_on"><?php esc_html_e("Don't show on", "mysticky" );?></option>
524 </select>
525 </div>
526 <div class="mysticky-welcomebar-url-option">
527 <select class="mysticky-url-options" name="" id="url_rules___count___option">
528 <option selected="selected" disabled value=""><?php esc_html_e("Select Rule", "mysticky" );?></option>
529 <?php foreach($url_options as $key=>$value) {
530 echo '<option value="'.$key.'">'.$value.'</option>';
531 } ?>
532 </select>
533 </div>
534 <div class="mysticky-welcomebar-url-box">
535 <span class='mysticky-welcomebar-url'><?php echo site_url("/"); ?></span>
536 </div>
537 <div class="mysticky-welcomebar-url-values">
538 <input type="text" value="" name="mysticky_option_name[mysticky_page_settings][__count__][value]" id="url_rules___count___value" disabled />
539 </div>
540 <div class="clear"></div>
541 </div>
542 <span class="myStickymenu-upgrade"><a class="sticky-header-upgrade" href="<?php echo esc_url($upgarde_url); ?>" target="_blank"><?php _e( 'Upgrade Now', 'mystickymenu' );?></a></span>
543 </div>
544 </div>
545 </div>
546 </div>
547 <div class="mystickymenu-content-option">
548 <label class="mysticky_title css-style-title"><?php _e("CSS style", 'mystickymenu'); ?></label>
549 <span class="mysticky_text"><?php _e( 'Add/edit CSS style. Leave it blank for default style.', 'mystickymenu');?></span>
550 <div class="mystickymenu-input-section">
551 <textarea type="text" rows="4" cols="60" id="myfixed_cssstyle" name="mysticky_option_name[myfixed_cssstyle]" <?php echo !$is_old?"disabled":"" ?> ><?php echo @$mysticky_options['myfixed_cssstyle'];?></textarea>
552 </div>
553 <p><?php esc_html_e( "CSS ID's and Classes to use:", "mystickymenu" );?></p>
554 <p>
555 #mysticky-wrap { }<br/>
556 #mysticky-nav.wrapfixed { }<br/>
557 #mysticky-nav.wrapfixed.up { }<br/>
558 #mysticky-nav.wrapfixed.down { }<br/>
559 #mysticky-nav .navbar { }<br/>
560 #mysticky-nav .navbar.myfixed { }<br/>
561 </p>
562 </div>
563
564 <div class="mystickymenu-content-option">
565 <label class="mysticky_title" for="disable_css"><?php _e("Disable CSS style", 'mystickymenu'); ?></label>
566 <div class="mystickymenu-input-section">
567 <label>
568 <input id="disable_css" name="mysticky_option_name[disable_css]" type="checkbox" <?php echo !$is_old?"disabled":"" ?> <?php checked( @$mysticky_options['disable_css'], 'on' );?> />
569 <?php _e( 'Use this option if you plan to include CSS Style manually', 'mystickymenu' );?>
570 </label>
571 </div>
572 <p></p>
573 </div>
574
575 <div class="mystickymenu-content-option">
576 <label class="mysticky_title"><?php _e("Disable at", 'mystickymenu'); ?></label>
577 <?php if(!$is_old) { ?><span class="myStickymenu-upgrade"><a class="sticky-header-upgrade" href="<?php echo esc_url($upgarde_url); ?>" target="_blank"><?php _e( 'Upgrade Now', 'mystickymenu' );?></a></span><?php } ?>
578 <div class="mystickymenu-input-section">
579 <ul class="mystickymenu-input-multicheckbox">
580 <li>
581 <label>
582 <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' );?>/>
583 <span><?php esc_attr_e('front page', 'mystickymenu' );?></span>
584 </label>
585 </li>
586 <li>
587 <label>
588 <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' );?>/>
589 <span><?php esc_attr_e('blog page', 'mystickymenu' );?></span>
590 </label>
591 </li>
592 <li>
593 <label>
594 <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' );?> />
595 <span><?php esc_attr_e('pages', 'mystickymenu' );?> </span>
596 </label>
597 </li>
598 <li>
599 <label>
600 <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' );?> />
601 <span><?php esc_attr_e('tags', 'mystickymenu' );?> </span>
602 </label>
603 </li>
604 <li>
605 <label>
606 <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' );?>/>
607 <span><?php esc_attr_e('categories', 'mystickymenu' );?></span>
608 </label>
609 </li>
610 <li>
611 <label>
612 <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' );?> />
613 <span><?php esc_attr_e('posts', 'mystickymenu' );?> </span>
614 </label>
615 </li>
616 <li>
617 <label>
618 <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' );?> />
619 <span><?php esc_attr_e('archives', 'mystickymenu' );?> </span>
620 </label>
621 </li>
622 <li>
623 <label>
624 <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' );?> />
625 <span><?php esc_attr_e('search', 'mystickymenu' );?> </span>
626 </label>
627 </li>
628 <li>
629 <label>
630 <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' );?>/>
631 <span><?php esc_attr_e('404', 'mystickymenu' );?> </span>
632 </label>
633 </li>
634 </ul>
635
636 <?php
637 if (isset ( $mysticky_options['mysticky_disable_at_page'] ) == true ) {
638 echo '<div class="mystickymenu-input-section">';
639 _e('<span class="description"><strong>Except for this pages:</strong> </span>', 'mystickymenu');
640
641 printf(
642 '<input type="text" size="26" class="mystickymenu_normal_text" id="mysticky_enable_at_pages" name="mysticky_option_name[mysticky_enable_at_pages]" value="%s" /> ',
643 isset( $mysticky_options['mysticky_enable_at_pages'] ) ? esc_attr( $mysticky_options['mysticky_enable_at_pages']) : ''
644 );
645
646 _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');
647 echo '</div>';
648 }
649
650 if (isset ( $mysticky_options['mysticky_disable_at_single'] ) == true ) {
651
652 echo '<div class="mystickymenu-input-section">';
653 _e('<span class="description"><strong>Except for this posts:</strong> </span>', 'mystickymenu');
654
655 printf(
656 '<input type="text" size="26" class="mystickymenu_normal_text" id="mysticky_enable_at_posts" name="mysticky_option_name[mysticky_enable_at_posts]" value="%s" /> ',
657 isset( $mysticky_options['mysticky_enable_at_posts'] ) ? esc_attr( $mysticky_options['mysticky_enable_at_posts']) : ''
658 );
659
660 _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');
661 echo '</div>';
662
663 }
664 ?>
665 <p></p>
666 </div>
667 </div>
668
669 </div>
670 <p class="submit">
671 <input type="submit" name="submit" id="submit" class="button button-primary" value="<?php esc_attr_e('Save', 'mystickymenu');?>">
672 </p>
673 <input type="hidden" name="nonce" value="<?php echo $nonce ?>">
674 </form>
675 <form class="mysticky-hideformreset" method="post" action="">
676 <input name="reset_mysticky_options" class="button button-secondary confirm" type="submit" value="<?php esc_attr_e('Reset', 'mystickymenu');?>" >
677 <input type="hidden" name="action" value="reset" />
678 <?php $nonce = wp_create_nonce('mysticky_option_backend_reset_nonce'); ?>
679 <input type="hidden" name="nonce" value="<?php echo $nonce ?>">
680 </form>
681 <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>
682 </div>
683 </div>
684 <?php }
685 }
686 public function mystickystickymenu_admin_new_welcomebar_page() {
687 ?>
688 <div id="mystickymenu" class="wrap mystickymenu mystickymenu-new-widget-wrap">
689 <?php include_once dirname(__FILE__) . '/mystickymeny-new-welcomebar.php';?>
690 </div>
691 <?php
692 }
693
694 public function mystickystickymenu_admin_welcomebar_page() {
695 /* welcome bar save data */
696 if (isset($_POST['mysticky_option_welcomebar']) && !empty($_POST['mysticky_option_welcomebar']) && isset($_POST['nonce'])) {
697 if(!empty($_POST['nonce']) && wp_verify_nonce($_POST['nonce'], 'mysticky_option_welcomebar_update')) {
698 $mysticky_option_welcomebar = filter_var_array( $_POST['mysticky_option_welcomebar'], FILTER_SANITIZE_STRING );
699 $mysticky_option_welcomebar['mysticky_welcomebar_bar_text'] = $_POST['mysticky_option_welcomebar']['mysticky_welcomebar_bar_text'];
700 $mysticky_option_welcomebar['mysticky_welcomebar_height'] = 60;
701 $mysticky_option_welcomebar['mysticky_welcomebar_device_desktop'] = 'desktop';
702 $mysticky_option_welcomebar['mysticky_welcomebar_device_mobile'] = 'mobile';
703 $mysticky_option_welcomebar['mysticky_welcomebar_trigger'] = 'after_a_few_seconds';
704 $mysticky_option_welcomebar['mysticky_welcomebar_triggersec'] = '0';
705 $mysticky_option_welcomebar['mysticky_welcomebar_expirydate'] = '';
706 $mysticky_option_welcomebar['mysticky_welcomebar_page_settings'] = '';
707 update_option( 'mysticky_option_welcomebar', $mysticky_option_welcomebar);
708 $this->mysticky_clear_all_caches();
709 echo '<div class="updated settings-error notice is-dismissible "><p><strong>' . esc_html__('Settings saved.','mystickymenu'). '</p></strong></div>';
710 } else {
711 wp_verify_nonce($_GET['nonce'], 'wporg_frontend_delete');
712 echo '<div class="error settings-error notice is-dismissible "><p><strong>' . esc_html__('Unable to complete your request','mystickymenu'). '</p></strong></div>';
713 }
714 }
715 if (isset($_POST['mysticky_welcomebar_reset']) && !empty($_POST['mysticky_welcomebar_reset']) && isset($_POST['nonce_reset'])) {
716 if(!empty($_POST['nonce_reset']) && wp_verify_nonce($_POST['nonce_reset'], 'mysticky_option_welcomebar_reset')) {
717 $mysticky_option_welcomebar_reset = mysticky_welcomebar_pro_widget_default_fields();
718 update_option( 'mysticky_option_welcomebar', $mysticky_option_welcomebar_reset);
719 $this->mysticky_clear_all_caches();
720 echo '<div class="updated settings-error notice is-dismissible "><p><strong>' . esc_html__('Reset Settings saved.','mystickymenu'). '</p></strong></div>';
721 } else {
722 wp_verify_nonce($_GET['nonce'], 'wporg_frontend_delete');
723 echo '<div class="error settings-error notice is-dismissible "><p><strong>' . esc_html__('Unable to complete your request','mystickymenu'). '</p></strong></div>';
724 }
725 }
726
727 $mysticky_options = get_option( 'mysticky_option_name');
728 $is_old = get_option("has_sticky_header_old_version");
729 $is_old = ($is_old == "yes")?true:false;
730 $nonce = wp_create_nonce('mysticky_option_backend_update');
731 $pro_url = "https://go.premio.io/?edd_action=add_to_cart&download_id=2199&edd_options[price_id]=";
732
733 ?>
734 <style>
735 div#wpcontent {
736 background: rgba(101,114,219,1);
737 background: -moz-linear-gradient(-45deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
738 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)));
739 background: -webkit-linear-gradient(-45deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
740 background: -o-linear-gradient(-45deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
741 background: -ms-linear-gradient(-45deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
742 background: linear-gradient(135deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
743 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6572db', endColorstr='#ee86c6', GradientType=1 );
744 }
745 </style>
746 <div id="mystickymenu" class="wrap mystickymenu">
747 <div class="sticky-header-menu">
748 <ul>
749 <li><a href="<?php echo admin_url( 'admin.php?page=my-stickymenu-settings' ) ?>"><?php _e('Sticky Menu', 'mystickymenu'); ?></a></li>
750 <li><a href="<?php echo admin_url( 'admin.php?page=my-stickymenu-welcomebar' ) ?>" class="active" ><?php _e('Welcome Bar', 'mystickymenu'); ?></a></li>
751 <li><a href="<?php echo admin_url( 'admin.php?page=my-stickymenu-upgrade' ) ?>"><?php _e('Upgrade to Pro', 'mystickymenu'); ?></a></li>
752 </ul>
753 </div>
754 <div id="sticky-header-welcome-bar" class="sticky-header-content">
755 <?php mysticky_welcome_bar_backend(); ?>
756 </div>
757 </div>
758 <?php
759 }
760 public function mystickymenu_recommended_plugins() {
761 include_once 'recommended-plugins.php';
762 }
763 public function mystickymenu_admin_upgrade_to_pro() {
764 $pro_url = "https://go.premio.io/checkount/?edd_action=add_to_cart&download_id=2199&edd_options[price_id]=";
765 ?>
766 <style>
767 div#wpcontent {
768 background: rgba(101,114,219,1);
769 background: -moz-linear-gradient(-45deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
770 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)));
771 background: -webkit-linear-gradient(-45deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
772 background: -o-linear-gradient(-45deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
773 background: -ms-linear-gradient(-45deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
774 background: linear-gradient(135deg, rgba(101,114,219,1) 0%, rgba(238,134,198,1) 67%, rgba(238,134,198,1) 100%);
775 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6572db', endColorstr='#ee86c6', GradientType=1 );
776 }
777 </style>
778 <div id="mystickymenu" class="wrap mystickymenu">
779 <div class="sticky-header-menu">
780 <ul>
781 <li><a href="<?php echo admin_url( 'admin.php?page=my-stickymenu-settings' ) ?>"><?php _e('Sticky Menu', 'mystickymenu'); ?></a></li>
782 <li><a href="<?php echo admin_url( 'admin.php?page=my-stickymenu-welcomebar' ) ?>" ><?php _e('Welcome Bar', 'mystickymenu'); ?></a></li>
783 <li><a href="<?php echo admin_url( 'admin.php?page=my-stickymenu-upgrade' ) ?>" class="active" ><?php _e('Upgrade to Pro', 'mystickymenu'); ?></a></li>
784 </ul>
785 </div>
786 <?php include_once "upgrade-to-pro.php"; ?>
787 </div>
788 <?php
789 }
790
791 public function mysticky_default_options() {
792
793 global $options;
794 $menu_locations = get_nav_menu_locations();
795 $menu_object = isset($menu_locations['menu-1']) ? wp_get_nav_menu_object( $menu_locations['menu-1'] ) : array();
796
797 if ( is_object($menu_object) && $menu_object->slug != '' ) {
798 $mysticky_class_id_selector = $menu_object->slug;
799 } else {
800 $mysticky_class_id_selector = 'custom';
801 }
802
803 $mystickyClass = '.navbar';
804 $template_name = get_template();
805 switch( $template_name ){
806 case 'ashe':
807 $mysticky_class_id_selector = 'custom';
808 $mystickyClass = '#main-nav';
809 break;
810 case 'astra':
811 case 'hello-elementor':
812 case 'sydney':
813 case 'twentysixteen':
814 $mysticky_class_id_selector = 'custom';
815 $mystickyClass = 'header.site-header';
816 break;
817 case 'generatepress':
818 $mysticky_class_id_selector = 'custom';
819 $mystickyClass = 'nav.main-navigation';
820 break;
821 case 'transportex':
822 $mysticky_class_id_selector = 'custom';
823 $mystickyClass = '.transportex-menu-full';
824 break;
825 case 'hestia':
826 case 'neve':
827 $mysticky_class_id_selector = 'custom';
828 $mystickyClass = 'header.header';
829 break;
830 case 'mesmerize':
831 $mysticky_class_id_selector = 'custom';
832 $mystickyClass = '.navigation-bar';
833 break;
834 case 'oceanwp':
835 $mysticky_class_id_selector = 'custom';
836 $mystickyClass = 'header#site-header';
837 break;
838 case 'shapely':
839 $mysticky_class_id_selector = 'custom';
840 $mystickyClass = '#site-navigation';
841 break;
842 case 'storefront':
843 $mysticky_class_id_selector = 'custom';
844 $mystickyClass = '.storefront-primary-navigation';
845 break;
846 case 'twentynineteen':
847 $mysticky_class_id_selector = 'custom';
848 $mystickyClass = '#site-navigation';
849 break;
850 case 'twentyseventeen':
851 $mysticky_class_id_selector = 'custom';
852 $mystickyClass = '.navigation-top';
853 break;
854 default:
855 break;
856 }
857
858
859 $default = array(
860 'mysticky_class_id_selector' => $mysticky_class_id_selector,
861 'mysticky_class_selector' => $mystickyClass,
862 'device_desktop' => 'on',
863 'device_mobile' => 'on',
864 'myfixed_zindex' => '99990',
865 'myfixed_bgcolor' => '#f7f5e7',
866 'myfixed_opacity' => '90',
867 'myfixed_transition_time' => '0.3',
868 'myfixed_disable_small_screen' => '0',
869 'myfixed_disable_large_screen' => '0',
870 'mysticky_active_on_height' => '0',
871 'mysticky_active_on_height_home'=> '0',
872 'myfixed_fade' => 'slide',
873 'myfixed_cssstyle' => '#mysticky-nav .myfixed { margin:0 auto; float:none; border:0px; background:none; max-width:100%; }'
874 );
875
876 if ( get_option('mysticky_option_name') == false && current_user_can( 'manage_options' ) ) {
877 $status = get_option("sticky_header_status");
878 if($status == false) {
879 update_option("sticky_header_status", "done");
880 update_option("has_sticky_header_old_version", "no");
881 }
882 update_option( 'mysticky_option_name', $default );
883 } else {
884 $status = get_option("sticky_header_status");
885 if($status == false) {
886 update_option("sticky_header_status", "done");
887 update_option("has_sticky_header_old_version", "yes");
888 }
889 }
890
891 if(isset($_POST['reset_mysticky_options']) && current_user_can( 'manage_options' )) {
892 if(isset($_REQUEST['nonce']) && !empty($_REQUEST['nonce']) && wp_verify_nonce($_REQUEST['nonce'], 'mysticky_option_backend_reset_nonce')) {
893 update_option('mysticky_option_name', $default);
894 } else {
895
896 }
897 }
898
899 if ( !get_option( 'update_mysticky_version_2_6') && current_user_can( 'manage_options' )) {
900 $mysticky_option_name = get_option( 'mysticky_option_name' );
901 $mysticky_option_name['mysticky_class_id_selector'] = 'custom';
902 if ($mysticky_option_name['myfixed_fade'] == 'on'){
903 $mysticky_option_name['myfixed_fade'] = 'slide';
904 }else{
905 $mysticky_option_name['myfixed_fade'] = 'fade';
906 }
907 update_option( 'mysticky_option_name', $mysticky_option_name );
908 update_option( 'update_mysticky_version_2_6', true );
909 }
910 }
911
912 /*
913 * clear cache when any option is updated
914 *
915 */
916 public function mysticky_clear_all_caches(){
917
918 try {
919 global $wp_fastest_cache;
920
921 // if W3 Total Cache is being used, clear the cache
922 if (function_exists('w3tc_flush_all')) {
923 w3tc_flush_all();
924 }
925 /* if WP Super Cache is being used, clear the cache */
926 if (function_exists('wp_cache_clean_cache')) {
927 global $file_prefix, $supercachedir;
928 if (empty($supercachedir) && function_exists('get_supercache_dir')) {
929 $supercachedir = get_supercache_dir();
930 }
931 wp_cache_clean_cache($file_prefix);
932 }
933
934 if (class_exists('WpeCommon')) {
935 //be extra careful, just in case 3rd party changes things on us
936 if (method_exists('WpeCommon', 'purge_memcached')) {
937 //WpeCommon::purge_memcached();
938 }
939 if (method_exists('WpeCommon', 'clear_maxcdn_cache')) {
940 //WpeCommon::clear_maxcdn_cache();
941 }
942 if (method_exists('WpeCommon', 'purge_varnish_cache')) {
943 //WpeCommon::purge_varnish_cache();
944 }
945 }
946
947 if (method_exists('WpFastestCache', 'deleteCache') && !empty($wp_fastest_cache)) {
948 $wp_fastest_cache->deleteCache();
949 }
950 if (function_exists('rocket_clean_domain')) {
951 rocket_clean_domain();
952 // Preload cache.
953 if (function_exists('run_rocket_sitemap_preload')) {
954 run_rocket_sitemap_preload();
955 }
956 }
957
958 if (class_exists("autoptimizeCache") && method_exists("autoptimizeCache", "clearall")) {
959 autoptimizeCache::clearall();
960 }
961
962 if (class_exists("LiteSpeed_Cache_API") && method_exists("autoptimizeCache", "purge_all")) {
963 LiteSpeed_Cache_API::purge_all();
964 }
965
966 if ( class_exists( '\Hummingbird\Core\Utils' ) ) {
967
968 $modules = \Hummingbird\Core\Utils::get_active_cache_modules();
969 foreach ( $modules as $module => $name ) {
970 $mod = \Hummingbird\Core\Utils::get_module( $module );
971
972 if ( $mod->is_active() ) {
973 if ( 'minify' === $module ) {
974 $mod->clear_files();
975 } else {
976 $mod->clear_cache();
977 }
978 }
979 }
980 }
981
982 } catch (Exception $e) {
983 return 1;
984 }
985 }
986
987 public function mystickymenu_deactivate() {
988 global $pagenow;
989
990 if ( 'plugins.php' !== $pagenow ) {
991 return;
992 }
993 include dirname(__FILE__) . "/mystickymenu-deactivate-form.php";
994 }
995 public function mystickymenu_plugin_deactivate() {
996 global $current_user;
997 if ( ! current_user_can( 'manage_options' ) ) {
998 wp_die(0);
999 }
1000 check_ajax_referer( 'mystickymenu_deactivate_nonce', 'nonce' );
1001
1002 $postData = $_POST;
1003 $errorCounter = 0;
1004 $response = array();
1005 $response['status'] = 0;
1006 $response['message'] = "";
1007 $response['valid'] = 1;
1008 if(!isset($postData['reason']) || empty($postData['reason'])) {
1009 $errorCounter++;
1010 $response['message'] = "Please provide reason";
1011 } else if(!isset($postData['reason']) || empty($postData['reason'])) {
1012 $errorCounter++;
1013 $response['message'] = "Please provide reason";
1014 } else {
1015 $nonce = $postData['nonce'];
1016 if(!wp_verify_nonce($nonce, 'mystickymenu_deactivate_nonce')) {
1017 $response['message'] = __("Your request is not valid", "mystickymenu");
1018 $errorCounter++;
1019 $response['valid'] = 0;
1020 }
1021 }
1022 if($errorCounter == 0) {
1023 global $current_user;
1024 $plugin_info = get_plugin_data( dirname(__FILE__) . "/mystickymenu.php" );
1025 $postData = $_POST;
1026 $email = "none@none.none";
1027
1028 if (isset($postData['email_id']) && !empty($postData['email_id']) && filter_var($postData['email_id'], FILTER_VALIDATE_EMAIL)) {
1029 $email = $postData['email_id'];
1030 }
1031 $domain = site_url();
1032 $user_name = $current_user->first_name . " " . $current_user->last_name;
1033 $subject = "My Sticky Menu was removed from {$domain}";
1034 $headers = "MIME-Version: 1.0\r\n";
1035 $headers .= "Content-Type: text/html; charset=UTF-8\r\n";
1036 $headers .= 'From: ' . $user_name . ' <' . $email . '>' . PHP_EOL;
1037 $headers .= 'Reply-To: ' . $user_name . ' <' . $email . '>' . PHP_EOL;
1038 $headers .= 'X-Mailer: PHP/' . phpversion();
1039 ob_start();
1040 ?>
1041 <table border="0" cellspacing="0" cellpadding="5">
1042 <tr>
1043 <th>Plugin</th>
1044 <td>My Sticky Menu</td>
1045 </tr>
1046 <tr>
1047 <th>Plugin Version</th>
1048 <td><?php echo $plugin_info['Version']; ?></td>
1049 </tr>
1050 <tr>
1051 <th>Domain</th>
1052 <td><?php echo $domain ?></td>
1053 </tr>
1054 <tr>
1055 <th>Email</th>
1056 <td><?php echo $email ?></td>
1057 </tr>
1058 <tr>
1059 <th>Reason</th>
1060 <td><?php echo nl2br($postData['reason']) ?></td>
1061 </tr>
1062 <tr>
1063 <th>WordPress Version</th>
1064 <td><?php echo get_bloginfo('version') ?></td>
1065 </tr>
1066 <tr>
1067 <th>PHP Version</th>
1068 <td><?php echo PHP_VERSION ?></td>
1069 </tr>
1070 </table>
1071 <?php
1072 $content = ob_get_clean();
1073 $to = "gal@premio.io,karina@premio.io";
1074 wp_mail($to, $subject, $content, $headers);
1075 $response['status'] = 1;
1076 }
1077 echo json_encode($response);
1078 wp_die();
1079 }
1080 }
1081
1082
1083
1084 class MyStickyMenuFrontend
1085 {
1086
1087 public function __construct()
1088 {
1089 add_action( 'wp_head', array( $this, 'mysticky_build_stylesheet_content' ) );
1090 add_action( 'wp_enqueue_scripts', array( $this, 'mysticky_disable_at' ) );
1091 }
1092
1093 public function mysticky_build_stylesheet_content() {
1094
1095 $mysticky_options = get_option( 'mysticky_option_name' );
1096
1097 if (isset($mysticky_options['disable_css'])) {
1098 //do nothing
1099 } else {
1100 $mysticky_options['disable_css'] = false;
1101 }
1102
1103 if ($mysticky_options ['disable_css'] == false ) {
1104
1105 echo '<style id="mystickymenu" type="text/css">';
1106 echo '#mysticky-nav { width:100%; position: static; }';
1107 echo '#mysticky-nav.wrapfixed { position:fixed; left: 0px; margin-top:0px; z-index: '. $mysticky_options ['myfixed_zindex'] .'; -webkit-transition: ' . $mysticky_options ['myfixed_transition_time'] . 's; -moz-transition: ' . $mysticky_options ['myfixed_transition_time'] . 's; -o-transition: ' . $mysticky_options ['myfixed_transition_time'] . 's; transition: ' . $mysticky_options ['myfixed_transition_time'] . 's; -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=' . $mysticky_options ['myfixed_opacity'] . ')"; filter: alpha(opacity=' . $mysticky_options ['myfixed_opacity'] . '); opacity:' . $mysticky_options ['myfixed_opacity'] / 100 . '; background-color: ' . $mysticky_options ['myfixed_bgcolor'] . ';}';
1108
1109 echo '#mysticky-nav.wrapfixed .myfixed{ background-color: ' . $mysticky_options ['myfixed_bgcolor'] . '; position: relative;top: auto;left: auto;right: auto;}';
1110
1111 if ( isset($mysticky_options ['myfixed_textcolor']) && $mysticky_options ['myfixed_textcolor'] != '' ) {
1112 echo '#mysticky-nav.wrapfixed ul li.menu-item a { color: ' . $mysticky_options ['myfixed_textcolor'] . ';}';
1113 }
1114
1115
1116 if ($mysticky_options ['myfixed_disable_small_screen'] > 0 ){
1117 //echo '@media (max-width: '.$mysticky_options['myfixed_disable_small_screen'].'px) {#mysticky-nav.wrapfixed {position: static;} }';
1118 };
1119 if ( !isset( $mysticky_options['myfixed_cssstyle'] ) ) {
1120 echo '#mysticky-nav .myfixed { margin:0 auto; float:none; border:0px; background:none; max-width:100%; }';
1121 }
1122 if ( isset( $mysticky_options['myfixed_cssstyle'] ) && $mysticky_options['myfixed_cssstyle'] != '' ) {
1123 echo $mysticky_options ['myfixed_cssstyle'];
1124 }
1125 echo '</style>';
1126 $template_name = get_template();
1127 ?>
1128 <style type="text/css">
1129 <?php if( $template_name == 'hestia' ) { ?>
1130 #mysticky-nav.wrapfixed {box-shadow: 0 1px 10px -6px #0000006b,0 1px 10px 0 #0000001f,0 4px 5px -2px #0000001a;}
1131 #mysticky-nav.wrapfixed .navbar {position: relative;background-color: transparent;box-shadow: none;}
1132 <?php } ?>
1133 <?php if( $template_name == 'shapely' ) { ?>
1134 #mysticky-nav.wrapfixed #site-navigation {position: relative;}
1135 <?php } ?>
1136 <?php if( $template_name == 'storefront' ) { ?>
1137 #mysticky-nav.wrapfixed > .site-header {margin-bottom: 0;}
1138 #mysticky-nav.wrapfixed > .storefront-primary-navigation {padding: 10px 0;}
1139 <?php } ?>
1140 <?php if( $template_name == 'transportex' ) { ?>
1141 #mysticky-nav.wrapfixed > .transportex-menu-full {margin: 0 auto;}
1142 .transportex-headwidget #mysticky-nav.wrapfixed .navbar-wp {top: 0;}
1143 <?php } ?>
1144 <?php if( $template_name == 'twentynineteen' ) { ?>
1145 #mysticky-nav.wrapfixed {padding: 10px;}
1146 <?php } ?>
1147 <?php if( $template_name == 'twentysixteen' ) { ?>
1148 #mysticky-nav.wrapfixed > .site-header {padding-top: 0;padding-bottom: 0;}
1149 <?php } ?>
1150 <?php if( $template_name == 'twentytwenty' ) { ?>
1151 #site-header {background: transparent;}
1152 <?php } ?>
1153 </style>
1154 <?php
1155 }
1156 }
1157
1158 public function mystickymenu_google_fonts_url() {
1159 $welcomebar = get_option( 'mysticky_option_welcomebar' );
1160
1161 $default_fonts = array('Arial', 'Tahoma', 'Verdana', 'Helvetica', 'Times New Roman', 'Trebuchet MS', 'Georgia' );
1162 $fonts_url = '';
1163 $fonts = array();
1164 $font_args = array();
1165 $base_url = "https://fonts.googleapis.com/css";
1166 $fonts['family']['Lato'] = 'Lato:400,500,600,700';
1167 if ( isset($welcomebar['mysticky_welcomebar_font']) && $welcomebar['mysticky_welcomebar_font'] !='' && !in_array( $welcomebar['mysticky_welcomebar_font'], $default_fonts) ) {
1168 $fonts['family'][$welcomebar['mysticky_welcomebar_font']] = $welcomebar['mysticky_welcomebar_font'] . ':400,500,600,700';
1169 }
1170 if ( isset($welcomebar['mysticky_welcomebar_btnfont']) && $welcomebar['mysticky_welcomebar_btnfont'] !='' && !in_array( $welcomebar['mysticky_welcomebar_btnfont'], $default_fonts) ) {
1171 $fonts['family'][$welcomebar['mysticky_welcomebar_btnfont']] = $welcomebar['mysticky_welcomebar_btnfont'] . ':400,500,600,700';
1172 }
1173
1174 /* Prepapre URL if font family defined. */
1175 if( !empty( $fonts['family'] ) ) {
1176
1177 /* format family to string */
1178 if( is_array($fonts['family']) ){
1179 $fonts['family'] = implode( '|', $fonts['family'] );
1180 }
1181
1182 $font_args['family'] = urlencode( trim( $fonts['family'] ) );
1183
1184 if( !empty( $fonts['subsets'] ) ){
1185
1186 /* format subsets to string */
1187 if( is_array( $fonts['subsets'] ) ){
1188 $fonts['subsets'] = implode( ',', $fonts['subsets'] );
1189 }
1190
1191 $font_args['subsets'] = urlencode( trim( $fonts['subsets'] ) );
1192 }
1193
1194 $fonts_url = add_query_arg( $font_args, $base_url );
1195 }
1196
1197 return esc_url_raw( $fonts_url );
1198 }
1199
1200 public function mystickymenu_script() {
1201
1202 $mysticky_options = get_option( 'mysticky_option_name' );
1203
1204 if ( is_admin_bar_showing() ) {
1205 $top = "true";
1206 } else {
1207 $top = "false";
1208 }
1209
1210 $welcomebar = get_option( 'mysticky_option_welcomebar' );
1211 if ( isset($welcomebar['mysticky_welcomebar_enable']) && $welcomebar['mysticky_welcomebar_enable'] == 1 ) {
1212 wp_enqueue_style('google-fonts', $this->mystickymenu_google_fonts_url(),array(), MYSTICKY_VERSION );
1213 }
1214
1215 // needed for update 1.7 => 1.8 ... will be removed in the future ()
1216 if (isset($mysticky_options['mysticky_active_on_height_home'])) {
1217 //do nothing
1218 } else {
1219 $mysticky_options['mysticky_active_on_height_home'] = $mysticky_options['mysticky_active_on_height'];
1220 }
1221
1222
1223 if ($mysticky_options['mysticky_active_on_height_home'] == 0 ) {
1224 $mysticky_options['mysticky_active_on_height_home'] = $mysticky_options['mysticky_active_on_height'];
1225 }
1226
1227
1228 if ( is_front_page() && is_home() ) {
1229
1230 $mysticky_options['mysticky_active_on_height'] = $mysticky_options['mysticky_active_on_height_home'];
1231
1232 } elseif ( is_front_page()){
1233
1234 $mysticky_options['mysticky_active_on_height'] = $mysticky_options['mysticky_active_on_height_home'];
1235
1236 }
1237 wp_register_script('detectmobilebrowser', plugins_url( 'js/detectmobilebrowser.js', __FILE__ ), array('jquery'), MYSTICKY_VERSION, true);
1238 wp_enqueue_script( 'detectmobilebrowser' );
1239
1240 wp_register_script('mystickymenu', plugins_url( 'js/mystickymenu.min.js', __FILE__ ), array('jquery'), MYSTICKY_VERSION, true);
1241 wp_enqueue_script( 'mystickymenu' );
1242
1243 $myfixed_disable_scroll_down = isset($mysticky_options['myfixed_disable_scroll_down']) ? $mysticky_options['myfixed_disable_scroll_down'] : 'false';
1244 $mystickyTransition = isset($mysticky_options['myfixed_fade']) ? $mysticky_options['myfixed_fade'] : 'fade';
1245 $mystickyDisableLarge = isset($mysticky_options['myfixed_disable_large_screen']) ? $mysticky_options['myfixed_disable_large_screen'] : '0';
1246
1247 $mystickyClass = ( $mysticky_options['mysticky_class_id_selector'] != 'custom') ? '.menu-' . $mysticky_options['mysticky_class_id_selector'] .'-container' : $mysticky_options['mysticky_class_selector'];
1248
1249 if ( $mysticky_options['mysticky_class_id_selector'] != 'custom' ) {
1250 $template_name = get_template();
1251 switch( $template_name ){
1252 case 'ashe':
1253 $mystickyClass = '#main-nav';
1254 break;
1255 case 'astra':
1256 case 'hello-elementor':
1257 case 'sydney':
1258 case 'twentysixteen':
1259 $mystickyClass = 'header.site-header';
1260 break;
1261 case 'generatepress':
1262 $mystickyClass = 'nav.main-navigation';
1263 break;
1264 case 'transportex':
1265 $mystickyClass = '.transportex-menu-full';
1266 break;
1267 case 'hestia':
1268 case 'neve':
1269 $mystickyClass = 'header.header';
1270 break;
1271 case 'mesmerize':
1272 $mystickyClass = '.navigation-bar';
1273 break;
1274 case 'oceanwp':
1275 $mystickyClass = 'header#site-header';
1276 break;
1277 case 'shapely':
1278 $mystickyClass = '#site-navigation';
1279 break;
1280 case 'storefront':
1281 $mystickyClass = '.storefront-primary-navigation';
1282 break;
1283 case 'twentynineteen':
1284 $mystickyClass = '#site-navigation';
1285 break;
1286 case 'twentyseventeen':
1287 $mystickyClass = '.navigation-top';
1288 break;
1289 default:
1290 break;
1291 }
1292 }
1293
1294
1295 $mysticky_translation_array = array(
1296 'mystickyClass' => $mystickyClass,
1297 'activationHeight' => $mysticky_options['mysticky_active_on_height'],
1298 'disableWidth' => $mysticky_options['myfixed_disable_small_screen'],
1299 'disableLargeWidth' => $mystickyDisableLarge,
1300 'adminBar' => $top,
1301 'device_desktop' => true,
1302 'device_mobile' => true,
1303 'mystickyTransition' => $mystickyTransition,
1304 'mysticky_disable_down' => $myfixed_disable_scroll_down,
1305
1306
1307 );
1308 wp_localize_script( 'mystickymenu', 'option', $mysticky_translation_array );
1309 }
1310
1311 public function mysticky_disable_at() {
1312
1313
1314 $mysticky_options = get_option( 'mysticky_option_name' );
1315
1316 $mysticky_disable_at_front_home = isset($mysticky_options['mysticky_disable_at_front_home']);
1317 $mysticky_disable_at_blog = isset($mysticky_options['mysticky_disable_at_blog']);
1318 $mysticky_disable_at_page = isset($mysticky_options['mysticky_disable_at_page']);
1319 $mysticky_disable_at_tag = isset($mysticky_options['mysticky_disable_at_tag']);
1320 $mysticky_disable_at_category = isset($mysticky_options['mysticky_disable_at_category']);
1321 $mysticky_disable_at_single = isset($mysticky_options['mysticky_disable_at_single']);
1322 $mysticky_disable_at_archive = isset($mysticky_options['mysticky_disable_at_archive']);
1323 $mysticky_disable_at_search = isset($mysticky_options['mysticky_disable_at_search']);
1324 $mysticky_disable_at_404 = isset($mysticky_options['mysticky_disable_at_404']);
1325 $mysticky_enable_at_pages = isset($mysticky_options['mysticky_enable_at_pages']) ? $mysticky_options['mysticky_enable_at_pages'] : '';
1326 $mysticky_enable_at_posts = isset($mysticky_options['mysticky_enable_at_posts']) ? $mysticky_options['mysticky_enable_at_posts'] : '';
1327
1328 // Trim input to ignore empty spaces
1329 $mysticky_enable_at_pages_exp = array_map('trim', explode(',', $mysticky_enable_at_pages));
1330 $mysticky_enable_at_posts_exp = array_map('trim', explode(',', $mysticky_enable_at_posts));
1331
1332
1333
1334
1335 if ( is_front_page() && is_home() ) { /* Default homepage */
1336
1337 if ( $mysticky_disable_at_front_home == false ) {
1338 $this->mystickymenu_script();
1339 }
1340 } elseif ( is_front_page()){ /* Static homepage */
1341
1342 if ( $mysticky_disable_at_front_home == false ) {
1343 $this->mystickymenu_script();
1344 }
1345
1346 } elseif ( is_home()){ /* Blog page */
1347
1348 if ( $mysticky_disable_at_blog == false ) {
1349 $this->mystickymenu_script();
1350 }
1351
1352 } elseif ( is_page() ){ /* Single page*/
1353
1354 if ( $mysticky_disable_at_page == false ) {
1355 $this->mystickymenu_script();
1356 }
1357 if ( is_page( $mysticky_enable_at_pages_exp ) ){
1358 $this->mystickymenu_script();
1359 }
1360
1361 } elseif ( is_tag()){ /* Tag page */
1362
1363 if ( $mysticky_disable_at_tag == false ) {
1364 $this->mystickymenu_script();
1365 }
1366
1367 } elseif ( is_category()){ /* Category page */
1368
1369 if ( $mysticky_disable_at_category == false ) {
1370 $this->mystickymenu_script();
1371 }
1372
1373 } elseif ( is_single()){ /* Single post */
1374
1375 if ( $mysticky_disable_at_single == false ) {
1376 $this->mystickymenu_script();
1377 }
1378
1379 if ( is_single( $mysticky_enable_at_posts_exp ) ){
1380 $this->mystickymenu_script();
1381 }
1382
1383 } elseif ( is_archive()){ /* Archive */
1384
1385 if ( $mysticky_disable_at_archive == false ) {
1386 $this->mystickymenu_script();
1387 }
1388
1389 } elseif ( is_search()){ /* Search */
1390
1391 if ( $mysticky_disable_at_search == false ) {
1392 $this->mystickymenu_script();
1393 }
1394
1395 } elseif ( is_404()){ /* 404 */
1396
1397 if ( $mysticky_disable_at_404 == false ) {
1398 $this->mystickymenu_script();
1399 }
1400 }
1401
1402 }
1403
1404 }
1405
1406 if( is_admin() ) {
1407 new MyStickyMenuBackend();
1408 require_once 'mystickymenu-affiliate.php';
1409
1410 } else {
1411 new MyStickyMenuFrontend();
1412 }