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