Sticky Menu (or Anything!) on Scroll - Version 2.32

Version Description

  • 2022-11-20
  • minor security fixes
Download this release

Release Info

Developer WebFactory
Plugin Icon 128x128 Sticky Menu (or Anything!) on Scroll
Version 2.32
Comparing to
See all releases

Code changes from version 2.31 to 2.32

assets/faq.php CHANGED
@@ -1,49 +1,49 @@
1
- <p><strong><?php _e('Q: I need help please!','sticky-menu-or-anything-on-scroll'); ?></strong><br />
2
  If you upgrade to WP Sticky PRO you'll have access to <a href="#" class="open-sticky-pro-dialog pro-feature" data-pro-feature="support">premium email support</a> directly from plugin devs.<br><br>
3
- <?php _e('Please read the FAQ below first as well as the <a href="https://wpsticky.com/documentation/?ref=sticky-free-docs" target="_blank">official documentation</a> and then go to the plugin\'s <a href="https://wordpress.org/support/plugin/sticky-menu-or-anything-on-scroll" target="_blank">community support forum</a> and post a message (include a link to your site). Support is provided on a voluntary basis.','sticky-menu-or-anything-on-scroll'); ?></p>
4
 
5
- <p><strong><?php _e('Q: I selected a class/ID in the settings screen, but the element doesn\'t stick when I scroll down. Why not?','sticky-menu-or-anything-on-scroll'); ?></strong><br />
6
- <?php _e('First, make sure that if you select the element by its classname, it is preceded by a dot (e.g. ".main-menu"), and if you select it by its ID, that it\'s preceded by a pound/hash/number sign (e.g. "#main-menu"). Also, make sure there is only ONE element on the page with the selector you\'re using. If there is none, or more than one element that matches your selector, nothing will happen.','sticky-menu-or-anything-on-scroll'); ?></p>
7
 
8
- <p><strong><?php _e('Q: Once the element becomes sticky, it\'s not positioned/sized properly at all.','sticky-menu-or-anything-on-scroll'); ?></strong><br />
9
- <?php _e('Due to the nature of CSS, there are situations where an element will not stick properly, usually if it has specific properties that are used to manipulate its location and/or dimensions. If your sticky element has any of the following properties, this could cause conflicts:</p><ul><li>- negative margins</li><li>- absolute positioning</li><li>- top/left/bottom/right properties</li><li>- "display: inline"</li><li>- "!important" applied to any of its properties</li></ul><p>Try to avoid all this where possible, but if you can\'t, using the plugin in Legacy Mode (see below) helps sometimes.<br>Another situation that can cause trouble, is when any parent of your sticky element has the "transform" CSS property applied to it.','sticky-menu-or-anything-on-scroll'); ?></p>
10
 
11
- <p><strong><?php _e('Q: Once the element becomes sticky, it\'s not responsive and doesn\'t resize when I change the browser size.','sticky-menu-or-anything-on-scroll'); ?></strong><br />
12
- <?php _e('This is a known (and annoying) bug in the plugin that I haven\'t been able to solve properly yet. For some sites (when the element does not contain any Javascript interactivity, usually), it sometimes helps to use the plugin in Legacy Mode (see below).','sticky-menu-or-anything-on-scroll'); ?></p>
13
 
14
- <p><strong><?php _e('Q: Is it possible to add some styles to the element but <em>only</em> when it\'s sticky?','sticky-menu-or-anything-on-scroll'); ?></strong><br />
15
- <?php _e('To add styles to your sticky element when it\'s <em>not sticky</em>, use classname ".element-is-not-sticky".<br>To add styles to your sticky element <em>only</em> when it\'s sticky, use classname ".element-is-sticky".','sticky-menu-or-anything-on-scroll'); ?></p>
16
- <p><?php _e('The following code would give your element a red background only when it\'s not sticky, and blue only when it is:','sticky-menu-or-anything-on-scroll'); ?></p>
17
- <p><?php _e('<code>.element-is-not-sticky {<br>&nbsp;&nbsp;&nbsp;background: red;<br>&nbsp;&nbsp;&nbsp;}<br><br>.element-is-sticky {<br>&nbsp;&nbsp;&nbsp;background: blue;<br>&nbsp;&nbsp;&nbsp;}</code>','sticky-menu-or-anything-on-scroll'); ?></p>
18
 
19
- <p><strong><?php _e('Q: Once the element becomes sticky, there\'s a brief moment where you see it twice.','sticky-menu-or-anything-on-scroll'); ?></strong><br />
20
- <?php _e('If you\'re using the plugin in Legacy Mode (see below), this happens when the sticky element (or any of its contents) has a CSS transition applied to it. Because the original element becomes invisible (and a cloned copy of it becomes visible), the visible-to-invisible status change will take place with a transition (ie. not instantly). Either remove any of the transitions the element has, or try disabling the Legacy Mode.','sticky-menu-or-anything-on-scroll'); ?></p>
21
 
22
- <p><strong><?php _e('Q: My menu sticks, but it doesn\'t open on the <a href="https://wordpress.org/themes/responsive" target="_blank">Responsive</a> theme when it\'s sticky.','sticky-menu-or-anything-on-scroll'); ?></strong><br />
23
- <?php _e('This was a bug in pre-2.0 versions, and an incompatibility with the theme. It has been fixed in 2.0, but in Legacy Mode, this bug is still present. If you need to enable Legacy Mode for some reason, it would be better to turn off stickiness for the mobile menu (set "Do not stick element when screen smaller than:" to 651 pixels).','sticky-menu-or-anything-on-scroll'); ?></p>
24
 
25
- <p><strong><?php _e('Q: I have another plugin called <a href="https://wordpress.org/plugins/easy-smooth-scroll-links/" target="_blank">Easy Smooth Scroll Links</a>, but once my menu becomes sticky, that one doesn\'t work anymore.','sticky-menu-or-anything-on-scroll'); ?></strong><br />
26
- <?php _e('This was a bug in pre-2.0 versions, and an incompatibility with the plugin. It has been fixed in 2.0, but in Legacy Mode, this bug is still present. If you need Legacy Mode enabled for some reason, there is no fix for this bug.','sticky-menu-or-anything-on-scroll'); ?></p>
27
 
28
- <p><strong><?php _e('Q: Still doesn\'t work. What could be wrong?','sticky-menu-or-anything-on-scroll'); ?></strong><br />
29
- <?php _e('Check the "Debug Mode" checkbox in the plugin\'s settings. Reload the page and you may see errors in your browser\'s console window. If you\'ve used a selector that doesn\'t exist, OR there are more of them on the page, you will be notified of that in the console.','sticky-menu-or-anything-on-scroll'); ?></p>
30
 
31
- <p><strong><?php _e('Q: Is it possible to have multiple sticky elements?','sticky-menu-or-anything-on-scroll'); ?></strong><br />
32
- <?php _e('The current version only allows one sticky element, but this functionality will be implemented in the next major version. No expected release date, though.','sticky-menu-or-anything-on-scroll'); ?></p>
33
 
34
- <p><strong><?php _e('Q: What is Legacy Mode? Should I use it?','sticky-menu-or-anything-on-scroll'); ?></strong><br />
35
- <?php _e('In version 2.0 of the plugin, a new/better method for making elements sticky was introduced. Before this, a sticky element would essentially be a cloned copy of the original element. Now, the element itself becomes sticky and doesn\'t use copying and cloning anymore, which solves a lot of issues.','sticky-menu-or-anything-on-scroll'); ?></p>
36
- <p><?php _e('So, should you use it or not? Well, if you <em>upgraded</em> this plugin from an earlier version, Legacy Mode will be turned ON by default, because chances are that the old method worked perfectly fine for your site. If that\'s the case, there is not really a need to use the new method and you can just continue using the old, classic method. If it ain\'t broke, don\'t fix it, right?','sticky-menu-or-anything-on-scroll'); ?></p>
37
- <p><?php _e('Having said that, it\'s worth checking if your element works just as well with Legacy Mode turned OFF, since this is the "better" method. Just give it a quick try. If it doesn\'t work, you can always just go back and enable it again.','sticky-menu-or-anything-on-scroll'); ?></p>
38
- <p><?php _e('<span style="font-weight:bold;">NOTE: new installs of the plugin will have the Legacy Mode turned off by default. Only UPGRADES from 1.4 (or before) should have it turned on by default.</span>','sticky-menu-or-anything-on-scroll'); ?></p>
39
 
40
- <p><strong><?php _e('Q: What is this Dynamic Mode thing exactly?','sticky-menu-or-anything-on-scroll'); ?></strong><br />
41
- <?php _e('This mode is only available in Legacy Mode, and to properly explain this, we\'ll need to go a little deeper in the plugin\'s functionality. So bear with me...','sticky-menu-or-anything-on-scroll'); ?></p>
42
- <p><?php _e('In Legacy Mode, when an element becomes sticky at the top of the page (and keeps its place regardless of the scrolling), it\'s actually not the element itself you see, but a cloned copy of it, while the actuak original element is out of view and invisible.','sticky-menu-or-anything-on-scroll'); ?></p>
43
- <p><?php _e('The original element always stays where it originally is on the page, while the cloned element is always at the top of the browser viewport screen. However, you will never see them both at the same time; depending on your scroll position, it always just shows either one or the other.','sticky-menu-or-anything-on-scroll'); ?></p>
44
- <p><?php _e('In the original plugin version, the clone would be created right the moment when you load the page (but not visible right away). Then when you would scroll down, it would become visible (and stick at the top), while the original element would disappear from view.','sticky-menu-or-anything-on-scroll'); ?></p>
45
- <p><?php _e('However, some themes use JavaScript to dynamically create elements (menus, mostly) for mobile sites. With this method, a menu doesn\'t exist in the HTML source code when you load the page, but is created some time after the page is fully loaded -- in many cases, these menus would just be generated ONLY when the screen is more (or less) than a certain specific width. With the original version of the plugin, the problem would be that the original element (that you want to make sticky) may not have been fully created upon page load, so the clone would also not be fully functional.','sticky-menu-or-anything-on-scroll'); ?></p>
46
- <p><?php _e('Enter Dynamic Mode. Now, a clone of the element is not created on page load -- instead, it\'s only created when the user scrolls and hits the "sticky" point. This ensures that the cloned element is an actual 1-on-1 copy of what the original element consists of at that specific point in time (and not at the "page is loaded" point, which may be different if the element was altered since).','sticky-menu-or-anything-on-scroll'); ?></p>
47
- <p><?php _e('Why don\'t we use Dynamic Mode all the time then? This has to do with the fact that other plugins initialize themselves on page load and may need the full markup (including the cloned element) at that point. In Dynamic Mode, there is no clone available yet on page load, so that could cause an issue if that other plugin is looking for an element that doesn\'t exist yet.','sticky-menu-or-anything-on-scroll'); ?></p>
48
- <p><?php _e('(This may all sound terribly confusing. And it is! So, much work was done to fix this nonsense: since v2.0 of the plugin, a whole different method is being used to make elements sticky, and Dynamic Mode is not even an issue anymore.)','sticky-menu-or-anything-on-scroll'); ?></p>
49
- <p><?php _e('Phew!','sticky-menu-or-anything-on-scroll'); ?></p>
1
+ <p><strong><?php sticky_wp_kses_wf(__('Q: I need help please!','sticky-menu-or-anything-on-scroll')); ?></strong><br />
2
  If you upgrade to WP Sticky PRO you'll have access to <a href="#" class="open-sticky-pro-dialog pro-feature" data-pro-feature="support">premium email support</a> directly from plugin devs.<br><br>
3
+ <?php sticky_wp_kses_wf(__('Please read the FAQ below first as well as the <a href="https://wpsticky.com/documentation/?ref=sticky-free-docs" target="_blank">official documentation</a> and then go to the plugin\'s <a href="https://wordpress.org/support/plugin/sticky-menu-or-anything-on-scroll" target="_blank">community support forum</a> and post a message (include a link to your site). Support is provided on a voluntary basis.','sticky-menu-or-anything-on-scroll')); ?></p>
4
 
5
+ <p><strong><?php sticky_wp_kses_wf(__('Q: I selected a class/ID in the settings screen, but the element doesn\'t stick when I scroll down. Why not?','sticky-menu-or-anything-on-scroll')); ?></strong><br />
6
+ <?php sticky_wp_kses_wf(__('First, make sure that if you select the element by its classname, it is preceded by a dot (e.g. ".main-menu"), and if you select it by its ID, that it\'s preceded by a pound/hash/number sign (e.g. "#main-menu"). Also, make sure there is only ONE element on the page with the selector you\'re using. If there is none, or more than one element that matches your selector, nothing will happen.','sticky-menu-or-anything-on-scroll')); ?></p>
7
 
8
+ <p><strong><?php sticky_wp_kses_wf(__('Q: Once the element becomes sticky, it\'s not positioned/sized properly at all.','sticky-menu-or-anything-on-scroll')); ?></strong><br />
9
+ <?php sticky_wp_kses_wf(__('Due to the nature of CSS, there are situations where an element will not stick properly, usually if it has specific properties that are used to manipulate its location and/or dimensions. If your sticky element has any of the following properties, this could cause conflicts:</p><ul><li>- negative margins</li><li>- absolute positioning</li><li>- top/left/bottom/right properties</li><li>- "display: inline"</li><li>- "!important" applied to any of its properties</li></ul><p>Try to avoid all this where possible, but if you can\'t, using the plugin in Legacy Mode (see below) helps sometimes.<br>Another situation that can cause trouble, is when any parent of your sticky element has the "transform" CSS property applied to it.','sticky-menu-or-anything-on-scroll')); ?></p>
10
 
11
+ <p><strong><?php sticky_wp_kses_wf(__('Q: Once the element becomes sticky, it\'s not responsive and doesn\'t resize when I change the browser size.','sticky-menu-or-anything-on-scroll')); ?></strong><br />
12
+ <?php sticky_wp_kses_wf(__('This is a known (and annoying) bug in the plugin that I haven\'t been able to solve properly yet. For some sites (when the element does not contain any Javascript interactivity, usually), it sometimes helps to use the plugin in Legacy Mode (see below).','sticky-menu-or-anything-on-scroll')); ?></p>
13
 
14
+ <p><strong><?php sticky_wp_kses_wf(__('Q: Is it possible to add some styles to the element but <em>only</em> when it\'s sticky?','sticky-menu-or-anything-on-scroll')); ?></strong><br />
15
+ <?php sticky_wp_kses_wf(__('To add styles to your sticky element when it\'s <em>not sticky</em>, use classname ".element-is-not-sticky".<br>To add styles to your sticky element <em>only</em> when it\'s sticky, use classname ".element-is-sticky".','sticky-menu-or-anything-on-scroll')); ?></p>
16
+ <p><?php sticky_wp_kses_wf(__('The following code would give your element a red background only when it\'s not sticky, and blue only when it is:','sticky-menu-or-anything-on-scroll')); ?></p>
17
+ <p><?php sticky_wp_kses_wf(__('<code>.element-is-not-sticky {<br>&nbsp;&nbsp;&nbsp;background: red;<br>&nbsp;&nbsp;&nbsp;}<br><br>.element-is-sticky {<br>&nbsp;&nbsp;&nbsp;background: blue;<br>&nbsp;&nbsp;&nbsp;}</code>','sticky-menu-or-anything-on-scroll')); ?></p>
18
 
19
+ <p><strong><?php sticky_wp_kses_wf(__('Q: Once the element becomes sticky, there\'s a brief moment where you see it twice.','sticky-menu-or-anything-on-scroll')); ?></strong><br />
20
+ <?php sticky_wp_kses_wf(__('If you\'re using the plugin in Legacy Mode (see below), this happens when the sticky element (or any of its contents) has a CSS transition applied to it. Because the original element becomes invisible (and a cloned copy of it becomes visible), the visible-to-invisible status change will take place with a transition (ie. not instantly). Either remove any of the transitions the element has, or try disabling the Legacy Mode.','sticky-menu-or-anything-on-scroll')); ?></p>
21
 
22
+ <p><strong><?php sticky_wp_kses_wf(__('Q: My menu sticks, but it doesn\'t open on the <a href="https://wordpress.org/themes/responsive" target="_blank">Responsive</a> theme when it\'s sticky.','sticky-menu-or-anything-on-scroll')); ?></strong><br />
23
+ <?php sticky_wp_kses_wf(__('This was a bug in pre-2.0 versions, and an incompatibility with the theme. It has been fixed in 2.0, but in Legacy Mode, this bug is still present. If you need to enable Legacy Mode for some reason, it would be better to turn off stickiness for the mobile menu (set "Do not stick element when screen smaller than:" to 651 pixels).','sticky-menu-or-anything-on-scroll')); ?></p>
24
 
25
+ <p><strong><?php sticky_wp_kses_wf(__('Q: I have another plugin called <a href="https://wordpress.org/plugins/easy-smooth-scroll-links/" target="_blank">Easy Smooth Scroll Links</a>, but once my menu becomes sticky, that one doesn\'t work anymore.','sticky-menu-or-anything-on-scroll')); ?></strong><br />
26
+ <?php sticky_wp_kses_wf(__('This was a bug in pre-2.0 versions, and an incompatibility with the plugin. It has been fixed in 2.0, but in Legacy Mode, this bug is still present. If you need Legacy Mode enabled for some reason, there is no fix for this bug.','sticky-menu-or-anything-on-scroll')); ?></p>
27
 
28
+ <p><strong><?php sticky_wp_kses_wf(__('Q: Still doesn\'t work. What could be wrong?','sticky-menu-or-anything-on-scroll')); ?></strong><br />
29
+ <?php sticky_wp_kses_wf(__('Check the "Debug Mode" checkbox in the plugin\'s settings. Reload the page and you may see errors in your browser\'s console window. If you\'ve used a selector that doesn\'t exist, OR there are more of them on the page, you will be notified of that in the console.','sticky-menu-or-anything-on-scroll')); ?></p>
30
 
31
+ <p><strong><?php sticky_wp_kses_wf(__('Q: Is it possible to have multiple sticky elements?','sticky-menu-or-anything-on-scroll')); ?></strong><br />
32
+ <?php sticky_wp_kses_wf(__('The current version only allows one sticky element, but this functionality will be implemented in the next major version. No expected release date, though.','sticky-menu-or-anything-on-scroll')); ?></p>
33
 
34
+ <p><strong><?php sticky_wp_kses_wf(__('Q: What is Legacy Mode? Should I use it?','sticky-menu-or-anything-on-scroll')); ?></strong><br />
35
+ <?php sticky_wp_kses_wf(__('In version 2.0 of the plugin, a new/better method for making elements sticky was introduced. Before this, a sticky element would essentially be a cloned copy of the original element. Now, the element itself becomes sticky and doesn\'t use copying and cloning anymore, which solves a lot of issues.','sticky-menu-or-anything-on-scroll')); ?></p>
36
+ <p><?php sticky_wp_kses_wf(__('So, should you use it or not? Well, if you <em>upgraded</em> this plugin from an earlier version, Legacy Mode will be turned ON by default, because chances are that the old method worked perfectly fine for your site. If that\'s the case, there is not really a need to use the new method and you can just continue using the old, classic method. If it ain\'t broke, don\'t fix it, right?','sticky-menu-or-anything-on-scroll')); ?></p>
37
+ <p><?php sticky_wp_kses_wf(__('Having said that, it\'s worth checking if your element works just as well with Legacy Mode turned OFF, since this is the "better" method. Just give it a quick try. If it doesn\'t work, you can always just go back and enable it again.','sticky-menu-or-anything-on-scroll')); ?></p>
38
+ <p><?php sticky_wp_kses_wf(__('<span style="font-weight:bold;">NOTE: new installs of the plugin will have the Legacy Mode turned off by default. Only UPGRADES from 1.4 (or before) should have it turned on by default.</span>','sticky-menu-or-anything-on-scroll')); ?></p>
39
 
40
+ <p><strong><?php sticky_wp_kses_wf(__('Q: What is this Dynamic Mode thing exactly?','sticky-menu-or-anything-on-scroll')); ?></strong><br />
41
+ <?php sticky_wp_kses_wf(__('This mode is only available in Legacy Mode, and to properly explain this, we\'ll need to go a little deeper in the plugin\'s functionality. So bear with me...','sticky-menu-or-anything-on-scroll')); ?></p>
42
+ <p><?php sticky_wp_kses_wf(__('In Legacy Mode, when an element becomes sticky at the top of the page (and keeps its place regardless of the scrolling), it\'s actually not the element itself you see, but a cloned copy of it, while the actuak original element is out of view and invisible.','sticky-menu-or-anything-on-scroll')); ?></p>
43
+ <p><?php sticky_wp_kses_wf(__('The original element always stays where it originally is on the page, while the cloned element is always at the top of the browser viewport screen. However, you will never see them both at the same time; depending on your scroll position, it always just shows either one or the other.','sticky-menu-or-anything-on-scroll')); ?></p>
44
+ <p><?php sticky_wp_kses_wf(__('In the original plugin version, the clone would be created right the moment when you load the page (but not visible right away). Then when you would scroll down, it would become visible (and stick at the top), while the original element would disappear from view.','sticky-menu-or-anything-on-scroll')); ?></p>
45
+ <p><?php sticky_wp_kses_wf(__('However, some themes use JavaScript to dynamically create elements (menus, mostly) for mobile sites. With this method, a menu doesn\'t exist in the HTML source code when you load the page, but is created some time after the page is fully loaded -- in many cases, these menus would just be generated ONLY when the screen is more (or less) than a certain specific width. With the original version of the plugin, the problem would be that the original element (that you want to make sticky) may not have been fully created upon page load, so the clone would also not be fully functional.','sticky-menu-or-anything-on-scroll')); ?></p>
46
+ <p><?php sticky_wp_kses_wf(__('Enter Dynamic Mode. Now, a clone of the element is not created on page load -- instead, it\'s only created when the user scrolls and hits the "sticky" point. This ensures that the cloned element is an actual 1-on-1 copy of what the original element consists of at that specific point in time (and not at the "page is loaded" point, which may be different if the element was altered since).','sticky-menu-or-anything-on-scroll')); ?></p>
47
+ <p><?php sticky_wp_kses_wf(__('Why don\'t we use Dynamic Mode all the time then? This has to do with the fact that other plugins initialize themselves on page load and may need the full markup (including the cloned element) at that point. In Dynamic Mode, there is no clone available yet on page load, so that could cause an issue if that other plugin is looking for an element that doesn\'t exist yet.','sticky-menu-or-anything-on-scroll')); ?></p>
48
+ <p><?php sticky_wp_kses_wf(__('(This may all sound terribly confusing. And it is! So, much work was done to fix this nonsense: since v2.0 of the plugin, a whole different method is being used to make elements sticky, and Dynamic Mode is not even an issue anymore.)','sticky-menu-or-anything-on-scroll')); ?></p>
49
+ <p><?php sticky_wp_kses_wf(__('Phew!','sticky-menu-or-anything-on-scroll')); ?></p>
assets/js/jq-sticky-anything.js CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * @preserve Sticky Anything 2.22 | @senff | GPL2 Licensed
3
  */
4
 
5
  console.error(
1
  /**
2
+ * @preserve Sticky Anything 2.22 | (c) WebFactory Ltd | GPL2 Licensed
3
  */
4
 
5
  console.error(
assets/js/jq-sticky-anything.min.js CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
- * @preserve Sticky Anything 2.22 | @senff | GPL2 Licensed
3
  */
4
 
5
  var stickyAnythingBreakpoint = '' // solely to use as a debugging breakpoint, if needed.
6
 
7
- !function(e){function t(t,i){e(".sticky-element-original").clone().insertAfter(e(".sticky-element-original")).addClass("sticky-element-cloned").removeClass("element-is-not-sticky").addClass("element-is-sticky").css("position","fixed").css("top",t+"px").css("margin-left","0").css("z-index",i).removeClass("sticky-element-original").hide()}e.fn.stickThis=function(i){var n,s=e.extend({top:0,minscreenwidth:0,maxscreenwidth:99999,zindex:1,legacymode:!1,dynamicmode:!1,debugmode:!1,pushup:"",adminbar:!1},i),l=e(this).length,r=e(s.pushup).length;return r<1?(1==s.debugmode&&s.pushup&&console.error('STICKY ANYTHING DEBUG: There are no elements with the selector/class/ID you selected for the Push-up element ("'+s.pushup+'").'),s.pushup=""):r>1&&(1==s.debugmode&&console.error("STICKY ANYTHING DEBUG: There are "+r+' elements on the page with the selector/class/ID you selected for the push-up element ("'+s.pushup+'"). You can select only ONE element to push the sticky element up.'),s.pushup=""),l<1?1==s.debugmode&&console.error('STICKY ANYTHING DEBUG: There are no elements with the selector/class/ID you selected for the sticky element ("'+this.selector+'").'):l>1?1==s.debugmode&&console.error("STICKY ANYTHING DEBUG: There There are "+r+' elements with the selector/class/ID you selected for the sticky element ("'+this.selector+'"). You can only make ONE element sticky.'):1==s.legacymode?(e(this).addClass("sticky-element-original").addClass("element-is-not-sticky"),1!=s.dynamicmode&&t(s.top,s.zindex,s.adminbar),checkElement=setInterval(function(){!function(i,n,s,l,o,r,d){var a=e(".sticky-element-original").offset();if(orgElementTop=a.top,o){var c=e(o).offset();pushElementTop=c.top}var m=window,g="inner";"innerWidth"in window||(g="client",m=document.documentElement||document.body);viewport=m[g+"Width"],d&&e("body").hasClass("admin-bar")&&viewport>600?adminBarHeight=e("#wpadminbar").height():adminBarHeight=0;e(window).scrollTop()>=orgElementTop-i-adminBarHeight&&viewport>=n&&viewport<=s?(orgElement=e(".sticky-element-original"),coordsOrgElement=orgElement.offset(),leftOrgElement=coordsOrgElement.left,widthOrgElement=orgElement[0].getBoundingClientRect().width,widthOrgElement||(widthOrgElement=orgElement.css("width")),heightOrgElement=orgElement.outerHeight(),paddingOrgElement=[orgElement.css("padding-top"),orgElement.css("padding-right"),orgElement.css("padding-bottom"),orgElement.css("padding-left")],paddingCloned=paddingOrgElement[0]+" "+paddingOrgElement[1]+" "+paddingOrgElement[2]+" "+paddingOrgElement[3],1==r&&e(".sticky-element-cloned").length<1&&t(i,l),elementHeight=0,heightOrgElement<1?elementHeight=e(".sticky-element-cloned").outerHeight():elementHeight=e(".sticky-element-original").outerHeight(),o&&e(window).scrollTop()>pushElementTop-i-elementHeight-adminBarHeight?stickyTopMargin=pushElementTop-i-elementHeight-e(window).scrollTop():stickyTopMargin=adminBarHeight,e(".sticky-element-cloned").css("left",leftOrgElement+"px").css("top",i+"px").css("width",widthOrgElement).css("margin-top",stickyTopMargin).css("padding",paddingCloned).show(),e(".sticky-element-original").css("visibility","hidden")):(1==r?e(".sticky-element-cloned").remove():e(".sticky-element-cloned").hide(),e(".sticky-element-original").css("visibility","visible"))}(s.top,s.minscreenwidth,s.maxscreenwidth,s.zindex,s.pushup,s.dynamicmode,s.adminbar)},10)):(e(this).addClass("sticky-element-original").addClass("element-is-not-sticky"),orgAssignedStyles=(n=e(this),o={},o.display=n.css("display"),o.float=n.css("float"),o.flex=n.css("flex"),o["box-sizing"]=n.css("box-sizing"),o.clear=n.css("clear"),o.overflow=n.css("overflow"),o.transform=n.css("transform"),o),orgInlineStyles=e(".sticky-element-original").attr("style"),null==orgInlineStyles&&(orgInlineStyles=""),e(".sticky-element-original").addClass("sticky-element-active").before('<div class="sticky-element-placeholder" style="width:0; height:0; margin:0; padding:0; visibility:hidden;"></div>'),checkElement=setInterval(function(){!function(t,i,n,s,l,o,r,d){$listenerElement=e(".sticky-element-active");var a=$listenerElement.offset();if(orgElementTop=a.top,l){var c=e(l).offset();pushElementTop=c.top}var m=window,g="inner";"innerWidth"in window||(g="client",m=document.documentElement||document.body);viewport=m[g+"Width"],o&&e("body").hasClass("admin-bar")&&viewport>600?adminBarHeight=e("#wpadminbar").height():adminBarHeight=0;if(e(window).scrollTop()>=orgElementTop-t-adminBarHeight&&viewport>=i&&viewport<=n){for(var h in coordsOrgElement=$listenerElement.offset(),leftOrgElement=coordsOrgElement.left,widthPlaceholder=$listenerElement[0].getBoundingClientRect().width,widthPlaceholder||(widthPlaceholder=$listenerElement.css("width")),heightPlaceholder=$listenerElement[0].getBoundingClientRect().height,heightPlaceholder||(heightPlaceholder=$listenerElement.css("height")),widthSticky=e(".sticky-element-original").css("width"),"0px"==widthSticky&&(widthSticky=e(".sticky-element-original")[0].getBoundingClientRect().width),heightSticky=e(".sticky-element-original").height(),paddingOrgElement=[e(".sticky-element-original").css("padding-top"),e(".sticky-element-original").css("padding-right"),e(".sticky-element-original").css("padding-bottom"),e(".sticky-element-original").css("padding-left")],paddingSticky=paddingOrgElement[0]+" "+paddingOrgElement[1]+" "+paddingOrgElement[2]+" "+paddingOrgElement[3],marginOrgElement=[$listenerElement.css("margin-top"),$listenerElement.css("margin-right"),$listenerElement.css("margin-bottom"),$listenerElement.css("margin-left")],marginPlaceholder=marginOrgElement[0]+" "+marginOrgElement[1]+" "+marginOrgElement[2]+" "+marginOrgElement[3],assignedStyles="",r)"inline"==r[h]?assignedStyles+=h+":inline-block; ":assignedStyles+=h+":"+r[h]+"; ";elementHeight=0,heightPlaceholder<1?elementHeight=e(".sticky-element-cloned").outerHeight():elementHeight=e(".sticky-element-original").outerHeight(),l&&e(window).scrollTop()>pushElementTop-t-elementHeight-adminBarHeight?stickyTopMargin=pushElementTop-t-elementHeight-e(window).scrollTop():stickyTopMargin=adminBarHeight,assignedStyles+="width:"+widthPlaceholder+"px; height:"+heightPlaceholder+"px; margin:"+marginPlaceholder+";",e(".sticky-element-original").removeClass("sticky-element-active").removeClass("element-is-not-sticky").addClass("element-is-sticky").css("cssText","margin-top: "+stickyTopMargin+"px !important; margin-left: 0 !important").css("position","fixed").css("left",leftOrgElement+"px").css("top",t+"px").css("width",widthSticky).css("padding",paddingSticky).css("z-index",s),e(".sticky-element-original").each(function(){this.style.setProperty("margin-top",stickyTopMargin,"important")}),e(".sticky-element-placeholder").hasClass("sticky-element-active")||e(".sticky-element-placeholder").addClass("sticky-element-active").attr("style",assignedStyles)}else e(".sticky-element-original").addClass("sticky-element-active").removeClass("element-is-sticky").addClass("element-is-not-sticky").attr("style",d),e(".sticky-element-placeholder").hasClass("sticky-element-active")&&e(".sticky-element-placeholder").removeClass("sticky-element-active").removeAttr("style").css("width","0").css("height","0").css("margin","0").css("padding","0")}(s.top,s.minscreenwidth,s.maxscreenwidth,s.zindex,s.pushup,s.adminbar,orgAssignedStyles,orgInlineStyles)},10)),this}}(jQuery);
1
  /**
2
+ * @preserve Sticky Anything 2.22 | (c) WebFactory Ltd | GPL2 Licensed
3
  */
4
 
5
  var stickyAnythingBreakpoint = '' // solely to use as a debugging breakpoint, if needed.
6
 
7
+ !function(e){function t(t,i){e(".sticky-element-original").clone().insertAfter(e(".sticky-element-original")).addClass("sticky-element-cloned").removeClass("element-is-not-sticky").addClass("element-is-sticky").css("position","fixed").css("top",t+"px").css("margin-left","0").css("z-index",i).removeClass("sticky-element-original").hide()}e.fn.stickThis=function(i){var n,s=e.extend({top:0,minscreenwidth:0,maxscreenwidth:99999,zindex:1,legacymode:!1,dynamicmode:!1,debugmode:!1,pushup:"",adminbar:!1},i),l=e(this).length,r=e(s.pushup).length;return r<1?(1==s.debugmode&&s.pushup&&console.error('STICKY ANYTHING DEBUG: There are no elements with the selector/class/ID you selected for the Push-up element ("'+s.pushup+'").'),s.pushup=""):r>1&&(1==s.debugmode&&console.error("STICKY ANYTHING DEBUG: There are "+r+' elements on the page with the selector/class/ID you selected for the push-up element ("'+s.pushup+'"). You can select only ONE element to push the sticky element up.'),s.pushup=""),l<1?1==s.debugmode&&console.error('STICKY ANYTHING DEBUG: There are no elements with the selector/class/ID you selected for the sticky element ("'+this.selector+'").'):l>1?1==s.debugmode&&console.error("STICKY ANYTHING DEBUG: There There are "+r+' elements with the selector/class/ID you selected for the sticky element ("'+this.selector+'"). You can only make ONE element sticky.'):1==s.legacymode?(e(this).addClass("sticky-element-original").addClass("element-is-not-sticky"),1!=s.dynamicmode&&t(s.top,s.zindex,s.adminbar),checkElement=setInterval(function(){!function(i,n,s,l,o,r,d){var a=e(".sticky-element-original").offset();if(orgElementTop=a.top,o){var c=e(o).offset();pushElementTop=c.top}var m=window,g="inner";"innerWidth"in window||(g="client",m=document.documentElement||document.body);viewport=m[g+"Width"],d&&e("body").hasClass("admin-bar")&&viewport>600?adminBarHeight=e("#wpadminbar").height():adminBarHeight=0;e(window).scrollTop()>=orgElementTop-i-adminBarHeight&&viewport>=n&&viewport<=s?(orgElement=e(".sticky-element-original"),coordsOrgElement=orgElement.offset(),leftOrgElement=coordsOrgElement.left,widthOrgElement=orgElement[0].getBoundingClientRect().width,widthOrgElement||(widthOrgElement=orgElement.css("width")),heightOrgElement=orgElement.outerHeight(),paddingOrgElement=[orgElement.css("padding-top"),orgElement.css("padding-right"),orgElement.css("padding-bottom"),orgElement.css("padding-left")],paddingCloned=paddingOrgElement[0]+" "+paddingOrgElement[1]+" "+paddingOrgElement[2]+" "+paddingOrgElement[3],1==r&&e(".sticky-element-cloned").length<1&&t(i,l),elementHeight=0,heightOrgElement<1?elementHeight=e(".sticky-element-cloned").outerHeight():elementHeight=e(".sticky-element-original").outerHeight(),o&&e(window).scrollTop()>pushElementTop-i-elementHeight-adminBarHeight?stickyTopMargin=pushElementTop-i-elementHeight-e(window).scrollTop():stickyTopMargin=adminBarHeight,e(".sticky-element-cloned").css("left",leftOrgElement+"px").css("top",i+"px").css("width",widthOrgElement).css("margin-top",stickyTopMargin).css("padding",paddingCloned).show(),e(".sticky-element-original").css("visibility","hidden")):(1==r?e(".sticky-element-cloned").remove():e(".sticky-element-cloned").hide(),e(".sticky-element-original").css("visibility","visible"))}(s.top,s.minscreenwidth,s.maxscreenwidth,s.zindex,s.pushup,s.dynamicmode,s.adminbar)},10)):(e(this).addClass("sticky-element-original").addClass("element-is-not-sticky"),orgAssignedStyles=(n=e(this),o={},o.display=n.css("display"),o.float=n.css("float"),o.flex=n.css("flex"),o["box-sizing"]=n.css("box-sizing"),o.clear=n.css("clear"),o.overflow=n.css("overflow"),o.transform=n.css("transform"),o),orgInlineStyles=e(".sticky-element-original").attr("style"),null==orgInlineStyles&&(orgInlineStyles=""),e(".sticky-element-original").addClass("sticky-element-active").before('<div class="sticky-element-placeholder" style="width:0; height:0; margin:0; padding:0; visibility:hidden;"></div>'),checkElement=setInterval(function(){!function(t,i,n,s,l,o,r,d){$listenerElement=e(".sticky-element-active");var a=$listenerElement.offset();if(orgElementTop=a.top,l){var c=e(l).offset();pushElementTop=c.top}var m=window,g="inner";"innerWidth"in window||(g="client",m=document.documentElement||document.body);viewport=m[g+"Width"],o&&e("body").hasClass("admin-bar")&&viewport>600?adminBarHeight=e("#wpadminbar").height():adminBarHeight=0;if(e(window).scrollTop()>=orgElementTop-t-adminBarHeight&&viewport>=i&&viewport<=n){for(var h in coordsOrgElement=$listenerElement.offset(),leftOrgElement=coordsOrgElement.left,widthPlaceholder=$listenerElement[0].getBoundingClientRect().width,widthPlaceholder||(widthPlaceholder=$listenerElement.css("width")),heightPlaceholder=$listenerElement[0].getBoundingClientRect().height,heightPlaceholder||(heightPlaceholder=$listenerElement.css("height")),widthSticky=e(".sticky-element-original").css("width"),"0px"==widthSticky&&(widthSticky=e(".sticky-element-original")[0].getBoundingClientRect().width),heightSticky=e(".sticky-element-original").height(),paddingOrgElement=[e(".sticky-element-original").css("padding-top"),e(".sticky-element-original").css("padding-right"),e(".sticky-element-original").css("padding-bottom"),e(".sticky-element-original").css("padding-left")],paddingSticky=paddingOrgElement[0]+" "+paddingOrgElement[1]+" "+paddingOrgElement[2]+" "+paddingOrgElement[3],marginOrgElement=[$listenerElement.css("margin-top"),$listenerElement.css("margin-right"),$listenerElement.css("margin-bottom"),$listenerElement.css("margin-left")],marginPlaceholder=marginOrgElement[0]+" "+marginOrgElement[1]+" "+marginOrgElement[2]+" "+marginOrgElement[3],assignedStyles="",r)"inline"==r[h]?assignedStyles+=h+":inline-block; ":assignedStyles+=h+":"+r[h]+"; ";elementHeight=0,heightPlaceholder<1?elementHeight=e(".sticky-element-cloned").outerHeight():elementHeight=e(".sticky-element-original").outerHeight(),l&&e(window).scrollTop()>pushElementTop-t-elementHeight-adminBarHeight?stickyTopMargin=pushElementTop-t-elementHeight-e(window).scrollTop():stickyTopMargin=adminBarHeight,assignedStyles+="width:"+widthPlaceholder+"px; height:"+heightPlaceholder+"px; margin:"+marginPlaceholder+";",e(".sticky-element-original").removeClass("sticky-element-active").removeClass("element-is-not-sticky").addClass("element-is-sticky").css("cssText","margin-top: "+stickyTopMargin+"px !important; margin-left: 0 !important").css("position","fixed").css("left",leftOrgElement+"px").css("top",t+"px").css("width",widthSticky).css("padding",paddingSticky).css("z-index",s),e(".sticky-element-original").each(function(){this.style.setProperty("margin-top",stickyTopMargin,"important")}),e(".sticky-element-placeholder").hasClass("sticky-element-active")||e(".sticky-element-placeholder").addClass("sticky-element-active").attr("style",assignedStyles)}else e(".sticky-element-original").addClass("sticky-element-active").removeClass("element-is-sticky").addClass("element-is-not-sticky").attr("style",d),e(".sticky-element-placeholder").hasClass("sticky-element-active")&&e(".sticky-element-placeholder").removeClass("sticky-element-active").removeAttr("style").css("width","0").css("height","0").css("margin","0").css("padding","0")}(s.top,s.minscreenwidth,s.maxscreenwidth,s.zindex,s.pushup,s.adminbar,orgAssignedStyles,orgInlineStyles)},10)),this}}(jQuery);
assets/js/stickThis.js CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * @preserve Sticky Anything 2.1.1 | @senff | GPL2 Licensed
3
  */
4
 
5
  (function($) {
1
  /**
2
+ * @preserve Sticky Anything 2.1.1 | (c) WebFactory Ltd | GPL2 Licensed
3
  */
4
 
5
  (function($) {
assets/js/sticky-admin-pointers.js CHANGED
@@ -1,7 +1,7 @@
1
  /*
2
  * Sticky Anything
3
  * Backend GUI pointers
4
- * (c) WebFactory Ltd, 2015 - 2021
5
  */
6
 
7
 
1
  /*
2
  * Sticky Anything
3
  * Backend GUI pointers
4
+ * (c) WebFactory Ltd, 2015 - 2022
5
  */
6
 
7
 
assets/js/sticky-anything-admin.js CHANGED
@@ -1,6 +1,6 @@
1
  /**
2
  * Sticky Menu or Anything
3
- * (c) WebFactory 2021, https://wpsticky.com/
4
  */
5
 
6
  jQuery(function ($) {
1
  /**
2
  * Sticky Menu or Anything
3
+ * (c) WebFactory 2022, https://wpsticky.com/
4
  */
5
 
6
  jQuery(function ($) {
assets/sidebar.php CHANGED
@@ -3,7 +3,7 @@
3
  <?php
4
  $options = get_option('sticky_anything_options');
5
  $dismiss_url = add_query_arg(array('action' => 'sticky_hide_review_notification', 'redirect' => urlencode($_SERVER['REQUEST_URI'])), admin_url('admin.php'));
6
- $dismiss_url = wp_nonce_url($dismiss_url, 'sticky_hide_review_notification');
7
  ?>
8
 
9
  <div class="inner">
@@ -12,5 +12,5 @@ Glad to see Sticky is helping you make things stick 😎<br>Please help other us
12
 
13
  </div>
14
 
15
- <p><a href="https://wordpress.org/support/plugin/sticky-menu-or-anything-on-scroll/reviews/#new-post" class="button button-primary" target="_blank">I want to rate &amp; keep Sticky Menu free!</a> &nbsp; <a href="<?php echo $dismiss_url; ?>">I already rated it</a></p>
16
 
3
  <?php
4
  $options = get_option('sticky_anything_options');
5
  $dismiss_url = add_query_arg(array('action' => 'sticky_hide_review_notification', 'redirect' => urlencode($_SERVER['REQUEST_URI'])), admin_url('admin.php'));
6
+ $dismiss_url = wp_nonce_url($dismiss_url, 'sticky_hide_review_notification');
7
  ?>
8
 
9
  <div class="inner">
12
 
13
  </div>
14
 
15
+ <p><a href="https://wordpress.org/support/plugin/sticky-menu-or-anything-on-scroll/reviews/#new-post" class="button button-primary" target="_blank">I want to rate &amp; keep Sticky Menu free!</a> &nbsp; <a href="<?php echo esc_url($dismiss_url); ?>">I already rated it</a></p>
16
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: sticky header, sticky menu, sticky, header, sticky widget, floating menu,
4
  Plugin URI: https://wpsticky.com/
5
  Requires at least: 3.6
6
  Tested up to: 6.1
7
- Stable tag: 2.31
8
  Requires PHP: 5.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -13,16 +13,16 @@ Sticky Menu or Sticky Header sticks elements at the top of the screen when you s
13
 
14
  == Description ==
15
 
16
- The <a href="https://wpsticky.com/?ref=wp-org-readme1">WP Sticky</a> Menu (or Sticky Header) On Scroll plugin allows you to **make any element on your pages "sticky"** as soon as it hits the top of the page when you scroll down. Although this is commonly used to keep menus at the top of your page to create floating menus, the plugin allows you to make any element sticky. Make a sticky header, stick menu, sticky widget (fixed widget), sticky logo, sticky call to action or a floating menu.
17
 
18
- You just need to know how to pick the right selector for the element you want to make sticky, and you need to be sure it's a unique selector. Sometimes a simple selector like "nav", "#main-menu", ".menu-main-menu-1" is enough. Other times you will have to be more detailed and use a more specific selector such as "header > ul:first-child" or "nav.top .menu-header ul.main". If you don't like messing with any code check out out the visual element picker in <a href="https://wpsticky.com/?ref=wp-org-readme2">WP Sticky PRO</a>.
19
 
20
  = Features =
21
 
22
- * **Any element can stick**: although common use is for navigation menus, or header the plugin will let you pick any unique element with a name, class or ID to stick at the top of the page once you scroll past it. Use it for sticky widget, sticky sidebar, sticky header, sticky menu, sticky header, sticky call-to-action box, sticky banner ad, etc. Need to make <a href="https://wpsticky.com/?ref=wp-org-readme3">multiple elements sticky</a>? Check out WP Sticky PRO.
23
  * **Positioning from top**: optionally, you can add any amount of space between the sticky element and the top of the page, so that the element is not always stuck at the "ceiling" of the page.
24
  * **Enable for certain screen sizes only**: optionally, you can set a minimum and/or maximum screen size where the stickiness should work. This can be handy if you have a responsive site and you don't want your element to be sticky on smaller screens, for example.
25
- * **Enable only on some pages**: sometimes you don't want the element to be sticky on the entire site. <a href="https://wpsticky.com/?ref=wp-org-readme4">WP Sticky PRO</a> gives you the option to pick posts, pages, categories, tags and CPTs where you don't want the element to be sticky.
26
  * **Push-up element**: optionally, you can pick any other element lower on the page that will push the sticky element up again (for example a sidebar widget).
27
  * **Admin Bar aware**: checks if the current user has an Admin Toolbar at the top of the page. If it has, the sticky element will not obscure it (or be obscured by it).
28
  * **Z-index**: in case there are other elements on the page that obscure or peek through your sticky element, you can add a Z-index easily.
@@ -32,6 +32,10 @@ You just need to know how to pick the right selector for the element you want to
32
 
33
  Having **problems with SSL**? Moving a site from HTTP to HTTPS? Install our free <a href="https://wordpress.org/plugins/wp-force-ssl/">WP Force SSL</a> plugin. It’s a great way to fix all SSL problems.
34
 
 
 
 
 
35
  == Installation ==
36
 
37
  1. Upload the "sticky-menu-or-anything" directory to your "wp-content/plugins" directory.
@@ -44,7 +48,7 @@ Having **problems with SSL**? Moving a site from HTTP to HTTPS? Install our free
44
  == Frequently Asked Questions ==
45
 
46
  = Can I make multiple elements sticky?
47
- Sure, <a href="https://wpsticky.com/?ref=wp-org-readme5">WP Sticky PRO</a> has that option. You can make as many elements sticky as you like and configure settings individually for each element.
48
 
49
  = I selected a class/ID in the settings screen, but the element doesn't stick when I scroll down. Why not? =
50
  First, make sure that if you select the element by its class name, it is preceded by a dot (e.g. ".main-menu"), and if you select it by its ID, that it's preceded by a pound/hash/number sign (e.g. "#main-menu"). Also, make sure there is only ONE element on the page with the selector you're using. If there is none, or more than one element that matches your selector, nothing will happen.
@@ -133,6 +137,10 @@ Please go to the plugin's [support forum on WordPress.org](https://wordpress.org
133
 
134
  == Changelog ==
135
 
 
 
 
 
136
  = 2.31 =
137
  * 2021-02-19
138
  * fixed one really really visible typo
4
  Plugin URI: https://wpsticky.com/
5
  Requires at least: 3.6
6
  Tested up to: 6.1
7
+ Stable tag: 2.32
8
  Requires PHP: 5.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
14
  == Description ==
15
 
16
+ The <a href="https://wpsticky.com/">WP Sticky</a> Menu (or Sticky Header) On Scroll plugin allows you to **make any element on your pages "sticky"** as soon as it hits the top of the page when you scroll down. Although this is commonly used to keep menus at the top of your page to create floating menus, the plugin allows you to make any element sticky. Make a sticky header, stick menu, sticky widget (fixed widget), sticky logo, sticky call to action or a floating menu.
17
 
18
+ You just need to know how to pick the right selector for the element you want to make sticky, and you need to be sure it's a unique selector. Sometimes a simple selector like "nav", "#main-menu", ".menu-main-menu-1" is enough. Other times you will have to be more detailed and use a more specific selector such as "header > ul:first-child" or "nav.top .menu-header ul.main". If you don't like messing with any code check out out the visual element picker in <a href="https://wpsticky.com/">WP Sticky PRO</a>.
19
 
20
  = Features =
21
 
22
+ * **Any element can stick**: although common use is for navigation menus, or header the plugin will let you pick any unique element with a name, class or ID to stick at the top of the page once you scroll past it. Use it for sticky widget, sticky sidebar, sticky header, sticky menu, sticky header, sticky call-to-action box, sticky banner ad, etc. Need to make <a href="https://wpsticky.com/">multiple elements sticky</a>? Check out WP Sticky PRO.
23
  * **Positioning from top**: optionally, you can add any amount of space between the sticky element and the top of the page, so that the element is not always stuck at the "ceiling" of the page.
24
  * **Enable for certain screen sizes only**: optionally, you can set a minimum and/or maximum screen size where the stickiness should work. This can be handy if you have a responsive site and you don't want your element to be sticky on smaller screens, for example.
25
+ * **Enable only on some pages**: sometimes you don't want the element to be sticky on the entire site. <a href="https://wpsticky.com/">WP Sticky PRO</a> gives you the option to pick posts, pages, categories, tags and CPTs where you don't want the element to be sticky.
26
  * **Push-up element**: optionally, you can pick any other element lower on the page that will push the sticky element up again (for example a sidebar widget).
27
  * **Admin Bar aware**: checks if the current user has an Admin Toolbar at the top of the page. If it has, the sticky element will not obscure it (or be obscured by it).
28
  * **Z-index**: in case there are other elements on the page that obscure or peek through your sticky element, you can add a Z-index easily.
32
 
33
  Having **problems with SSL**? Moving a site from HTTP to HTTPS? Install our free <a href="https://wordpress.org/plugins/wp-force-ssl/">WP Force SSL</a> plugin. It’s a great way to fix all SSL problems.
34
 
35
+ #### GDPR compatibility
36
+ We are not lawyers. Please do not take any of the following as legal advice.
37
+ Sticky does not track, collect or process any user data on the front end or in the admin. Nothing is logged or pushed to any 3rd parties. We also don't use any 3rd party services or CDNs. Based on that, we feel it's GDPR compatible, but again, please, don't take this as legal advice.
38
+
39
  == Installation ==
40
 
41
  1. Upload the "sticky-menu-or-anything" directory to your "wp-content/plugins" directory.
48
  == Frequently Asked Questions ==
49
 
50
  = Can I make multiple elements sticky?
51
+ Sure, <a href="https://wpsticky.com/">WP Sticky PRO</a> has that option. You can make as many elements sticky as you like and configure settings individually for each element.
52
 
53
  = I selected a class/ID in the settings screen, but the element doesn't stick when I scroll down. Why not? =
54
  First, make sure that if you select the element by its class name, it is preceded by a dot (e.g. ".main-menu"), and if you select it by its ID, that it's preceded by a pound/hash/number sign (e.g. "#main-menu"). Also, make sure there is only ONE element on the page with the selector you're using. If there is none, or more than one element that matches your selector, nothing will happen.
137
 
138
  == Changelog ==
139
 
140
+ = 2.32 =
141
+ * 2022-11-20
142
+ * minor security fixes
143
+
144
  = 2.31 =
145
  * 2021-02-19
146
  * fixed one really really visible typo
sticky-menu-or-anything.php CHANGED
@@ -5,10 +5,27 @@ Plugin URI: https://wpsticky.com/
5
  Description: Pick any element on the page, and it will stick when it reaches the top of the page when you scroll down. Handy for navigation menus, but can be used for any element on the page.
6
  Author: WebFactory Ltd
7
  Author URI: https://www.webfactoryltd.com/
8
- Version: 2.31
9
  Requires at least: 3.6
10
- Tested up to: 6.0
11
  Requires PHP: 5.2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  */
13
 
14
  defined('ABSPATH') or die('INSERT COIN');
@@ -26,7 +43,7 @@ new wf_flyout(__FILE__);
26
  */
27
  if (!function_exists('sticky_anything_activate')) {
28
  function sticky_anything_activate() {
29
- $versionNum = '2.31';
30
  if (get_option('sticky_anything_options') === false) {
31
  $new_options['sa_version'] = $versionNum;
32
  $new_options['sa_element'] = '';
@@ -39,8 +56,8 @@ if (!function_exists('sticky_anything_activate')) {
39
  $new_options['sa_dynamicmode'] = false;
40
  $new_options['sa_debugmode'] = false;
41
  $new_options['sa_pushup'] = '';
42
- $new_options['sa_hide_review_notification'] = false;
43
- $new_options['sa_dismiss_upsell_auto_open'] = false;
44
  add_option('sticky_anything_options',$new_options);
45
  }
46
  }
@@ -198,9 +215,9 @@ if (!function_exists('sticky_anything_config_page')) {
198
  ?>
199
 
200
  <div id="sticky-anything-settings-general" class="wrap">
201
- <h2 style="margin-bottom: 12px;"><img class="header-logo" src="<?php echo plugin_dir_url(__FILE__); ?>assets/img/wp-sticky-pro.png" alt="<?php _e('Sticky Menu (or Anything!) on Scroll','sticky-menu-or-anything-on-scroll'); ?>" title="<?php _e('Sticky Menu (or Anything!) on Scroll','sticky-menu-or-anything-on-scroll'); ?>"><?php _e('Sticky Menu (or Anything!) on Scroll','sticky-menu-or-anything-on-scroll'); ?></h2>
202
 
203
- <p><?php _e('Pick any element on the page, and it will stick when it reaches the top of the page when you scroll down. Great for headers and navigation menus, but can be used for any page element.','sticky-menu-or-anything-on-scroll'); ?><br><br></p>
204
  <?php
205
  if (!empty($sticky_anything_options['sa_element']) && empty($sticky_anything_options['sa_hide_review_notification'])) {
206
  $dismiss_url = add_query_arg(array('action' => 'sticky_hide_review_notification', 'redirect' => urlencode($_SERVER['REQUEST_URI'])), admin_url('admin.php'));
@@ -208,7 +225,7 @@ if (!function_exists('sticky_anything_config_page')) {
208
  ?>
209
  <div class="notice-info notice notice-rate"><p><strong>Help us keep Sticky Menu updated &amp; free!</strong></p>
210
  <p>Glad to see Sticky is helping you make things stick 😎<br>Please help other users learn about Sticky by rating it. It takes only a few clicks but it keeps the plugin free, updated and supported! <b>Thank you!</b></p>
211
- <p><a href="https://wordpress.org/support/plugin/sticky-menu-or-anything-on-scroll/reviews/#new-post" class="button button-primary" target="_blank">I want to rate &amp; keep Sticky Menu free!</a> &nbsp; <a href="<?php echo $dismiss_url; ?>">I already rated it</a></p>
212
  </div>
213
  <?php
214
  }
@@ -227,9 +244,9 @@ if (!function_exists('sticky_anything_config_page')) {
227
  ?>
228
 
229
  <h2 class="nav-tab-wrapper">
230
- <a class="nav-tab <?php if ($activeTab == 'main') { echo 'nav-tab-active'; } ?>" href="#main"><?php _e('Basic settings','sticky-menu-or-anything-on-scroll'); ?></a>
231
- <a class="nav-tab <?php if ($activeTab == 'advanced') { echo 'nav-tab-active'; } ?>" href="#advanced"><?php _e('Advanced settings','sticky-menu-or-anything-on-scroll'); ?></a>
232
- <a class="nav-tab <?php if ($activeTab == 'faq') { echo ' nav-tab-active'; } ?>" href="#faq"><?php _e('Support/FAQ','sticky-menu-or-anything-on-scroll'); ?></a>
233
  <a class="nav-tab nav-tab-pro open-sticky-pro-dialog" href="#" data-pro-feature="tab">Get Sticky PRO</a>
234
  </h2>
235
 
@@ -323,33 +340,33 @@ if (!function_exists('sticky_anything_config_page')) {
323
  <table class="form-table">
324
 
325
  <tr>
326
- <th scope="row"><label for="sa_element"><?php _e('Sticky Element:','sticky-menu-or-anything-on-scroll'); ?> (required)</label> <span tooltip="<?php _e('The element that needs to be sticky once you scroll. This can be your menu, or any other element like a sidebar, ad banner, etc. Make sure this is a unique identifier.','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
327
  <td>
328
  <input type="text" id="sa_element" name="sa_element" value="<?php
329
  if (@$sticky_anything_options['sa_element'] != '#NO-ELEMENT') {
330
  echo esc_html( @$sticky_anything_options['sa_element'] );
331
  }
332
- ?>"/> <em><?php _e('(choose ONE element, e.g. <strong>#main-navigation</strong>, OR <strong>.main-menu-1</strong>, OR <strong>header nav</strong>, etc.)','sticky-menu-or-anything-on-scroll'); ?></em>
333
  <p>Don't know the element's ID or class? Don't even know what that is? Use the <a href="#" class="open-sticky-pro-dialog pro-feature" data-pro-feature="visual-elements-picker">visual element picker</a> and just point to the element you want.</p>
334
  </td>
335
  </tr>
336
 
337
  <tr>
338
- <th scope="row"><label for=""><?php _e('Add Another Sticky Element:','sticky-menu-or-anything-on-scroll'); ?></label> <span tooltip="<?php _e('Need more than one element sticky on your site?','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
339
  <td>
340
  <p>Need two, three or ten elements on the site to be sticky? Upgrade to WP Sticky PRO and <a href="#" class="open-sticky-pro-dialog pro-feature" data-pro-feature="multiple-elements">make as many elements sticky as you need</a> and configure settings for each element individually.</p>
341
  </td>
342
  </tr>
343
 
344
  <tr>
345
- <th scope="row"><label for="sa_topspace"><?php _e('Space between top of page and sticky element: (optional)','sticky-menu-or-anything-on-scroll'); ?></label> <span tooltip="<?php _e('If you don\'t want the element to be sticky at the very top of the page, but a little lower, add the number of pixels that should be between your element and the \'ceiling\' of the page.','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
346
  <td>
347
  <input type="number" id="sa_topspace" name="sa_topspace" value="<?php echo esc_html( @$sticky_anything_options['sa_topspace'] ); ?>" style="width:80px;"> pixels
348
  </td>
349
  </tr>
350
 
351
  <tr>
352
- <th scope="row"><label for="sa_opacity"><?php _e('Sticky element opacity when scrolling: (optional)','sticky-menu-or-anything-on-scroll'); ?></label> <span tooltip="<?php _e('Sticky element opacity when element is sticky/scrolling','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
353
  <td>
354
  <input type="number" id="sa_opacity" name="sa_opacity" value="100" style="width:80px;" disabled> %
355
  <em>This option is available in <a href="#" class="open-sticky-pro-dialog pro-feature" data-pro-feature="opacity">WP Sticky PRO</a>.</em>
@@ -357,15 +374,15 @@ if (!function_exists('sticky_anything_config_page')) {
357
  </tr>
358
 
359
  <tr>
360
- <th scope="row"><?php _e('Check for Admin Toolbar:','sticky-menu-or-anything-on-scroll'); ?> <span tooltip="<?php _e('If the sticky element gets obscured by the Administrator Toolbar for logged in users (or vice versa), check this box.','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
361
  <td>
362
  <input type="checkbox" id="sa_adminbar" name="sa_adminbar" <?php if ($sticky_anything_options['sa_adminbar'] ) echo ' checked="checked" ';?> />
363
- <label for="sa_adminbar"><?php _e('Move the sticky element down a little if there is an Administrator Toolbar at the top (for logged in users).','sticky-menu-or-anything-on-scroll'); ?></label>
364
  </td>
365
  </tr>
366
 
367
  <tr>
368
- <th scope="row"><label for="sa_effects"><?php _e('Effects:','sticky-menu-or-anything-on-scroll'); ?></label> <span tooltip="<?php _e('Effects are added to the sticky element when scrolling','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
369
  <td>
370
  <input type="checkbox" disabled> <label>Fade-in</label><br>
371
  <input type="checkbox" disabled> <label>Slide-down</label>
@@ -375,7 +392,7 @@ if (!function_exists('sticky_anything_config_page')) {
375
  </tr>
376
 
377
  <tr>
378
- <th scope="row"><label for="sa_bg_color"><?php _e('Background Color When Sticky:','sticky-menu-or-anything-on-scroll'); ?></label> <span tooltip="<?php _e('Element\'s background color when it\'s sticky','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
379
  <td>
380
  <input class="sticky-color-field" type="text" id="sa_bg_color" value="" style="width:80px;">
381
  <br>
@@ -385,7 +402,7 @@ if (!function_exists('sticky_anything_config_page')) {
385
  </tr>
386
 
387
  <tr>
388
- <th scope="row"><label for="custom_css"><?php _e('Custom CSS:','sticky-menu-or-anything-on-scroll'); ?></label> <span tooltip="<?php _e('Custom CSS that\'s added to the element when it\'s sticky','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
389
  <td>
390
  <textarea id="custom_css" cols="40" rows="3" placeholder="border: 2px solid black;" disabled></textarea>
391
  <br>
@@ -396,14 +413,14 @@ if (!function_exists('sticky_anything_config_page')) {
396
  </tr>
397
 
398
  <tr>
399
- <th scope="row"><label for="sa_minscreenwidth"><?php _e('Do not stick element when screen is smaller than: (optional)','sticky-menu-or-anything-on-scroll'); ?></label> <span tooltip="<?php _e('Sometimes you do not want your element to be sticky when your screen is small (responsive menus, etc). If you enter a value here, your menu will not be sticky when your screen width is smaller than his value.','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
400
  <td>
401
  <input type="number" id="sa_minscreenwidth" name="sa_minscreenwidth" value="<?php echo esc_html( $sticky_anything_options['sa_minscreenwidth'] ); ?>" style="width:80px;" /> pixels
402
  </td>
403
  </tr>
404
 
405
  <tr>
406
- <th scope="row"><label for="sa_maxscreenwidth"><?php _e('Do not stick element when screen is larger than: (optional)','sticky-menu-or-anything-on-scroll'); ?></label> <span tooltip="<?php _e('Sometimes you do not want your element to be sticky when your screen is large (responsive menus, etc). If you enter a value here, your menu will not be sticky when your screen width is wider than this value.','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
407
  <td>
408
  <input type="number" id="sa_maxscreenwidth" name="sa_maxscreenwidth" value="<?php echo esc_html( $sticky_anything_options['sa_maxscreenwidth'] ); ?>" style="width:80px;" /> pixels
409
  </td>
@@ -422,35 +439,35 @@ if (!function_exists('sticky_anything_config_page')) {
422
  <table class="form-table">
423
 
424
  <tr>
425
- <th scope="row"><label for="sa_zindex"><?php _e('Z-index: (optional)','sticky-menu-or-anything-on-scroll'); ?></label> <span tooltip="<?php _e('If there are other elements on the page that obscure/overlap the sticky element, adding a Z-index might help. If you have no idea what that means, try entering 99999.','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
426
  <td>
427
  <input type="number" id="sa_zindex" name="sa_zindex" value="<?php echo esc_html( @$sticky_anything_options['sa_zindex'] ); ?>" style="width:80px;" />
428
  </td>
429
  </tr>
430
 
431
  <tr>
432
- <th scope="row"><label for="sa_pushup"><?php _e('Push-up element (optional):','sticky-menu-or-anything-on-scroll'); ?></label> <span tooltip="<?php _e('If you want your sticky element to be \'pushed up\' again by another element lower on the page, enter it here. Make sure this is a unique identifier.','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
433
  <td>
434
  <input type="text" id="sa_pushup" name="sa_pushup" value="<?php
435
  if ($sticky_anything_options['sa_pushup'] != '#NO-ELEMENT') {
436
  echo esc_html( $sticky_anything_options['sa_pushup'] );
437
  }
438
- ?>"/> <em><?php _e('(choose ONE element, e.g. <strong>#footer</strong>, OR <strong>.widget-bottom</strong>, etc.)','sticky-menu-or-anything-on-scroll'); ?></em>
439
  <p>Don't know the element's ID or class? Don't even know what that is? Use the <a href="#" class="open-sticky-pro-dialog pro-feature" data-pro-feature="visual-elements-picker-2">visual element picker</a> and just point to the element you want.</p>
440
  </td>
441
  </tr>
442
 
443
  <tr>
444
- <th scope="row"><!-- <span class="new"><?php _e('NEW!','sticky-menu-or-anything-on-scroll'); ?></span>--> <?php _e('Legacy mode:','sticky-menu-or-anything-on-scroll'); ?> <span tooltip="<?php _e('If you upgraded from an earlier version and it always worked before, use legacy mode to keep using the old method.','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
445
  <td>
446
  <input type="checkbox" id="sa_legacymode" name="sa_legacymode" <?php if ($sticky_anything_options['sa_legacymode'] == true ) echo ' checked="checked" ';?> />
447
- <label for="sa_legacymode"><strong><?php _e('Legacy Mode (only recommended if you upgraded from earlier version).','sticky-menu-or-anything-on-scroll'); ?></strong></label>
448
- <p class="description"><?php _e('In version 2.0, a new/better method for making elements sticky was introduced. However, if you upgraded this plugin from an earlier version, and the old method always worked for you, there is no need to use the new method and you should keep this option checked.<br>More information about this setting can be found in the <a href="#faq" class="faq">FAQ</a>.','sticky-menu-or-anything-on-scroll'); ?></p>
449
  </td>
450
  </tr>
451
 
452
  <tr>
453
- <th scope="row"><?php _e('Don\'t use sticky on selected pages/posts:','sticky-menu-or-anything-on-scroll'); ?> <span tooltip="<?php _e('Pick pages, posts, categories, tags, or post types where sticky will not be active.','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
454
  <td>
455
  Posts: <select disabled><option>This option is available in the PRO version</option></select><br>
456
  Pages: <select disabled><option>This option is available in the PRO version</option></select><br>
@@ -462,21 +479,21 @@ if (!function_exists('sticky_anything_config_page')) {
462
  </tr>
463
 
464
  <tr id="row-dynamic-mode" <?php if ($sticky_anything_options['sa_legacymode'] == false ) echo 'class="disabled-feature"';?>>
465
- <th scope="row"><div class="showhide" <?php if ($sticky_anything_options['sa_legacymode'] == false ) echo 'style="display:none;"';?>><?php _e('Dynamic mode:','sticky-menu-or-anything-on-scroll'); ?> <span tooltip="<?php _e('When Dynamic Mode is OFF, a cloned element will be created upon page load. If this mode is ON, a cloned element will be created every time your scrolled position hits the \'sticky\' point (option available in Legacy Mode only).','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></div></th>
466
  <td><div class="showhide" <?php if ($sticky_anything_options['sa_legacymode'] == false ) echo 'style="display:none;"';?>>
467
  <input type="checkbox" id="sa_dynamicmode" name="sa_dynamicmode" <?php if ($sticky_anything_options['sa_dynamicmode'] ) echo ' checked="checked" ';?> />
468
- <label for="sa_dynamicmode"><strong><?php _e('If the plugin doesn\'t work in your theme (often the case with responsive themes), try it in Dynamic Mode.','sticky-menu-or-anything-on-scroll'); ?></strong></label>
469
- <p class="description"><?php _e('NOTE: this is not a \'Magic Checkbox\' that fixes all problems. It simply solves some issues that frequently appear with some responsive themes, but doesn\'t necessarily work in ALL situations.','sticky-menu-or-anything-on-scroll'); ?></p>
470
  </div>
471
  </td>
472
  </tr>
473
 
474
  <tr>
475
- <th scope="row"><?php _e('Debug mode:','sticky-menu-or-anything-on-scroll'); ?> <span tooltip="<?php _e('When Debug Mode is on, error messages will be shown in your browser\'s console when the element you selected either doesn\'t exist, or when there are more elements on the page with your chosen selector.','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
476
  <td>
477
  <input type="checkbox" id="sa_debugmode" name="sa_debugmode" <?php if (@$sticky_anything_options['sa_debugmode'] ) echo ' checked="checked" ';?> />
478
- <label for="sa_debugmode"><strong><?php _e('Log plugin errors in browser console','sticky-menu-or-anything-on-scroll'); ?></strong></label>
479
- <p class="description"><?php _e('This will help debugging the plugin in case of problems. Do NOT check this option in production environments.','sticky-menu-or-anything-on-scroll'); ?></p>
480
  </td>
481
  </tr>
482
 
@@ -486,9 +503,9 @@ if (!function_exists('sticky_anything_config_page')) {
486
 
487
  <div class="tab-content tab-sticky-main tab-sticky-advanced <?php if (($activeTab != 'main') && ($activeTab != 'advanced')) {echo 'hide';} ?>">
488
 
489
- <input type="hidden" name="sa_tab" value="<?php echo $activeTab ?>">
490
 
491
- &nbsp;<br><input type="submit" value="<?php _e('Save Changes','sticky-menu-or-anything-on-scroll'); ?>" class="button-primary"/>
492
 
493
  </div>
494
 
@@ -515,7 +532,7 @@ if (!function_exists('sticky_anything_config_page')) {
515
  <div class="pro-ad-sidebar">
516
  <a title="WP Sticky PRO" href="#" class="open-sticky-pro-dialog" data-pro-feature="sidebar">
517
  <div class="inner center logo">
518
- <img style="max-height: 100px;" src="<?php echo $plugin_url; ?>assets/img/wp-sticky-pro.png" alt="WP Sticky PRO" title="WP Sticky PRO"><br>
519
  <h3>WP Sticky PRO is here!<br>Grab the <u>50% OFF</u> launch DISCOUNT 🚀</h3>
520
  </div></a>
521
  </div>
@@ -622,7 +639,7 @@ if (!function_exists('process_sticky_anything_options')) {
622
  $tabValue = $_POST['sa_tab'];
623
 
624
  update_option( 'sticky_anything_options', $options );
625
- wp_redirect( add_query_arg(
626
  array('page' => 'stickyanythingmenu', 'message' => '1', 'tab' => $tabValue),
627
  admin_url( 'options-general.php' )
628
  )
@@ -699,7 +716,6 @@ function sticky_anything_admin_footer() {
699
 
700
  $plugin_url = plugin_dir_url(__FILE__);
701
 
702
- //$out .= '<div class="center logo"><a href="https://wpsticky.com/?ref=sticky-free-popup" target="_blank"><img style="max-height: 100px;" src="' . $plugin_url . 'assets/img/wp-sticky-pro.png' . '" alt="WP Sticky PRO" title="WP Sticky PRO"></a><br>
703
  $out .= '<div class="center logo"><b><a href="https://wpsticky.com/?ref=sticky-free-popup" target="_blank">WP Sticky PRO</a> is here!<br>Grab the <i>50% OFF</i> launch DISCOUNT 🚀</b></div>';
704
 
705
  $out .= '<table id="sticky-table">';
@@ -777,9 +793,9 @@ function sticky_anything_admin_footer() {
777
 
778
  $out .= '</table>';
779
 
780
- $out .= '<div class="center footer"><b>100% No-Risk Money Back Guarantee!</b> If you don\'t like the plugin over the next 7 days, we\'ll refund 100% of your money. No questions asked! Payments are processed by our merchant of records - <a href="https://paddle.com" target="_blank">Paddle</a>.</div></div>';
781
 
782
- echo $out;
783
  } // sticky_anything_admin_footer
784
 
785
 
@@ -871,6 +887,308 @@ function sticky_anything_admin_footer() {
871
  update_option('sticky_anything_options', $sticky_anything_options);
872
  }
873
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
874
  /**
875
  * === HOOKS AND ACTIONS AND FILTERS AND SUCH ==========================================================
876
  */
5
  Description: Pick any element on the page, and it will stick when it reaches the top of the page when you scroll down. Handy for navigation menus, but can be used for any element on the page.
6
  Author: WebFactory Ltd
7
  Author URI: https://www.webfactoryltd.com/
8
+ Version: 2.32
9
  Requires at least: 3.6
10
+ Tested up to: 6.1
11
  Requires PHP: 5.2
12
+ Text Domain: sticky-menu-or-anything-on-scroll
13
+
14
+ Copyright 2020 - 2022 WebFactory Ltd (email: support@webfactoryltd.com)
15
+ Copyright 2019 - 2020 @senff
16
+
17
+ This program is free software; you can redistribute it and/or modify
18
+ it under the terms of the GNU General Public License, version 2, as
19
+ published by the Free Software Foundation.
20
+
21
+ This program is distributed in the hope that it will be useful,
22
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
23
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
+ GNU General Public License for more details.
25
+
26
+ You should have received a copy of the GNU General Public License
27
+ along with this program; if not, write to the Free Software
28
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29
  */
30
 
31
  defined('ABSPATH') or die('INSERT COIN');
43
  */
44
  if (!function_exists('sticky_anything_activate')) {
45
  function sticky_anything_activate() {
46
+ $versionNum = '2.32';
47
  if (get_option('sticky_anything_options') === false) {
48
  $new_options['sa_version'] = $versionNum;
49
  $new_options['sa_element'] = '';
56
  $new_options['sa_dynamicmode'] = false;
57
  $new_options['sa_debugmode'] = false;
58
  $new_options['sa_pushup'] = '';
59
+ $new_options['sa_hide_review_notification'] = false;
60
+ $new_options['sa_dismiss_upsell_auto_open'] = false;
61
  add_option('sticky_anything_options',$new_options);
62
  }
63
  }
215
  ?>
216
 
217
  <div id="sticky-anything-settings-general" class="wrap">
218
+ <h2 style="margin-bottom: 12px;"><img class="header-logo" src="<?php echo plugin_dir_url(__FILE__); ?>assets/img/wp-sticky-pro.png" alt="<?php esc_html_e('Sticky Menu (or Anything!) on Scroll','sticky-menu-or-anything-on-scroll'); ?>" title="<?php esc_html_e('Sticky Menu (or Anything!) on Scroll','sticky-menu-or-anything-on-scroll'); ?>"><?php esc_html_e('Sticky Menu (or Anything!) on Scroll','sticky-menu-or-anything-on-scroll'); ?></h2>
219
 
220
+ <p><?php esc_html_e('Pick any element on the page, and it will stick when it reaches the top of the page when you scroll down. Great for headers and navigation menus, but can be used for any page element.','sticky-menu-or-anything-on-scroll'); ?><br><br></p>
221
  <?php
222
  if (!empty($sticky_anything_options['sa_element']) && empty($sticky_anything_options['sa_hide_review_notification'])) {
223
  $dismiss_url = add_query_arg(array('action' => 'sticky_hide_review_notification', 'redirect' => urlencode($_SERVER['REQUEST_URI'])), admin_url('admin.php'));
225
  ?>
226
  <div class="notice-info notice notice-rate"><p><strong>Help us keep Sticky Menu updated &amp; free!</strong></p>
227
  <p>Glad to see Sticky is helping you make things stick 😎<br>Please help other users learn about Sticky by rating it. It takes only a few clicks but it keeps the plugin free, updated and supported! <b>Thank you!</b></p>
228
+ <p><a href="https://wordpress.org/support/plugin/sticky-menu-or-anything-on-scroll/reviews/#new-post" class="button button-primary" target="_blank">I want to rate &amp; keep Sticky Menu free!</a> &nbsp; <a href="<?php echo esc_url($dismiss_url); ?>">I already rated it</a></p>
229
  </div>
230
  <?php
231
  }
244
  ?>
245
 
246
  <h2 class="nav-tab-wrapper">
247
+ <a class="nav-tab <?php if ($activeTab == 'main') { echo 'nav-tab-active'; } ?>" href="#main"><?php esc_html_e('Basic settings','sticky-menu-or-anything-on-scroll'); ?></a>
248
+ <a class="nav-tab <?php if ($activeTab == 'advanced') { echo 'nav-tab-active'; } ?>" href="#advanced"><?php esc_html_e('Advanced settings','sticky-menu-or-anything-on-scroll'); ?></a>
249
+ <a class="nav-tab <?php if ($activeTab == 'faq') { echo ' nav-tab-active'; } ?>" href="#faq"><?php esc_html_e('Support/FAQ','sticky-menu-or-anything-on-scroll'); ?></a>
250
  <a class="nav-tab nav-tab-pro open-sticky-pro-dialog" href="#" data-pro-feature="tab">Get Sticky PRO</a>
251
  </h2>
252
 
340
  <table class="form-table">
341
 
342
  <tr>
343
+ <th scope="row"><label for="sa_element"><?php esc_html_e('Sticky Element:','sticky-menu-or-anything-on-scroll'); ?> (required)</label> <span tooltip="<?php esc_html_e('The element that needs to be sticky once you scroll. This can be your menu, or any other element like a sidebar, ad banner, etc. Make sure this is a unique identifier.','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
344
  <td>
345
  <input type="text" id="sa_element" name="sa_element" value="<?php
346
  if (@$sticky_anything_options['sa_element'] != '#NO-ELEMENT') {
347
  echo esc_html( @$sticky_anything_options['sa_element'] );
348
  }
349
+ ?>"/> <em><?php sticky_wp_kses_wf(__('(choose ONE element, e.g. <strong>#main-navigation</strong>, OR <strong>.main-menu-1</strong>, OR <strong>header nav</strong>, etc.)','sticky-menu-or-anything-on-scroll')); ?></em>
350
  <p>Don't know the element's ID or class? Don't even know what that is? Use the <a href="#" class="open-sticky-pro-dialog pro-feature" data-pro-feature="visual-elements-picker">visual element picker</a> and just point to the element you want.</p>
351
  </td>
352
  </tr>
353
 
354
  <tr>
355
+ <th scope="row"><label for=""><?php esc_html_e('Add Another Sticky Element:','sticky-menu-or-anything-on-scroll'); ?></label> <span tooltip="<?php esc_html_e('Need more than one element sticky on your site?','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
356
  <td>
357
  <p>Need two, three or ten elements on the site to be sticky? Upgrade to WP Sticky PRO and <a href="#" class="open-sticky-pro-dialog pro-feature" data-pro-feature="multiple-elements">make as many elements sticky as you need</a> and configure settings for each element individually.</p>
358
  </td>
359
  </tr>
360
 
361
  <tr>
362
+ <th scope="row"><label for="sa_topspace"><?php esc_html_e('Space between top of page and sticky element: (optional)','sticky-menu-or-anything-on-scroll'); ?></label> <span tooltip="<?php esc_html_e('If you don\'t want the element to be sticky at the very top of the page, but a little lower, add the number of pixels that should be between your element and the \'ceiling\' of the page.','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
363
  <td>
364
  <input type="number" id="sa_topspace" name="sa_topspace" value="<?php echo esc_html( @$sticky_anything_options['sa_topspace'] ); ?>" style="width:80px;"> pixels
365
  </td>
366
  </tr>
367
 
368
  <tr>
369
+ <th scope="row"><label for="sa_opacity"><?php esc_html_e('Sticky element opacity when scrolling: (optional)','sticky-menu-or-anything-on-scroll'); ?></label> <span tooltip="<?php esc_html_e('Sticky element opacity when element is sticky/scrolling','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
370
  <td>
371
  <input type="number" id="sa_opacity" name="sa_opacity" value="100" style="width:80px;" disabled> %
372
  <em>This option is available in <a href="#" class="open-sticky-pro-dialog pro-feature" data-pro-feature="opacity">WP Sticky PRO</a>.</em>
374
  </tr>
375
 
376
  <tr>
377
+ <th scope="row"><?php esc_html_e('Check for Admin Toolbar:','sticky-menu-or-anything-on-scroll'); ?> <span tooltip="<?php esc_html_e('If the sticky element gets obscured by the Administrator Toolbar for logged in users (or vice versa), check this box.','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
378
  <td>
379
  <input type="checkbox" id="sa_adminbar" name="sa_adminbar" <?php if ($sticky_anything_options['sa_adminbar'] ) echo ' checked="checked" ';?> />
380
+ <label for="sa_adminbar"><?php esc_html_e('Move the sticky element down a little if there is an Administrator Toolbar at the top (for logged in users).','sticky-menu-or-anything-on-scroll'); ?></label>
381
  </td>
382
  </tr>
383
 
384
  <tr>
385
+ <th scope="row"><label for="sa_effects"><?php esc_html_e('Effects:','sticky-menu-or-anything-on-scroll'); ?></label> <span tooltip="<?php esc_html_e('Effects are added to the sticky element when scrolling','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
386
  <td>
387
  <input type="checkbox" disabled> <label>Fade-in</label><br>
388
  <input type="checkbox" disabled> <label>Slide-down</label>
392
  </tr>
393
 
394
  <tr>
395
+ <th scope="row"><label for="sa_bg_color"><?php esc_html_e('Background Color When Sticky:','sticky-menu-or-anything-on-scroll'); ?></label> <span tooltip="<?php esc_html_e('Element\'s background color when it\'s sticky','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
396
  <td>
397
  <input class="sticky-color-field" type="text" id="sa_bg_color" value="" style="width:80px;">
398
  <br>
402
  </tr>
403
 
404
  <tr>
405
+ <th scope="row"><label for="custom_css"><?php esc_html_e('Custom CSS:','sticky-menu-or-anything-on-scroll'); ?></label> <span tooltip="<?php esc_html_e('Custom CSS that\'s added to the element when it\'s sticky','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
406
  <td>
407
  <textarea id="custom_css" cols="40" rows="3" placeholder="border: 2px solid black;" disabled></textarea>
408
  <br>
413
  </tr>
414
 
415
  <tr>
416
+ <th scope="row"><label for="sa_minscreenwidth"><?php esc_html_e('Do not stick element when screen is smaller than: (optional)','sticky-menu-or-anything-on-scroll'); ?></label> <span tooltip="<?php esc_html_e('Sometimes you do not want your element to be sticky when your screen is small (responsive menus, etc). If you enter a value here, your menu will not be sticky when your screen width is smaller than his value.','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
417
  <td>
418
  <input type="number" id="sa_minscreenwidth" name="sa_minscreenwidth" value="<?php echo esc_html( $sticky_anything_options['sa_minscreenwidth'] ); ?>" style="width:80px;" /> pixels
419
  </td>
420
  </tr>
421
 
422
  <tr>
423
+ <th scope="row"><label for="sa_maxscreenwidth"><?php esc_html_e('Do not stick element when screen is larger than: (optional)','sticky-menu-or-anything-on-scroll'); ?></label> <span tooltip="<?php esc_html_e('Sometimes you do not want your element to be sticky when your screen is large (responsive menus, etc). If you enter a value here, your menu will not be sticky when your screen width is wider than this value.','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
424
  <td>
425
  <input type="number" id="sa_maxscreenwidth" name="sa_maxscreenwidth" value="<?php echo esc_html( $sticky_anything_options['sa_maxscreenwidth'] ); ?>" style="width:80px;" /> pixels
426
  </td>
439
  <table class="form-table">
440
 
441
  <tr>
442
+ <th scope="row"><label for="sa_zindex"><?php esc_html_e('Z-index: (optional)','sticky-menu-or-anything-on-scroll'); ?></label> <span tooltip="<?php esc_html_e('If there are other elements on the page that obscure/overlap the sticky element, adding a Z-index might help. If you have no idea what that means, try entering 99999.','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
443
  <td>
444
  <input type="number" id="sa_zindex" name="sa_zindex" value="<?php echo esc_html( @$sticky_anything_options['sa_zindex'] ); ?>" style="width:80px;" />
445
  </td>
446
  </tr>
447
 
448
  <tr>
449
+ <th scope="row"><label for="sa_pushup"><?php esc_html_e('Push-up element (optional):','sticky-menu-or-anything-on-scroll'); ?></label> <span tooltip="<?php esc_html_e('If you want your sticky element to be \'pushed up\' again by another element lower on the page, enter it here. Make sure this is a unique identifier.','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
450
  <td>
451
  <input type="text" id="sa_pushup" name="sa_pushup" value="<?php
452
  if ($sticky_anything_options['sa_pushup'] != '#NO-ELEMENT') {
453
  echo esc_html( $sticky_anything_options['sa_pushup'] );
454
  }
455
+ ?>"/> <em><?php sticky_wp_kses_wf(__('(choose ONE element, e.g. <strong>#footer</strong>, OR <strong>.widget-bottom</strong>, etc.)','sticky-menu-or-anything-on-scroll')); ?></em>
456
  <p>Don't know the element's ID or class? Don't even know what that is? Use the <a href="#" class="open-sticky-pro-dialog pro-feature" data-pro-feature="visual-elements-picker-2">visual element picker</a> and just point to the element you want.</p>
457
  </td>
458
  </tr>
459
 
460
  <tr>
461
+ <th scope="row"><!-- <span class="new"><?php esc_html_e('NEW!','sticky-menu-or-anything-on-scroll'); ?></span>--> <?php esc_html_e('Legacy mode:','sticky-menu-or-anything-on-scroll'); ?> <span tooltip="<?php esc_html_e('If you upgraded from an earlier version and it always worked before, use legacy mode to keep using the old method.','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
462
  <td>
463
  <input type="checkbox" id="sa_legacymode" name="sa_legacymode" <?php if ($sticky_anything_options['sa_legacymode'] == true ) echo ' checked="checked" ';?> />
464
+ <label for="sa_legacymode"><strong><?php esc_html_e('Legacy Mode (only recommended if you upgraded from earlier version).','sticky-menu-or-anything-on-scroll'); ?></strong></label>
465
+ <p class="description"><?php sticky_wp_kses_wf(__('In version 2.0, a new/better method for making elements sticky was introduced. However, if you upgraded this plugin from an earlier version, and the old method always worked for you, there is no need to use the new method and you should keep this option checked.<br>More information about this setting can be found in the <a href="#faq" class="faq">FAQ</a>.','sticky-menu-or-anything-on-scroll')); ?></p>
466
  </td>
467
  </tr>
468
 
469
  <tr>
470
+ <th scope="row"><?php esc_html_e('Don\'t use sticky on selected pages/posts:','sticky-menu-or-anything-on-scroll'); ?> <span tooltip="<?php esc_html_e('Pick pages, posts, categories, tags, or post types where sticky will not be active.','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
471
  <td>
472
  Posts: <select disabled><option>This option is available in the PRO version</option></select><br>
473
  Pages: <select disabled><option>This option is available in the PRO version</option></select><br>
479
  </tr>
480
 
481
  <tr id="row-dynamic-mode" <?php if ($sticky_anything_options['sa_legacymode'] == false ) echo 'class="disabled-feature"';?>>
482
+ <th scope="row"><div class="showhide" <?php if ($sticky_anything_options['sa_legacymode'] == false ) echo 'style="display:none;"';?>><?php esc_html_e('Dynamic mode:','sticky-menu-or-anything-on-scroll'); ?> <span tooltip="<?php esc_html_e('When Dynamic Mode is OFF, a cloned element will be created upon page load. If this mode is ON, a cloned element will be created every time your scrolled position hits the \'sticky\' point (option available in Legacy Mode only).','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></div></th>
483
  <td><div class="showhide" <?php if ($sticky_anything_options['sa_legacymode'] == false ) echo 'style="display:none;"';?>>
484
  <input type="checkbox" id="sa_dynamicmode" name="sa_dynamicmode" <?php if ($sticky_anything_options['sa_dynamicmode'] ) echo ' checked="checked" ';?> />
485
+ <label for="sa_dynamicmode"><strong><?php esc_html_e('If the plugin doesn\'t work in your theme (often the case with responsive themes), try it in Dynamic Mode.','sticky-menu-or-anything-on-scroll'); ?></strong></label>
486
+ <p class="description"><?php esc_html_e('NOTE: this is not a \'Magic Checkbox\' that fixes all problems. It simply solves some issues that frequently appear with some responsive themes, but doesn\'t necessarily work in ALL situations.','sticky-menu-or-anything-on-scroll'); ?></p>
487
  </div>
488
  </td>
489
  </tr>
490
 
491
  <tr>
492
+ <th scope="row"><?php esc_html_e('Debug mode:','sticky-menu-or-anything-on-scroll'); ?> <span tooltip="<?php esc_html_e('When Debug Mode is on, error messages will be shown in your browser\'s console when the element you selected either doesn\'t exist, or when there are more elements on the page with your chosen selector.','sticky-menu-or-anything-on-scroll'); ?>"><span class="dashicons dashicons-editor-help"></span></span></th>
493
  <td>
494
  <input type="checkbox" id="sa_debugmode" name="sa_debugmode" <?php if (@$sticky_anything_options['sa_debugmode'] ) echo ' checked="checked" ';?> />
495
+ <label for="sa_debugmode"><strong><?php esc_html_e('Log plugin errors in browser console','sticky-menu-or-anything-on-scroll'); ?></strong></label>
496
+ <p class="description"><?php esc_html_e('This will help debugging the plugin in case of problems. Do NOT check this option in production environments.','sticky-menu-or-anything-on-scroll'); ?></p>
497
  </td>
498
  </tr>
499
 
503
 
504
  <div class="tab-content tab-sticky-main tab-sticky-advanced <?php if (($activeTab != 'main') && ($activeTab != 'advanced')) {echo 'hide';} ?>">
505
 
506
+ <input type="hidden" name="sa_tab" value="<?php esc_attr_e($activeTab); ?>">
507
 
508
+ &nbsp;<br><input type="submit" value="<?php esc_html_e('Save Changes','sticky-menu-or-anything-on-scroll'); ?>" class="button-primary"/>
509
 
510
  </div>
511
 
532
  <div class="pro-ad-sidebar">
533
  <a title="WP Sticky PRO" href="#" class="open-sticky-pro-dialog" data-pro-feature="sidebar">
534
  <div class="inner center logo">
535
+ <img style="max-height: 100px;" src="<?php echo esc_url($plugin_url); ?>assets/img/wp-sticky-pro.png" alt="WP Sticky PRO" title="WP Sticky PRO"><br>
536
  <h3>WP Sticky PRO is here!<br>Grab the <u>50% OFF</u> launch DISCOUNT 🚀</h3>
537
  </div></a>
538
  </div>
639
  $tabValue = $_POST['sa_tab'];
640
 
641
  update_option( 'sticky_anything_options', $options );
642
+ wp_safe_redirect( add_query_arg(
643
  array('page' => 'stickyanythingmenu', 'message' => '1', 'tab' => $tabValue),
644
  admin_url( 'options-general.php' )
645
  )
716
 
717
  $plugin_url = plugin_dir_url(__FILE__);
718
 
 
719
  $out .= '<div class="center logo"><b><a href="https://wpsticky.com/?ref=sticky-free-popup" target="_blank">WP Sticky PRO</a> is here!<br>Grab the <i>50% OFF</i> launch DISCOUNT 🚀</b></div>';
720
 
721
  $out .= '<table id="sticky-table">';
793
 
794
  $out .= '</table>';
795
 
796
+ $out .= '<div class="center footer"><b>100% No-Risk Money Back Guarantee!</b> If you don\'t like the plugin over the next 7 days, we\'ll refund 100% of your money. No questions asked! Payments are processed by our merchant of records - <a href="https://paddle.com/" target="_blank">Paddle</a>.</div></div>';
797
 
798
+ sticky_wp_kses_wf($out);
799
  } // sticky_anything_admin_footer
800
 
801
 
887
  update_option('sticky_anything_options', $sticky_anything_options);
888
  }
889
 
890
+ function sticky_wp_kses_wf($html)
891
+ {
892
+ add_filter('safe_style_css', function ($styles) {
893
+ $styles_wf = array(
894
+ 'text-align',
895
+ 'margin',
896
+ 'color',
897
+ 'float',
898
+ 'border',
899
+ 'background',
900
+ 'background-color',
901
+ 'border-bottom',
902
+ 'border-bottom-color',
903
+ 'border-bottom-style',
904
+ 'border-bottom-width',
905
+ 'border-collapse',
906
+ 'border-color',
907
+ 'border-left',
908
+ 'border-left-color',
909
+ 'border-left-style',
910
+ 'border-left-width',
911
+ 'border-right',
912
+ 'border-right-color',
913
+ 'border-right-style',
914
+ 'border-right-width',
915
+ 'border-spacing',
916
+ 'border-style',
917
+ 'border-top',
918
+ 'border-top-color',
919
+ 'border-top-style',
920
+ 'border-top-width',
921
+ 'border-width',
922
+ 'caption-side',
923
+ 'clear',
924
+ 'cursor',
925
+ 'direction',
926
+ 'font',
927
+ 'font-family',
928
+ 'font-size',
929
+ 'font-style',
930
+ 'font-variant',
931
+ 'font-weight',
932
+ 'height',
933
+ 'letter-spacing',
934
+ 'line-height',
935
+ 'margin-bottom',
936
+ 'margin-left',
937
+ 'margin-right',
938
+ 'margin-top',
939
+ 'overflow',
940
+ 'padding',
941
+ 'padding-bottom',
942
+ 'padding-left',
943
+ 'padding-right',
944
+ 'padding-top',
945
+ 'text-decoration',
946
+ 'text-indent',
947
+ 'vertical-align',
948
+ 'width',
949
+ 'display',
950
+ );
951
+
952
+ foreach ($styles_wf as $style_wf) {
953
+ $styles[] = $style_wf;
954
+ }
955
+ return $styles;
956
+ });
957
+
958
+ $allowed_tags = wp_kses_allowed_html('post');
959
+ $allowed_tags['input'] = array(
960
+ 'type' => true,
961
+ 'style' => true,
962
+ 'class' => true,
963
+ 'id' => true,
964
+ 'checked' => true,
965
+ 'disabled' => true,
966
+ 'name' => true,
967
+ 'size' => true,
968
+ 'placeholder' => true,
969
+ 'value' => true,
970
+ 'data-*' => true,
971
+ 'size' => true,
972
+ 'disabled' => true
973
+ );
974
+
975
+ $allowed_tags['textarea'] = array(
976
+ 'type' => true,
977
+ 'style' => true,
978
+ 'class' => true,
979
+ 'id' => true,
980
+ 'checked' => true,
981
+ 'disabled' => true,
982
+ 'name' => true,
983
+ 'size' => true,
984
+ 'placeholder' => true,
985
+ 'value' => true,
986
+ 'data-*' => true,
987
+ 'cols' => true,
988
+ 'rows' => true,
989
+ 'disabled' => true,
990
+ 'autocomplete' => true
991
+ );
992
+
993
+ $allowed_tags['select'] = array(
994
+ 'type' => true,
995
+ 'style' => true,
996
+ 'class' => true,
997
+ 'id' => true,
998
+ 'checked' => true,
999
+ 'disabled' => true,
1000
+ 'name' => true,
1001
+ 'size' => true,
1002
+ 'placeholder' => true,
1003
+ 'value' => true,
1004
+ 'data-*' => true,
1005
+ 'multiple' => true,
1006
+ 'disabled' => true
1007
+ );
1008
+
1009
+ $allowed_tags['option'] = array(
1010
+ 'type' => true,
1011
+ 'style' => true,
1012
+ 'class' => true,
1013
+ 'id' => true,
1014
+ 'checked' => true,
1015
+ 'disabled' => true,
1016
+ 'name' => true,
1017
+ 'size' => true,
1018
+ 'placeholder' => true,
1019
+ 'value' => true,
1020
+ 'selected' => true,
1021
+ 'data-*' => true
1022
+ );
1023
+ $allowed_tags['optgroup'] = array(
1024
+ 'type' => true,
1025
+ 'style' => true,
1026
+ 'class' => true,
1027
+ 'id' => true,
1028
+ 'checked' => true,
1029
+ 'disabled' => true,
1030
+ 'name' => true,
1031
+ 'size' => true,
1032
+ 'placeholder' => true,
1033
+ 'value' => true,
1034
+ 'selected' => true,
1035
+ 'data-*' => true,
1036
+ 'label' => true
1037
+ );
1038
+
1039
+ $allowed_tags['a'] = array(
1040
+ 'href' => true,
1041
+ 'data-*' => true,
1042
+ 'class' => true,
1043
+ 'style' => true,
1044
+ 'id' => true,
1045
+ 'target' => true,
1046
+ 'data-*' => true,
1047
+ 'role' => true,
1048
+ 'aria-controls' => true,
1049
+ 'aria-selected' => true,
1050
+ 'disabled' => true
1051
+ );
1052
+
1053
+ $allowed_tags['div'] = array(
1054
+ 'style' => true,
1055
+ 'class' => true,
1056
+ 'id' => true,
1057
+ 'data-*' => true,
1058
+ 'role' => true,
1059
+ 'aria-labelledby' => true,
1060
+ 'value' => true,
1061
+ 'aria-modal' => true,
1062
+ 'tabindex' => true
1063
+ );
1064
+
1065
+ $allowed_tags['li'] = array(
1066
+ 'style' => true,
1067
+ 'class' => true,
1068
+ 'id' => true,
1069
+ 'data-*' => true,
1070
+ 'role' => true,
1071
+ 'aria-labelledby' => true,
1072
+ 'value' => true,
1073
+ 'aria-modal' => true,
1074
+ 'tabindex' => true
1075
+ );
1076
+
1077
+ $allowed_tags['span'] = array(
1078
+ 'style' => true,
1079
+ 'class' => true,
1080
+ 'id' => true,
1081
+ 'data-*' => true,
1082
+ 'aria-hidden' => true
1083
+ );
1084
+
1085
+ $allowed_tags['style'] = array(
1086
+ 'class' => true,
1087
+ 'id' => true,
1088
+ 'type' => true
1089
+ );
1090
+
1091
+ $allowed_tags['fieldset'] = array(
1092
+ 'class' => true,
1093
+ 'id' => true,
1094
+ 'type' => true
1095
+ );
1096
+
1097
+ $allowed_tags['link'] = array(
1098
+ 'class' => true,
1099
+ 'id' => true,
1100
+ 'type' => true,
1101
+ 'rel' => true,
1102
+ 'href' => true,
1103
+ 'media' => true
1104
+ );
1105
+
1106
+ $allowed_tags['form'] = array(
1107
+ 'style' => true,
1108
+ 'class' => true,
1109
+ 'id' => true,
1110
+ 'method' => true,
1111
+ 'action' => true,
1112
+ 'data-*' => true
1113
+ );
1114
+
1115
+ $allowed_tags['script'] = array(
1116
+ 'class' => true,
1117
+ 'id' => true,
1118
+ 'type' => true,
1119
+ 'src' => true
1120
+ );
1121
+
1122
+ echo wp_kses($html, $allowed_tags);
1123
+
1124
+ add_filter('safe_style_css', function ($styles) {
1125
+ $styles_wf = array(
1126
+ 'text-align',
1127
+ 'margin',
1128
+ 'color',
1129
+ 'float',
1130
+ 'border',
1131
+ 'background',
1132
+ 'background-color',
1133
+ 'border-bottom',
1134
+ 'border-bottom-color',
1135
+ 'border-bottom-style',
1136
+ 'border-bottom-width',
1137
+ 'border-collapse',
1138
+ 'border-color',
1139
+ 'border-left',
1140
+ 'border-left-color',
1141
+ 'border-left-style',
1142
+ 'border-left-width',
1143
+ 'border-right',
1144
+ 'border-right-color',
1145
+ 'border-right-style',
1146
+ 'border-right-width',
1147
+ 'border-spacing',
1148
+ 'border-style',
1149
+ 'border-top',
1150
+ 'border-top-color',
1151
+ 'border-top-style',
1152
+ 'border-top-width',
1153
+ 'border-width',
1154
+ 'caption-side',
1155
+ 'clear',
1156
+ 'cursor',
1157
+ 'direction',
1158
+ 'font',
1159
+ 'font-family',
1160
+ 'font-size',
1161
+ 'font-style',
1162
+ 'font-variant',
1163
+ 'font-weight',
1164
+ 'height',
1165
+ 'letter-spacing',
1166
+ 'line-height',
1167
+ 'margin-bottom',
1168
+ 'margin-left',
1169
+ 'margin-right',
1170
+ 'margin-top',
1171
+ 'overflow',
1172
+ 'padding',
1173
+ 'padding-bottom',
1174
+ 'padding-left',
1175
+ 'padding-right',
1176
+ 'padding-top',
1177
+ 'text-decoration',
1178
+ 'text-indent',
1179
+ 'vertical-align',
1180
+ 'width'
1181
+ );
1182
+
1183
+ foreach ($styles_wf as $style_wf) {
1184
+ if (($key = array_search($style_wf, $styles)) !== false) {
1185
+ unset($styles[$key]);
1186
+ }
1187
+ }
1188
+ return $styles;
1189
+ });
1190
+ }
1191
+
1192
  /**
1193
  * === HOOKS AND ACTIONS AND FILTERS AND SUCH ==========================================================
1194
  */
wf-flyout/config.php CHANGED
@@ -13,6 +13,7 @@ $config['custom_css'] = '#wf-flyout .wff-menu-item .dashicons.dashicons-universa
13
 
14
  $config['menu_items'] = array(
15
  array('href' => '#', 'label' => 'Get WP Sticky PRO with 50% off', 'icon' => 'dashicons-admin-post', 'class' => 'accent open-sticky-pro-dialog', 'data' => 'data-pro-feature="flyout"'),
 
16
  array('href' => 'https://wp301redirects.com/?ref=wff-sticky&coupon=50off', 'label' => 'Get WP 301 Redirects PRO with 50% off', 'icon' => '301-logo.png', 'class' => 'wp301-icon'),
17
  array('href' => 'https://wpreset.com/?ref=wff-sticky&coupon=50off', 'target' => '_blank', 'label' => 'Get WP Reset PRO with 50% off', 'icon' => 'wp-reset.png'),
18
  array('href' => 'https://underconstructionpage.com/?ref=wff-sticky&coupon=welcome', 'target' => '_blank', 'label' => 'Create the perfect Under Construction Page', 'icon' => 'ucp.png', 'class' => 'ucp-icon'),
13
 
14
  $config['menu_items'] = array(
15
  array('href' => '#', 'label' => 'Get WP Sticky PRO with 50% off', 'icon' => 'dashicons-admin-post', 'class' => 'accent open-sticky-pro-dialog', 'data' => 'data-pro-feature="flyout"'),
16
+ array('href' => 'https://wpforcessl.com/?ref=wff-sticky', 'label' => 'Fix all SSL problems &amp; monitor site in real-time', 'icon' => 'wp-ssl.png', 'class' => 'wpfssl-icon'),
17
  array('href' => 'https://wp301redirects.com/?ref=wff-sticky&coupon=50off', 'label' => 'Get WP 301 Redirects PRO with 50% off', 'icon' => '301-logo.png', 'class' => 'wp301-icon'),
18
  array('href' => 'https://wpreset.com/?ref=wff-sticky&coupon=50off', 'target' => '_blank', 'label' => 'Get WP Reset PRO with 50% off', 'icon' => 'wp-reset.png'),
19
  array('href' => 'https://underconstructionpage.com/?ref=wff-sticky&coupon=welcome', 'target' => '_blank', 'label' => 'Create the perfect Under Construction Page', 'icon' => 'ucp.png', 'class' => 'ucp-icon'),
wf-flyout/icons/wp-ssl.png ADDED
Binary file
wf-flyout/wf-flyout.js CHANGED
@@ -1,6 +1,6 @@
1
  /**
2
  * Universal fly-out menu for WebFactory plugins
3
- * (c) WebFactory Ltd, 2021
4
  */
5
 
6
  jQuery(document).ready(function ($) {
1
  /**
2
  * Universal fly-out menu for WebFactory plugins
3
+ * (c) WebFactory Ltd, 2022
4
  */
5
 
6
  jQuery(document).ready(function ($) {
wf-flyout/wf-flyout.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  /**
4
  * Universal fly-out menu for WebFactory plugins
5
- * (c) WebFactory Ltd, 2021
6
  */
7
 
8
 
@@ -112,7 +112,7 @@ if (false == class_exists('wf_flyout')) {
112
  $out .= $this->config['custom_css'];
113
  $out .= '</style>';
114
 
115
- echo $out;
116
  } // admin_head
117
 
118
 
@@ -161,7 +161,7 @@ if (false == class_exists('wf_flyout')) {
161
 
162
  $out .= '</div>'; // #wf-flyout
163
 
164
- echo $out;
165
  } // admin_footer
166
  } // wf_flyout
167
  } // if class exists
2
 
3
  /**
4
  * Universal fly-out menu for WebFactory plugins
5
+ * (c) WebFactory Ltd, 2022
6
  */
7
 
8
 
112
  $out .= $this->config['custom_css'];
113
  $out .= '</style>';
114
 
115
+ sticky_wp_kses_wf($out);
116
  } // admin_head
117
 
118
 
161
 
162
  $out .= '</div>'; // #wf-flyout
163
 
164
+ sticky_wp_kses_wf($out);
165
  } // admin_footer
166
  } // wf_flyout
167
  } // if class exists