Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wp-wpdesk-rating-petition
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wpdesk
wp-wpdesk-rating-petition
Commits
63677dc4
Commit
63677dc4
authored
5 years ago
by
dyszczo
Browse files
Options
Downloads
Patches
Plain Diff
url to redirect user when wants to rate
parent
1727c632
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+4
-0
4 additions, 0 deletions
CHANGELOG.md
README.md
+4
-2
4 additions, 2 deletions
README.md
src/RatingPetitionNotice.php
+11
-2
11 additions, 2 deletions
src/RatingPetitionNotice.php
with
19 additions
and
4 deletions
CHANGELOG.md
+
4
−
0
View file @
63677dc4
## [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
This diff is collapsed.
Click to expand it.
README.md
+
4
−
2
View file @
63677dc4
...
...
@@ -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'
)
);
}
...
...
This diff is collapsed.
Click to expand it.
src/RatingPetitionNotice.php
+
11
−
2
View file @
63677dc4
...
...
@@ -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
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment