PluginProbe ʕ •ᴥ•ʔ
My Sticky Bar – Floating Notification Bar & Sticky Header (formerly myStickymenu) / 2.4.3
My Sticky Bar – Floating Notification Bar & Sticky Header (formerly myStickymenu) v2.4.3
2.9.1 2.9.0 2.8.9 2.8.8 trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9 1.9.1 2.0 2.0.1 2.0.3 2.0.4 2.0.5 2.0.6 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3 2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 2.4 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.5 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.6.6 2.6.7 2.6.8 2.6.9 2.7 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7
mystickymenu / mystickymenu-affiliate.php
mystickymenu Last commit date
css 6 years ago fonts 7 years ago images 6 years ago js 6 years ago languages 7 years ago class-review-box.php 6 years ago index.php 8 years ago mystickymenu-affiliate.php 6 years ago mystickymenu-fonts.php 6 years ago mystickymenu-popup.php 6 years ago mystickymenu.php 6 years ago readme.txt 5 years ago uninstall.php 7 years ago welcome-bar.php 6 years ago
mystickymenu-affiliate.php
170 lines
1 <?php
2 class MyStickyMenu_affiliate_program {
3
4 public $plugin = "mystickymenu";
5
6 public function __construct() {
7 add_action("wp_ajax_".$this->plugin."_affiliate_program", array($this, "mystickymenu_affiliate_program"));
8
9 add_action('admin_notices', array($this, 'mystickymenu_admin_notices'));
10 }
11
12 public function mystickymenu_affiliate_program() {
13 $nonce = filter_input(INPUT_POST, 'nonce', FILTER_SANITIZE_STRING);
14 $days = filter_input(INPUT_POST, 'days', FILTER_SANITIZE_STRING);
15 if(!empty($nonce) && wp_verify_nonce($nonce, $this->plugin."_affiliate_program")) {
16 if($days == -1) {
17 add_option($this->plugin."_hide_affiliate_box", "1");
18 } else {
19 $date = date("Y-m-d", strtotime("+".$days." days"));
20 update_option($this->plugin."_show_affiliate_box_after", $date);
21 }
22 }
23 die;
24 }
25
26 public function mystickymenu_admin_notices() {
27 $is_hidden = get_option($this->plugin."_hide_affiliate_box");
28 if($is_hidden !== false) {
29 return;
30 }
31
32 $date_to_show = get_option($this->plugin."_show_affiliate_box_after");
33 if($date_to_show === false || empty($date_to_show)) {
34 $date = date("Y-m-d", strtotime("+5 days"));
35 update_option($this->plugin."_show_affiliate_box_after", $date);
36 return;
37 }
38 $current_date = date("Y-m-d");
39 if( $date_to_show != '' && $current_date < $date_to_show) {
40 return;
41 }
42 ?>
43 <style>
44 .premio-affiliate p a {
45 display: inline-block;
46 float: right;
47 text-decoration: none;
48 color: #999999;
49 position: absolute;
50 right: 12px;
51 top: 12px;
52 }
53 .premio-affiliate p a:hover, .premio-affiliate p a:focus {
54 color: #333333;
55 }
56 .premio-affiliate .button span {
57 display: inline-block;
58 line-height: 27px;
59 font-size: 16px;
60 }
61 .premio-affiliate {
62 padding: 1px 100px 12px 12px;
63 margin: 15px 15px 2px;
64 position: relative;
65 }
66 .affiliate-popup {
67 position: fixed;
68 width: 100%;
69 height: 100%;
70 z-index: 10001;
71 background: rgba(0,0,0,0.65);
72 top: 0;
73 left: 0;
74 display: none;
75 }
76 .affiliate-popup-content {
77 background: #ffffff;
78 padding: 20px;
79 position: absolute;
80 max-width: 450px;
81 width: 100%;
82 margin: 0 auto;
83 top: 45%;
84 left: 0;
85 right: 0;
86 -webkit-border-radius: 5px;
87 -moz-border-radius: 5px;
88 border-radius: 5px;: ;
89 }
90 .affiliate-title {
91 padding: 0 0 10px 0;
92 font-weight: bold;
93 }
94 .affiliate-options a {
95 display: block;
96 margin: 5px 0 5px 0;
97 color: #333;
98 text-decoration: none;
99 }
100 .affiliate-options a.dismiss {
101 color: #999;
102 }
103 .affiliate-options a:hover, .affiliate-options a:focus {
104 color: #0073aa;
105 }
106 button.close-affiliate-popup {
107 position: absolute;
108 top: 5px;
109 right: 0;
110 border: none;
111 background: transparent;
112 cursor: pointer;
113 }
114 a.button.button-primary.affiliate-btn {
115 font-size: 14px;
116 background: #F51366;
117 color: #fff;
118 border: solid 1px #F51366;
119 border-radius: 3px;
120 line-height: 24px;
121 -webkit-box-shadow: 0 3px 5px -3px #333333;
122 -moz-box-shadow: 0 3px 5px -3px #333333;
123 box-shadow: 0 3px 5px -3px #333333;
124 text-shadow: none;
125 }
126 </style>
127 <div class="notice notice-info premio-affiliate <?php echo esc_attr($this->plugin) ?>-premio-affiliate">
128 <p>Hi there, you've been using My Sticky Menu for a while now. Do you know that <b>My Sticky Menu</b> has an affiliate program? Join now and get <b>25% lifetime commission</b> <a href="javascript:;" class="dismiss-btn"><span class="dashicons dashicons-no-alt"></span> Dismiss</a></p>
129 <div class="clear clearfix"></div>
130 <a class="button button-primary affiliate-btn" target="_blank" href="https://premio.io/affiliates/?utm_source=inapp&plugin=mystickymenu&domain=<?php echo $_SERVER['HTTP_HOST'] ?>">Tell me more <span class="dashicons dashicons-arrow-right-alt"></span></a>
131 </div>
132 <div class="affiliate-popup">
133 <div class="affiliate-popup-content">
134 <button class="close-affiliate-popup"><span class="dashicons dashicons-no-alt"></span></button>
135 <div class="affiliate-title">Would you like us to remind you about this later?</div>
136 <div class="affiliate-options">
137 <a href="javascript:;" data-days="3">Remind me in 3 days</a>
138 <a href="javascript:;" data-days="10">Remind me in 10 days</a>
139 <a href="javascript:;" data-days="-1" class="dismiss">Don't remind me about this</a>
140 </div>
141 </div>
142 </div>
143 <script>
144 jQuery(document).ready(function(){
145 jQuery(document).on("click", ".premio-affiliate p a.dismiss-btn", function(){
146 jQuery(".affiliate-popup").show();
147 });
148 jQuery(document).on("click", ".close-affiliate-popup", function(){
149 jQuery(".affiliate-popup").hide();
150 });
151 jQuery(document).on("click", ".affiliate-options a", function(){
152 var dataDays = jQuery(this).attr("data-days");
153 jQuery(".affiliate-popup").hide();
154 jQuery(".<?php echo esc_attr($this->plugin) ?>-premio-affiliate").hide();
155 jQuery.ajax({
156 url: "<?php echo admin_url("admin-ajax.php") ?>",
157 data: "action=<?php echo esc_attr($this->plugin) ?>_affiliate_program&days="+dataDays+"&nonce=<?php echo esc_attr(wp_create_nonce($this->plugin."_affiliate_program")) ?>",
158 type: "post",
159 success: function() {
160 jQuery(".affiliate-popup").remove();
161 jQuery(".<?php echo esc_attr($this->plugin) ?>-premio-affiliate").remove();
162 }
163 });
164 });
165 });
166 </script>
167 <?php
168 }
169 }
170 $MyStickyMenu_affiliate_program = new MyStickyMenu_affiliate_program();