PluginProbe ʕ •ᴥ•ʔ
Music Player for WooCommerce / 1.8.0
Music Player for WooCommerce v1.8.0
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 4 months ago css 4 months ago feedback 4 months ago inc 4 months ago js 4 months ago languages 4 months ago pagebuilders 4 months ago vendors 4 months ago views 4 months ago widgets 4 months ago banner.php 4 months ago readme.txt 1 month ago wcmp.php 4 months ago
banner.php
107 lines
1 <?php
2 global $codepeople_promote_banner_plugins;
3 if ( empty( $codepeople_promote_banner_plugins ) ) {
4 $codepeople_promote_banner_plugins = array();
5 }
6 if ( ! function_exists( 'codepeople_add_promote_banner' ) ) {
7 function codepeople_add_promote_banner( $wp_admin_bar ) {
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 ) {
15 return;
16 }
17
18 if( ! function_exists( 'get_current_screen' ) ) { return; }
19 $screen = get_current_screen();
20 if ( 'post' == $screen->post_type || 'page' == $screen->post_type ) {
21 return;
22 }
23
24 // Take action over the banner
25 if ( isset( $_POST['codepeople_promote_banner_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['codepeople_promote_banner_nonce'] ) ), __FILE__ ) ) {
26 if ( ! empty( $_POST['codepeople_promote_banner_plugin'] ) ) {
27 $_codepeople_promote_banner_plugin = sanitize_text_field( wp_unslash( $_POST['codepeople_promote_banner_plugin'] ) );
28 if ( ! empty( $codepeople_promote_banner_plugins[ $_codepeople_promote_banner_plugin ] ) ) {
29 set_transient( 'codepeople_promote_banner_' . $_codepeople_promote_banner_plugin, -1, 0 );
30 if (
31 ! empty( $_POST['codepeople_promote_banner_action'] ) &&
32 'set-review' == $_POST['codepeople_promote_banner_action'] &&
33 ! empty( $codepeople_promote_banner_plugins[ $_codepeople_promote_banner_plugin ]['plugin_url'] )
34 ) {
35 print '<script>document.location.href="' . str_replace( '&amp;', '&', esc_js( $codepeople_promote_banner_plugins[ $_codepeople_promote_banner_plugin ]['plugin_url'] ) ) . '";</script>'; // phpcs:ignore WordPress.Security.EscapeOutput
36 }
37 }
38 }
39 }
40
41 $minimum_days = 86400 * 7;
42 $now = time();
43
44 foreach ( $codepeople_promote_banner_plugins as $plugin_slug => $plugin_data ) {
45 $value = get_transient( 'codepeople_promote_banner_' . $plugin_slug );
46 if ( false === $value ) {
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 <style>
54 #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;}
55 #codepeople-review-banner form{float:left; padding:0 5px;}
56 #codepeople-review-banner .codepeople-review-banner-picture{width:120px;padding:10px 10px 10px 10px;float:left;text-align:center;}
57 #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 );}
58 #codepeople-review-banner .codepeople-review-banner-buttons{padding-top:20px;}
59 #codepeople-review-banner .no-thank-button,
60 #codepeople-review-banner .main-button{height: 28px;border-width:1px;border-style:solid;border-radius:5px;text-decoration: none;}
61 #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;}
62 #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;}
63 #codepeople-review-banner .main-button:hover,#codepeople-review-banner .main-button:focus{background: #008ec2;border-color: #006799;color: #fff;}
64 #codepeople-review-banner .no-thank-button:hover,
65 #codepeople-review-banner .no-thank-button:focus{background: #fafafa;border-color: #999;color: #23282d;}
66 @media screen AND (max-width:760px)
67 {
68 #codepeople-review-banner{position:relative;top:50px;}
69 #codepeople-review-banner .codepeople-review-banner-picture{display:none;}
70 #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 );}
71 }
72 </style>
73 <div id="codepeople-review-banner">
74 <div class="codepeople-review-banner-picture">
75 <img alt="" src="https://secure.gravatar.com/avatar/c0662edcefb5a4e2ab12803856ba2358?s=150&amp;d=mm&amp;r=g" style="width:80px;">
76 </div>
77 <div class="codepeople-review-banner-content">
78 <div class="codepeople-review-banner-text">
79 <p><strong>Want to help to the development of the "<?php print esc_html( $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>
80 </div>
81 <div class="codepeople-review-banner-buttons">
82 <form method="post" target="_blank">
83 <button class="main-button" onclick="jQuery(this).closest('[id=\'codepeople-review-banner\']').hide();">Publish a Review</button>
84 <input type="hidden" name="codepeople_promote_banner_plugin" value="<?php echo esc_attr( $plugin_slug ); ?>" />
85 <input type="hidden" name="codepeople_promote_banner_action" value="set-review" />
86 <input type="hidden" name="codepeople_promote_banner_nonce" value="<?php echo esc_attr( wp_create_nonce( __FILE__ ) ); ?>" />
87 </form>
88 <form method="post">
89 <button class="no-thank-button">No Thanks</button>
90 <input type="hidden" name="codepeople_promote_banner_plugin" value="<?php echo esc_attr( $plugin_slug ); ?>" />
91 <input type="hidden" name="codepeople_promote_banner_action" value="not-thanks" />
92 <input type="hidden" name="codepeople_promote_banner_nonce" value="<?php echo esc_attr( wp_create_nonce( __FILE__ ) ); ?>" />
93 </form>
94 <div style="clear:both;display:block;"></div>
95 </div>
96 <div style="clear:both;"></div>
97 </div>
98 <div style="clear:both;"></div>
99 </div>
100 <?php
101 return;
102 }
103 }
104 }
105 add_action( 'admin_bar_menu', 'codepeople_add_promote_banner' );
106 } // End codepeople_promote_banner block
107