| @@ -40,25 +40,21 @@ | ||
| 40 | 40 | if ( '1' == $nobug || 'yes' == $rated ) { |
| 41 | 41 | return; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | + $now = strtotime( 'now' ); | |
| 45 | + | |
| 44 | 46 | $install_date = ExtraSettings::instance()->get_option( 'rtsb_plugin_activation_time', false ); |
| 47 | + $showing_date = strtotime( '+15 days', $install_date ); | |
| 48 | + $remind_time = get_option( 'rtsb_admin_review_remind_me' ); | |
| 45 | 49 | |
| 46 | - // Bail until the activation time is recorded, otherwise the notice would show immediately. | |
| 47 | - if ( ! $install_date ) { | |
| 48 | - return; | |
| 50 | + if ( ! $remind_time ) { | |
| 51 | + $remind_time = $install_date; | |
| 49 | 52 | } |
| 50 | 53 | |
| 51 | - $now = strtotime( 'now' ); | |
| 52 | - $remind_time = get_option( 'rtsb_admin_review_remind_me' ); | |
| 54 | + $remind_due = strtotime( '+20 days', $remind_time ); | |
| 53 | 55 | |
| 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. | |
| 56 | + if ( ! $now > $showing_date || $now < $remind_due ) { | |
| 61 | 57 | return; |
| 62 | 58 | } |
| 63 | 59 | |
| 64 | 60 | add_action( 'admin_notices', [ $this, 'display_admin_notice' ] ); |
| @@ -159,9 +155,9 @@ | ||
| 159 | 155 | $args = [ '_wpnonce' => wp_create_nonce( 'rtsb_notice_nonce' ) ]; |
| 160 | 156 | $dont_disturb = add_query_arg( $args + [ 'rtsb_admin_review_spare_me' => '1' ], $this->rtsb_current_admin_url() ); |
| 161 | 157 | $remind_me = add_query_arg( $args + [ 'rtsb_admin_review_remind_me' => '1' ], $this->rtsb_current_admin_url() ); |
| 162 | 158 | $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'; | |
| 159 | + $reviewurl = 'https://wordpress.org/support/plugin/shopbuilder/reviews/'; | |
| 164 | 160 | $plugin_name = 'ShopBuilder – Elementor WooCommerce Builder Addons'; |
| 165 | 161 | ?> |
| 166 | 162 | <div class="notice rtsb-review-notice rtsb-review-notice--extended"> |
| 167 | 163 | <div class="rtsb-review-notice_content"> |
| @@ -168,13 +164,15 @@ | ||
| 168 | 164 | <h3>Enjoying <?php echo esc_html( $plugin_name ); ?>? </h3> |
| 169 | 165 | <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 | 166 | <div class="rtsb-review-notice_actions"> |
| 171 | 167 | <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> | |
| 168 | + class="rtsb-review-button rtsb-review-button--cta" target="_blank"><span>⭐ Yes, You Deserve It!</span></a> | |
| 173 | 169 | <a href="<?php echo esc_url( $rated ); ?>" |
| 174 | 170 | class="rtsb-review-button rtsb-review-button--cta rtsb-review-button--outline"><span>😀 Already Rated!</span></a> |
| 175 | 171 | <a href="<?php echo esc_url( $remind_me ); ?>" |
| 176 | 172 | class="rtsb-review-button rtsb-review-button--cta rtsb-review-button--outline"><span>🔔 Remind Me Later</span></a> |
| 173 | + <a href="<?php echo esc_url( $dont_disturb ); ?>" | |
| 174 | + class="rtsb-review-button rtsb-review-button--cta rtsb-review-button--error rtsb-review-button--outline"><span>😐 No Thanks </span></a> | |
| 177 | 175 | </div> |
| 178 | 176 | </div> |
| 179 | 177 | </div> |
| 180 | 178 | <style> |
| @@ -244,16 +242,15 @@ | ||
| 244 | 242 | padding: 0.4375rem 0.75rem; |
| 245 | 243 | border: 0; |
| 246 | 244 | border-radius: 3px;; |
| 247 | 245 | background: var(--e-button-context-color); |
| 246 | + color: #fff; | |
| 248 | 247 | vertical-align: middle; |
| 249 | 248 | text-align: center; |
| 250 | - text-decoration: none !important; | |
| 249 | + text-decoration: none; | |
| 251 | 250 | white-space: nowrap; |
| 252 | 251 | } |
| 253 | - .rtsb-going-to-review { | |
| 254 | - color: #fff !important; | |
| 255 | - } | |
| 252 | + | |
| 256 | 253 | .rtsb-review-button:active { |
| 257 | 254 | background: var(--e-button-context-color-dark); |
| 258 | 255 | color: #fff; |
| 259 | 256 | text-decoration: none; |