PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.4.0
ShopBuilder – WooCommerce Builder For Elementor v2.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 +34 -22 3.4.12.4.0 View file →
@@ -24,8 +24,10 @@
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();
28 30 }
29 31
30 32 /**
31 33 * Check if review notice should be shown or not
@@ -32,9 +34,8 @@
32 34 *
33 35 * @return void
34 36 */
35 37 public function check_installation_time() {
36 -
37 38 $nobug = get_option( 'rtsb_admin_review_spare_me' );
38 39 $rated = get_option( 'rtsb_admin_review_rated' );
39 40
40 41 if ( '1' == $nobug || 'yes' == $rated ) {
@@ -40,25 +41,21 @@
40 41 if ( '1' == $nobug || 'yes' == $rated ) {
41 42 return;
42 43 }
43 44
45 + $now = strtotime( 'now' );
46 +
44 47 $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' );
45 50
46 - // Bail until the activation time is recorded, otherwise the notice would show immediately.
47 - if ( ! $install_date ) {
48 - return;
51 + if ( ! $remind_time ) {
52 + $remind_time = $install_date;
49 53 }
50 54
51 - $now = strtotime( 'now' );
52 - $remind_time = get_option( 'rtsb_admin_review_remind_me' );
55 + $remind_due = strtotime( '+20 days', $remind_time );
53 56
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.
57 + if ( ! $now > $showing_date || $now < $remind_due ) {
61 58 return;
62 59 }
63 60
64 61 add_action( 'admin_notices', [ $this, 'display_admin_notice' ] );
@@ -130,11 +127,8 @@
130 127 /**
131 128 * Display Admin Notice, asking for a review
132 129 **/
133 130 public function display_admin_notice() {
134 - if ( isset( $GLOBALS['woobundle_notice'] ) || isset( $GLOBALS['rtsb__notice'] ) ) {
135 - return;
136 - }
137 131 global $pagenow;
138 132
139 133 $exclude = [
140 134 'themes.php',
@@ -159,9 +153,9 @@
159 153 $args = [ '_wpnonce' => wp_create_nonce( 'rtsb_notice_nonce' ) ];
160 154 $dont_disturb = add_query_arg( $args + [ 'rtsb_admin_review_spare_me' => '1' ], $this->rtsb_current_admin_url() );
161 155 $remind_me = add_query_arg( $args + [ 'rtsb_admin_review_remind_me' => '1' ], $this->rtsb_current_admin_url() );
162 156 $rated = add_query_arg( $args + [ 'rtsb_admin_review_rated' => '1' ], $this->rtsb_current_admin_url() );
163 - $reviewurl = 'https://wordpress.org/support/plugin/shopbuilder/reviews/#new-post';
157 + $reviewurl = 'https://wordpress.org/support/plugin/shopbuilder/reviews/?filter=5#new-post';
164 158 $plugin_name = 'ShopBuilder – Elementor WooCommerce Builder Addons';
165 159 ?>
166 160 <div class="notice rtsb-review-notice rtsb-review-notice--extended">
167 161 <div class="rtsb-review-notice_content">
@@ -168,13 +162,15 @@
168 162 <h3>Enjoying <?php echo esc_html( $plugin_name ); ?>? </h3>
169 163 <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>
170 164 <div class="rtsb-review-notice_actions">
171 165 <a href="<?php echo esc_url( $reviewurl ); ?>"
172 - class="rtsb-review-button rtsb-going-to-review rtsb-review-button--cta" target="_blank"><span>⭐ Yes, You Deserve It!</span></a>
166 + class="rtsb-review-button rtsb-review-button--cta" target="_blank"><span>⭐ Yes, You Deserve It!</span></a>
173 167 <a href="<?php echo esc_url( $rated ); ?>"
174 168 class="rtsb-review-button rtsb-review-button--cta rtsb-review-button--outline"><span>😀 Already Rated!</span></a>
175 169 <a href="<?php echo esc_url( $remind_me ); ?>"
176 170 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>
177 173 </div>
178 174 </div>
179 175 </div>
180 176 <style>
@@ -244,16 +240,15 @@
244 240 padding: 0.4375rem 0.75rem;
245 241 border: 0;
246 242 border-radius: 3px;;
247 243 background: var(--e-button-context-color);
244 + color: #fff;
248 245 vertical-align: middle;
249 246 text-align: center;
250 - text-decoration: none !important;
247 + text-decoration: none;
251 248 white-space: nowrap;
252 249 }
253 - .rtsb-going-to-review {
254 - color: #fff !important;
255 - }
250 +
256 251 .rtsb-review-button:active {
257 252 background: var(--e-button-context-color-dark);
258 253 color: #fff;
259 254 text-decoration: none;
@@ -302,6 +297,23 @@
302 297 }
303 298 </style>
304 299 <?php
305 300 }
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 + );
306 318 }
307 319 }