PluginProbe ʕ •ᴥ•ʔ
Music Player for WooCommerce / 1.0.176
Music Player for WooCommerce v1.0.176
1.8.3 1.8.2 1.8.1 1.1.10 1.1.11 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.10 1.3.11 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.5.0 1.5.1 1.6.0 1.6.1 1.6.2 1.6.3 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9 1.8.0 trunk 1.0.173 1.0.174 1.0.175 1.0.176 1.0.177 1.0.178 1.0.179 1.0.180 1.0.181 1.0.182 1.0.183 1.0.184 1.0.185 1.0.186 1.0.187 1.0.188 1.0.189 1.0.190 1.0.191 1.0.192 1.0.193 1.0.194 1.0.195 1.0.196 1.0.197 1.1.0 1.1.1
music-player-for-woocommerce / banner.php
music-player-for-woocommerce Last commit date
addons 3 years ago css 3 years ago js 3 years ago languages 3 years ago pagebuilders 3 years ago views 3 years ago widgets 3 years ago banner.php 3 years ago readme.txt 3 years ago wcmp.php 3 years ago
banner.php
108 lines
1 <?php
2 global $codepeople_promote_banner_plugins;
3 if(empty($codepeople_promote_banner_plugins)) $codepeople_promote_banner_plugins = array();
4 if(!function_exists( 'codepeople_add_promote_banner' ))
5 {
6 function codepeople_add_promote_banner($wp_admin_bar)
7 {
8 global $codepeople_promote_banner_plugins;
9
10 if(
11 empty($codepeople_promote_banner_plugins) ||
12 !is_admin() ||
13 !current_user_can( 'manage_options' )
14 ) return;
15
16 $screen = get_current_screen();
17 if ( $screen->post_type == 'post' || $screen->post_type == 'page' ) return;
18
19 // Take action over the banner
20 if(isset($_POST['codepeople_promote_banner_nonce']) && wp_verify_nonce($_POST['codepeople_promote_banner_nonce'], __FILE__))
21 {
22 if(
23 !empty($_POST['codepeople_promote_banner_plugin']) &&
24 !empty($codepeople_promote_banner_plugins[$_POST['codepeople_promote_banner_plugin']])
25 )
26 {
27 set_transient( 'codepeople_promote_banner_'.sanitize_text_field($_POST['codepeople_promote_banner_plugin']), -1, 0);
28 if(
29 !empty($_POST['codepeople_promote_banner_action']) &&
30 $_POST['codepeople_promote_banner_action'] == 'set-review' &&
31 !empty($codepeople_promote_banner_plugins[$_POST['codepeople_promote_banner_plugin']]['plugin_url'])
32 )
33 {
34 print '<script>document.location.href="'.str_replace('&amp;', '&', esc_js($codepeople_promote_banner_plugins[$_POST['codepeople_promote_banner_plugin']]['plugin_url'])).'";</script>';
35 }
36 }
37 }
38
39 $minimum_days = 86400*7;
40 $now = time();
41
42 foreach($codepeople_promote_banner_plugins as $plugin_slug => $plugin_data )
43 {
44 $value = get_transient( 'codepeople_promote_banner_'.$plugin_slug );
45 if( $value === false )
46 {
47 $value = $now;
48 set_transient( 'codepeople_promote_banner_'.$plugin_slug, $value, 0 );
49 }
50
51 if($minimum_days <= abs($now-$value) && 0<$value*1)
52 {
53 ?>
54 <style>
55 #codepeople-review-banner{width:calc( 100% - 20px );width:-webkit-calc( 100% - 20px );width:-moz-calc( 100% - 20px );width:-o-calc( 100% - 20px );border:10px solid #1582AB;background:#FFF;display:table;}
56 #codepeople-review-banner form{float:left; padding:0 5px;}
57 #codepeople-review-banner .codepeople-review-banner-picture{width:120px;padding:10px 10px 10px 10px;float:left;text-align:center;}
58 #codepeople-review-banner .codepeople-review-banner-content{float: left;padding:10px;width: calc( 100% - 160px );width: -webkit-calc( 100% - 160px );width: -moz-calc( 100% - 160px );width: -o-calc( 100% - 160px );}
59 #codepeople-review-banner .codepeople-review-banner-buttons{padding-top:20px;}
60 #codepeople-review-banner .no-thank-button,
61 #codepeople-review-banner .main-button{height: 28px;border-width:1px;border-style:solid;border-radius:5px;text-decoration: none;}
62 #codepeople-review-banner .main-button{background: #0085ba;border-color: #0073aa #006799 #006799;-webkit-box-shadow: 0 1px 0 #006799;box-shadow: 0 1px 0 #006799;color: #fff;text-decoration: none;text-shadow: 0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799;}
63 #codepeople-review-banner .no-thank-button {color: #555;border-color: #cccccc;background: #f7f7f7;-webkit-box-shadow: 0 1px 0 #cccccc;box-shadow: 0 1px 0 #cccccc;vertical-align: top;}
64 #codepeople-review-banner .main-button:hover,#codepeople-review-banner .main-button:focus{background: #008ec2;border-color: #006799;color: #fff;}
65 #codepeople-review-banner .no-thank-button:hover,
66 #codepeople-review-banner .no-thank-button:focus{background: #fafafa;border-color: #999;color: #23282d;}
67 @media screen AND (max-width:760px)
68 {
69 #codepeople-review-banner{position:relative;top:50px;}
70 #codepeople-review-banner .codepeople-review-banner-picture{display:none;}
71 #codepeople-review-banner .codepeople-review-banner-content{width:calc( 100% - 20px );width:-webkit-calc( 100% - 20px );width:-moz-calc( 100% - 20px );width:-o-calc( 100% - 20px );}
72 }
73 </style>
74 <div id="codepeople-review-banner">
75 <div class="codepeople-review-banner-picture">
76 <img alt="" src="https://secure.gravatar.com/avatar/c0662edcefb5a4e2ab12803856ba2358?s=150&amp;d=mm&amp;r=g" style="width:80px;">
77 </div>
78 <div class="codepeople-review-banner-content">
79 <div class="codepeople-review-banner-text">
80 <p><strong>Want to help to the development of the "<?php print $plugin_data[ 'plugin_name' ]; ?>" plugin?</strong> The main features of this plugin are provided free of charge. We need your help to continue developing it and adding new features. If you want to help with the development please <span style="color:#1582AB;font-weight:bold;">add a review to support it</span>. Thank you!</p>
81 </div>
82 <div class="codepeople-review-banner-buttons">
83 <form method="post" target="_blank">
84 <button class="main-button" onclick="jQuery(this).closest('[id=\'codepeople-review-banner\']').hide();">Publish a Review</button>
85 <input type="hidden" name="codepeople_promote_banner_plugin" value="<?php echo esc_attr($plugin_slug); ?>" />
86 <input type="hidden" name="codepeople_promote_banner_action" value="set-review" />
87 <input type="hidden" name="codepeople_promote_banner_nonce" value="<?php echo wp_create_nonce(__FILE__); ?>" />
88 </form>
89 <form method="post">
90 <button class="no-thank-button">No Thanks</button>
91 <input type="hidden" name="codepeople_promote_banner_plugin" value="<?php echo esc_attr($plugin_slug); ?>" />
92 <input type="hidden" name="codepeople_promote_banner_action" value="not-thanks" />
93 <input type="hidden" name="codepeople_promote_banner_nonce" value="<?php echo wp_create_nonce(__FILE__); ?>" />
94 </form>
95 <div style="clear:both;display:block;"></div>
96 </div>
97 <div style="clear:both;"></div>
98 </div>
99 <div style="clear:both;"></div>
100 </div>
101 <?php
102 return;
103 }
104 }
105 }
106 add_action( 'admin_bar_menu', 'codepeople_add_promote_banner' );
107 } // End codepeople_promote_banner block
108 ?>