PluginProbe ʕ •ᴥ•ʔ
Widget Options – Advanced Conditional Visibility for Gutenberg Blocks & Classic Widgets / 3.9.5
Widget Options – Advanced Conditional Visibility for Gutenberg Blocks & Classic Widgets v3.9.5
4.2.5 4.2.4 trunk 3.7.10 3.7.11 3.7.12 3.7.13 3.7.14 3.7.2 3.7.5 3.7.6 3.7.7 3.7.8 3.7.9 3.8 3.8.1 3.8.10 3.8.2 3.8.3 3.8.4 3.8.5 3.8.6 3.8.7 3.8.8 3.8.9 3.8.9.1 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.0.5.1 4.0.6 4.0.6.1 4.0.7 4.0.8 4.0.9 4.1.0 4.1.1 4.1.2 4.1.3 4.2.0 4.2.1 4.2.2 4.2.3
widget-options / includes / admin / notices.php
widget-options / includes / admin Last commit date
settings 2 years ago globals.php 2 years ago import-export.php 2 years ago notices.php 2 years ago welcome.php 2 years ago
notices.php
83 lines
1 <?php
2 /**
3 * Handles additional widget tab options
4 * run on __construct function
5 */
6
7 // Exit if accessed directly
8 if ( ! defined( 'ABSPATH' ) ) exit;
9
10
11 /**
12 * Admin Messages
13 * @return void
14 */
15 if( !function_exists( 'widgetopts_admin_notices' ) ):
16 function widgetopts_admin_notices() {
17 if( !current_user_can( 'update_plugins' ) )
18 return;
19
20 //show rating notice to page that matters most
21 global $pagenow;
22 if( !in_array( $pagenow, array( 'widgets.php', 'options-general.php' ) ) ){
23 return;
24 }
25
26 if( $pagenow == 'options-general.php' && function_exists( 'get_current_screen' ) ){
27 $screen = get_current_screen();
28 if( isset( $screen->base ) && $screen->base != 'settings_page_widgetopts_plugin_settings' ){
29 return;
30 }
31 }
32
33 $install_date = get_option( 'widgetopts_installDate' );
34 $saved = get_option( 'widgetopts_RatingDiv' );
35 $display_date = date( 'Y-m-d h:i:s' );
36 $datetime1 = new DateTime( $install_date );
37 $datetime2 = new DateTime( $display_date );
38 $diff_intrval = round( ($datetime2->format( 'U' ) - $datetime1->format( 'U' ) ) / (60*60*24));
39 if( 'yes' != $saved && $diff_intrval >= 7 ){
40 echo '<div class="widgetopts_notice updated" style="box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);">
41 <p>Well done! You have been enjoying <strong>Widget Options</strong> for more than a week.
42 <br>
43 Do you love it? Are you over the moon? Will you give us a <a href="https://wordpress.org/support/view/plugin-reviews/widget-options" class="thankyou" target="_blank" title="Ok, you deserved it" style="font-weight:bold;"><strong>5-star rating</strong></a> on WordPress?
44 </br>
45 Your review is essential to the Widget Options community and our ongoing succes.
46 <br><br>
47 Thank you so much! � Your Widget Options Team
48 <ul>
49 <li><a href="https://wordpress.org/support/view/plugin-reviews/widget-options" class="thankyou" target="_blank" title="Ok, you deserved it" style="font-weight:bold;">'. __( 'Definitely. Widget Options is the best!', 'widget-options' ) .'</a></li>
50 <li><a href="javascript:void(0);" class="widgetopts_bHideRating" title="I already did" style="font-weight:bold;">'. __( 'Already done!', 'widget-options' ) .'</a></li>
51 <li><a href="https://widget-options.com/contact/" class="thankyou" target="_blank" title="Ok, you deserved it" style="font-weight:bold;">'. __( "Not convinced yet. Still think about it.", 'widget-options' ) .'</a></li>
52 <li><a href="javascript:void(0);" class="widgetopts_bHideRating" title="No, not good enough" style="font-weight:bold;">'. __( "Dismiss", 'widget-options' ) .'</a></li>
53 </ul>
54 </div>
55 <script>
56 jQuery( document ).ready(function( $ ) {
57
58 jQuery(\'.widgetopts_bHideRating\').click(function(){
59 var data={\'action\':\'widgetopts_hideRating\'}
60 jQuery.ajax({
61
62 url: "'. admin_url( 'admin-ajax.php' ) .'",
63 type: "post",
64 data: data,
65 dataType: "json",
66 async: !0,
67 success: function(e) {
68 if (e=="success") {
69 jQuery(\'.widgetopts_notice\').slideUp(\'slow\');
70
71 }
72 }
73 });
74 })
75
76 });
77 </script>
78 ';
79 }
80 }
81 add_action( 'admin_notices', 'widgetopts_admin_notices' );
82 endif;
83