|
7 | 7 | * Author URI: https://btcpayserver.org |
8 | 8 | * Text Domain: btcpay-greenfield-for-woocommerce |
9 | 9 | * Domain Path: /languages |
10 | | - * Version: 2.6.0 |
| 10 | + * Version: 2.6.1 |
11 | 11 | * Requires PHP: 8.0 |
12 | 12 | * Tested up to: 6.4 |
13 | 13 | * Requires at least: 5.9 |
|
26 | 26 |
|
27 | 27 | defined( 'ABSPATH' ) || exit(); |
28 | 28 |
|
29 | | -define( 'BTCPAYSERVER_VERSION', '2.6.0' ); |
| 29 | +define( 'BTCPAYSERVER_VERSION', '2.6.1' ); |
30 | 30 | define( 'BTCPAYSERVER_VERSION_KEY', 'btcpay_gf_version' ); |
31 | 31 | define( 'BTCPAYSERVER_PLUGIN_FILE_PATH', plugin_dir_path( __FILE__ ) ); |
32 | 32 | define( 'BTCPAYSERVER_PLUGIN_URL', plugin_dir_url(__FILE__ ) ); |
@@ -183,14 +183,18 @@ public function legacyPluginNotification() { |
183 | 183 | * Shows a notice on the admin dashboard to periodically ask for a review. |
184 | 184 | */ |
185 | 185 | public function submitReviewNotification() { |
186 | | - if (!get_transient('btcpaygf_review_dismissed')) { |
| 186 | + if (!get_option('btcpay_gf_review_dismissed_forever') && !get_transient('btcpay_gf_review_dismissed')) { |
187 | 187 | $reviewMessage = sprintf( |
188 | | - __( 'Thank you for using BTCPay for WooCommerce! If you like the plugin, we would love if you %1$sleave us a review%2$s.', 'btcpay-greenfield-for-woocommerce' ), |
| 188 | + __( 'Thank you for using BTCPay for WooCommerce! If you like the plugin, we would love if you %1$sleave us a review%2$s. %3$sRemind me later%4$s %5$sStop reminding me forever!%6$s', 'btcpay-greenfield-for-woocommerce' ), |
189 | 189 | '<a href="https://wordpress.org/support/plugin/btcpay-greenfield-for-woocommerce/reviews/?filter=5#new-post" target="_blank">', |
190 | | - '</a>' |
| 190 | + '</a>', |
| 191 | + '<button class="btcpay-review-dismiss">', |
| 192 | + '</button>', |
| 193 | + '<button class="btcpay-review-dismiss-forever">', |
| 194 | + '</button>' |
191 | 195 | ); |
192 | 196 |
|
193 | | - Notice::addNotice('info', $reviewMessage, true, 'btcpay-review-notice'); |
| 197 | + Notice::addNotice('info', $reviewMessage, false, 'btcpay-review-notice'); |
194 | 198 | } |
195 | 199 | } |
196 | 200 |
|
@@ -321,8 +325,16 @@ public function processAjaxModalBlocksCheckout() { |
321 | 325 | */ |
322 | 326 | public function processAjaxNotification() { |
323 | 327 | check_ajax_referer('btcpaygf-notifications-nonce', 'nonce'); |
324 | | - // Dismiss review notice for 30 days. |
325 | | - set_transient('btcpaygf_review_dismissed', true, DAY_IN_SECONDS * 30); |
| 328 | + |
| 329 | + $dismissForever = filter_var($_POST['dismiss_forever'], FILTER_VALIDATE_BOOL); |
| 330 | + |
| 331 | + if ($dismissForever) { |
| 332 | + update_option('btcpay_gf_review_dismissed_forever', true); |
| 333 | + } else { |
| 334 | + // Dismiss review notice for 30 days. |
| 335 | + set_transient('btcpay_gf_review_dismissed', true, DAY_IN_SECONDS * 30); |
| 336 | + } |
| 337 | + |
326 | 338 | wp_send_json_success(); |
327 | 339 | } |
328 | 340 |
|
|
0 commit comments