mirror of
https://github.com/julien731/WP-Review-Me.git
synced 2025-11-24 08:01:28 +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 can you get more good reviews? Simply ask your users.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## How It Works
|
## How It Works
|
||||||
|
|
||||||
|
|
|
||||||
25
review.php
25
review.php
|
|
@ -13,17 +13,12 @@
|
||||||
*
|
*
|
||||||
* @package WP Review Me
|
* @package WP Review Me
|
||||||
* @author Julien Liabeuf <julien@liabeuf.fr>
|
* @author Julien Liabeuf <julien@liabeuf.fr>
|
||||||
* @version 1.0
|
* @version 2.0.1
|
||||||
* @license GPL-2.0+
|
* @license GPL-2.0+
|
||||||
* @link https://julienliabeuf.com
|
* @link https://julienliabeuf.com
|
||||||
* @copyright 2016 Julien Liabeuf
|
* @copyright 2016 Julien Liabeuf
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// If this file is called directly, abort.
|
|
||||||
if ( ! defined( 'WPINC' ) ) {
|
|
||||||
die;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( ! class_exists( 'WP_Review_Me' ) ) {
|
if ( ! class_exists( 'WP_Review_Me' ) ) {
|
||||||
|
|
||||||
class WP_Review_Me {
|
class WP_Review_Me {
|
||||||
|
|
@ -34,7 +29,7 @@ if ( ! class_exists( 'WP_Review_Me' ) ) {
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $version = '1.0';
|
public $version = '2.0.1';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Required version of PHP.
|
* Required version of PHP.
|
||||||
|
|
@ -238,14 +233,14 @@ if ( ! class_exists( 'WP_Review_Me' ) ) {
|
||||||
*/
|
*/
|
||||||
public function is_time() {
|
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();
|
$this->setup_date();
|
||||||
$installed = time();
|
$installed = time();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $installed + ( $this->days + 86400 ) > time() ) {
|
if ( $installed + ( $this->days * 86400 ) > time() ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -271,23 +266,23 @@ if ( ! class_exists( 'WP_Review_Me' ) ) {
|
||||||
*/
|
*/
|
||||||
protected function get_review_link() {
|
protected function get_review_link() {
|
||||||
|
|
||||||
$link = 'https://wordpress.org/support/view/';
|
$link = 'https://wordpress.org/support/';
|
||||||
|
|
||||||
switch ( $this->type ) {
|
switch ( $this->type ) {
|
||||||
|
|
||||||
case 'theme':
|
case 'theme':
|
||||||
$link .= 'theme-reviews/';
|
$link .= 'theme/';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'plugin':
|
case 'plugin':
|
||||||
$link .= 'plugin-reviews/';
|
$link .= 'plugin/';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$link .= $this->slug;
|
$link .= $this->slug . '/reviews';
|
||||||
$link = add_query_arg( 'rate', $this->rating, $link );
|
$link = add_query_arg( 'rate', $this->rating, $link );
|
||||||
$link = esc_url( $link . '#postform' );
|
$link = esc_url( $link . '#new-post' );
|
||||||
|
|
||||||
return $link;
|
return $link;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue