Version Description
- 2021-01-05
- minor bug fixes and improvements
- removed promo campaign for WP 301 Redirects
Download this release
Release Info
Developer | WebFactory |
Plugin | Sticky Menu (or Anything!) on Scroll |
Version | 2.28 |
Comparing to | |
See all releases |
Code changes from version 2.25 to 2.28
- assets/css/sticky-anything-admin.css +35 -15
- assets/faq.php +2 -2
- assets/js/sticky-admin-pointers.js +33 -0
- assets/js/sticky-anything-admin.js +3 -1
- readme.txt +10 -4
- sticky-menu-or-anything.php +136 -22
- wp301/wp301-logo.png +0 -0
- wp301/wp301.js +0 -128
- wp301/wp301.php +0 -294
assets/css/sticky-anything-admin.css
CHANGED
@@ -7,6 +7,12 @@
|
|
7 |
width: 70%;
|
8 |
}
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
.main-content .new-feature {
|
11 |
border: solid 1px #c0c0c0;
|
12 |
background: #e7e7e7;
|
@@ -276,7 +282,7 @@
|
|
276 |
}
|
277 |
|
278 |
.sticky-pro-dialog .ui-dialog-titlebar {
|
279 |
-
background-color: #
|
280 |
border-bottom: none;
|
281 |
text-align: center;
|
282 |
display: none;
|
@@ -289,11 +295,11 @@
|
|
289 |
}
|
290 |
|
291 |
.nav-tab-pro {
|
292 |
-
background-color: #
|
293 |
}
|
294 |
|
295 |
.settings_page_stickyanythingmenu a.button-buy {
|
296 |
-
background-color: #
|
297 |
color: #fff;
|
298 |
font-weight: 700;
|
299 |
padding: 5px 10px;
|
@@ -304,17 +310,18 @@
|
|
304 |
}
|
305 |
|
306 |
.pro-feature {
|
307 |
-
background-color: #
|
308 |
-
padding:
|
|
|
309 |
color: #333;
|
310 |
text-decoration: none;
|
311 |
}
|
312 |
|
313 |
.pro-feature:hover {
|
314 |
-
background-color: #
|
315 |
-
padding:
|
316 |
color: #333;
|
317 |
-
text-decoration:
|
318 |
}
|
319 |
|
320 |
.center {
|
@@ -322,7 +329,7 @@
|
|
322 |
}
|
323 |
|
324 |
.sticky-pro-dialog .logo {
|
325 |
-
background-color: #
|
326 |
padding: 10px;
|
327 |
}
|
328 |
|
@@ -336,13 +343,13 @@
|
|
336 |
}
|
337 |
|
338 |
.sticky-pro-dialog .logo i {
|
339 |
-
color: #
|
340 |
font-style: normal;
|
341 |
}
|
342 |
|
343 |
.sticky-pro-dialog .footer {
|
344 |
padding: 15px 10px;
|
345 |
-
background-color: #
|
346 |
}
|
347 |
|
348 |
.sticky-pro-dialog {
|
@@ -369,18 +376,18 @@
|
|
369 |
}
|
370 |
|
371 |
#sticky-table tr:first-child td {
|
372 |
-
color: #
|
373 |
font-size: 18px;
|
374 |
font-weight: 800 !important;
|
375 |
padding: 15px 0;
|
376 |
}
|
377 |
|
378 |
s#sticky-table tr td:nth-child(2) {
|
379 |
-
background-color: #
|
380 |
}
|
381 |
|
382 |
#ssticky-table tr td:last-child {
|
383 |
-
background-color: #
|
384 |
}
|
385 |
|
386 |
#sticky-table tr:last-child td {
|
@@ -406,7 +413,7 @@ s#sticky-table tr td:nth-child(2) {
|
|
406 |
.pro-ad-sidebar {
|
407 |
float: right;
|
408 |
width: 25%;
|
409 |
-
background: #
|
410 |
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
|
411 |
padding: 25px;
|
412 |
margin: 20px 0 0 0;
|
@@ -421,3 +428,16 @@ s#sticky-table tr td:nth-child(2) {
|
|
421 |
.pro-ad-sidebar a {
|
422 |
text-decoration: none;
|
423 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
width: 70%;
|
8 |
}
|
9 |
|
10 |
+
.header-logo {
|
11 |
+
max-height: 42px;
|
12 |
+
padding-right: 15px;
|
13 |
+
margin-bottom: -13px;
|
14 |
+
}
|
15 |
+
|
16 |
.main-content .new-feature {
|
17 |
border: solid 1px #c0c0c0;
|
18 |
background: #e7e7e7;
|
282 |
}
|
283 |
|
284 |
.sticky-pro-dialog .ui-dialog-titlebar {
|
285 |
+
background-color: #ffde66;
|
286 |
border-bottom: none;
|
287 |
text-align: center;
|
288 |
display: none;
|
295 |
}
|
296 |
|
297 |
.nav-tab-pro {
|
298 |
+
background-color: #ffde66;
|
299 |
}
|
300 |
|
301 |
.settings_page_stickyanythingmenu a.button-buy {
|
302 |
+
background-color: #b93c24;
|
303 |
color: #fff;
|
304 |
font-weight: 700;
|
305 |
padding: 5px 10px;
|
310 |
}
|
311 |
|
312 |
.pro-feature {
|
313 |
+
background-color: #ffde66aa;
|
314 |
+
padding: 2px;
|
315 |
+
line-height: 2.2;
|
316 |
color: #333;
|
317 |
text-decoration: none;
|
318 |
}
|
319 |
|
320 |
.pro-feature:hover {
|
321 |
+
background-color: #ffde66;
|
322 |
+
padding: 2px;
|
323 |
color: #333;
|
324 |
+
text-decoration: none;
|
325 |
}
|
326 |
|
327 |
.center {
|
329 |
}
|
330 |
|
331 |
.sticky-pro-dialog .logo {
|
332 |
+
background-color: #ffde66;
|
333 |
padding: 10px;
|
334 |
}
|
335 |
|
343 |
}
|
344 |
|
345 |
.sticky-pro-dialog .logo i {
|
346 |
+
color: #b93c24;
|
347 |
font-style: normal;
|
348 |
}
|
349 |
|
350 |
.sticky-pro-dialog .footer {
|
351 |
padding: 15px 10px;
|
352 |
+
background-color: #ffde66;
|
353 |
}
|
354 |
|
355 |
.sticky-pro-dialog {
|
376 |
}
|
377 |
|
378 |
#sticky-table tr:first-child td {
|
379 |
+
color: #b93c24;
|
380 |
font-size: 18px;
|
381 |
font-weight: 800 !important;
|
382 |
padding: 15px 0;
|
383 |
}
|
384 |
|
385 |
s#sticky-table tr td:nth-child(2) {
|
386 |
+
background-color: #ffde66;
|
387 |
}
|
388 |
|
389 |
#ssticky-table tr td:last-child {
|
390 |
+
background-color: #ffde66;
|
391 |
}
|
392 |
|
393 |
#sticky-table tr:last-child td {
|
413 |
.pro-ad-sidebar {
|
414 |
float: right;
|
415 |
width: 25%;
|
416 |
+
background: #ffde66;
|
417 |
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
|
418 |
padding: 25px;
|
419 |
margin: 20px 0 0 0;
|
428 |
.pro-ad-sidebar a {
|
429 |
text-decoration: none;
|
430 |
}
|
431 |
+
|
432 |
+
.wp-picker-holder {
|
433 |
+
z-index: 9999;
|
434 |
+
position: absolute;
|
435 |
+
}
|
436 |
+
|
437 |
+
.wp-picker-container .iris-picker {
|
438 |
+
border: 1px solid;
|
439 |
+
}
|
440 |
+
|
441 |
+
.form-table tr {
|
442 |
+
border-bottom: thin solid #00000038;
|
443 |
+
}
|
assets/faq.php
CHANGED
@@ -1,6 +1,6 @@
|
|
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">
|
3 |
-
<?php _e('Please read the FAQ below first 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>
|
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/?utm_source=sticky-free&utm_content=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>
|
assets/js/sticky-admin-pointers.js
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* Sticky Anything
|
3 |
+
* Backend GUI pointers
|
4 |
+
* (c) WebFactory Ltd, 2015 - 2021
|
5 |
+
*/
|
6 |
+
|
7 |
+
|
8 |
+
jQuery(document).ready(function($){
|
9 |
+
if (typeof sticky_pointers == 'undefined') {
|
10 |
+
return;
|
11 |
+
}
|
12 |
+
|
13 |
+
$.each(sticky_pointers, function(index, pointer) {
|
14 |
+
if (index.charAt(0) == '_') {
|
15 |
+
return true;
|
16 |
+
}
|
17 |
+
$(pointer.target).pointer({
|
18 |
+
content: '<h3>Sticky Menu (or Anything!) on Scroll</h3><p>' + pointer.content + '</p>',
|
19 |
+
position: {
|
20 |
+
edge: pointer.edge,
|
21 |
+
align: pointer.align
|
22 |
+
},
|
23 |
+
width: 320,
|
24 |
+
close: function() {
|
25 |
+
$.post(ajaxurl, {
|
26 |
+
notice_name: index,
|
27 |
+
_ajax_nonce: sticky_pointers._nonce_dismiss_notice,
|
28 |
+
action: 'sticky_dismiss_notice'
|
29 |
+
});
|
30 |
+
}
|
31 |
+
}).pointer('open');
|
32 |
+
});
|
33 |
+
});
|
assets/js/sticky-anything-admin.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/**
|
2 |
* Sticky Menu or Anything
|
3 |
-
* (c) WebFactory
|
4 |
*/
|
5 |
|
6 |
jQuery(function ($) {
|
@@ -55,6 +55,8 @@ jQuery(function ($) {
|
|
55 |
}
|
56 |
});
|
57 |
|
|
|
|
|
58 |
$('.form-table').on('click', '.disabled-feature', function (e) {
|
59 |
e.preventDefault();
|
60 |
});
|
1 |
/**
|
2 |
* Sticky Menu or Anything
|
3 |
+
* (c) WebFactory 2021, https://wpsticky.com/
|
4 |
*/
|
5 |
|
6 |
jQuery(function ($) {
|
55 |
}
|
56 |
});
|
57 |
|
58 |
+
$('.sticky-color-field').wpColorPicker();
|
59 |
+
|
60 |
$('.form-table').on('click', '.disabled-feature', function (e) {
|
61 |
e.preventDefault();
|
62 |
});
|
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: 5.6
|
7 |
-
Stable tag: 2.
|
8 |
Requires PHP: 5.2
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -13,15 +13,16 @@ Sticky Menu or Sticky Header lets you stick any element at the top of the screen
|
|
13 |
|
14 |
== Description ==
|
15 |
|
16 |
-
The WP Sticky 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, sticky logo, sticky call to action or a floating menu.
|
17 |
|
18 |
-
|
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-readme">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 |
* **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).
|
26 |
* **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).
|
27 |
* **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.
|
@@ -131,6 +132,11 @@ Please go to the plugin's [support forum on WordPress.org](https://wordpress.org
|
|
131 |
|
132 |
== Changelog ==
|
133 |
|
|
|
|
|
|
|
|
|
|
|
134 |
= 2.25 =
|
135 |
* 2020-10-16
|
136 |
* PRO version is here
|
4 |
Plugin URI: https://wpsticky.com/
|
5 |
Requires at least: 3.6
|
6 |
Tested up to: 5.6
|
7 |
+
Stable tag: 2.28
|
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/?ref=wp-org-readme&utm_content=wp-sticky">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, 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-readme&utm_content=visual-picker">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-readme&utm_content=multiple-elements">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-readme&utm_content=pick-pages">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.
|
132 |
|
133 |
== Changelog ==
|
134 |
|
135 |
+
= 2.28 =
|
136 |
+
* 2021-01-05
|
137 |
+
* minor bug fixes and improvements
|
138 |
+
* removed promo campaign for WP 301 Redirects
|
139 |
+
|
140 |
= 2.25 =
|
141 |
* 2020-10-16
|
142 |
* PRO version is here
|
sticky-menu-or-anything.php
CHANGED
@@ -5,7 +5,7 @@ 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.
|
9 |
Requires at least: 3.6
|
10 |
Tested up to: 5.6
|
11 |
Requires PHP: 5.2
|
@@ -13,9 +13,6 @@ Requires PHP: 5.2
|
|
13 |
|
14 |
defined('ABSPATH') or die('INSERT COIN');
|
15 |
|
16 |
-
require_once 'wp301/wp301.php';
|
17 |
-
new wf_wp301(__FILE__, 'skip_plugin_page');
|
18 |
-
|
19 |
/**
|
20 |
* === FUNCTIONS ========================================================================================
|
21 |
*/
|
@@ -157,10 +154,22 @@ if (!function_exists('sticky_anything_settings_link')) {
|
|
157 |
function sticky_anything_settings_link($links) {
|
158 |
$settings_link = '<a href="options-general.php?page=stickyanythingmenu">Settings</a>';
|
159 |
array_unshift($links, $settings_link);
|
|
|
|
|
160 |
return $links;
|
161 |
}
|
162 |
}
|
163 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
|
165 |
/**
|
166 |
* --- THE WHOLE ADMIN SETTINGS PAGE -------------------------------------------------------------------
|
@@ -168,13 +177,13 @@ function sticky_anything_settings_link($links) {
|
|
168 |
if (!function_exists('sticky_anything_config_page')) {
|
169 |
function sticky_anything_config_page() {
|
170 |
// Retrieve plugin configuration options from database
|
171 |
-
|
172 |
?>
|
173 |
|
174 |
<div id="sticky-anything-settings-general" class="wrap">
|
175 |
-
<h2><?php _e('Sticky Menu (or Anything!)
|
176 |
|
177 |
-
|
178 |
<?php
|
179 |
if (!empty($sticky_anything_options['sa_element']) && empty($sticky_anything_options['sa_hide_review_notification'])) {
|
180 |
$dismiss_url = add_query_arg(array('action' => 'sticky_hide_review_notification', 'redirect' => urlencode($_SERVER['REQUEST_URI'])), admin_url('admin.php'));
|
@@ -316,14 +325,14 @@ if (!function_exists('sticky_anything_config_page')) {
|
|
316 |
</tr>
|
317 |
|
318 |
<tr>
|
319 |
-
<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></
|
320 |
<td>
|
321 |
<input type="number" id="sa_topspace" name="sa_topspace" value="<?php echo esc_html( @$sticky_anything_options['sa_topspace'] ); ?>" style="width:80px;"> pixels
|
322 |
</td>
|
323 |
</tr>
|
324 |
|
325 |
<tr>
|
326 |
-
<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></
|
327 |
<td>
|
328 |
<input type="number" id="sa_opacity" name="sa_opacity" value="100" style="width:80px;" disabled> %
|
329 |
<em>This option is available in <a href="#" class="open-sticky-pro-dialog pro-feature" data-pro-feature="opacity">WP Sticky PRO</a>.</em>
|
@@ -331,7 +340,7 @@ if (!function_exists('sticky_anything_config_page')) {
|
|
331 |
</tr>
|
332 |
|
333 |
<tr>
|
334 |
-
<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></
|
335 |
<td>
|
336 |
<input type="checkbox" id="sa_adminbar" name="sa_adminbar" <?php if ($sticky_anything_options['sa_adminbar'] ) echo ' checked="checked" ';?> />
|
337 |
<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>
|
@@ -339,24 +348,45 @@ if (!function_exists('sticky_anything_config_page')) {
|
|
339 |
</tr>
|
340 |
|
341 |
<tr>
|
342 |
-
<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></
|
343 |
<td>
|
344 |
<input type="checkbox" disabled> <label>Fade-in</label><br>
|
345 |
<input type="checkbox" disabled> <label>Slide-down</label>
|
346 |
<br>
|
347 |
<p>Effects are available in <a href="#" class="open-sticky-pro-dialog pro-feature" data-pro-feature="effects">WP Sticky PRO</a>.</p>
|
348 |
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
349 |
</tr>
|
350 |
|
351 |
<tr>
|
352 |
-
<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></
|
353 |
<td>
|
354 |
<input type="number" id="sa_minscreenwidth" name="sa_minscreenwidth" value="<?php echo esc_html( $sticky_anything_options['sa_minscreenwidth'] ); ?>" style="width:80px;" /> pixels
|
355 |
</td>
|
356 |
</tr>
|
357 |
|
358 |
<tr>
|
359 |
-
<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></
|
360 |
<td>
|
361 |
<input type="number" id="sa_maxscreenwidth" name="sa_maxscreenwidth" value="<?php echo esc_html( $sticky_anything_options['sa_maxscreenwidth'] ); ?>" style="width:80px;" /> pixels
|
362 |
</td>
|
@@ -375,14 +405,14 @@ if (!function_exists('sticky_anything_config_page')) {
|
|
375 |
<table class="form-table">
|
376 |
|
377 |
<tr>
|
378 |
-
<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></
|
379 |
<td>
|
380 |
<input type="number" id="sa_zindex" name="sa_zindex" value="<?php echo esc_html( @$sticky_anything_options['sa_zindex'] ); ?>" style="width:80px;" />
|
381 |
</td>
|
382 |
</tr>
|
383 |
|
384 |
<tr>
|
385 |
-
<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></
|
386 |
<td>
|
387 |
<input type="text" id="sa_pushup" name="sa_pushup" value="<?php
|
388 |
if ($sticky_anything_options['sa_pushup'] != '#NO-ELEMENT') {
|
@@ -394,7 +424,7 @@ if (!function_exists('sticky_anything_config_page')) {
|
|
394 |
</tr>
|
395 |
|
396 |
<tr>
|
397 |
-
<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></
|
398 |
<td>
|
399 |
<input type="checkbox" id="sa_legacymode" name="sa_legacymode" <?php if ($sticky_anything_options['sa_legacymode'] == true ) echo ' checked="checked" ';?> />
|
400 |
<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>
|
@@ -403,7 +433,7 @@ if (!function_exists('sticky_anything_config_page')) {
|
|
403 |
</tr>
|
404 |
|
405 |
<tr>
|
406 |
-
<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></
|
407 |
<td>
|
408 |
Posts: <select disabled><option>This option is available in the PRO version</option></select><br>
|
409 |
Pages: <select disabled><option>This option is available in the PRO version</option></select><br>
|
@@ -415,7 +445,7 @@ if (!function_exists('sticky_anything_config_page')) {
|
|
415 |
</tr>
|
416 |
|
417 |
<tr id="row-dynamic-mode" <?php if ($sticky_anything_options['sa_legacymode'] == false ) echo 'class="disabled-feature"';?>>
|
418 |
-
<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></
|
419 |
<td><div class="showhide" <?php if ($sticky_anything_options['sa_legacymode'] == false ) echo 'style="display:none;"';?>>
|
420 |
<input type="checkbox" id="sa_dynamicmode" name="sa_dynamicmode" <?php if ($sticky_anything_options['sa_dynamicmode'] ) echo ' checked="checked" ';?> />
|
421 |
<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>
|
@@ -425,7 +455,7 @@ if (!function_exists('sticky_anything_config_page')) {
|
|
425 |
</tr>
|
426 |
|
427 |
<tr>
|
428 |
-
<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></
|
429 |
<td>
|
430 |
<input type="checkbox" id="sa_debugmode" name="sa_debugmode" <?php if (@$sticky_anything_options['sa_debugmode'] ) echo ' checked="checked" ';?> />
|
431 |
<label for="sa_debugmode"><strong><?php _e('Log plugin errors in browser console','sticky-menu-or-anything-on-scroll'); ?></strong></label>
|
@@ -591,6 +621,27 @@ if (!function_exists('process_sticky_anything_options')) {
|
|
591 |
*/
|
592 |
if (!function_exists('sticky_anything_styles')) {
|
593 |
function sticky_anything_styles($hook) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
594 |
if ($hook != 'settings_page_stickyanythingmenu') {
|
595 |
return;
|
596 |
}
|
@@ -606,10 +657,10 @@ if (!function_exists('sticky_anything_styles')) {
|
|
606 |
wp_enqueue_style('wp-jquery-ui-dialog');
|
607 |
wp_enqueue_script('jquery-ui-dialog');
|
608 |
|
|
|
|
|
|
|
609 |
$js_vars = array(
|
610 |
-
'nonce_wp301_promo_submit' => wp_create_nonce('wp301_submit'),
|
611 |
-
'nonce_wp301_promo_dismiss' => wp_create_nonce('wp301_dismiss'),
|
612 |
-
'nonce_wp301_upsell_dismiss' => wp_create_nonce('wp301_dismiss'),
|
613 |
'auto_open_pro_dialog' => empty($sticky_anything_options['sa_dismiss_upsell_auto_open']),
|
614 |
);
|
615 |
|
@@ -794,6 +845,67 @@ function sticky_anything_admin_footer() {
|
|
794 |
exit;
|
795 |
} // sticky_hide_review_notification
|
796 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
797 |
/**
|
798 |
* === HOOKS AND ACTIONS AND FILTERS AND SUCH ==========================================================
|
799 |
*/
|
@@ -808,6 +920,8 @@ add_action('admin_init', 'sticky_anything_admin_init');
|
|
808 |
add_action('admin_footer', 'sticky_anything_admin_footer');
|
809 |
add_action('admin_enqueue_scripts', 'sticky_anything_styles' );
|
810 |
add_filter("plugin_action_links_$plugin", 'sticky_anything_settings_link' );
|
|
|
811 |
add_filter('install_plugins_table_api_args_featured', 'sticky_featured_plugins_tab');
|
812 |
add_filter('install_plugins_table_api_args_recommended', 'sticky_featured_plugins_tab');
|
813 |
add_action('admin_action_sticky_hide_review_notification', 'sticky_hide_review_notification');
|
|
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.28
|
9 |
Requires at least: 3.6
|
10 |
Tested up to: 5.6
|
11 |
Requires PHP: 5.2
|
13 |
|
14 |
defined('ABSPATH') or die('INSERT COIN');
|
15 |
|
|
|
|
|
|
|
16 |
/**
|
17 |
* === FUNCTIONS ========================================================================================
|
18 |
*/
|
154 |
function sticky_anything_settings_link($links) {
|
155 |
$settings_link = '<a href="options-general.php?page=stickyanythingmenu">Settings</a>';
|
156 |
array_unshift($links, $settings_link);
|
157 |
+
$links[] = '<a href="https://wpsticky.com/?utm_source=sticky-free&utm_content=plugins-table" target="_blank"><b>Get PRO</b></a>';
|
158 |
+
|
159 |
return $links;
|
160 |
}
|
161 |
}
|
162 |
|
163 |
+
function sticky_plugin_meta_links($links, $file) {
|
164 |
+
$support_link = '<a target="_blank" href="https://wpsticky.com/documentation/?utm_source=sticky-free&utm_content=support" title="Get help">Support</a>';
|
165 |
+
|
166 |
+
if ($file == plugin_basename(__FILE__)) {
|
167 |
+
$links[] = $support_link;
|
168 |
+
}
|
169 |
+
|
170 |
+
return $links;
|
171 |
+
} // sticky_plugin_meta_links
|
172 |
+
|
173 |
|
174 |
/**
|
175 |
* --- THE WHOLE ADMIN SETTINGS PAGE -------------------------------------------------------------------
|
177 |
if (!function_exists('sticky_anything_config_page')) {
|
178 |
function sticky_anything_config_page() {
|
179 |
// Retrieve plugin configuration options from database
|
180 |
+
$sticky_anything_options = get_option( 'sticky_anything_options' );
|
181 |
?>
|
182 |
|
183 |
<div id="sticky-anything-settings-general" class="wrap">
|
184 |
+
<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>
|
185 |
|
186 |
+
<p><?php _e('Pick any element on your page, and it will stick when it reaches the top of the page when you scroll down. Great for navigation menus, but can be used for any element on the page.','sticky-menu-or-anything-on-scroll'); ?><br><br></p>
|
187 |
<?php
|
188 |
if (!empty($sticky_anything_options['sa_element']) && empty($sticky_anything_options['sa_hide_review_notification'])) {
|
189 |
$dismiss_url = add_query_arg(array('action' => 'sticky_hide_review_notification', 'redirect' => urlencode($_SERVER['REQUEST_URI'])), admin_url('admin.php'));
|
325 |
</tr>
|
326 |
|
327 |
<tr>
|
328 |
+
<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>
|
329 |
<td>
|
330 |
<input type="number" id="sa_topspace" name="sa_topspace" value="<?php echo esc_html( @$sticky_anything_options['sa_topspace'] ); ?>" style="width:80px;"> pixels
|
331 |
</td>
|
332 |
</tr>
|
333 |
|
334 |
<tr>
|
335 |
+
<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>
|
336 |
<td>
|
337 |
<input type="number" id="sa_opacity" name="sa_opacity" value="100" style="width:80px;" disabled> %
|
338 |
<em>This option is available in <a href="#" class="open-sticky-pro-dialog pro-feature" data-pro-feature="opacity">WP Sticky PRO</a>.</em>
|
340 |
</tr>
|
341 |
|
342 |
<tr>
|
343 |
+
<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>
|
344 |
<td>
|
345 |
<input type="checkbox" id="sa_adminbar" name="sa_adminbar" <?php if ($sticky_anything_options['sa_adminbar'] ) echo ' checked="checked" ';?> />
|
346 |
<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>
|
348 |
</tr>
|
349 |
|
350 |
<tr>
|
351 |
+
<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>
|
352 |
<td>
|
353 |
<input type="checkbox" disabled> <label>Fade-in</label><br>
|
354 |
<input type="checkbox" disabled> <label>Slide-down</label>
|
355 |
<br>
|
356 |
<p>Effects are available in <a href="#" class="open-sticky-pro-dialog pro-feature" data-pro-feature="effects">WP Sticky PRO</a>.</p>
|
357 |
</td>
|
358 |
+
</tr>
|
359 |
+
|
360 |
+
<tr>
|
361 |
+
<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>
|
362 |
+
<td>
|
363 |
+
<input class="sticky-color-field" type="text" id="sa_bg_color" value="" style="width:80px;">
|
364 |
+
<br>
|
365 |
+
<p>Set a background color for the element when it's sticky.<br>
|
366 |
+
Background color is available in <a href="#" class="open-sticky-pro-dialog pro-feature" data-pro-feature="bgcolor">WP Sticky PRO</a>.</p>
|
367 |
+
</td>
|
368 |
+
</tr>
|
369 |
+
|
370 |
+
<tr>
|
371 |
+
<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>
|
372 |
+
<td>
|
373 |
+
<textarea id="custom_css" cols="40" rows="3" placeholder="border: 2px solid black;" disabled></textarea>
|
374 |
+
<br>
|
375 |
+
<p>CSS properties that will be applied to the element when it's sticky.<br>
|
376 |
+
Do not wrap the properties in any selector, instead of <code>.classname{ color: #FFF; }</code> just write <code>color: #FFF;</code>
|
377 |
+
<br>Custom CSS is available in <a href="#" class="open-sticky-pro-dialog pro-feature" data-pro-feature="customcss">WP Sticky PRO</a>.</p>
|
378 |
+
</td>
|
379 |
</tr>
|
380 |
|
381 |
<tr>
|
382 |
+
<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>
|
383 |
<td>
|
384 |
<input type="number" id="sa_minscreenwidth" name="sa_minscreenwidth" value="<?php echo esc_html( $sticky_anything_options['sa_minscreenwidth'] ); ?>" style="width:80px;" /> pixels
|
385 |
</td>
|
386 |
</tr>
|
387 |
|
388 |
<tr>
|
389 |
+
<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>
|
390 |
<td>
|
391 |
<input type="number" id="sa_maxscreenwidth" name="sa_maxscreenwidth" value="<?php echo esc_html( $sticky_anything_options['sa_maxscreenwidth'] ); ?>" style="width:80px;" /> pixels
|
392 |
</td>
|
405 |
<table class="form-table">
|
406 |
|
407 |
<tr>
|
408 |
+
<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>
|
409 |
<td>
|
410 |
<input type="number" id="sa_zindex" name="sa_zindex" value="<?php echo esc_html( @$sticky_anything_options['sa_zindex'] ); ?>" style="width:80px;" />
|
411 |
</td>
|
412 |
</tr>
|
413 |
|
414 |
<tr>
|
415 |
+
<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>
|
416 |
<td>
|
417 |
<input type="text" id="sa_pushup" name="sa_pushup" value="<?php
|
418 |
if ($sticky_anything_options['sa_pushup'] != '#NO-ELEMENT') {
|
424 |
</tr>
|
425 |
|
426 |
<tr>
|
427 |
+
<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>
|
428 |
<td>
|
429 |
<input type="checkbox" id="sa_legacymode" name="sa_legacymode" <?php if ($sticky_anything_options['sa_legacymode'] == true ) echo ' checked="checked" ';?> />
|
430 |
<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>
|
433 |
</tr>
|
434 |
|
435 |
<tr>
|
436 |
+
<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>
|
437 |
<td>
|
438 |
Posts: <select disabled><option>This option is available in the PRO version</option></select><br>
|
439 |
Pages: <select disabled><option>This option is available in the PRO version</option></select><br>
|
445 |
</tr>
|
446 |
|
447 |
<tr id="row-dynamic-mode" <?php if ($sticky_anything_options['sa_legacymode'] == false ) echo 'class="disabled-feature"';?>>
|
448 |
+
<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>
|
449 |
<td><div class="showhide" <?php if ($sticky_anything_options['sa_legacymode'] == false ) echo 'style="display:none;"';?>>
|
450 |
<input type="checkbox" id="sa_dynamicmode" name="sa_dynamicmode" <?php if ($sticky_anything_options['sa_dynamicmode'] ) echo ' checked="checked" ';?> />
|
451 |
<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>
|
455 |
</tr>
|
456 |
|
457 |
<tr>
|
458 |
+
<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>
|
459 |
<td>
|
460 |
<input type="checkbox" id="sa_debugmode" name="sa_debugmode" <?php if (@$sticky_anything_options['sa_debugmode'] ) echo ' checked="checked" ';?> />
|
461 |
<label for="sa_debugmode"><strong><?php _e('Log plugin errors in browser console','sticky-menu-or-anything-on-scroll'); ?></strong></label>
|
621 |
*/
|
622 |
if (!function_exists('sticky_anything_styles')) {
|
623 |
function sticky_anything_styles($hook) {
|
624 |
+
|
625 |
+
// welcome pointer is shown on all pages except Sticky, only to admins, until dismissed
|
626 |
+
$pointers = sticky_get_pointers();
|
627 |
+
$dismissed_notices = sticky_get_dismissed_notices();
|
628 |
+
|
629 |
+
foreach ($dismissed_notices as $notice_name => $tmp) {
|
630 |
+
if ($tmp) {
|
631 |
+
unset($pointers[$notice_name]);
|
632 |
+
}
|
633 |
+
} // foreach
|
634 |
+
|
635 |
+
if (current_user_can('administrator') && !empty($pointers) && 'settings_page_stickyanythingmenu' != $hook) {
|
636 |
+
$pointers['_nonce_dismiss_notice'] = wp_create_nonce('sticky_dismiss_notice');
|
637 |
+
|
638 |
+
wp_enqueue_style('wp-pointer');
|
639 |
+
|
640 |
+
wp_enqueue_script('wp-sticky-pointers', plugins_url('assets/js/sticky-admin-pointers.js', __FILE__), array('jquery'), 1, true);
|
641 |
+
wp_enqueue_script('wp-pointer');
|
642 |
+
wp_localize_script('wp-pointer', 'sticky_pointers', $pointers);
|
643 |
+
}
|
644 |
+
|
645 |
if ($hook != 'settings_page_stickyanythingmenu') {
|
646 |
return;
|
647 |
}
|
657 |
wp_enqueue_style('wp-jquery-ui-dialog');
|
658 |
wp_enqueue_script('jquery-ui-dialog');
|
659 |
|
660 |
+
wp_enqueue_style('wp-color-picker');
|
661 |
+
wp_enqueue_script('wp-color-picker');
|
662 |
+
|
663 |
$js_vars = array(
|
|
|
|
|
|
|
664 |
'auto_open_pro_dialog' => empty($sticky_anything_options['sa_dismiss_upsell_auto_open']),
|
665 |
);
|
666 |
|
845 |
exit;
|
846 |
} // sticky_hide_review_notification
|
847 |
|
848 |
+
|
849 |
+
/**
|
850 |
+
* Returns all WP pointers
|
851 |
+
*
|
852 |
+
* @return array
|
853 |
+
*/
|
854 |
+
function sticky_get_pointers()
|
855 |
+
{
|
856 |
+
$pointers = array();
|
857 |
+
|
858 |
+
$pointers['welcome'] = array('target' => '#menu-settings', 'edge' => 'left', 'align' => 'right', 'content' => 'Thank you for using the <b style="font-weight: 700;">Sticky Menu (or Anaything!) on Scroll</b> plugin.<br>Open <a href="' . admin_url('options-general.php?page=stickyanythingmenu') . '">Settings - Sticky Menu</a> to make anything sticky.');
|
859 |
+
|
860 |
+
return $pointers;
|
861 |
+
} // sticky_get_pointers
|
862 |
+
|
863 |
+
|
864 |
+
/**
|
865 |
+
* Get all dismissed notices, or check for one specific notice.
|
866 |
+
*
|
867 |
+
* @param string $notice_name Optional. Check if specified notice is dismissed.
|
868 |
+
*
|
869 |
+
* @return bool|array
|
870 |
+
*/
|
871 |
+
function sticky_get_dismissed_notices($notice_name = '')
|
872 |
+
{
|
873 |
+
$notices = get_option('sticky_dismissed_notices', array());
|
874 |
+
|
875 |
+
if (empty($notice_name)) {
|
876 |
+
return $notices;
|
877 |
+
} else {
|
878 |
+
if (empty($notices[$notice_name])) {
|
879 |
+
return false;
|
880 |
+
} else {
|
881 |
+
return true;
|
882 |
+
}
|
883 |
+
}
|
884 |
+
} // sticky_get_dismissed_notices
|
885 |
+
|
886 |
+
|
887 |
+
/**
|
888 |
+
* Dismiss notice via AJAX call
|
889 |
+
*
|
890 |
+
* @return null
|
891 |
+
*/
|
892 |
+
function sticky_ajax_dismiss_notice()
|
893 |
+
{
|
894 |
+
check_ajax_referer('sticky_dismiss_notice');
|
895 |
+
|
896 |
+
if (empty($_POST['notice_name'])) {
|
897 |
+
wp_send_json_error('Notice name is undefined.');
|
898 |
+
} else {
|
899 |
+
$notice_name = substr(sanitize_key($_POST['notice_name']), 0, 64);
|
900 |
+
}
|
901 |
+
|
902 |
+
$notices = get_option('sticky_dismissed_notices', array());
|
903 |
+
$notices[$notice_name] = true;
|
904 |
+
update_option('sticky_dismissed_notices', $notices);
|
905 |
+
|
906 |
+
wp_send_json_success();
|
907 |
+
} // sticky_ajax_dismiss_notice
|
908 |
+
|
909 |
/**
|
910 |
* === HOOKS AND ACTIONS AND FILTERS AND SUCH ==========================================================
|
911 |
*/
|
920 |
add_action('admin_footer', 'sticky_anything_admin_footer');
|
921 |
add_action('admin_enqueue_scripts', 'sticky_anything_styles' );
|
922 |
add_filter("plugin_action_links_$plugin", 'sticky_anything_settings_link' );
|
923 |
+
add_filter('plugin_row_meta', 'sticky_plugin_meta_links', 10, 2);
|
924 |
add_filter('install_plugins_table_api_args_featured', 'sticky_featured_plugins_tab');
|
925 |
add_filter('install_plugins_table_api_args_recommended', 'sticky_featured_plugins_tab');
|
926 |
add_action('admin_action_sticky_hide_review_notification', 'sticky_hide_review_notification');
|
927 |
+
add_action('wp_ajax_sticky_dismiss_notice', 'sticky_ajax_dismiss_notice');
|
wp301/wp301-logo.png
DELETED
Binary file
|
wp301/wp301.js
DELETED
@@ -1,128 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Campaign for WP 301 Redirects PRO
|
3 |
-
* (c) WebFactory Ltd, 2020
|
4 |
-
*/
|
5 |
-
|
6 |
-
jQuery(document).ready(function ($) {
|
7 |
-
$('#wp301promo_dismiss').on('click', function (e) {
|
8 |
-
e.preventDefault();
|
9 |
-
|
10 |
-
var slug = $(this).data('plugin-slug');
|
11 |
-
|
12 |
-
$.get({
|
13 |
-
url: ajaxurl,
|
14 |
-
data: {
|
15 |
-
action: 'wp301_promo_dismiss',
|
16 |
-
slug: slug,
|
17 |
-
_ajax_nonce: wp301_promo.nonce_wp301_promo_dismiss,
|
18 |
-
},
|
19 |
-
})
|
20 |
-
.always(function (data) {})
|
21 |
-
.done(function (data) {
|
22 |
-
if (data.success) {
|
23 |
-
if (slug == 'dashboard') {
|
24 |
-
$('#wp301promo_widget').hide();
|
25 |
-
} else {
|
26 |
-
$('#wp301-dialog').dialog('close');
|
27 |
-
}
|
28 |
-
} else {
|
29 |
-
alert('Sorry, something is not right. Please reload the page and try again.');
|
30 |
-
}
|
31 |
-
})
|
32 |
-
.fail(function (data) {
|
33 |
-
alert('Sorry, something is not right. Please reload the page and try again.');
|
34 |
-
});
|
35 |
-
}); // dismiss
|
36 |
-
|
37 |
-
|
38 |
-
$('#wp301promo_submit').on('click', function (e) {
|
39 |
-
e.preventDefault();
|
40 |
-
|
41 |
-
var btn = $('#wp301promo_submit');
|
42 |
-
var name = $('#wp301promo_name').val();
|
43 |
-
var email = $('#wp301promo_email').val();
|
44 |
-
var plugin = $('#wp301promo_plugin').val();
|
45 |
-
var position = $('#wp301promo_position').val();
|
46 |
-
var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
|
47 |
-
|
48 |
-
if (name.length < 2 || name.length > 128) {
|
49 |
-
$('#wp301promo_name').focus();
|
50 |
-
alert('Please enter your name. Thank you 👍');
|
51 |
-
return false;
|
52 |
-
}
|
53 |
-
if (!regex.test(email) || email.lenght > 128) {
|
54 |
-
$('#wp301promo_email').focus();
|
55 |
-
alert('Please enter a valid email address. Thank you 👍');
|
56 |
-
return false;
|
57 |
-
}
|
58 |
-
|
59 |
-
$(btn).addClass('disabled');
|
60 |
-
$.get({
|
61 |
-
url: ajaxurl,
|
62 |
-
data: {
|
63 |
-
action: 'wp301_promo_submit',
|
64 |
-
_ajax_nonce: wp301_promo.nonce_wp301_promo_submit,
|
65 |
-
name: name,
|
66 |
-
email: email,
|
67 |
-
position: position,
|
68 |
-
plugin: plugin,
|
69 |
-
},
|
70 |
-
})
|
71 |
-
.always(function (data) {
|
72 |
-
$(btn).removeClass('disabled');
|
73 |
-
})
|
74 |
-
.done(function (data) {
|
75 |
-
if (data.success) {
|
76 |
-
alert(data.data);
|
77 |
-
|
78 |
-
if (position == 'dashboard') {
|
79 |
-
$('#wp301promo_widget').hide();
|
80 |
-
} else {
|
81 |
-
$('#wp301-dialog').dialog('close');
|
82 |
-
}
|
83 |
-
} else {
|
84 |
-
alert(data.data);
|
85 |
-
}
|
86 |
-
})
|
87 |
-
.fail(function (data) {
|
88 |
-
alert('Sorry, something is not right. Please reload the page and try again.');
|
89 |
-
});
|
90 |
-
});
|
91 |
-
|
92 |
-
|
93 |
-
$('#wp301promo_name, #wp301promo_email').on('keypress', function (e) {
|
94 |
-
if (e.which == 13) {
|
95 |
-
$('#wp301promo_submit').trigger('click');
|
96 |
-
}
|
97 |
-
}); // on enter
|
98 |
-
|
99 |
-
|
100 |
-
if (wp301_promo.open_popup && $('#wp301-dialog').length == 1) {
|
101 |
-
$('#wp301-dialog').dialog({
|
102 |
-
dialogClass: 'wp-dialog wp301-dialog',
|
103 |
-
modal: true,
|
104 |
-
resizable: false,
|
105 |
-
width: 550,
|
106 |
-
height: 'auto',
|
107 |
-
show: 'fade',
|
108 |
-
hide: 'fade',
|
109 |
-
close: function (event, ui) {},
|
110 |
-
open: function (event, ui) {
|
111 |
-
$(this)
|
112 |
-
.siblings()
|
113 |
-
.find('span.ui-dialog-title')
|
114 |
-
.html('Get a WP 301 Redirects PRO license for FREE <del>$158</del>');
|
115 |
-
wp301_fix_dialog_close(event, ui);
|
116 |
-
},
|
117 |
-
autoOpen: true,
|
118 |
-
closeOnEscape: false,
|
119 |
-
});
|
120 |
-
} // open dialog
|
121 |
-
}); // jQuery ready
|
122 |
-
|
123 |
-
|
124 |
-
function wp301_fix_dialog_close(event, ui) {
|
125 |
-
jQuery('.ui-widget-overlay').bind('click', function () {
|
126 |
-
jQuery('#' + event.target.id).dialog('close');
|
127 |
-
});
|
128 |
-
} // wp301_fix_dialog_close
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wp301/wp301.php
DELETED
@@ -1,294 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Campaign for WP 301 Redirects PRO
|
5 |
-
* (c) WebFactory Ltd, 2020
|
6 |
-
*/
|
7 |
-
|
8 |
-
|
9 |
-
if (false == class_exists('wf_wp301')) {
|
10 |
-
class wf_wp301
|
11 |
-
{
|
12 |
-
var $plugin_file = '';
|
13 |
-
var $plugin_slug = '';
|
14 |
-
var $plugin_screen = '';
|
15 |
-
var $options = '';
|
16 |
-
|
17 |
-
|
18 |
-
function __construct($plugin_file, $plugin_screen)
|
19 |
-
{
|
20 |
-
$this->plugin_file = $plugin_file;
|
21 |
-
$this->plugin_slug = basename(dirname($plugin_file));
|
22 |
-
$this->plugin_screen = $plugin_screen;
|
23 |
-
$this->options = get_option('wp301promo', array());
|
24 |
-
|
25 |
-
if (!is_admin() || !empty($this->options['email_submitted']) || date('Y-m-d') > '2020-11-05') {
|
26 |
-
return;
|
27 |
-
} else {
|
28 |
-
add_action('admin_init', array($this, 'init'));
|
29 |
-
}
|
30 |
-
} // __construct
|
31 |
-
|
32 |
-
|
33 |
-
function init()
|
34 |
-
{
|
35 |
-
add_action('wp_dashboard_setup', array($this, 'add_widget'));
|
36 |
-
add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
|
37 |
-
add_action('wp_ajax_wp301_promo_submit', array($this, 'ajax_submit'));
|
38 |
-
add_action('wp_ajax_wp301_promo_dismiss', array($this, 'ajax_dismiss'));
|
39 |
-
add_action('admin_footer', array($this, 'admin_footer'));
|
40 |
-
} // init
|
41 |
-
|
42 |
-
|
43 |
-
function admin_enqueue_scripts()
|
44 |
-
{
|
45 |
-
$screen = get_current_screen();
|
46 |
-
|
47 |
-
if ($screen->base != 'dashboard' && $screen->id != $this->plugin_screen) {
|
48 |
-
return;
|
49 |
-
}
|
50 |
-
|
51 |
-
if ($screen->base == 'dashboard' && !empty($this->options['popup_dismissed_dashboard'])) {
|
52 |
-
return;
|
53 |
-
}
|
54 |
-
|
55 |
-
if ($screen->id == $this->plugin_screen) {
|
56 |
-
wp_enqueue_style('wp-jquery-ui-dialog');
|
57 |
-
wp_enqueue_script('jquery-ui-dialog');
|
58 |
-
}
|
59 |
-
|
60 |
-
wp_enqueue_script('wp301_promo', plugin_dir_url($this->plugin_file) . 'wp301/wp301.js');
|
61 |
-
|
62 |
-
$js_vars = array(
|
63 |
-
'nonce_wp301_promo_submit' => wp_create_nonce('wp301_submit'),
|
64 |
-
'nonce_wp301_promo_dismiss' => wp_create_nonce('wp301_dismiss'),
|
65 |
-
);
|
66 |
-
|
67 |
-
if (empty($this->options['popup_dismissed_' . $this->plugin_slug])) {
|
68 |
-
$js_vars['open_popup'] = true;
|
69 |
-
}
|
70 |
-
|
71 |
-
wp_localize_script('wp301_promo', 'wp301_promo', $js_vars);
|
72 |
-
} // admin_enqueue_scripts
|
73 |
-
|
74 |
-
|
75 |
-
function ajax_dismiss()
|
76 |
-
{
|
77 |
-
if (!wp_verify_nonce(@$_GET['_ajax_nonce'], 'wp301_dismiss')) {
|
78 |
-
wp_send_json_error('Something is not right. Please reload the page and try again.');
|
79 |
-
}
|
80 |
-
|
81 |
-
$slug = substr(strip_tags(trim(@$_GET['slug'])), 0, 64);
|
82 |
-
|
83 |
-
$this->options['popup_dismissed_' . $slug] = true;
|
84 |
-
$tmp = update_option('wp301promo', $this->options);
|
85 |
-
|
86 |
-
if ($tmp) {
|
87 |
-
wp_send_json_success();
|
88 |
-
} else {
|
89 |
-
wp_send_json_error();
|
90 |
-
}
|
91 |
-
} // ajax_dismiss
|
92 |
-
|
93 |
-
|
94 |
-
function ajax_submit()
|
95 |
-
{
|
96 |
-
if (!wp_verify_nonce(@$_GET['_ajax_nonce'], 'wp301_submit')) {
|
97 |
-
wp_send_json_error('Something is not right. Please reload the page and try again.');
|
98 |
-
}
|
99 |
-
|
100 |
-
$email = strip_tags(trim(@$_GET['email']));
|
101 |
-
$name = strip_tags(trim(@$_GET['name']));
|
102 |
-
$plugin = strip_tags(trim(@$_GET['plugin'])) . '-' . strip_tags(trim(@$_GET['position']));
|
103 |
-
|
104 |
-
if (!is_email($email)) {
|
105 |
-
wp_send_json_error('Please enter a valid email address.');
|
106 |
-
}
|
107 |
-
|
108 |
-
$url = add_query_arg(array('name' => $name, 'email' => $email, 'plugin' => $plugin), 'https://wp301redirects.com/subscribe/');
|
109 |
-
|
110 |
-
$response = wp_remote_get($url, array('timeout' => 25));
|
111 |
-
|
112 |
-
if (is_wp_error($response)) {
|
113 |
-
wp_send_json_error('Something is not right. Please reload the page and try again.');
|
114 |
-
}
|
115 |
-
|
116 |
-
$body = @json_decode(wp_remote_retrieve_body($response), true);
|
117 |
-
if (empty($body['success'])) {
|
118 |
-
wp_send_json_error('Something is not right. Please reload the page and try again.');
|
119 |
-
}
|
120 |
-
|
121 |
-
$this->options['email_submitted'] = true;
|
122 |
-
update_option('wp301promo', $this->options);
|
123 |
-
wp_send_json_success('Thank you for trusting us with your email! You\'ll hear from us soon 🚀');
|
124 |
-
} // ajax_submit
|
125 |
-
|
126 |
-
|
127 |
-
function add_widget()
|
128 |
-
{
|
129 |
-
if (!empty($this->options['popup_dismissed_dashboard'])) {
|
130 |
-
return;
|
131 |
-
}
|
132 |
-
|
133 |
-
add_meta_box('wp301promo_widget', 'Get a WP 301 Redirects PRO license for FREE <del>$158</del>', array($this, 'widget_content'), 'dashboard', 'side', 'high');
|
134 |
-
} // add_widget
|
135 |
-
|
136 |
-
|
137 |
-
function widget_content()
|
138 |
-
{
|
139 |
-
$out = '';
|
140 |
-
|
141 |
-
$out .= '<style>';
|
142 |
-
$out .= '#wp301promo_widget .disabled { pointer-events: none; }';
|
143 |
-
$out .= '#wp301promo_widget label { font-weight: normal; display: inline-block; width: 15%; margin-bottom: 10px; }';
|
144 |
-
$out .= '#wp301promo_widget input { width: 74%; margin-bottom: 10px; }';
|
145 |
-
$out .= '#wp301promo_widget .button-primary { padding: 14px 28px; text-decoration: none; line-height: 1; }';
|
146 |
-
$out .= '#wp301promo_dismiss { font-style: italic; display: inline-block; color: #444; text-decoration: none; margin: 8px 0 0 0; }';
|
147 |
-
$out .= '#wp301promo_dismiss:hover { text-decoration: underline; }';
|
148 |
-
$out .= '#wp301promo_widget, #wp301promo_widget p { font-size: 14px; }';
|
149 |
-
$out .= '#wp301promo_widget .title301 { font-weight: 600; margin: 10px 0 -10px 0; }';
|
150 |
-
$out .= '#wp301promo_widget img { max-width: 60%; }';
|
151 |
-
$out .= '#wp301promo_widget .center { text-align: center; }';
|
152 |
-
$out .= '#wp301promo_email { margin-bottom: 0 !important; }';
|
153 |
-
$out .= '#wp301promo_widget { background-color: #fafafa; }';
|
154 |
-
$out .= '#wp301promo_widget li a { text-decoration: underline; }';
|
155 |
-
$out .= '#wp301promo_widget .wp301inside { padding: 25px 12px 0px 12px; position: relative; }';
|
156 |
-
$out .= '#wp301promo_widget p { margin-top: 14px; line-height: 1.5; }';
|
157 |
-
$out .= '#wp301promo_widget small { margin-left: 17%; }';
|
158 |
-
$out .= '#wp301promo_widget ul { font-size: 14px; margin: 0 0 20px 0; list-style-type: disc; list-style-position: inside; }';
|
159 |
-
$out .= '#wp301promo_widget li { margin-bottom: 3px; }';
|
160 |
-
$out .= '#wp301promo_submit span { display: none; text-decoration: none; margin-right: 10px; animation: wf-spin-animation 1.5s infinite linear; }';
|
161 |
-
$out .= '#wp301promo_submit.disabled span { display: inline-block; }';
|
162 |
-
$out .= '@keyframes wf-spin-animation {
|
163 |
-
from { transform: rotate(0deg); }
|
164 |
-
to { transform: rotate(360deg); }
|
165 |
-
}';
|
166 |
-
$out .= '#wp301promo_widget .inside { overflow: hidden; margin: 0; }
|
167 |
-
.ribbon { margin: 0; padding: 11px 20px 10px 20px; background: #007cba; color: #FFF; font-weight: 800; position: absolute; top: -17px; right: -17px; transform: translateX(30%) translateY(0%) rotate(45deg); transform-origin: top left; letter-spacing: 1px; }
|
168 |
-
.ribbon:before, .ribbon:after { content: ""; position: absolute; top:0; margin: 0 -1px; width: 100%; height: 100%; background: #007cba; }
|
169 |
-
.ribbon:before { right:100%; }
|
170 |
-
.ribbon:after { left:100%; }';
|
171 |
-
$out .= '</style>';
|
172 |
-
|
173 |
-
$plugin_url = plugin_dir_url($this->plugin_file);
|
174 |
-
|
175 |
-
$out .= '<div class="ribbon">FREE</div>';
|
176 |
-
$out .= '<div class="wp301inside">';
|
177 |
-
|
178 |
-
$out .= '<div class="center"><a href="https://wp301redirects.com/free-license/?ref=free-' . $this->plugin_slug . '-dashboard" target="_blank"><img src="' . $plugin_url . 'wp301/wp301-logo.png' . '" alt="WP 301 Redirects PRO" title="WP 301 Redirects PRO"></a></div>';
|
179 |
-
|
180 |
-
$out .= '<p>On November 6th <a href="https://www.webfactoryltd.com/" target="_blank">WebFactory Ltd</a> will give away a limited number of lifetime WP 301 Redirect PRO licenses, <b>each for 10 sites</b>. A $158 retail value! 🚀 Leave your email, we\'ll send you a link & download your copy.</p><p style="margin-bottom: 0;"><b>What do I get?</b></p>';
|
181 |
-
|
182 |
-
$out .= '<ul>';
|
183 |
-
$out .= '<li>Automatically fix 404 errors & URL typos</li>';
|
184 |
-
$out .= '<li>Create advanced redirect rules & control affiliate links</li>';
|
185 |
-
$out .= '<li>Detailed log of all redirects & 404s</li>';
|
186 |
-
$out .= '<li>Manage all sites\' licenses from a central Dashboard</li>';
|
187 |
-
$out .= '<li>Lifetime license for 10 sites. <a href="https://wp301redirects.com/free-license/?ref=free-' . $this->plugin_slug . '-dashboard" target="_blank">See all features</a></li>';
|
188 |
-
$out .= '</ul>';
|
189 |
-
|
190 |
-
$out .= '
|
191 |
-
<div>
|
192 |
-
<label for="wp301promo_name">Name:</label>
|
193 |
-
<input type="text" name="wp301promo_name" id="wp301promo_name" placeholder="How shall we call you?"><br>
|
194 |
-
<label for="wp301promo_email">Email:</label>
|
195 |
-
<input type="text" name="wp301promo_email" id="wp301promo_email" placeholder="Your best email address to get the plugin"><br>
|
196 |
-
<small>We hate spam as much as you do and never send it!</small>
|
197 |
-
<input type="hidden" id="wp301promo_plugin" value="' . $this->plugin_slug . '">
|
198 |
-
<input type="hidden" id="wp301promo_position" value="dashboard">
|
199 |
-
</div>
|
200 |
-
|
201 |
-
<p class="center">
|
202 |
-
<a id="wp301promo_submit" class="button button-primary" href="#"><span class="dashicons dashicons-update"></span>I Want My FREE License <del>$158</del></a><br>
|
203 |
-
<a id="wp301promo_dismiss" class="" href="#" data-plugin-slug="dashboard">I don\'t want a free license; don\'t show this again</a>
|
204 |
-
</p>
|
205 |
-
</div>';
|
206 |
-
|
207 |
-
echo $out;
|
208 |
-
} // widget_content
|
209 |
-
|
210 |
-
|
211 |
-
function admin_footer()
|
212 |
-
{
|
213 |
-
$screen = get_current_screen();
|
214 |
-
if ($screen->id != $this->plugin_screen) {
|
215 |
-
return;
|
216 |
-
}
|
217 |
-
|
218 |
-
$out = '';
|
219 |
-
|
220 |
-
$out .= '<style>';
|
221 |
-
$out .= '#wp301promo_widget .disabled { pointer-events: none; }';
|
222 |
-
$out .= '.wp301-dialog .ui-dialog-titlebar-close { visibility: hidden; }';
|
223 |
-
$out .= '#wp301-dialog label { font-weight: normal; display: inline-block; width: 15%; margin-bottom: 10px; }';
|
224 |
-
$out .= '#wp301-dialog input { width: 74%; margin-bottom: 10px; }';
|
225 |
-
$out .= '#wp301-dialog .button-primary { padding: 14px 28px; text-decoration: none; line-height: 1; }';
|
226 |
-
$out .= '#wp301-dialog, #wp301-dialog p { font-size: 14px; }';
|
227 |
-
$out .= '#wp301-dialog .title301 { font-size: 1.3em; font-weight: 600; margin: 10px 0 -10px 0; }';
|
228 |
-
$out .= '#wp301-dialog img { max-width: 60%; }';
|
229 |
-
$out .= '#wp301-dialog li a { text-decoration: underline; }';
|
230 |
-
$out .= '#wp301-dialog small { margin-left: 16%; }';
|
231 |
-
$out .= '#wp301-dialog .center { text-align: center; }';
|
232 |
-
$out .= '#wp301-dialog, .wp301-dialog .ui-dialog-titlebar { background-color: #fafafa; }';
|
233 |
-
$out .= '#wp301-dialog .wp301inside { padding: 12px 12px 0px 12px; }';
|
234 |
-
$out .= '#wp301-dialog p { margin-top: 14px; line-height: 1.5; }';
|
235 |
-
$out .= '#wp301-dialog ul { margin: 0 0 20px 0; list-style-type: disc; list-style-position: inside; }';
|
236 |
-
$out .= '#wp301-dialog li { margin-bottom: 3px; }';
|
237 |
-
$out .= '#wp301promo_dismiss { display: inline-block; color: #444; text-decoration: none; margin: 8px 0 0 0; }';
|
238 |
-
$out .= '#wp301promo_dismiss:hover { text-decoration: underline; }';
|
239 |
-
$out .= '#wp301promo_submit span { display: none; text-decoration: none; margin-right: 10px; animation: wf-spin-animation 1.5s infinite linear; }';
|
240 |
-
$out .= '#wp301promo_submit.disabled span { display: inline-block; }';
|
241 |
-
$out .= '@keyframes wf-spin-animation {
|
242 |
-
from { transform: rotate(0deg); }
|
243 |
-
to { transform: rotate(360deg); }
|
244 |
-
}';
|
245 |
-
$out .= '#wp301promo_widget .inside { overflow: hidden; margin: 0; }
|
246 |
-
.ribbon { margin: 0; padding: 11px 20px 10px 20px; background: #007cba; color: #FFF; font-weight: 800; position: absolute; top: -17px; right: -17px; transform: translateX(30%) translateY(0%) rotate(45deg); transform-origin: top left; letter-spacing: 1px; }
|
247 |
-
.ribbon:before, .ribbon:after { content: ""; position: absolute; top:0; margin: 0 -1px; width: 100%; height: 100%; background: #007cba; }
|
248 |
-
.ribbon:before { right:100%; }
|
249 |
-
.ribbon:after { left:100%; }';
|
250 |
-
$out .= '</style>';
|
251 |
-
|
252 |
-
$out .= '<div id="wp301-dialog" style="display: none;" title="Get a WP 301 Redirects PRO license for FREE"><span class="ui-helper-hidden-accessible"><input type="text"/></span>';
|
253 |
-
|
254 |
-
$plugin_url = plugin_dir_url($this->plugin_file);
|
255 |
-
|
256 |
-
$out .= '<div class="wp301inside">';
|
257 |
-
$out .= '<div class="ribbon">FREE</div>';
|
258 |
-
|
259 |
-
$out .= '<div class="center"><a href="https://wp301redirects.com/free-license/?ref=free-' . $this->plugin_slug . '-popup" target="_blank"><img src="' . $plugin_url . 'wp301/wp301-logo.png' . '" alt="WP 301 Redirects PRO" title="WP 301 Redirects PRO"></a></div>';
|
260 |
-
|
261 |
-
$out .= '<p>On November 6th <a href="https://www.webfactoryltd.com/" target="_blank">WebFactory Ltd</a> will give away a limited number of lifetime WP 301 Redirect PRO licenses, <b>each for 10 sites</b>. A $158 retail value! 🚀 Leave your email, we\'ll send you a link & download your copy.</p><p style="margin-bottom: 0;"><b>What do I get?</b></p>';
|
262 |
-
|
263 |
-
$out .= '<ul>';
|
264 |
-
$out .= '<li>Automatically fix 404 errors & URL typos</li>';
|
265 |
-
$out .= '<li>Create advanced redirect rules & control affiliate links</li>';
|
266 |
-
$out .= '<li>Detailed log of all redirects & 404s</li>';
|
267 |
-
$out .= '<li>Manage all sites\' licenses from a central Dashboard</li>';
|
268 |
-
$out .= '<li>Lifetime license for 10 sites. <a href="https://wp301redirects.com/free-license/?ref=free-' . $this->plugin_slug . '-popup" target="_blank">See all features</a></li>';
|
269 |
-
$out .= '</ul>';
|
270 |
-
|
271 |
-
$out .= '
|
272 |
-
<div>
|
273 |
-
<label for="wp301promo_name">Name:</label>
|
274 |
-
<input type="text" name="wp301promo_name" id="wp301promo_name" placeholder="How shall we call you?"><br>
|
275 |
-
<label for="wp301promo_email">Email:</label>
|
276 |
-
<input type="text" name="wp301promo_email" id="wp301promo_email" placeholder="Your best email address to get the plugin"><br>
|
277 |
-
<small>We hate spam as much as you do and never send it!</small>
|
278 |
-
<input type="hidden" id="wp301promo_plugin" value="' . $this->plugin_slug . '">
|
279 |
-
<input type="hidden" id="wp301promo_position" value="popup">
|
280 |
-
</div>
|
281 |
-
|
282 |
-
<p class="center">
|
283 |
-
<a id="wp301promo_submit" class="button button-primary" href="#"><span class="dashicons dashicons-update"></span>I Want My FREE License <del>$158</del></a><br>
|
284 |
-
<a id="wp301promo_dismiss" class="" href="#" data-plugin-slug="' . $this->plugin_slug . '">I don\'t want a free license; don\'t show this again</a>
|
285 |
-
</p>
|
286 |
-
|
287 |
-
</div>';
|
288 |
-
|
289 |
-
$out .= '</div>';
|
290 |
-
|
291 |
-
echo $out;
|
292 |
-
} // wp_footer
|
293 |
-
} // wf_wp301
|
294 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|