Skip to content
Snippets Groups Projects
Commit 63677dc4 authored by dyszczo's avatar dyszczo
Browse files

url to redirect user when wants to rate

parent 1727c632
No related branches found
No related tags found
No related merge requests found
## [1.0.1] - 2019-12-02
### Changes
- RatingPetitionNotice can get url to redirect user when wants to rate
## [1.0.0] - 2019-11-29
### Added
- First version
\ No newline at end of file
......@@ -24,7 +24,8 @@ private function init_repository_rating() {
new RatingPetitionNotice(
$time_tracker,
FedexShippingService::UNIQUE_ID,
$this->plugin_info->get_plugin_name()
$this->plugin_info->get_plugin_name(),
'https://wpde.sk/fs-fedex-rate'
)
);
}
......@@ -40,7 +41,8 @@ private function init_repository_rating() {
new RatingPetitionNotice(
$time_tracker,
FedexShippingService::UNIQUE_ID,
$this->plugin_info->get_plugin_name()
$this->plugin_info->get_plugin_name(),
'https://wpde.sk/fs-fedex-rate'
)
);
}
......
......@@ -46,16 +46,25 @@ class RatingPetitionNotice implements Hookable {
*/
private $plugin_name;
/**
* Url to redirect when user wants to send a rate.
*
* @var string
*/
private $rate_url;
/**
* RatingPetitionNotice constructor.
*
* @param TimeWatcher $method_watcher Watcher to decide when should first notice be displayed.
* @param string $namespace Unique namespace for id/option generation.
* @param string $plugin_name Plugin name in notice content.
* @param string $rate_url Url to redirect when user wants to send a rate.
*/
public function __construct( TimeWatcher $method_watcher, $namespace, $plugin_name ) {
public function __construct( TimeWatcher $method_watcher, $namespace, $plugin_name, $rate_url = '' ) {
$this->namespace = $namespace;
$this->plugin_name = $plugin_name;
$this->rate_url = $rate_url;
$this->second_notice_start_time = get_option( $this->prepare_notice_start_time_option_name(), '' );
$this->first_notice_start_time = '';
......@@ -173,7 +182,7 @@ class RatingPetitionNotice implements Hookable {
$actions[] = sprintf( // phpcs:ignore
// Translators: link.
__( '%1$sOk, you deserved it%2$s', 'wpdesk-rating-petition' ),
'<a class="fs-response-deserved" target="_blank" href="' . esc_url( 'https://wordpress.org/plugins/wpdesk-rating-petition/#reviews' ) . '">',
'<a class="fs-response-deserved" target="_blank" href="' . esc_url( $this->rate_url ) . '">',
'</a>'
);
$actions[] = sprintf(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment