mirror of
https://github.com/julien731/WP-Review-Me.git
synced 2025-11-23 23:45:51 +08:00
Compare commits
17 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c3a084e10 | ||
|
|
c9bae4c60f | ||
|
|
8df8feafa4 | ||
|
|
a9efc4fb2d | ||
|
|
a47a0fc6fa | ||
|
|
cb43e768e0 | ||
|
|
0f616f7edd | ||
|
|
973892a9a0 | ||
|
|
4f9d9633a1 | ||
|
|
66baf1dbd9 | ||
|
|
1e24fa8a8f | ||
|
|
686edccb6e | ||
|
|
25598778fc | ||
|
|
db6090587d | ||
|
|
ca9d11a379 | ||
|
|
5688afde4e | ||
|
|
73c551ebe6 |
2 changed files with 13 additions and 18 deletions
|
|
@ -10,7 +10,7 @@ The bad thing with reviews is that, while unhappy users love to let the world kn
|
|||
|
||||
How can you get more good reviews? Simply ask your users.
|
||||
|
||||

|
||||

|
||||
|
||||
## How It Works
|
||||
|
||||
|
|
@ -38,4 +38,4 @@ new WP_Review_Me( array( 'days_after' => 10, 'type' => 'plugin', 'slug' => 'my-p
|
|||
|
||||
This is the simplest way of creating a review prompt. If you want to customize it further, a few advanced parameters are available.
|
||||
|
||||
You can see the documentation on the wiki page: https://github.com/julien731/WP-Review-Me/wiki
|
||||
You can see the documentation on the wiki page: https://github.com/julien731/WP-Review-Me/wiki
|
||||
|
|
|
|||
27
review.php
27
review.php
|
|
@ -13,17 +13,12 @@
|
|||
*
|
||||
* @package WP Review Me
|
||||
* @author Julien Liabeuf <julien@liabeuf.fr>
|
||||
* @version 1.0
|
||||
* @version 2.0.1
|
||||
* @license GPL-2.0+
|
||||
* @link https://julienliabeuf.com
|
||||
* @copyright 2016 Julien Liabeuf
|
||||
*/
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'WP_Review_Me' ) ) {
|
||||
|
||||
class WP_Review_Me {
|
||||
|
|
@ -34,7 +29,7 @@ if ( ! class_exists( 'WP_Review_Me' ) ) {
|
|||
* @since 1.0
|
||||
* @var string
|
||||
*/
|
||||
public $version = '1.0';
|
||||
public $version = '2.0.1';
|
||||
|
||||
/**
|
||||
* Required version of PHP.
|
||||
|
|
@ -238,14 +233,14 @@ if ( ! class_exists( 'WP_Review_Me' ) ) {
|
|||
*/
|
||||
public function is_time() {
|
||||
|
||||
$installed = get_option( $this->key, false );
|
||||
$installed = (int) get_option( $this->key, 0 );
|
||||
|
||||
if ( false === $installed ) {
|
||||
if ( 0 === $installed ) {
|
||||
$this->setup_date();
|
||||
$installed = time();
|
||||
}
|
||||
|
||||
if ( $installed + ( $this->days + 86400 ) > time() ) {
|
||||
if ( $installed + ( $this->days * 86400 ) > time() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -271,23 +266,23 @@ if ( ! class_exists( 'WP_Review_Me' ) ) {
|
|||
*/
|
||||
protected function get_review_link() {
|
||||
|
||||
$link = 'https://wordpress.org/support/view/';
|
||||
$link = 'https://wordpress.org/support/';
|
||||
|
||||
switch ( $this->type ) {
|
||||
|
||||
case 'theme':
|
||||
$link .= 'theme-reviews/';
|
||||
$link .= 'theme/';
|
||||
break;
|
||||
|
||||
case 'plugin':
|
||||
$link .= 'plugin-reviews/';
|
||||
$link .= 'plugin/';
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
$link .= $this->slug;
|
||||
$link .= $this->slug . '/reviews';
|
||||
$link = add_query_arg( 'rate', $this->rating, $link );
|
||||
$link = esc_url( $link . '#postform' );
|
||||
$link = esc_url( $link . '#new-post' );
|
||||
|
||||
return $link;
|
||||
|
||||
|
|
@ -423,4 +418,4 @@ if ( ! class_exists( 'WP_Review_Me' ) ) {
|
|||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue