class-shortcodes-ultimate-notice-rate.php
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
* The "Rate plugin" notice.
*
* @since 5.0.0
*
* @package Shortcodes_Ultimate
* @subpackage Shortcodes_Ultimate/admin
*/
final class Shortcodes_Ultimate_Notice_Rate extends Shortcodes_Ultimate_Notice
{
/**
* Initialize the class and set its properties.
*
* @since 5.0.0
*/
public function __construct( $notice_id, $template_file )
{
parent::__construct( $notice_id, $template_file );
$this->defer_delay = 3 * DAY_IN_SECONDS;
$this->first_time_delay = 7 * DAY_IN_SECONDS;
}
/**
* Display the notice.
*
* @since 5.0.0
*/
public function display_notice()
{
// Make sure this is the Plugins screen
if ( $this->get_current_screen_id() !== 'plugins' ) {
return;
}
// Check user capability
if ( !$this->current_user_can_view() ) {
return;
}
// Make sure the notice is not dismissed
if ( $this->is_dismissed() ) {
return;
}
// Display the notice
$this->include_template();
}
}