PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.4.0
ShopBuilder – WooCommerce Builder For Elementor v3.4.0
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
← All changes | app/Controllers/Admin/Notice/Review.php +22 -34 2.2.23.4.0 View file →
@@ -24,10 +24,8 @@
24 24 */
25 25 private function __construct() {
26 26 add_action( 'admin_init', [ $this, 'check_installation_time' ], 10 );
27 27 add_action( 'admin_init', [ $this, 'notice_actions' ], 5 );
28 -
29 - $this->remove_all_notices();
30 28 }
31 29
32 30 /**
33 31 * Check if review notice should be shown or not
@@ -34,8 +32,9 @@
34 32 *
35 33 * @return void
36 34 */
37 35 public function check_installation_time() {
36 +
38 37 $nobug = get_option( 'rtsb_admin_review_spare_me' );
39 38 $rated = get_option( 'rtsb_admin_review_rated' );
40 39
41 40 if ( '1' == $nobug || 'yes' == $rated ) {
@@ -41,21 +40,25 @@
41 40 if ( '1' == $nobug || 'yes' == $rated ) {
42 41 return;
43 42 }
44 43
45 - $now = strtotime( 'now' );
46 -
47 44 $install_date = ExtraSettings::instance()->get_option( 'rtsb_plugin_activation_time', false );
48 - $showing_date = strtotime( '+15 days', $install_date );
49 - $remind_time = get_option( 'rtsb_admin_review_remind_me' );
50 45
51 - if ( ! $remind_time ) {
52 - $remind_time = $install_date;
46 + // Bail until the activation time is recorded, otherwise the notice would show immediately.
47 + if ( ! $install_date ) {
48 + return;
53 49 }
54 50
55 - $remind_due = strtotime( '+20 days', $remind_time );
51 + $now = strtotime( 'now' );
52 + $remind_time = get_option( 'rtsb_admin_review_remind_me' );
56 53
57 - if ( ! $now > $showing_date || $now < $remind_due ) {
54 + if ( $remind_time ) {
55 + // User asked to be reminded later: show again 20 days after that click.
56 + if ( $now < strtotime( '+20 days', $remind_time ) ) {
57 + return;
58 + }
59 + } elseif ( $now < strtotime( '+15 days', $install_date ) ) {
60 + // First time: show 15 days after installation.
58 61 return;
59 62 }
60 63
61 64 add_action( 'admin_notices', [ $this, 'display_admin_notice' ] );
@@ -127,8 +130,11 @@
127 130 /**
128 131 * Display Admin Notice, asking for a review
129 132 **/
130 133 public function display_admin_notice() {
134 + if ( isset( $GLOBALS['woobundle_notice'] ) || isset( $GLOBALS['rtsb__notice'] ) ) {
135 + return;
136 + }
131 137 global $pagenow;
132 138
133 139 $exclude = [
134 140 'themes.php',
@@ -153,9 +159,9 @@
153 159 $args = [ '_wpnonce' => wp_create_nonce( 'rtsb_notice_nonce' ) ];
154 160 $dont_disturb = add_query_arg( $args + [ 'rtsb_admin_review_spare_me' => '1' ], $this->rtsb_current_admin_url() );
155 161 $remind_me = add_query_arg( $args + [ 'rtsb_admin_review_remind_me' => '1' ], $this->rtsb_current_admin_url() );
156 162 $rated = add_query_arg( $args + [ 'rtsb_admin_review_rated' => '1' ], $this->rtsb_current_admin_url() );
157 - $reviewurl = 'https://wordpress.org/support/plugin/shopbuilder/reviews/?filter=5#new-post';
163 + $reviewurl = 'https://wordpress.org/support/plugin/shopbuilder/reviews/#new-post';
158 164 $plugin_name = 'ShopBuilder – Elementor WooCommerce Builder Addons';
159 165 ?>
160 166 <div class="notice rtsb-review-notice rtsb-review-notice--extended">
161 167 <div class="rtsb-review-notice_content">
@@ -162,15 +168,13 @@
162 168 <h3>Enjoying <?php echo esc_html( $plugin_name ); ?>? </h3>
163 169 <p>Thank you for choosing <strong>ShopBuilder</strong>. If you have found our plugin useful and makes you smile, please consider giving us a 5-star rating on WordPress.org. It will help us to grow.</p>
164 170 <div class="rtsb-review-notice_actions">
165 171 <a href="<?php echo esc_url( $reviewurl ); ?>"
166 - class="rtsb-review-button rtsb-review-button--cta" target="_blank"><span>⭐ Yes, You Deserve It!</span></a>
172 + class="rtsb-review-button rtsb-going-to-review rtsb-review-button--cta" target="_blank"><span>⭐ Yes, You Deserve It!</span></a>
167 173 <a href="<?php echo esc_url( $rated ); ?>"
168 174 class="rtsb-review-button rtsb-review-button--cta rtsb-review-button--outline"><span>😀 Already Rated!</span></a>
169 175 <a href="<?php echo esc_url( $remind_me ); ?>"
170 176 class="rtsb-review-button rtsb-review-button--cta rtsb-review-button--outline"><span>🔔 Remind Me Later</span></a>
171 - <a href="<?php echo esc_url( $dont_disturb ); ?>"
172 - class="rtsb-review-button rtsb-review-button--cta rtsb-review-button--error rtsb-review-button--outline"><span>😐 No Thanks </span></a>
173 177 </div>
174 178 </div>
175 179 </div>
176 180 <style>
@@ -240,15 +244,16 @@
240 244 padding: 0.4375rem 0.75rem;
241 245 border: 0;
242 246 border-radius: 3px;;
243 247 background: var(--e-button-context-color);
244 - color: #fff;
245 248 vertical-align: middle;
246 249 text-align: center;
247 - text-decoration: none;
250 + text-decoration: none !important;
248 251 white-space: nowrap;
249 252 }
250 -
253 + .rtsb-going-to-review {
254 + color: #fff !important;
255 + }
251 256 .rtsb-review-button:active {
252 257 background: var(--e-button-context-color-dark);
253 258 color: #fff;
254 259 text-decoration: none;
@@ -297,23 +302,6 @@
297 302 }
298 303 </style>
299 304 <?php
300 305 }
301 - }
302 -
303 - /**
304 - * Remove admin notices
305 - */
306 - public function remove_all_notices() {
307 - add_action(
308 - 'in_admin_header',
309 - function () {
310 - $screen = get_current_screen();
311 - if ( in_array( $screen->base, [ 'shopbuilder_page_rtsb-get-help' ], true ) ) {
312 - remove_all_actions( 'admin_notices' );
313 - remove_all_actions( 'all_admin_notices' );
314 - }
315 - },
316 - 1000
317 - );
318 306 }
319 307 }