diff --git a/CHANGELOG.md b/CHANGELOG.md index b4d942ca7b030a4781750876a6a6f4e7b6dbdb86..c02849b193981f5af522b3fddedf40747cd9711d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [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 diff --git a/README.md b/README.md index 058d458ed6cca07bd964783dc7d2be4517112c5c..1818a66aea545971c7fd735fa7053e97ab2fc126 100644 --- a/README.md +++ b/README.md @@ -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' ) ); } diff --git a/src/RatingPetitionNotice.php b/src/RatingPetitionNotice.php index 4c96bf40f3035206e21edadd42aa8218054621f0..e78fc0c93d9c2b7bb1c5c9cc4637c9a194a6fa12 100644 --- a/src/RatingPetitionNotice.php +++ b/src/RatingPetitionNotice.php @@ -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(