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