PluginProbe ʕ •ᴥ•ʔ
My Sticky Bar – Floating Notification Bar & Sticky Header (formerly myStickymenu) / 2.5.9
My Sticky Bar – Floating Notification Bar & Sticky Header (formerly myStickymenu) v2.5.9
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 / class-upgrade-box.php
mystickymenu Last commit date
css 4 years ago fonts 4 years ago images 4 years ago js 4 years ago languages 4 years ago class-review-box.php 4 years ago class-upgrade-box.php 4 years ago index.php 8 years ago mystickymenu-affiliate.php 4 years ago mystickymenu-deactivate-form.php 4 years ago mystickymenu-fonts.php 4 years ago mystickymenu-popup.php 4 years ago mystickymenu.php 4 years ago mystickymeny-new-welcomebar.php 4 years ago readme.txt 4 years ago recommended-plugins.php 4 years ago stickymenu-dashboard.php 4 years ago uninstall.php 4 years ago update.php 4 years ago upgrade-to-pro.php 4 years ago welcome-bar.php 4 years ago
class-upgrade-box.php
326 lines
1 <?php
2 class Sticky_menu_upgrade_box {
3
4 public $plugin_name = "myStickymenu";
5
6 public $plugin_slug = "my-sticky-menu";
7
8 public function __construct() {
9
10 add_action("wp_ajax_".$this->plugin_slug."_upgrade_box", array($this, "mystickymenu_upgradetopro"));
11 add_action('admin_notices', array($this, 'admin_notices'));
12
13 }
14
15 public function mystickymenu_upgradetopro() {
16 $nonce = filter_input(INPUT_POST, 'nonce', FILTER_SANITIZE_STRING);
17 $days = filter_input(INPUT_POST, 'days', FILTER_SANITIZE_STRING);
18 if(!empty($nonce) && wp_verify_nonce($nonce, $this->plugin_slug."_upgrade_box")) {
19 if($days == -1) {
20 add_option($this->plugin_slug."_hide_upgrade_box", "1");
21 } else {
22 $date = date("Y-m-d", strtotime("+".$days." days"));
23 update_option($this->plugin_slug."_show_upgrade_box_after", $date);
24 }
25 }
26 die;
27 }
28
29 public function admin_notices() {
30
31 $is_hidden = get_option($this->plugin_slug."_hide_upgrade_box");
32
33 if($is_hidden !== false) {
34 return;
35 }
36 $current_count = get_option($this->plugin_slug."_show_upgrade_box_after");
37 if($current_count === false) {
38 $date = date("Y-m-d", strtotime("+15 days"));
39 add_option($this->plugin_slug."_show_upgrade_box_after", $date);
40 return;
41 }
42 $date_to_show = get_option($this->plugin_slug."_show_upgrade_box_after");
43 if($date_to_show !== false) {
44 $current_date = date("Y-m-d");
45 if($current_date < $date_to_show) {
46 return;
47 }
48 }
49 ?>
50 <style>
51 .mystickymenu-tab-integration-action{
52 padding: 0 10px;
53 /* float: right;*/
54 }
55
56
57 .mystickymenu-tab-integration-action a {
58 display: inline-block;
59 text-decoration: none;
60 position: unset;
61 padding: 0px;
62 margin-left:15px;
63 font-size: 13px;
64 color: #3C85F7 !important;
65 background-color: #fff;
66 border-radius: 5px;
67 border: 2px solid #3C85F7;
68 min-width: 110px;
69 text-align: center;
70 line-height: 25px;
71 }
72
73 .<?php echo esc_attr($this->plugin_slug); ?>-premio-upgrade-box .
74 mystickymenu-tab-integration-action a {
75 /*display: inline-block;
76 float: right;
77 text-decoration: none;
78 position: unset;
79 padding: 0px;
80 font-size: 13px;
81 right: 50px;
82 top: 7px;
83 color: #3C85F7;
84 background-color: #fff;
85 border-radius: 5px;
86 border: 2px solid #3C85F7;
87 min-width: 110px;
88 text-align: center;
89 line-height: 25px;*/
90 }
91
92
93 .<?php echo esc_attr($this->plugin_slug); ?>-premio-upgrade-box .mystickymenu-tab-integration-action a:hover{
94 background-color:#fff
95 }
96
97
98
99
100 .<?php echo esc_attr($this->plugin_slug); ?>-premio-upgrade-box p a {
101 display: inline-block;
102 /* float: right;*/
103 text-decoration: none;
104 color: #999999;
105 /*position: absolute;
106 right: 12px;
107 top: 12px;*/
108 }
109
110
111 .dismiss-btn{
112 float:right;
113 }
114
115
116 .<?php echo esc_attr($this->plugin_slug); ?>-premio-upgrade-box p a:hover, .<?php echo esc_attr($this->plugin_slug); ?>-premio-upgrade-box p a:focus {
117 color: #333333;
118 }
119 .<?php echo esc_attr($this->plugin_slug); ?>-premio-upgrade-box .button span {
120 display: inline-block;
121 line-height: 27px;
122 font-size: 16px;
123 }
124 .<?php echo esc_attr($this->plugin_slug); ?>-upgrade-box-popup {
125 position: fixed;
126 width: 100%;
127 height: 100%;
128 z-index: 10001;
129 background: rgba(0,0,0,0.65);
130 top: 0;
131 left: 0;
132 display: none;
133 }
134 .<?php echo esc_attr($this->plugin_slug); ?>-upgrade-box-popup-content {
135 background: #ffffff;
136 padding: 20px;
137 position: absolute;
138 max-width: 450px;
139 width: 100%;
140 margin: 0 auto;
141 top: 45%;
142 left: 0;
143 right: 0;
144 -webkit-border-radius: 5px;
145 -moz-border-radius: 5px;
146 border-radius: 5px;: ;
147 }
148 .<?php echo esc_attr($this->plugin_slug); ?>-upgrade-box-title {
149 padding: 0 0 10px 0;
150 font-weight: bold;
151 }
152 .<?php echo esc_attr($this->plugin_slug); ?>-upgrade-box-options a {
153 display: block;
154 margin: 5px 0 5px 0;
155 color: #333;
156 text-decoration: none;
157 }
158 .<?php echo esc_attr($this->plugin_slug); ?>-upgrade-box-options a.dismiss {
159 color: #999;
160 }
161 .<?php echo esc_attr($this->plugin_slug); ?>-upgrade-box-options a:hover, .affiliate-options a:focus {
162 color: #0073aa;
163 }
164 button.<?php echo esc_attr($this->plugin_slug); ?>-close-upgrade-box-popup {
165 position: absolute;
166 top: 5px;
167 right: 0;
168 border: none;
169 background: transparent;
170 cursor: pointer;
171 }
172 a.button.button-primary.<?php echo esc_attr($this->plugin_slug); ?>-upgrade-box-btn {
173 font-size: 14px;
174 background: #F51366;
175 color: #fff;
176 border: solid 1px #F51366;
177 border-radius: 3px;
178 line-height: 24px;
179 -webkit-box-shadow: 0 3px 5px -3px #333333;
180 -moz-box-shadow: 0 3px 5px -3px #333333;
181 box-shadow: 0 3px 5px -3px #333333;
182 text-shadow: none;
183 }
184 .notice.notice-info.premio-notice {
185 position: relative;
186 padding: 1px 10px 1px 12px;
187 }
188 .notice.notice-info.premio-notice ul li {
189 margin: 0;
190 }
191 .notice.notice-info.premio-notice ul li a {
192 color: #0073aa;
193 font-size: 14px;
194 text-decoration: underline;
195 }
196 .<?php echo esc_attr($this->plugin_slug); ?>-premio-upgrade-box p {
197 line-height: 30px;
198 vertical-align: middle;
199 padding: 0 10px 0 0;
200 font-size: 14px;
201 }
202 .<?php echo esc_attr($this->plugin_slug); ?>-premio-upgrade-box p img {
203 width: 30px;
204 height: 30px;
205 display: inline-block;
206 margin: 0 10px;
207 vertical-align: middle;
208 border-radius: 15px;
209 }
210 .review-thanks-img img {
211 width: 100%;
212 height: auto;
213 max-width: 200px;
214 }
215 .review-thanks-msg {
216 padding: 5px 0 0 10px;
217 display: inline-block;
218 text-align: left;
219 }
220 .review-thanks-box {
221 padding: 10px 0 10px 0;
222 position: relative;
223 text-align: center;
224 display: none;
225 }
226 .upgrade-box-default {
227 }
228 .review-thanks-btn {
229 border: 0;
230 background: transparent;
231 position: absolute;
232 right: -30px;
233 top: 5px;
234 }
235 .review-thanks-img {
236 display: inline-block;
237 vertical-align: top;
238 width: 200px;
239 }
240 .thanks-msg-title {
241 font-weight: bold;
242 font-size: 18px;
243 }
244 .thanks-msg-desc {
245 padding: 24px 0;
246 }
247 .thanks-msg-footer {
248 font-weight: bold;
249 }
250 </style>
251 <div class="notice notice-info premio-notice <?php echo esc_attr($this->plugin_slug); ?>-premio-upgrade-box <?php echo esc_attr($this->plugin_slug); ?>-premio-upgrade-box">
252 <div class="upgrade-box-default" id="default-upgrade-box-<?php echo esc_attr($this->plugin_slug); ?>">
253 <p>
254 <strong>Upgrade to MyStickyMenu Pro to</strong> experience more awesome features
255 <span class="mystickymenu-tab-integration-action">
256 <a href="<?php echo esc_url(admin_url("admin.php?page=my-stickymenu-upgrade")); ?>" target="_blank" class="btn upgradenow-box-btn" data-days="-1">Upgrade now</a>
257 </span>
258 <a href="javascript:;" class="dismiss-btn <?php echo esc_attr($this->plugin_slug); ?>-premio-upgrade-dismiss-btn"><span class="dashicons dashicons-no-alt"></span></a>
259 </p>
260 <div class="clear clearfix"></div>
261 </div>
262 </div>
263 <div class="<?php echo esc_attr($this->plugin_slug); ?>-upgrade-box-popup">
264 <div class="<?php echo esc_attr($this->plugin_slug); ?>-upgrade-box-popup-content">
265 <button class="<?php echo esc_attr($this->plugin_slug); ?>-close-upgrade-box-popup"><span class="dashicons dashicons-no-alt"></span></button>
266 <div class="<?php echo esc_attr($this->plugin_slug); ?>-upgrade-box-title">Would you like us to remind you about this later?</div>
267 <div class="<?php echo esc_attr($this->plugin_slug); ?>-upgrade-box-options">
268 <a href="javascript:;" data-days="7">Remind me in 7 days</a>
269 <a href="javascript:;" data-days="30">Remind me in 30 days</a>
270 <a href="javascript:;" data-days="-1" class="dismiss">Don't remind me about this</a>
271 </div>
272 </div>
273 </div>
274 <script>
275 jQuery(document).ready(function(){
276 jQuery("body").addClass("has-premio-box");
277 jQuery(document).on("click", ".<?php echo esc_attr($this->plugin_slug); ?>-premio-upgrade-dismiss-btn, .<?php echo esc_attr($this->plugin_slug); ?>-premio-upgrade-box-future-btn", function(){
278 jQuery(".<?php echo esc_attr($this->plugin_slug); ?>-upgrade-box-popup").show();
279 });
280 jQuery(document).on("click", ".<?php echo esc_attr($this->plugin_slug); ?>-close-upgrade-box-popup", function(){
281 jQuery(".<?php echo esc_attr($this->plugin_slug); ?>-upgrade-box-popup").hide();
282 });
283
284 jQuery(document).on("click", ".<?php echo esc_attr($this->plugin_slug); ?>-upgrade-box-options a", function(){
285 var dataDays = jQuery(this).attr("data-days");
286 jQuery(".<?php echo esc_attr($this->plugin_slug); ?>-upgrade-box-popup").remove();
287 jQuery(".<?php echo esc_attr($this->plugin_slug); ?>-premio-upgrade-box").remove();
288 jQuery("body").removeClass("has-premio-box");
289 jQuery.ajax({
290 url: "<?php echo admin_url("admin-ajax.php") ?>",
291 data: "action=<?php echo esc_attr($this->plugin_slug) ?>_upgrade_box&days="+dataDays+"&nonce=<?php echo esc_attr(wp_create_nonce($this->plugin_slug."_upgrade_box")) ?>",
292 type: "post",
293 success: function() {
294 jQuery(".<?php echo esc_attr($this->plugin_slug); ?>-upgrade-box-popup").remove();
295 jQuery(".<?php echo esc_attr($this->plugin_slug); ?>-premio-upgrade-box").remove();
296 }
297 });
298 });
299
300 jQuery(document).on("click",".upgradenow-box-btn",function(){
301 jQuery(".notice.notice-info.premio-notice").hide();
302
303 var dataDays = jQuery(this).attr("data-days");
304
305 jQuery(".<?php echo esc_attr($this->plugin_slug); ?>-upgrade-box-popup").remove();
306 jQuery(".<?php echo esc_attr($this->plugin_slug); ?>-premio-upgrade-box").remove();
307 jQuery("body").removeClass("has-premio-box");
308
309 jQuery.ajax({
310 url: "<?php echo admin_url("admin-ajax.php") ?>",
311 data: "action=<?php echo esc_attr($this->plugin_slug) ?>_upgrade_box&days="+dataDays+"&nonce=<?php echo esc_attr(wp_create_nonce($this->plugin_slug."_upgrade_box")) ?>",
312 type: "post",
313 success: function() {
314 jQuery(".<?php echo esc_attr($this->plugin_slug); ?>-upgrade-box-popup").remove();
315 jQuery(".<?php echo esc_attr($this->plugin_slug); ?>-premio-upgrade-box").remove();
316 }
317 });
318 });
319 });
320
321 jQuery
322 </script>
323 <?php
324 }
325 }
326 $Sticky_menu_upgrade_box = new Sticky_menu_upgrade_box();