| 1 |
<?php |
| 2 |
/** |
| 3 |
* Notification output for a review request. |
| 4 |
* |
| 5 |
* @package ConvertKit |
| 6 |
* @author ConvertKit |
| 7 |
*/ |
| 8 |
|
| 9 |
?> |
| 10 |
|
| 11 |
<div class="notice notice-info is-dismissible review-<?php echo esc_attr( $this->plugin_slug ); ?>"> |
| 12 |
<p> |
| 13 |
<?php |
| 14 |
echo esc_html( |
| 15 |
sprintf( |
| 16 |
/* translators: Plugin Name */ |
| 17 |
__( 'We\'d be super grateful if you could spread the word about %s and give it a 5 star rating on WordPress?', 'convertkit' ), |
| 18 |
$this->plugin_name |
| 19 |
) |
| 20 |
); |
| 21 |
?> |
| 22 |
</p> |
| 23 |
<p> |
| 24 |
<a href="<?php echo esc_attr( $this->get_review_url() ); ?>" class="button button-primary" rel="noopener" target="_blank"> |
| 25 |
<?php esc_html_e( 'Yes, leave review', 'convertkit' ); ?> |
| 26 |
</a> |
| 27 |
<a href="<?php echo esc_attr( $this->get_support_url() ); ?>" class="button" rel="noopener" target="_blank"> |
| 28 |
<?php |
| 29 |
echo esc_html( |
| 30 |
sprintf( |
| 31 |
/* translators: Plugin Name */ |
| 32 |
__( 'No, I\'m having issues with %s', 'convertkit' ), |
| 33 |
$this->plugin_name |
| 34 |
) |
| 35 |
); |
| 36 |
?> |
| 37 |
</a> |
| 38 |
</p> |
| 39 |
|
| 40 |
<script type="text/javascript"> |
| 41 |
jQuery( document ).ready( function( $ ) { |
| 42 |
// Dismiss Review Notification. |
| 43 |
$( 'div.review-<?php echo esc_attr( $this->plugin_slug ); ?>' ).on( 'click', 'a, button.notice-dismiss', function( e ) { |
| 44 |
|
| 45 |
// Do request |
| 46 |
$.post( |
| 47 |
ajaxurl, |
| 48 |
{ |
| 49 |
action: '<?php echo esc_attr( str_replace( '-', '_', $this->plugin_slug ) ); ?>_dismiss_review', |
| 50 |
}, |
| 51 |
function( response ) { |
| 52 |
} |
| 53 |
); |
| 54 |
|
| 55 |
// Hide notice |
| 56 |
$( 'div.review-<?php echo esc_attr( $this->plugin_slug ); ?>' ).hide(); |
| 57 |
|
| 58 |
} ); |
| 59 |
} ); |
| 60 |
</script> |
| 61 |
</div> |
| 62 |
|
| 63 |
|