PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 5.6.2
Defender Security – Malware Scanner, Login Security & Firewall v5.6.2
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
defender-security / extra / free-dashboard / classes / notices / class-rating.php

class-rating.php in Defender Security – Malware Scanner, Login Security & Firewall 5.6.2, at extra/free-dashboard/classes/notices/class-rating.php

113 lines 3.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Rating notice class.
4 *
5 * Rating notice is almost same as email notice. Only the notice
6 * content is different.
7 *
8 * @since 2.0
9 * @author Incsub (Joel James)
10 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11 * @copyright Copyright (c) 2022, Incsub
12 * @package WPMUDEV\Notices\Notices
13 */
14
15 namespace WPMUDEV\Notices\Notices;
16
17 // If this file is called directly, abort.
18 defined( 'WPINC' ) || die;
19
20 if ( ! class_exists( __NAMESPACE__ . '\\Rating' ) ) {
21 /**
22 * Class Rating
23 *
24 * @since 2.0
25 * @package WPMUDEV\Notices
26 */
27 class Rating extends Email {
28
29 /**
30 * Current notice type.
31 *
32 * @since 2.0
33 * @var string $type
34 */
35 protected $type = 'rate';
36
37 /**
38 * Show after 1 week.
39 *
40 * @since 2.0
41 * @var string $time
42 */
43 protected $time = WEEK_IN_SECONDS; // After 1 week.
44
45 /**
46 * Render a notice type content.
47 *
48 * @since 2.0
49 *
50 * @param string $plugin Plugin ID.
51 *
52 * @return void
53 */
54 public function render( $plugin ) {
55 $this->enqueue_assets( $plugin );
56
57 /* translators: %s - plugin name */
58 $title = __( 'Enjoying %s? We’d love to hear your feedback!', 'wdev_frash' );
59 $title = apply_filters( 'wdev_rating_title_' . $plugin, $title );
60
61 /* translators: %s - plugin name */
62 $message = __( 'You’ve been using %s for over a week now, and we’d love to hear about your experience! We’ve spent countless hours developing it for you, and your feedback is important to us. We’d really appreciate your rating.', 'wdev_frash' );
63 $message = apply_filters( 'wdev_rating_message_' . $plugin, $message );
64
65 // Plugin title.
66 $plugin_title = $this->get_option( 'title', __( 'Plugin', 'wdev_frash' ) );
67
68 ?>
69 <div class="notice notice-info frash-notice frash-notice-<?php echo esc_attr( $this->type ); ?> hidden">
70 <?php $this->render_hidden_fields( $plugin ); // Render hidden fields. ?>
71
72 <div class="frash-notice-logo <?php echo esc_attr( $plugin ); ?>"><span></span></div>
73 <div class="frash-notice-message">
74 <p class="notice-title"><?php printf( esc_html( $title ), esc_html( $plugin_title ) ); ?></p>
75 <p><?php printf( esc_html( $message ), esc_html( $plugin_title ) ); ?></p>
76 <div class="frash-notice-actions">
77 <a href="#" class="frash-notice-act frash-stars" data-msg="<?php esc_attr_e( 'Thanks :)', 'wdev_frash' ); ?>">
78 <span>�
79 </span><span>�
80 </span><span>�
81 </span><span>�
82 </span><span>�
83 </span>
84 </a>
85 <span class="frash-notice-cta-divider">|</span>
86 <a href="#" class="frash-notice-dismiss" data-msg="<?php esc_attr_e( 'Saving', 'wdev_frash' ); ?>">
87 <?php esc_html_e( 'Dismiss', 'wdev_frash' ); ?>
88 </a>
89 </div>
90 </div>
91 </div>
92 <?php
93 }
94
95 /**
96 * Check if current notice is allowed for the plugin.
97 *
98 * @since 2.0
99 *
100 * @param string $plugin Plugin ID.
101 *
102 * @return bool
103 */
104 public function can_show( $plugin ) {
105 // Mailchimp list id is required.
106 $wp_slug = $this->get_option( 'wp_slug' );
107
108 // Show only on dashboard.
109 return 'dashboard' === $this->screen_id() && ! empty( $wp_slug );
110 }
111 }
112 }
113