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