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