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
Merge requests
!4
chore(readme): more documentation
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
chore(readme): more documentation
feature/readme
into
master
Overview
0
Commits
2
Pipelines
1
Changes
2
Merged
Krzysztof Dyszczyk
requested to merge
feature/readme
into
master
3 years ago
Overview
0
Commits
2
Pipelines
1
Changes
2
0
0
Merge request reports
Viewing commit
42dd8a7e
Prev
Next
Show latest version
2 files
+
34
−
22
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
42dd8a7e
chore(readme): more documentation
· 42dd8a7e
Grzegorz Rola
authored
3 years ago
README.md
+
33
−
22
View file @ 42dd8a7e
Edit in single-file editor
Open in Web IDE
Show full file
@@ -2,48 +2,59 @@
[

](https://gitlab.com/wpdesk/wp-wpdesk-rating-petition/commits/master)
[

](https://packagist.org/packages/wpdesk/wp-wpdesk-rating-petition)
[

](https://packagist.org/packages/wpdesk/wp-wpdesk-rating-petition)
[

](https://packagist.org/packages/wpdesk/wp-wpdesk-rating-petition)
[

](https://packagist.org/packages/wpdesk/wp-wpdesk-rating-petition)
WordPress Library to ask for good rate in repository.
===================================================
##
# Usage
##
Requirements
When using in shipping zones:
PHP 7.0 or later.
## Installation via Composer
In order to install the bindings via Composer run the following command:
```
bash
composer require wpdesk/wp-wpdesk-rating-petition
```
## Example usage
### When using in shipping zones:
```
php
private
function
init_repository_rating
()
{
$time_tracker
=
new
ShippingMethodWatcher
(
function
init_repository_rating
()
{
$time_tracker
=
new
\WPDesk\RepositoryRating\TimeWatcher\
ShippingMethod
Instance
Watcher
(
FedexShippingService
::
UNIQUE_ID
,
'plugin_activation_flexible-shipping-fedex/flexible-shipping-fedex.php'
,
'28-11-2019'
,
FedexShippingMethod
::
class
);
$this
->
add_hookable
(
$time_tracker
);
$this
->
add_hookable
(
new
RatingPetitionNotice
(
$time_tracker
,
FedexShippingService
::
UNIQUE_ID
,
$this
->
plugin_info
->
get_plugin_name
(),
'https://wpde.sk/fs-fedex-rate'
)
);
$time_tracker
->
hooks
();
(
new
\WPDesk\RepositoryRating\RatingPetitionNotice
(
$time_tracker
,
'flexible_shipping_fedex'
,
$this
->
plugin_info
->
get_plugin_name
(),
'https://wpde.sk/fs-fedex-rate'
)
)
->
hooks
();
}
```
When using in shipping method:
###
When using in shipping method:
```
php
private
function
init_repository_rating
()
{
$time_tracker
=
new
ShippingMethodGlobalSettingsWatcher
(
FedexShippingService
::
UNIQUE_ID
);
$this
->
add_hookable
(
$time_tracker
);
$this
->
add_hookable
(
new
RatingPetitionNotice
(
<?php
function
init_repository_rating
()
{
$time_tracker
=
new
\WPDesk\RepositoryRating\TimeWatcher\ShippingMethodGlobalSettingsWatcher
(
'flexible_shipping_fedex'
);
$time_tracker
->
hooks
();
(
new
\WPDesk\RepositoryRating\RatingPetitionNotice
(
$time_tracker
,
FedexShippingService
::
UNIQUE_ID
,
'flexible_shipping_fedex'
,
$this
->
plugin_info
->
get_plugin_name
(),
'https://wpde.sk/fs-fedex-rate'
)
);
)
->
hooks
(
);
}
```
Loading