PluginProbe ʕ •ᴥ•ʔ
Hustle – Email Marketing, Lead Generation, Optins, Popups / 7.8.9
Hustle – Email Marketing, Lead Generation, Optins, Popups v7.8.9
7.8.13 7.8.13.1 trunk 3.0 3.1 3.1.1 3.1.2 3.1.3 3.1.4 4.3.2 4.4.4 4.4.5 4.4.5.1 4.4.5.4 4.6 4.6.1.1 4.6.1.4 4.7.0.2 4.7.0.3 4.7.0.7 4.7.0.9 4.7.1.0 4.7.1.1 4.8.0.0 5.0.0 5.0.1 5.0.1.1 5.0.1.2 5.1 5.1.1 5.1.2 5.1.3 5.1.3.1 5.1.3.2 5.1.4 5.1.5 6.0 6.0.1 6.0.2 6.0.3 6.0.4.2 6.0.5 6.0.6.1 6.0.7 6.0.8.1 6.0.9 7.0.0.1 7.0.2 7.0.3 7.0.4 7.1.0 7.1.1 7.2.0 7.2.1 7.3.0 7.3.1 7.3.3 7.3.5 7.3.6 7.3.7 7.4.0 7.4.1 7.4.11 7.4.13 7.4.13.1 7.4.2 7.4.3 7.4.4 7.4.5 7.4.5.1 7.4.5.2 7.4.6 7.4.7 7.5.0 7.6.0 7.6.1 7.6.3 7.6.4 7.6.6 7.7.0 7.7.1 7.8.0 7.8.1 7.8.10 7.8.10.1 7.8.10.2 7.8.11 7.8.12 7.8.12.1 7.8.2 7.8.3 7.8.4 7.8.5 7.8.6 7.8.7 7.8.8 7.8.9 7.8.9.1 7.8.9.2 7.8.9.3
wordpress-popup / lib / free-dashboard / classes / notices / class-rating.php
wordpress-popup / lib / free-dashboard / classes / notices Last commit date
class-email.php 3 years ago class-giveaway.php 9 months ago class-notice.php 9 months ago class-rating.php 3 years ago
class-rating.php
113 lines
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